/* =========================
   Search results & cards
   ========================= */

.results-section {
  max-width: 1100px;
  margin: 20px auto;
  padding: 18px 20px;
  background: transparent;
}

.results-header {
 display: flex;
 flex-direction: column;
}

.results-header div {
 align-self: flex-start;
 display: flex;
 gap: 2rem
}

.back-button {
 background-color: transparent;
 border: none;
 color: #0B3B6F;
}

.results-header h2, .results-header div {
  color: #0B3B6F;
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 700;
}

/* grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(260px, 1fr) );
  gap: 16px;
}

/* card */
.result-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(11,58,111,0.05);
  align-items: stretch;
  transition: transform .12s ease, box-shadow .12s ease;
}

.result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(11,58,111,0.08);
}

/* media */
.card-media {
  flex: 0 0 120px;
  width: 120px;
  height: 96px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #f6f8fa, #eef4f7);
  display:flex;
  align-items:center;
  justify-content:center;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* body */
.card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  color: #0B2A44;
  font-weight: 700;
}

.card-desc {
  margin: 0;
  font-size: 13px;
  color: #6b7a89;
  line-height: 1.3;
}

/* compat & meta */
.card-compat {
  margin: 0;
  font-size: 13px;
  color: #0B2A44;
}

.card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

/* availability tags */
.availability {
  display: inline-block;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: none;
}

.in-stock {
  background: rgba(46,196,214,0.12);
  color: #0B3B6F;
  border: 1px solid rgba(46,196,214,0.18);
}

.low-stock {
  background: rgba(255,192,77,0.10);
  color: #b07000;
  border: 1px solid rgba(255,192,77,0.14);
}

.out-of-stock {
  background: rgba(220,80,80,0.08);
  color: #b00000;
  border: 1px solid rgba(220,80,80,0.12);
}

.price {
  margin-left: auto;
  color: #0B2A44;
  font-weight: 800;
  font-size: 14px;
}

/* actions */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.card-actions .btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: transform .08s ease;
}

.btn.place-order {
  background: #2EC4D6;
  color: #fff;
  box-shadow: 0 8px 20px rgba(46,196,214,0.08);
}

.btn.place-order:hover { transform: translateY(-2px); }

.btn.see-details {
  background: transparent;
  border: 1px solid rgba(11,58,111,0.08);
  color: #0B3B6F;
}

.btn.see-details:hover {
  background: rgba(11,58,111,0.04);
  transform: translateY(-2px);
}

/* make card layout stack on small screens */
@media (max-width: 520px) {
  .result-card {
    flex-direction: column;
    align-items: stretch;
  }
  .card-media {
    width: 100%;
    height: 160px;
  }
  .price { margin-left: 0; }
}

/* =========================
   Modals (simple)
   ========================= */

/* base modal utility */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

/* backdrop covers screen */
.modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7,12,20,0.45);
  backdrop-filter: blur(2px);
}

/* panel */
.modal .modal-panel {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 48px));
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(11,58,111,0.12);
}

/* modal content */
.modal .modal-body {
  margin-top: 8px;
  color: #0B2A44;
  max-height: 60vh;
  overflow: auto;
}

/* header/footer */
.modal header h2 {
  margin: 0;
  color: #0B3B6F;
  font-size: 18px;
  font-weight: 800;
}

.modal footer {
  margin-top: 12px;
  text-align: right;
}

/* close buttons */
.modal .modal-close,
.modal .instruction-ok {
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  background: #0B3B6F;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* small screens */
@media (max-width: 520px) {
  .modal .modal-panel { width: calc(100% - 28px); padding: 14px; }
}

/* page lock while modal open */
body.modal-open {
  overflow: hidden;
}

/* =========================
   Utility / accessibility
   ========================= */

.result-card .btn:focus,
.modal .modal-close:focus,
.card-actions .btn:focus {
  outline: 3px solid rgba(46,196,214,0.18);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Pagination controls (Manny Autos) ---------- */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pager {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: transparent;
  padding: 6px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(11,58,111,0.03);
}

.pager-btn,
.pager-num {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: #fff;
  color: #0B3B6F;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  min-width: 44px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(11,58,111,0.04);
  transition: transform .12s ease, background .12s ease, color .12s ease;
}

.pager-btn[disabled],
.pager-num[disabled] {
  opacity: 0.48;
  cursor: default;
  transform: none;
}

.pager-btn:hover:not([disabled]),
.pager-num:hover:not(.active) {
  transform: translateY(-2px);
  background: rgba(46,196,214,0.06);
}

.pager-num.active {
  background: linear-gradient(180deg, #2EC4D6 0%, #0B3B6F 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(11,58,111,0.10);
  transform: translateY(-1px);
}

.pager .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #6b7a89;
  font-weight: 700;
}

/* Responsive: make controls wrap on small screens */
@media (max-width: 420px) {
  .pager {
    gap: 6px;
    padding: 4px;
  }
  .pager-btn,
  .pager-num {
    padding: 8px 10px;
    min-width: 36px;
    font-size: 14px;
  }
}

/* --------------------------
   Modal Tabs (General Info / Specs)
--------------------------- */
.details-modal .modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #ccc;
  margin-bottom: 12px;
}

.details-modal .modal-tab {
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  background-color: #f5f7fa;
  color: #0B3B6F;
  transition: background-color 0.2s, color 0.2s;
}

.details-modal .modal-tab.active {
  background-color: #0B3B6F;
  color: #fff;
  border-bottom: 2px solid #0B3B6F;
}

/* --------------------------
   Quick Order Panel
--------------------------- */
.quick-order-panel {
 padding: 1rem;
}
.quick-order-panel button, .tab-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}


.quick-order-panel .btn-secondary {
  background-color: #f5f7fa;
  color: #0B3B6F;
  border: 1px solid #0B3B6F;
}

.quick-order-panel .btn-secondary:hover {
  background-color: #e1e5ea;
}


@media (min-width: 450px){
 .general-grid {
   display:grid;
   grid-template-columns:1fr 1fr;
   gap:12px;
 }
}

/* Modal root */
.info-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
}

/* Overlay */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

/* Modal panel */
.modal-content {
  position: relative;
  background: #fff;
  width: min(1100px, 94vw);
  max-height: 92vh;
  border-radius: 14px;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: modalIn 0.25s ease-out;
}

/* Header */
.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  z-index: 2;
}

.modal-header h2 {
  font-size: 20px;
  margin: 0;
  color: #0B3B6F;
}

.close-btn {
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

/* Body */
.modal-body {
  padding: 18px;
}

/* Top section */
.info-top {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.info-image img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 10px;
  background: #f5f7fa;
}

/* Buttons */
.info-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/*
.btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: #2EC4D6;
  color: #fff;
}
*/

.btn-secondary {
  background: #0B3B6F;
  color: #fff;
  background-color: #7b7a89;
  color: #000;
}

/* Quick order dropdowns */
.quick-order {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.quick-order select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: #6b7a89;
}

.tab-btn.active {
  color: #0B3B6F;
  border-bottom: 3px solid #2EC4D6;
}

/* Tab content */
.tab-content {
  display: grid;
  gap: 8px;
}

.field-item {
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
  word-break: break-word;
}

/* Animation */
@keyframes modalIn {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .info-top {
    grid-template-columns: 1fr;
  }

  .info-image img {
    height: 220px;
  }
}