/* ============================================================
   BestDealz International — Sprint 13 Retention & Conversion
   Used by: header autocomplete dropdown, saved searches list,
            returns/RMA portal (buyer side).
   Theme:   blue #003c8c + orange #f08c00, matches homepage.
   ============================================================ */

/* ── Header search autocomplete dropdown ─────────────────── */
.bd-ac-dropdown{
  position:absolute;
  top:100%; left:0; right:0;
  background:#fff;
  border:1px solid var(--line);
  border-top:0;
  border-radius:0 0 10px 10px;
  box-shadow:0 12px 36px rgba(0,0,0,.12);
  max-height:480px;
  overflow-y:auto;
  z-index:9000;
  display:none;
}
.bd-ac-dropdown.show{ display:block; }
.bd-ac-section{
  padding:8px 0;
  border-bottom:1px solid var(--line);
}
.bd-ac-section:last-child{ border-bottom:0; }
.bd-ac-section h6{
  font-size:10.5px; font-weight:800;
  color:var(--ink-500);
  text-transform:uppercase; letter-spacing:.5px;
  margin:0;
  padding:6px 16px;
}
.bd-ac-item{
  display:flex; gap:12px; align-items:center;
  padding:8px 16px;
  text-decoration:none;
  color:var(--ink-700);
  transition:background .12s;
}
.bd-ac-item:hover, .bd-ac-item.active{ background:#fff8ee; }
.bd-ac-item img{
  width:42px; height:42px;
  object-fit:cover;
  border-radius:5px;
  border:1px solid var(--line);
  flex-shrink:0;
}
.bd-ac-item .info{ flex:1; min-width:0; }
.bd-ac-item .info .name{
  font-size:13px; font-weight:600; color:var(--ink-900);
  display:block;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.bd-ac-item .info .meta{
  font-size:11px; color:var(--ink-500);
  margin-top:2px;
  display:flex; gap:6px; align-items:center;
}
.bd-ac-item .info .meta .pill{
  background:#dcfce7; color:#14532d;
  font-size:9.5px; font-weight:800;
  padding:1px 6px; border-radius:3px;
  letter-spacing:.4px;
}
.bd-ac-item .info .meta .pill.b{ background:#dbeafe; color:#1e40af; }
.bd-ac-item .info .meta .pill.c{ background:#fff8ee; color:#92400e; }
.bd-ac-item .price{
  font-size:13px; font-weight:800; color:var(--bd-orange);
  white-space:nowrap;
}
.bd-ac-chip-row{
  display:flex; flex-wrap:wrap; gap:6px;
  padding:8px 16px 10px;
}
.bd-ac-chip{
  background:#fafafa;
  border:1px solid var(--line);
  color:var(--ink-700);
  font-size:11.5px; font-weight:600;
  padding:5px 12px; border-radius:999px;
  text-decoration:none;
}
.bd-ac-chip:hover{ border-color:var(--bd-orange); color:var(--bd-orange); }
.bd-ac-footer{
  padding:10px 16px;
  background:#fafafa;
  font-size:11.5px; color:var(--ink-500);
  text-align:center;
}
.bd-ac-footer kbd{
  background:#fff;
  border:1px solid var(--line);
  border-radius:3px;
  padding:1px 6px;
  font-size:10px;
  color:var(--ink-700);
}
.bd-ac-empty{
  padding:20px;
  text-align:center;
  font-size:12.5px; color:var(--ink-500);
}

/* Make the header search wrap relative so the dropdown anchors correctly */
.bd-search-wrap, .search-form-wrapper, .main-search{
  position:relative;
}

/* ── Live-search v2 — tab-aware result variants ─────────────── */

/* Section heading hint (small grey label after the count) */
.bd-ac-section h6 .bd-ac-h6-hint{
  font-weight: 500;
  color: var(--ink-400);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
  font-size: 11px;
}

/* Generic country flag chip used inside result rows */
.bd-ac-flag{
  display:inline-block;
  width:16px; height:11px;
  border-radius:2px;
  vertical-align:-1px;
  position:relative;
  flex-shrink:0;
  border:1px solid rgba(0,0,0,.08);
}
.bd-ac-flag.cn{
  background:#d8232a; color:#ffd700;
  text-align:left; font-size:9px; line-height:11px;
  padding-left:2px;
}
.bd-ac-flag.za{
  background:linear-gradient(0deg,#007749 33%,#fff 33% 66%,#de3831 66%);
}

/* Verified badge inline */
.bd-ac-verified{
  display:inline-flex; align-items:center;
  background:#dcfce7; color:#15803d;
  font-size:10px; font-weight:800;
  padding:1px 7px; border-radius:30px;
  margin-left:4px;
}

/* Product-tab supplier hint inside .meta */
.bd-ac-prod .meta .sup{
  color: var(--ink-500); font-weight: 600;
}

/* Suppliers tab — bigger logo, right arrow, prominent name */
.bd-ac-sup{ padding:10px 16px; }
.bd-ac-sup img,
.bd-ac-sup .bd-ac-noimg{
  width:46px; height:46px; border-radius:8px;
  object-fit:cover;
  background:#f3f4f6;
  flex-shrink:0;
  border:1px solid var(--line);
}
.bd-ac-sup .info{ flex:1; min-width:0; }
.bd-ac-sup .info .name{
  display:flex; align-items:center; gap:6px;
  font-size:13.5px; font-weight:800; color:var(--ink-900);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.bd-ac-sup .info .meta{
  font-size:11.5px; color:var(--ink-500); margin-top:2px;
  display:block;
}
.bd-ac-sup .info .meta strong{ color: var(--ink-700); }
.bd-ac-arrow{
  font-size:18px; color: var(--ink-400);
  flex-shrink:0; padding-left:8px;
  transition: transform .15s, color .15s;
}
.bd-ac-sup:hover .bd-ac-arrow,
.bd-ac-sup.active .bd-ac-arrow{
  color: var(--bd-orange);
  transform: translateX(3px);
}

/* RFQ tab — Class B products with a strong "Get Quote" CTA on the right */
.bd-ac-rfq{ padding:9px 16px; }
.bd-ac-rfq img,
.bd-ac-rfq .bd-ac-noimg{
  width:46px; height:46px; border-radius:6px;
  object-fit:cover; background:#fff8ee; flex-shrink:0;
  border:1px solid var(--line);
}
.bd-ac-rfq .info{ flex:1; min-width:0; }
.bd-ac-rfq .info .name{
  font-size:13px; font-weight:700; color:var(--ink-900);
  display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.bd-ac-rfq .info .meta{
  font-size:11.5px; color:var(--ink-500); margin-top:2px; display:block;
}
.bd-ac-rfq-cta{
  flex-shrink:0;
  background: linear-gradient(115deg, var(--bd-orange) 0%, #c97400 100%);
  color:#fff;
  font-size:11.5px; font-weight:800;
  padding:7px 12px;
  border-radius:6px;
  white-space:nowrap;
  transition: filter .15s;
}
.bd-ac-rfq:hover .bd-ac-rfq-cta,
.bd-ac-rfq.active .bd-ac-rfq-cta{ filter: brightness(1.08); }

/* No-image placeholder shared by all variants */
.bd-ac-noimg{
  width:42px; height:42px; border-radius:5px;
  background:#f3f4f6; flex-shrink:0;
}

/* ── Saved searches table ────────────────────────────────── */
.bd-saved-search{
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:18px 22px;
  margin-bottom:12px;
  display:flex; justify-content:space-between; align-items:center;
  gap:14px;
}
.bd-saved-search .info h4{
  font-size:14.5px; font-weight:700; color:var(--ink-900);
  margin:0 0 4px;
}
.bd-saved-search .info .meta{
  font-size:12px; color:var(--ink-500);
  display:flex; gap:8px; flex-wrap:wrap;
}
.bd-saved-search .info .meta .tag{
  background:#fff8ee; color:#92400e;
  padding:1px 8px; border-radius:3px;
  font-weight:700; font-size:10.5px;
}
.bd-saved-search .actions{
  display:flex; gap:6px;
}
.bd-saved-search .actions button, .bd-saved-search .actions a{
  background:#fafafa; border:1px solid var(--line);
  color:var(--ink-700);
  padding:7px 12px; border-radius:5px;
  font-size:12px; font-weight:600;
  cursor:pointer; text-decoration:none;
  transition:border-color .15s, color .15s;
}
.bd-saved-search .actions a.primary{
  background:var(--bd-orange); border-color:var(--bd-orange); color:#fff;
}
.bd-saved-search .actions button:hover, .bd-saved-search .actions a:hover{
  border-color:var(--bd-orange); color:var(--bd-orange);
}
.bd-saved-search .actions .toggle.on{
  background:#dcfce7; border-color:#15803d; color:#14532d;
}

/* ── Returns / RMA portal ─────────────────────────────────── */
.bd-rma-shell{ padding:24px 0 48px; }

.bd-rma-list .card{
  background:#fff; border:1px solid var(--line);
  border-radius:10px; padding:18px 22px;
  margin-bottom:12px;
  display:flex; justify-content:space-between; align-items:center;
  gap:14px;
}
.bd-rma-list .card .info h4{
  font-size:14.5px; font-weight:700; color:var(--ink-900); margin:0 0 4px;
}
.bd-rma-list .card .info .meta{
  font-size:12px; color:var(--ink-500); display:flex; gap:8px; flex-wrap:wrap;
}
.bd-rma-status{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:800;
  padding:4px 11px; border-radius:999px;
  letter-spacing:.4px; text-transform:uppercase;
}
.bd-rma-status .dot{ width:6px; height:6px; border-radius:50%; }
.bd-rma-status.requested  { background:#fff8ee; color:#92400e; }
.bd-rma-status.requested .dot{ background:#d97706; }
.bd-rma-status.approved   { background:#dbeafe; color:#1e40af; }
.bd-rma-status.approved .dot{ background:#1e40af; }
.bd-rma-status.label_issued, .bd-rma-status.in_transit{ background:#e0e7ff; color:#4338ca; }
.bd-rma-status.received, .bd-rma-status.inspected { background:#fae8ff; color:#86198f; }
.bd-rma-status.refunded   { background:#dcfce7; color:#14532d; }
.bd-rma-status.refunded .dot{ background:#15803d; }
.bd-rma-status.rejected   { background:#fee2e2; color:#991b1b; }
.bd-rma-status.closed     { background:#f3f4f6; color:#666; }

/* ── RMA timeline ─────────────────────────────────────────── */
.bd-rma-timeline{
  background:#fff; border:1px solid var(--line);
  border-radius:10px; padding:24px 28px;
  margin-bottom:18px;
}
.bd-rma-timeline ol{
  list-style:none; padding:0; margin:0;
  position:relative;
}
.bd-rma-timeline ol::before{
  content:'';
  position:absolute;
  left:9px; top:6px; bottom:6px;
  width:2px;
  background:var(--line);
}
.bd-rma-timeline li{
  position:relative;
  padding:0 0 18px 32px;
  font-size:13px; color:var(--ink-500);
}
.bd-rma-timeline li::before{
  content:'';
  position:absolute;
  left:4px; top:4px;
  width:12px; height:12px;
  border-radius:50%;
  background:#fff;
  border:2px solid var(--line);
  z-index:1;
}
.bd-rma-timeline li.done{ color:var(--ink-700); }
.bd-rma-timeline li.done::before{
  background:#15803d; border-color:#15803d;
}
.bd-rma-timeline li.current{ color:var(--ink-900); font-weight:700; }
.bd-rma-timeline li.current::before{
  background:var(--bd-orange); border-color:var(--bd-orange);
  box-shadow:0 0 0 3px rgba(240,140,0,.2);
}
.bd-rma-timeline li strong{
  display:block; font-size:13.5px; color:var(--ink-900);
  margin-bottom:2px;
}
.bd-rma-timeline li:last-child{ padding-bottom:0; }

/* ── RMA item picker form ──────────────────────────────── */
.bd-rma-item-row{
  display:grid;
  grid-template-columns: 22px 70px 1fr 110px;
  gap:14px; align-items:center;
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  margin-bottom:8px;
  cursor:pointer;
  transition:border-color .15s, background .15s;
}
.bd-rma-item-row:hover{ border-color:var(--bd-orange); }
.bd-rma-item-row.checked{
  border-color:var(--bd-orange);
  background:#fff8ee;
}
.bd-rma-item-row img{
  width:60px; height:60px; border-radius:5px;
  border:1px solid var(--line);
  object-fit:cover;
  background:#fafafa;
}
.bd-rma-item-row .info h5{
  font-size:13.5px; font-weight:600; color:var(--ink-900);
  margin:0 0 2px;
}
.bd-rma-item-row .info .meta{
  font-size:11.5px; color:var(--ink-500);
}
.bd-rma-item-row .qty{
  display:flex; align-items:center; gap:4px;
  background:#fff; border:1px solid var(--line); border-radius:5px;
  padding:4px;
  width:100%;
}
.bd-rma-item-row .qty button{
  width:24px; height:24px;
  background:transparent; border:0; cursor:pointer;
  color:var(--ink-700); font-size:14px; font-weight:700;
}
.bd-rma-item-row .qty input{
  flex:1; min-width:0; text-align:center;
  border:0; padding:0;
  font-size:13px; font-weight:600; color:var(--ink-900);
  outline:0;
}
.bd-rma-item-row.disabled{
  opacity:.5; pointer-events:none;
  border-style:dashed;
}

/* ── RMA reason picker grid ────────────────────────────── */
.bd-rma-reasons{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
  gap:8px;
  margin:14px 0 18px;
}
.bd-rma-reasons label{
  background:#fff; border:1px solid var(--line);
  padding:14px;
  border-radius:8px;
  cursor:pointer;
  text-align:center;
  transition:border-color .15s, background .15s;
  display:block;
}
.bd-rma-reasons label:hover{ border-color:var(--bd-orange); }
.bd-rma-reasons input[type=radio]{ display:none; }
.bd-rma-reasons input[type=radio]:checked + .label{ color:var(--bd-orange); font-weight:700; }
.bd-rma-reasons label.checked{
  border-color:var(--bd-orange);
  background:#fff8ee;
}
.bd-rma-reasons .icon{
  font-size:22px;
  margin-bottom:6px;
}
.bd-rma-reasons .label{
  font-size:13px; font-weight:600; color:var(--ink-700);
}

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width:800px){
  .bd-ac-dropdown{ max-height:60vh; }
  .bd-saved-search{ flex-direction:column; align-items:flex-start; }
  .bd-saved-search .actions{ width:100%; }
  .bd-saved-search .actions button, .bd-saved-search .actions a{ flex:1; text-align:center; }
  .bd-rma-list .card{ flex-direction:column; align-items:flex-start; }
  .bd-rma-item-row{ grid-template-columns:22px 50px 1fr; }
  .bd-rma-item-row .qty{ grid-column:2 / -1; }
}
@media (max-width:480px){
  .bd-ac-item img{ width:36px; height:36px; }
  .bd-rma-reasons{ grid-template-columns:1fr 1fr; }
}
