/* ==========================================================================
   SAHU TRADERS — SMART SEARCH, DISCOVERY, SAVED SHORTLIST & POLISH STYLES
   ========================================================================== */

/* Smart Autocomplete Dropdown */
.search-results-dropdown {
  max-height: 440px;
  overflow-y: auto;
  z-index: 1200;
}
.search-group-label {
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748B;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.search-group-action {
  background: none;
  border: none;
  color: #FF7900;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.search-suggestion-item.is-kb-active,
.search-suggestion-item:hover {
  background: #FFF7ED;
}
.search-suggestion-item mark {
  background: #FEF3C7;
  color: #061A2B;
  padding: 0 2px;
  border-radius: 2px;
}
.search-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
}
.search-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #061A2B;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.search-quick-chip:hover {
  border-color: #FF7900;
  background: #FFF7ED;
}
.search-chip-rm {
  background: none;
  border: none;
  color: #64748B;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0 2px;
}
.search-view-all-link {
  display: block;
  text-align: center;
  padding: 10px;
  background: #061A2B;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
}
.search-view-all-link:hover {
  background: #FF7900;
}

/* Did you mean + Active Filter Chips */
.did-you-mean-bar {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: #7C2D12;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.did-you-mean-btn {
  background: #FF7900;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 700;
  cursor: pointer;
}
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #061A2B;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.active-chip button {
  background: none;
  border: none;
  color: #B91C1C;
  cursor: pointer;
  font-weight: 800;
  padding: 0 2px;
}

/* Save / Heart Button on Product Cards & Header */
.product-item-thumb { position: relative; }
.btn-save-product {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748B;
  transition: transform 0.15s ease, color 0.15s ease;
}
.btn-save-product:hover { transform: scale(1.06); color: #FF7900; }
.btn-save-product.is-saved { color: #EF4444; border-color: #FECACA; background: #FEF2F2; }
.btn-save-product svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-save-product.is-saved svg { fill: currentColor; }

/* Smart Modals (Shortlist, Finder, Feedback) */
.smart-modal {
  margin: auto;
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 680px;
  width: calc(100vw - 24px);
  max-height: 88vh;
  box-shadow: 0 20px 50px rgba(6, 26, 43, 0.35);
}
.smart-modal::backdrop { background: rgba(6, 26, 43, 0.65); }
.smart-modal-header {
  background: #061A2B;
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.smart-modal-header h2 { font-size: 1.08rem; margin: 0; color: #FFFFFF; }
.smart-modal-close {
  background: rgba(255,255,255,0.15);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-weight: 700;
}
.smart-modal-body { padding: 18px; overflow-y: auto; max-height: calc(88vh - 60px); }
.shortlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #E2E8F0;
}
.shortlist-row img { border-radius: 6px; object-fit: cover; border: 1px solid #E2E8F0; }
.shortlist-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shortlist-info a { color: #061A2B; text-decoration: none; font-size: 0.9rem; }
.shortlist-info span { color: #64748B; font-size: 0.8rem; }
.shortlist-row-actions { display: flex; gap: 6px; }
.shortlist-actions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.shortlist-io-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid #E2E8F0; }
.shortlist-io-box h3 { font-size: 0.92rem; margin: 0 0 8px; color: #061A2B; }

.smart-btn-primary, .smart-btn-navy, .smart-btn-outline, .smart-btn-wa, .smart-btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 7px; font-size: 0.84rem; font-weight: 700;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
.smart-btn-primary { background: #FF7900; color: #FFFFFF; }
.smart-btn-navy { background: #061A2B; color: #FFFFFF; }
.smart-btn-outline { background: #FFFFFF; color: #061A2B; border-color: #CBD5E1; }
.smart-btn-wa { background: #078447; color: #FFFFFF; }
.smart-btn-sm { background: #061A2B; color: #FFFFFF; padding: 5px 10px; font-size: 0.78rem; }
.smart-btn-rm { background: #FEE2E2; color: #B91C1C; border: none; border-radius: 5px; padding: 5px 9px; cursor: pointer; font-weight: 700; }

/* Guided Finder */
.finder-progress { height: 6px; background: #E2E8F0; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.finder-progress-bar { height: 100%; background: #FF7900; transition: width 0.2s ease; }
.finder-count { font-size: 0.84rem; color: #475569; margin: 0 0 12px; }
.finder-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.finder-opt { padding: 8px 14px; border: 1.5px solid #CBD5E1; border-radius: 8px; background: #FFFFFF; color: #061A2B; font-weight: 600; cursor: pointer; }
.finder-opt.active { background: #061A2B; color: #FFFFFF; border-color: #FF7900; }
.finder-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 12px; border-top: 1px solid #E2E8F0; }
.finder-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.finder-result-item { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid #E2E8F0; border-radius: 8px; text-decoration: none; color: #061A2B; }
.finder-result-item img { border-radius: 6px; object-fit: cover; }
.finder-result-item div { display: flex; flex-direction: column; font-size: 0.82rem; }

/* Sections: Recently Viewed, Discovery, Bundles */
.smart-extra-section {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 20px;
  margin-top: 28px;
}
.smart-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.smart-section-head h2 { font-size: 1.15rem; color: #061A2B; margin: 0; }
.smart-link-btn { background: none; border: none; color: #FF7900; font-weight: 700; cursor: pointer; font-size: 0.85rem; }
.smart-compact-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; }

/* Suggested Products Together */
.bundle-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px;
  margin-top: 20px;
}
.bundle-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #E2E8F0; flex-wrap: wrap; }
.bundle-item-row:last-child { border-bottom: none; }

/* Offline Banner & Back to Top */
.sahu-offline-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: #B91C1C;
  color: #FFFFFF;
  text-align: center;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 2000;
}
.sahu-back-to-top {
  position: fixed;
  right: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #061A2B;
  color: #FFFFFF;
  border: 2px solid #FF7900;
  cursor: pointer;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(6, 26, 43, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sahu-back-to-top.visible { opacity: 1; pointer-events: auto; }
.sahu-back-to-top:hover { background: #FF7900; transform: translateY(-2px); }

/* Skeleton Image Placeholder */
.img-skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: sahuShimmer 1.4s infinite;
}
@keyframes sahuShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .img-skeleton { animation: none; }
  .sahu-back-to-top, .finder-progress-bar, .btn-save-product { transition: none; }
}

/* Full-Screen Product Image Viewer Modal */
.smart-gallery-modal {
  margin: auto;
  width: min(96vw, 960px);
  height: min(92vh, 760px);
  border: none;
  border-radius: 12px;
  background: #061A2B;
  color: #FFFFFF;
  padding: 0;
  overflow: hidden;
}
.smart-gallery-modal::backdrop { background: rgba(2, 13, 33, 0.85); }
.sgv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
}
.sgv-controls { display: flex; gap: 8px; }
.sgv-controls button, .sgv-nav {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-weight: 700;
  cursor: pointer;
}
.sgv-stage {
  position: relative;
  height: calc(100% - 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  touch-action: pinch-zoom;
}
.sgv-stage img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.18s ease;
}
.sgv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  z-index: 2;
}
.sgv-nav.prev { left: 12px; }
.sgv-nav.next { right: 12px; }
.cement-zoom-trigger { overflow: hidden; }
.cement-zoom-trigger img { transition: transform 0.18s ease; }
