/* ============================================================
   ShopNexa — Premium UI v2
   Dark-first, light-mode supported, mobile-ready
   ============================================================ */

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:         #0A0C12;
  --surface:    #111318;
  --surface-2:  #181B24;
  --surface-3:  #1E2230;
  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.11);
  --border-hi:  rgba(255,255,255,0.18);
  --text:       #ECEDF2;
  --text-muted: #6B7080;
  --text-soft:  #9EA3B5;
  --accent:     #2563EB;
  --accent-2:   #38D4B8;
  --accent-dim: rgba(94,234,207,0.10);
  --accent-glow:rgba(94,234,207,0.18);
  --signal:     #F97316;
  --signal-dim: rgba(255,107,91,0.12);
  --gold:       #F5C842;
  --gold-dim:   rgba(245,200,66,0.12);
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --font-display:'Space Grotesk', sans-serif;
  --font-body:  'Inter', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --card-shadow:0 2px 20px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
  --card-hover: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--border-hi);
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

html.light {
  --bg:         #F2F4F8;
  --surface:    #FFFFFF;
  --surface-2:  #F6F7FA;
  --surface-3:  #ECEEF3;
  --border:     rgba(0,0,0,0.07);
  --border-mid: rgba(0,0,0,0.11);
  --border-hi:  rgba(0,0,0,0.18);
  --text:       #0F1117;
  --text-muted: #888DA0;
  --text-soft:  #565B6F;
  --accent:     #0B9E8A;
  --accent-2:   #087A6A;
  --accent-dim: rgba(11,158,138,0.08);
  --accent-glow:rgba(11,158,138,0.15);
  --signal:     #D94F3A;
  --signal-dim: rgba(217,79,58,0.10);
  --gold:       #C9920A;
  --gold-dim:   rgba(201,146,10,0.10);
  --card-shadow:0 2px 14px rgba(0,0,0,0.08), 0 0 0 1px var(--border);
  --card-hover: 0 8px 32px rgba(0,0,0,0.14), 0 0 0 1px var(--border-hi);
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 80px;
  transition: background var(--transition), color var(--transition);
}
html, body {
  overflow-x: hidden;
  width: 100%;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-dim); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media(max-width: 480px) {
  .wrap { padding: 0 16px; }
}

/* ── NAV ─────────────────────────────────────────────────── */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: 1200px; margin: 0 auto; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: -0.02em; white-space: nowrap;
}
.logo .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 14px var(--accent-glow);
  animation: dot-pulse 2.8s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%,100% { box-shadow: 0 0 0 3px var(--accent-dim), 0 0 14px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 5px var(--accent-dim), 0 0 22px var(--accent-glow); }
}
nav.links { display: flex; gap: 28px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
nav.links a { transition: color var(--transition); padding: 4px 0; }
nav.links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media(max-width: 480px) {
  .nav-actions { gap: 6px; }
  .icon-btn { width: 32px; height: 32px; font-size: 13px; }
  #currencyPicker { padding: 6px 9px; font-size: 11px; }
  #installBtn { padding: 7px 12px; font-size: 11px; }
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border-mid); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); font-size: 15px; position: relative;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-dim); transform: translateY(-1px); }
.badge-count {
  position: absolute; top: -5px; right: -5px; background: var(--signal); color: #fff;
  font-size: 9.5px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  font-family: var(--font-mono); border: 2px solid var(--bg);
}
@media(max-width: 820px) { nav.links { display: none; } }
@media(max-width: 480px) {
  .hero-trust { flex-direction: column; gap: 8px; }
}
@media(max-width: 360px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; text-align: center; }
}
@media(max-width: 640px) {
  .hero { padding: 40px 0 32px; }
  .hero-grid { gap: 28px; }
  .hero p.sub { margin-bottom: 20px; font-size: 14px; }
  .eyebrow { margin-bottom: 14px; }
}
/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  padding: 11px 22px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent); color: #050A0E;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 0 28px var(--accent-glow); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; border-color: var(--border-mid); color: var(--text-soft);
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface-2); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -120px; right: -80px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center;
}
.hero-grid > div { max-width: 620px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(94,234,207,0.25);
  border-radius: 999px; padding: 5px 13px; margin-bottom: 22px; letter-spacing: 0.04em;
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.25;} }

h1 {
  font-family: var(--font-display); font-size: 48px; line-height: 1.05;
  letter-spacing: -0.03em; font-weight: 700; margin-bottom: 20px;
}
h1 span { color: var(--accent); }
@media(max-width:640px) { h1 { font-size: 34px; } }
@media(max-width: 640px) {
  .hero { padding: 40px 0 32px; }
  .hero-grid { gap: 28px; }
  .hero p.sub { margin-bottom: 20px; font-size: 14px; }
  .eyebrow { margin-bottom: 14px; }
}
.hero p.sub {
  color: var(--text-soft); font-size: 15.5px; line-height: 1.65;
  max-width: 460px; margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero pulse card */
.pulse-card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
  position: relative; overflow: hidden;
}
.pulse-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--signal), var(--gold));
}
.pulse-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.pulse-head .name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.pulse-head .cat { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.drop-tag {
  background: var(--signal-dim); color: var(--signal);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 7px; border: 1px solid rgba(255,107,91,0.2);
  white-space: nowrap;
}
.seller-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.seller-name { width: 80px; font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--signal));
  animation: grow 1.2s cubic-bezier(0.4,0,0.2,1) forwards;
  transform-origin: left;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.seller-price {
  width: 62px; text-align: right;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
}
.pulse-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--border-mid);
}
.best-price { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.best-price b { color: var(--accent); font-size: 18px; display: block; margin-top: 2px; }

/* ── SECTIONS ────────────────────────────────────────────── */
section { padding: 60px 0; }
@media(max-width: 640px) {
  section { padding: 40px 0; }
}
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 700; letter-spacing: -0.02em;
}
.section-head p { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }

/* ── CATEGORY GRID ───────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px,1fr));
  gap: 14px;
}
@media(max-width: 820px) { .cat-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width: 820px) {
  .cat-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 0 12px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .cat-grid::-webkit-scrollbar { display: none; }
  .cat-card {
    flex: 0 0 auto;
    width: 74px;
    padding: 0;
    background: none;
    border: none;
    text-align: center;
    scroll-snap-align: start;
  }
  .cat-card .glyph {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 54px; margin: 0 auto 8px;
    background: transparent; border: none; box-shadow: none;
    border-radius: 50%; font-size: 24px;
    transition: transform 0.12s ease;
  }
  .cat-card:active .glyph { transform: scale(0.95); }

  .cat-card[data-cat="grp:fashion"] .glyph      { background: rgba(167,139,250,0.18); }
  .cat-card[data-cat="grp:beauty"] .glyph       { background: rgba(251,113,133,0.18); }
  .cat-card[data-cat="grp:electronics"] .glyph  { background: rgba(56,189,248,0.18); }
  .cat-card[data-cat="grp:kids"] .glyph         { background: rgba(251,191,36,0.18); }
  .cat-card[data-cat="grp:pets"] .glyph         { background: rgba(52,211,153,0.18); }
  .cat-card .title {
    font-size: 11px; font-weight: 600; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cat-card .count { display: none; }
}
.cat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 20px; cursor: pointer;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.cat-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--card-hover); }
.cat-card:hover::after { opacity: 1; }
.cat-card .glyph { font-size: 26px; margin-bottom: 14px; display: block; }
.cat-card .title { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: 5px; }
.cat-card .count { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); line-height: 1.5; }

/* ── LAYOUT / SIDEBAR ────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media(max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  position: sticky; top: 76px;
}
.sidebar h4 {
  font-family: var(--font-display); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); padding: 4px 10px 10px;
}
.side-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-soft); margin-bottom: 1px;
  transition: background var(--transition), color var(--transition);
}
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.active { background: var(--accent-dim); color: var(--accent); }
.side-item .g { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.side-item .n {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted);
}
.side-item.active .n { color: var(--accent); }
.sidebar .divider { height: 1px; background: var(--border); margin: 10px 0 12px; }
.side-group { margin-bottom: 2px; }
.side-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; cursor: pointer;
  font-family: var(--font-display); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-radius: 8px;
  transition: background var(--transition);
}
.side-group-head:hover { background: var(--surface-2); }
.side-group-head .arrow { transition: transform 0.22s ease; font-size: 10px; }
.side-group.collapsed .arrow { transform: rotate(-90deg); }
.side-group.collapsed .side-group-items { display: none; }
.side-group-items { padding-left: 4px; }

.mobile-cat-toggle { display: none; }
@media(max-width: 860px) {
  .mobile-cat-toggle {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border-mid);
    border-radius: 9px; padding: 10px 14px; font-size: 13.5px; font-weight: 500;
    cursor: pointer; color: var(--text); margin-bottom: 14px;
    transition: border-color var(--transition);
  }
  .mobile-cat-toggle:hover { border-color: var(--accent); }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100%; width: 268px; z-index: 90;
    border-radius: 0; transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto; padding-top: 70px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 85; }
  .sidebar-overlay.show { display: block; }
  .sidebar .close-x { display: block; position: absolute; top: 16px; right: 16px; }
}
.sidebar .close-x { display: none; }

/* ── FILTER BAR ──────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 20px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.search-input {
  flex: 1; min-width: 180px;
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: 9px; padding: 9px 14px;
  color: var(--text); font-family: var(--font-body); font-size: 13.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select {
  background: var(--surface-2); border: 1px solid var(--border-mid); color: var(--text);
  border-radius: 9px; padding: 9px 12px;
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  transition: border-color var(--transition);
}
select:hover { border-color: var(--border-hi); }

/* ── PRODUCT CARDS ───────────────────────────────────────── */
.prod-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 18px;
}
@media(max-width: 960px) { .prod-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width: 640px) { .prod-grid { grid-template-columns: 1fr; gap: 12px; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: card-in 0.32s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--card-hover);
}
@media(max-width: 640px) {
  .card { 
    border-radius: 10px; 
    flex-direction: row;
  }
  .card:hover { transform: translateY(-2px); }
}

.thumb {
  height: 148px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; overflow: hidden;
}
@media(max-width: 640px) {
  .thumb { 
    height: auto; 
    width: 140px;
    min-width: 110px;
    aspect-ratio: 1;
    font-size: 42px;
    border-radius: 8px 0 0 8px;
  }
}
.thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.35));
}
.thumb .wish {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border-radius: 9px; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; border: 1px solid rgba(255,255,255,0.15);
  transition: all var(--transition); z-index: 2;
}
@media(max-width: 640px) {
  .thumb .wish {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}
.thumb .wish:hover { transform: scale(1.1); border-color: var(--signal); }
.thumb .wish.active { background: var(--signal); border-color: var(--signal); }
.thumb .tag {
  position: absolute; top: 10px; left: 10px;
  background: var(--signal); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; z-index: 2;
  box-shadow: 0 2px 8px rgba(255,107,91,0.4);
}
@media(max-width: 640px) {
  .thumb .tag {
    font-size: 8px;
    padding: 2px 6px;
  }
}

.card-body {
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1;
}
@media(max-width: 640px) {
  .card-body { 
    padding: 12px 12px 12px 14px; 
    gap: 4px;
    justify-content: space-between;
  }
}

.card-cat {
  font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .05em;
}
@media(max-width: 640px) {
  .card-cat { 
    font-size: 8px;
    display: none;
  }
}

.card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  line-height: 1.3; color: var(--text);
}
@media(max-width: 640px) {
  .card-title {
    font-size: 13px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    display: -webkit-box;
  }
}
.card-rating { font-size: 12px; color: var(--text-muted); }
.card-rating b { color: var(--text); }
@media(max-width: 640px) {
  .card-rating {
    font-size: 10px;
  }
}
.card-rating .star { color: var(--gold); }

.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--border);
}
@media(max-width: 640px) {
  .card-foot {
    margin-top: 6px;
    padding-top: 6px;
    gap: 6px;
  }
}
.price-now {
  font-family: var(--font-mono); font-weight: 700; font-size: 18px; color: var(--text);
}
@media(max-width: 640px) {
  .price-now {
    font-size: 16px;
  }
}
.price-was {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  text-decoration: line-through; margin-left: 6px;
}
.compare-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-muted); cursor: pointer;
}
.compare-check input { accent-color: var(--accent); cursor: pointer; }
@media(max-width: 640px) {
  .compare-check {
    display: none;
  }
}

.buy-btn {
  width: 100%; margin-top: 10px;
  background: var(--accent); color: #050A0E;
  border: none; border-radius: 9px; padding: 10px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all var(--transition);
  letter-spacing: 0.01em;
}
@media(max-width: 640px) {
  .buy-btn { 
    margin-top: 6px; 
    padding: 8px 10px; 
    font-size: 11px;
    white-space: nowrap;
  }
}
.buy-btn:hover {
  background: var(--accent-2);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}
.buy-btn:active { transform: scale(0.98); }

.empty-state {
  text-align: center; padding: 70px 20px; color: var(--text-muted);
  grid-column: 1/-1;
}
.empty-state .e-glyph { font-size: 34px; margin-bottom: 12px; opacity: 0.6; }

/* ── COMPARE TRAY ────────────────────────────────────────── */
.compare-tray {
  position: fixed; bottom: 20px; left: 50%;
  transform: translate(-50%, 130%); z-index: 60;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg); padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 0 0 1px var(--border-hi);
  backdrop-filter: blur(12px);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
}
.compare-tray.show { transform: translate(-50%, 0); }
.compare-tray span { font-size: 13px; font-family: var(--font-mono); color: var(--text-soft); }
.compare-tray span b { color: var(--accent); }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl); max-width: 780px; width: 100%;
  max-height: 84vh; overflow: auto; padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: modal-in 0.22s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.close-x {
  cursor: pointer; font-size: 20px; color: var(--text-muted);
  background: none; border: none;
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.close-x:hover { background: var(--surface-3); color: var(--text); }

table.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cmp-table th,
table.cmp-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
}
table.cmp-table th {
  font-family: var(--font-display); font-weight: 600; color: var(--text-muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2);
}
table.cmp-table td.pname { font-weight: 600; font-family: var(--font-display); color: var(--accent); }
table.cmp-table tr:last-child td { border-bottom: none; }
table.cmp-table tr:hover td { background: var(--surface-2); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border); padding: 48px 0 60px; margin-top: 24px;
}
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px;
}
@media(max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-col h4 {
  font-size: 12px; font-family: var(--font-display); font-weight: 700;
  margin-bottom: 14px; color: var(--text); text-transform: uppercase; letter-spacing: .06em;
}
.foot-col a { display: block; font-size: 13.5px; color: var(--text-muted); margin-bottom: 9px; transition: color var(--transition); }
.foot-col a:hover { color: var(--accent); }
.disclosure {
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 20px; line-height: 1.7;
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* ── STAGGERED CARD ANIMATION ────────────────────────────── */
.card:nth-child(1)  { animation-delay: 0.02s; }
.card:nth-child(2)  { animation-delay: 0.05s; }
.card:nth-child(3)  { animation-delay: 0.08s; }
.card:nth-child(4)  { animation-delay: 0.11s; }
.card:nth-child(5)  { animation-delay: 0.14s; }
.card:nth-child(6)  { animation-delay: 0.17s; }
.card:nth-child(7)  { animation-delay: 0.20s; }
.card:nth-child(8)  { animation-delay: 0.23s; }
.card:nth-child(9)  { animation-delay: 0.26s; }
.card:nth-child(10) { animation-delay: 0.29s; }
.card:nth-child(11) { animation-delay: 0.32s; }
.card:nth-child(12) { animation-delay: 0.35s; }

/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* ── SELLER PRICE TICKER (stock-market style row) ─────────── */
.seller-ticker {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 0; margin-top: 4px;
}
.ticker-chip {
  font-family: var(--font-mono); font-size: 10.5px;
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: 6px; padding: 3px 7px;
  color: var(--text-muted); white-space: nowrap;
}
.ticker-chip b { color: var(--text-soft); font-weight: 600; margin-left: 3px; }
.ticker-chip.best {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
}
.ticker-chip.best b { color: var(--accent); }
/* ── HERO TRUST LINE ─────────────────────────────────────── */
.hero-trust {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 18px; font-size: 12.5px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.hero-trust span { display: flex; align-items: center; gap: 5px; }

/* ── TRUST STRIP SECTION ─────────────────────────────────── */
.trust-strip {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 28px 0; background: var(--surface);
}
.trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  text-align: center;
}
.trust-num {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--accent); margin-bottom: 4px;
}
.trust-label {
  font-size: 12px; color: var(--text-muted); letter-spacing: .02em;
}
@media(max-width: 700px) { .trust-grid { grid-template-columns: repeat(2,1fr); gap: 22px; } }

/* ── DISCOUNT BADGE ───────────────────────────────────────── */
.discount-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #0a0d14;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; z-index: 2;
  box-shadow: 0 2px 8px rgba(94,234,207,0.4);
}

/* ── STORE BADGE ──────────────────────────────────────────── */
.store-badge {
  font-size: 10.5px; color: var(--text-muted);
  margin-top: 3px; font-family: var(--font-mono);
}
/* ── HEADER v2: hamburger + search + mobile menu ─────────────────── */
.nav-inner { flex-wrap: nowrap; }
.nav-left { display: flex; align-items: center; gap: 10px; }

.hamburger-btn {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border-mid);
  border-radius: 9px;
  background: var(--surface-2);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  cursor: pointer;
}
.hamburger-btn span {
  display: block; width: 16px; height: 2px;
  background: var(--text); border-radius: 2px;
}
.hamburger-btn span:last-child { width: 12px; }
@media(max-width: 820px) {
  .hamburger-btn { display: flex; }
}

.nav-search-desktop {
  flex: 1; max-width: 480px; margin: 0 24px;
  display: block;
}
.nav-search-desktop input {
  width: 100%; height: 40px;
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: 999px; padding: 0 16px;
  color: var(--text); font-family: var(--font-body); font-size: 13.5px;
}
.nav-search-desktop input:focus { border-color: var(--accent); outline: none; }
@media(max-width: 820px) {
  .nav-search-desktop { display: none; }
}

.nav-search-mobile { display: none; padding: 0 16px 12px; }
.nav-search-mobile input {
  width: 100%; height: 38px;
  background: var(--surface-2); border: 1px solid var(--border-mid);
  border-radius: 999px; padding: 0 16px;
  color: var(--text); font-family: var(--font-body); font-size: 13px;
}
@media(max-width: 820px) {
  .nav-search-mobile { display: block; }
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 8px 16px 16px;
  gap: 4px;
}
.mobile-menu a {
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-soft);
}
.mobile-menu a:hover { background: var(--surface-2); color: var(--text); }
.mobile-menu.open { display: flex; }

@media(max-width: 480px) {
  .nav-actions #installBtn { display: none !important; }
}
/* ============================================================
   Legal / Info pages (About, Contact, Privacy, Terms, Affiliate)
   Uses existing design tokens from :root / html.light — theme aware
   ============================================================ */

.legal-hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--accent-dim), transparent);
  padding: 48px 0 40px;
}
.legal-hero-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.legal-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(94,234,207,0.25);
  border-radius: 999px; padding: 5px 13px; margin-bottom: 18px; letter-spacing: 0.04em;
}
.legal-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.legal-hero h1 {
  font-family: var(--font-display); font-size: 32px; line-height: 1.15;
  letter-spacing: -0.02em; font-weight: 700; margin-bottom: 14px;
}
.legal-hero h1 span { color: var(--accent); }
@media(max-width: 640px) { .legal-hero h1 { font-size: 25px; } }
.legal-hero p { color: var(--text-soft); font-size: 14.5px; line-height: 1.65; max-width: 620px; }
.legal-updated {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  font-size: 11.5px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px;
  background: var(--surface);
}

.legal-body { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }

.legal-section {
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
}
.legal-section:last-child { border-bottom: none; }
.legal-section h2 {
  display: flex; align-items: flex-start; gap: 12px;
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 12px;
}
.legal-section h2 .num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  background: var(--accent); color: #050A0E;
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.legal-section p {
  color: var(--text-soft); font-size: 13.5px; line-height: 1.75; margin-bottom: 12px;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section b { color: var(--text); }

/* Stat grid (About page) */
.stat-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 8px;
}
@media(max-width: 560px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 10px; text-align: center;
}
.stat-card .v { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--accent); }
.stat-card .l { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }

/* Value / How / Flow card grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.info-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  transition: border-color 0.18s;
}
.info-card:hover { border-color: var(--accent); }
.info-card .icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent-dim);
  color: var(--accent); font-size: 15px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.info-card .tag { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.15em; color: var(--accent); }
.info-card .title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; margin: 4px 0 5px; color: var(--text); }
.info-card .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

/* Callout */
.callout {
  border-radius: 14px; padding: 16px; border: 1px solid; margin-bottom: 14px;
  font-size: 13px; line-height: 1.65;
}
.callout .callout-title { font-weight: 700; font-family: var(--font-display); font-size: 13.5px; margin-bottom: 5px; }
.callout.teal { background: var(--accent-dim); border-color: rgba(94,234,207,0.3); color: var(--text); }
.callout.teal .callout-title { color: var(--accent); }
.callout.amber { background: var(--gold-dim); border-color: rgba(245,200,66,0.3); color: var(--text); }
.callout.amber .callout-title { color: var(--gold); }
.callout.slate { background: var(--surface-2); border-color: var(--border-mid); color: var(--text); }
.callout.slate .callout-title { color: var(--text); }

/* Bullets */
.legal-bullets { list-style: none; margin: 12px 0; }
.legal-bullets li {
  display: flex; gap: 10px; font-size: 13.5px; color: var(--text-soft);
  line-height: 1.6; margin-bottom: 9px;
}
.legal-bullets li::before {
  content: ''; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-top: 7px;
}

.mail-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Contact page: primary email card */
.contact-card {
  border-radius: 20px; border: 1px solid var(--border-mid); overflow: hidden; margin-bottom: 16px;
}
.contact-card-head {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 28px 24px; color: #050A0E;
}
.contact-card-head .label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.75;
}
.contact-card-head .email-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.contact-card-head .email-row a {
  font-family: var(--font-display); font-weight: 700; font-size: 19px; word-break: break-all;
  color: #050A0E; text-decoration: underline;
}
.contact-card-head p { color: rgba(5,10,14,0.75); font-size: 12.5px; margin-top: 10px; max-width: 480px; }
.contact-card-head .btns { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.contact-card-head .btns button, .contact-card-head .btns a {
  border-radius: 999px; padding: 9px 18px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: none;
}
.btn-solid-dark { background: #050A0E; color: #fff; }
.btn-outline-dark { background: rgba(5,10,14,0.12); color: #050A0E; border: 1px solid rgba(5,10,14,0.25) !important; }

.contact-info-grid { display: grid; grid-template-columns: repeat(3,1fr); background: var(--surface); }
@media(max-width: 560px) { .contact-info-grid { grid-template-columns: 1fr; } }
.contact-info-grid > div {
  padding: 16px; text-align: center; border-top: 1px solid var(--border);
}
@media(min-width: 561px) {
  .contact-info-grid > div:not(:first-child) { border-left: 1px solid var(--border); }
}
.contact-info-grid .i { font-size: 15px; }
.contact-info-grid .l { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-top: 4px; }
.contact-info-grid .v { font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 3px; }

/* Reason cards (contact) */
.reason-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; transition: all 0.18s;
}
.reason-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.reason-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.reason-card .icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.reason-card .title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; margin: 10px 0 4px; color: var(--text); }
.reason-card .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.reason-card .subj {
  margin-top: 10px; background: var(--surface-3); border-radius: 8px; padding: 6px 10px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* FAQ */
.faq-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-mid); display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-muted); transition: transform 0.18s;
}
.faq-item[open] summary::after { transform: rotate(45deg); background: var(--accent); color: #050A0E; border-color: var(--accent); }
.faq-item .a { padding: 0 16px 16px; font-size: 12.5px; color: var(--text-muted); line-height: 1.65; }

/* Security note */
.security-note {
  border: 1px solid rgba(245,200,66,0.3); background: var(--gold-dim); border-radius: 14px;
  padding: 16px; font-size: 13px; line-height: 1.65; color: var(--text);
}

/* Cookie table */
.cookie-table { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.cookie-row { display: flex; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cookie-row:last-child { border-bottom: none; }
.cookie-row:nth-child(even) { background: var(--surface-2); }
.cookie-row .t { width: 130px; flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--text); }
.cookie-row .d { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
@media(max-width: 560px) { .cookie-row { flex-direction: column; gap: 4px; } .cookie-row .t { width: auto; } }

/* ============================================================
   MOBILE-ONLY HEADER CLEANUP (max-width: 820px)
   Fixes the messy wrapping of the currency picker, "live" badge,
   auth greeting and icon buttons that app.js injects into
   .nav-actions on small screens. Nothing here touches desktop —
   every rule is scoped inside this single media query.
   ============================================================ */
@media (max-width: 820px) {

  /* Let the actions block drop to its own full-width row below
     the hamburger + logo row, instead of squeezing/wrapping next
     to the logo. */
  .nav-inner {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .nav-left {
    order: 1;
  }
  .nav-actions {
    order: 2;
    flex-basis: 100%;
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav-actions::-webkit-scrollbar { display: none; }

  /* The currency <select> + "live/est" badge wrapper that app.js
     inserts as the first child of .nav-actions. It's the only
     plain <div> among .nav-actions' children, so this selector
     targets it safely without needing a class from app.js. */
  .nav-actions > div {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  #currencyPicker {
    padding: 6px 8px;
    font-size: 11px;
    max-width: 84px;
  }

  /* The "● live / ○ est." text is just noise on a small screen —
     hide it so the currency picker doesn't fight for space. */
  #ratesBadge {
    display: none;
  }

  #authSlot {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
  }
  #authSlot .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  /* On very narrow phones, drop the "Hi, Name" text and keep just
     the logout icon so the row never runs out of room. */
  #authSlot > span {
    display: none;
  }
}