/* ============================================================================
   PriceSmart 2.0 — Storefront Design System (Themed via theme.css variables)
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(53, 99, 245, 0.22);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(53, 99, 245, 0.28);
}

.btn-navy {
  background: #101828;
  color: #FFFFFF;
  border-color: var(--border-strong);
}
.btn-navy:hover:not(:disabled) { background: #1D2939; }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.2);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-emerald {
  background: var(--emerald);
  color: #FFFFFF;
}
.btn-emerald:hover:not(:disabled) { background: #0E8F63; }

.btn-sm { padding: 6px 11px; font-size: 0.8rem; }
.btn-lg { padding: 12px 22px; font-size: 0.95rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- Top Navigation Bar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.logo .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(53, 99, 245, 0.25);
}

.logo span.accent { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Search bar + Autocomplete */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 460px;
  min-width: 180px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 4px 4px 4px 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search-bar:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53, 99, 245, 0.12);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text);
}

.search-bar input::placeholder { color: var(--text-subtle); }

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 120;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}

.search-suggestions.visible { display: block; }

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg); }
.suggestion-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.suggestion-meta { flex: 1; min-width: 0; }
.suggestion-title { font-weight: 600; font-size: 0.88rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-sub { font-size: 0.76rem; color: var(--text-muted); }
.suggestion-price { font-weight: 700; font-size: 0.86rem; color: var(--emerald); white-space: nowrap; }

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.wishlist-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}
.wishlist-link:hover { background: var(--surface-subtle); color: var(--primary); }

.wishlist-count {
  background: var(--emerald);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

#nav-auth-slot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Alert Bell */
.alert-bell { position: relative; }
.alert-bell-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 1.05rem;
}
.alert-bell-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.alert-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.alert-bell-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
}
.alert-bell-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alert-bell-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.alert-bell-item:hover { background: var(--bg); }
.alert-bell-item img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.alert-bell-item-name { font-weight: 600; font-size: 0.84rem; color: var(--navy); }
.alert-bell-item-price { font-size: 0.78rem; color: var(--emerald); font-weight: 600; }
.alert-bell-item-target { color: var(--text-muted); font-weight: 500; }
.alert-bell-empty { padding: 18px 14px; text-align: center; font-size: 0.84rem; color: var(--text-muted); }

/* ---------- App Shell with Persistent Responsive Sidebar ---------- */
.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--nav-height));
  max-width: 1560px;
  margin: 0 auto;
}

.shop-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px 32px;
}

.sidebar-group { margin-bottom: 22px; }
.sidebar-label {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0 10px 8px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}
.sidebar-link:hover { background: var(--bg); color: var(--navy); }
.sidebar-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-link-left { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.sidebar-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
}
.sidebar-link.active .sidebar-count {
  background: rgba(53, 99, 245, 0.16);
  color: var(--primary);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  z-index: 95;
}
.sidebar-backdrop.visible { display: block; }

.main-content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 48px;
}

/* ---------- Hero Banner (Startup Light Identity) ---------- */
.hero-2 {
  background: var(--hero-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 34px 36px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 28px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}

.hero-2::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(34, 199, 217, 0.12) 0%, rgba(53, 99, 245, 0.06) 45%, transparent 72%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(18, 168, 117, 0.2);
}

.hero-2 h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin: 0 0 12px;
}

.hero-2 h1 .highlight {
  color: var(--primary);
}

.hero-2 p.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 22px;
  max-width: 560px;
}

.hero-search-inline {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin-bottom: 18px;
}

.hero-search-inline input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 0.92rem;
  background: var(--input-bg);
  color: var(--text);
}
.hero-search-inline input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53, 99, 245, 0.12);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.hero-kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}
.hero-kpi span {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-visual-card {
  background: #0F172A;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid #1E293B;
}

.hero-visual-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #94A3B8;
  margin-bottom: 14px;
}

.hero-visual-badge {
  background: rgba(18, 168, 117, 0.18);
  color: #34D399;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
}

.hero-store-rows { display: flex; flex-direction: column; gap: 9px; }
.hero-store-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}
.hero-store-row.best {
  background: rgba(18, 168, 117, 0.14);
  border-color: rgba(18, 168, 117, 0.4);
}
.hero-store-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hero-store-price { font-weight: 700; }

/* ---------- Section Headings ---------- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 16px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 3px;
}
.section-header p { margin: 0; font-size: 0.86rem; color: var(--text-muted); }

/* ---------- Category Grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(165px, 100%), 1fr));
  gap: 14px;
}

.category-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.category-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.category-tile-top { display: flex; align-items: center; justify-content: space-between; }
.category-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}
.category-tile .tile-name { font-weight: 700; font-size: 0.94rem; color: var(--navy); }
.category-tile .tile-count { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Product Cards Grid & Horizontal Carousel ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 18px;
}

.carousel-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}
.carousel-row .product-card-wrap {
  min-width: 265px;
  max-width: 280px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.product-card-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.product-card-wrap:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-top-actions {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.card-top-actions > * { pointer-events: auto; }

.discount-flag {
  background: var(--emerald);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  box-shadow: var(--shadow-xs);
}

.compare-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.compare-check input { accent-color: var(--primary); cursor: pointer; }

.product-thumb-link {
  display: block;
  background: var(--bg);
  padding: 20px;
  height: 196px;
  border-bottom: 1px solid var(--border);
}
.product-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  transition: transform 0.22s ease;
}
.product-card-wrap:hover .product-thumb-link img { transform: scale(1.03); }

.product-card-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.brand-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 2px 7px;
  border-radius: 5px;
}

.product-title-link {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-title-link:hover { color: var(--primary); }

.rating-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.rating-badge {
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.price {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--navy);
}
.original {
  font-size: 0.84rem;
  color: var(--text-subtle);
  text-decoration: line-through;
}

.badge-lowest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  padding-top: 4px;
}
.trend-down { color: var(--emerald); font-weight: 600; }
.trend-up { color: var(--danger); font-weight: 600; }
.trend-flat { color: var(--text-subtle); }

.card-updated {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.card-action-bar {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.card-action-bar .btn { flex: 1; }
.card-wishlist-icon {
  flex: 0 0 auto !important;
  width: 36px;
  padding: 0;
}

/* ---------- Explorer Filter Toolbar ---------- */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.filter-field label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}
.filter-field select,
.filter-field input {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
  max-width: 100%;
}
.price-inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.price-inputs input { width: 88px; flex: 1 1 72px; min-width: 0; }

/* ---------- Popular Comparisons & How It Works ---------- */
.pop-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 14px;
}
.pop-compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.pop-compare-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.pop-compare-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
}
.vs-pill {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 6px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.86rem;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.step-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--navy); }
.step-card p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Recently Viewed Strip ---------- */
.recent-strip { display: none; margin: 22px 0; }
.recent-strip.visible { display: block; }
.recent-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.recent-item {
  position: relative;
  min-width: 150px;
  max-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}
.recent-item img { width: 100%; height: 90px; object-fit: contain; border-radius: 8px; background: var(--bg); }
.recent-item .name { font-size: 0.8rem; font-weight: 600; color: var(--navy); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}

/* ---------- Product Details Page ---------- */
.page-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb a:hover { color: var(--primary); }

.product-detail {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  align-items: start;
}
.product-detail > div { min-width: 0; }

.detail-image-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: sticky;
  top: 90px;
}
.detail-image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--bg);
}

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--navy);
  margin: 8px 0 8px;
}
.detail-specs { color: var(--text-muted); margin: 0 0 18px; }

.detail-price-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.intel-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.intel-stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.intel-stat-box span { display: block; font-size: 0.74rem; color: var(--text-muted); }
.intel-stat-box strong { font-size: 1rem; color: var(--navy); }

/* Tables */
.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.comparison th {
  text-align: left;
  padding: 11px 12px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
table.comparison td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.comparison tr.lowest-row { background: rgba(18, 168, 117, 0.05); }

.store-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); }
.store-dot { width: 9px; height: 9px; border-radius: 50%; }
.store-dot.amazon { background: #FF9900; }
.store-dot.flipkart { background: #2874F0; }
.store-dot.croma { background: #12A875; }
.store-savings { font-size: 0.75rem; color: var(--emerald); font-weight: 600; }
.visit-store-link { color: var(--primary); font-weight: 600; font-size: 0.84rem; }
.visit-store-link:hover { text-decoration: underline; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Alert Box & Reviews */
.alert-box input {
  width: 240px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  margin-right: 8px;
}

.alert-message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
}
.alert-message.ok { background: var(--emerald-soft); color: #0B7B54; }
.alert-message.wait { background: var(--amber-soft); color: #92400E; }

.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.review-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.review-stars { color: #F59E0B; font-weight: 700; }
.review-author { font-weight: 600; font-size: 0.86rem; color: var(--navy); }
.review-comment { margin: 0; font-size: 0.9rem; color: var(--text); }
.review-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.review-form select, .review-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
}
.review-form textarea { min-height: 84px; resize: vertical; }

/* ---------- Customer Account Dashboard (/wishlist.html) ---------- */
.account-shell {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--nav-height));
}
.account-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.account-main {
  padding: 28px;
  min-width: 0;
}
.account-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.account-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.account-kpi-card span { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.account-kpi-card strong { display: block; font-family: var(--font-display); font-size: 1.55rem; color: var(--navy); margin-top: 4px; }

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
}

.wishlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 12px;
}
.wishlist-item-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.wishlist-item-link img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--bg); padding: 4px; border: 1px solid var(--border); }

/* ---------- Auth Split Layout (Light Theme) ---------- */
.auth-page {
  min-height: calc(100vh - var(--nav-height));
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.auth-brand {
  background: linear-gradient(155deg, #101828 0%, #172554 100%);
  color: #FFFFFF;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-brand h2 { font-family: var(--font-display); font-size: 2rem; line-height: 1.2; margin: 20px 0 12px; }
.auth-brand p { color: #CBD5E1; max-width: 440px; }
.auth-brand ul { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-brand li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: #E2E8F0; }

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  background: var(--bg);
}
.auth-wrap {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-wrap h2 { font-family: var(--font-display); margin: 0 0 6px; color: var(--navy); }
.auth-wrap .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.auth-wrap label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--navy); margin: 12px 0 6px; }
.auth-wrap input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: var(--input-bg);
  color: var(--text);
}
.auth-wrap input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(53, 99, 245, 0.12); }

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field input { padding-right: 44px; }
.pw-toggle-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 6px;
}
.pw-toggle-btn:hover { color: var(--primary); }

.auth-error {
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 500;
  min-height: 20px;
  margin-bottom: 6px;
}
.forgot-link { text-align: right; margin: 8px 0 16px; font-size: 0.84rem; color: var(--primary); font-weight: 600; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--text-muted); }
.auth-switch a { color: var(--primary); font-weight: 600; }

.demo-callout {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Floating Compare Bar & Toasts ---------- */
.compare-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 140;
  background: var(--navy);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 24px);
  transition: transform 0.2s ease;
}
.compare-bar.visible { transform: translateX(-50%) translateY(0); }
.compare-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }

.price-drop-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 180;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s, transform 0.2s;
}
.price-drop-toast.visible { opacity: 1; transform: translateY(0); }
.toast-title { font-weight: 700; font-size: 0.88rem; color: var(--navy); }
.toast-msg { font-size: 0.82rem; color: var(--text-muted); margin: 3px 0 6px; }
.toast-link { font-size: 0.8rem; font-weight: 700; color: var(--primary); }
.toast-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-subtle); }

/* ---------- Skeletons & Empty States ---------- */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-block {
  background: linear-gradient(90deg, var(--surface-subtle) 25%, var(--border) 50%, var(--surface-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
}
.thumb-sk { height: 150px; }
.line-sk { height: 14px; width: 85%; }
.line-sk.short { width: 52%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  margin: 0 auto 12px;
}

.loading { padding: 28px; text-align: center; color: var(--text-muted); font-weight: 500; }
.clear-search { color: var(--primary); font-weight: 600; font-size: 0.85rem; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 44px 28px 28px;
  margin-top: 32px;
}
.footer-grid {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
.site-footer h4 { color: #FFFFFF; margin: 0 0 12px; font-size: 0.92rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.site-footer li a:hover { color: #FFFFFF; }
.footer-bottom {
  max-width: 1380px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: #94A3B8;
}

/* ---------- Modal (About/Support/Privacy/Terms Info) ---------- */
.ps-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.55);
  z-index: 220;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ps-modal-backdrop.open { display: flex; }
.ps-modal {
  width: 100%;
  max-width: 520px;
  background: var(--modal-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.ps-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ps-modal-head h3 { margin: 0; font-family: var(--font-display); color: var(--navy); }

/* ---------- Responsive Breakpoints (1440, 1280, 768, 390, 360) ---------- */
@media (max-width: 1080px) {
  .hero-2 { grid-template-columns: 1fr; padding: 26px; }
  .product-detail { grid-template-columns: 1fr; }
  .detail-image-card { position: static; }
  .intel-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sidebar-toggle-btn { display: inline-flex; }
  .nav-links { display: none; }
  .navbar { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .search-wrap { order: 3; flex: 1 1 100%; max-width: none; }
  .shop-sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .shop-sidebar.open { transform: translateX(0); }
  .account-shell { grid-template-columns: 1fr; }
  .account-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .navbar { padding: 10px 14px; gap: 8px; }
  .theme-toggle-label { display: none; }
  .nav-left { min-width: 0; }
  .nav-actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: space-between; gap: 6px; min-width: 0; max-width: 100%; }
  #nav-auth-slot { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-tile { padding: 12px; }
  .category-tile .tile-name { font-size: 0.84rem; word-break: break-word; }
  .main-content { padding: 16px 14px 40px; }
  .hero-2 { padding: 20px 16px; }
  .hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-search-inline { flex-direction: column; }
  .page-container { padding: 16px 14px 44px; }
  .account-main { padding: 16px 14px; }
  .wishlist-item { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr; }
  .alert-box input { width: 100%; margin-right: 0; margin-bottom: 10px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 7px 10px; font-size: 0.78rem; }
  .wishlist-link { padding: 5px 7px; font-size: 0.8rem; }
}
