/* =========================================================
   QUICKVAST THEME
   1. Tokens   2. Base   3. Layout   4. Components   5. Utilities
   ========================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Brand (green) */
  --brand-50:  #e0f5e6;
  --brand-100: #c2eaca;
  --brand-500: #22a55e;
  --brand-600: #16a34a;   /* primary */
  --brand-700: #0f7d38;

  /* Accent (orange) */
  --accent-50:  #eef0ff;
  --accent-100: #dfe2ff;
  --accent-500: #3f46a3;
  --accent-600: #0f166d;  /* primary CTA / highlight */
  --accent-700: #0a0f52;

  /* Ink (text) */
  --ink-900: #0a0f52;     /* headings, prices */
  --ink-700: #2a3556;
  --ink-500: #5d6785;     /* body / muted */
  --ink-400: #8b93ab;     /* meta, placeholders */

  /* Surfaces */
/* --bg:          #f5f7ff; */
--bg:          #ffffff;
--bg-soft:     #dfe2ff;
--surface:     #e8ecff;
--surface-alt: #dfe4ff;   /* pills, active menu item */
--media:       #d6dcff;   /* card image area */
--media-2:     #e1e6ff;
--line:        #9da6d970;

  /* Status */
  --success-bg: #e3f6ec;
  --success-fg: #12784a;
  --heart:      #f2750d;

  /* Hero headline colours (one per slide) */
  --hl-1: #0f7d38;   /* green         */
  --hl-2: #0a0f52;   /* orange        */
  --hl-3: #22a55e;   /* bright green  */
  --hl-4: #0f166d;   /* deep orange   */
  --gold: #0a0f52;

  /* Shape */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 26, 58, .05);
  --shadow-md: 0 8px 24px rgba(15, 26, 58, .07);
  --shadow-lg: 0 18px 40px rgba(15, 26, 58, .10);

  /* Loading placeholders */
  --sk-shine: rgba(255, 255, 255, .6);

  /* Type */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: .6875rem;
  --fs-sm: .78rem;
  --fs-md: .875rem;
  --fs-lg: 1rem;
  --fs-h3: 1.35rem;
  --fs-h2: 1.6rem;
  --fs-h1: clamp(1.9rem, 1.2rem + 2.6vw, 3.6rem);

  --topbar-h: 64px;
  --sidebar-w: 240px;
  --content-max: 900px;
  --gutter: clamp(16px, 3vw, 32px);
  /* Inner width shared by header, shell and footer. Guests: main only. */
  --shell-inner: var(--content-max);
}
/* Logged-in pages have a sidebar, so the shell grows to keep MAIN at --content-max */
body.has-sidebar { --shell-inner: calc(var(--content-max) + var(--sidebar-w) + 28px); }

:root[data-theme="dark"] {
  --brand-50:  #123a2b;
  --brand-100: #15472f;
  --brand-500: #2fbd66;
  --brand-600: #22c55e;
  --brand-700: #4ade80;
  --accent-50:  #3a2312;
  --accent-100: #4a2c12;
  --accent-500: #fb8a2e;
  --accent-600: #fb923c;
  --accent-700: #fdba74;
  --ink-900: #f2f5ff;
  --ink-700: #d3d9ee;
  --ink-500: #a4adc7;
  --ink-400: #7b849f;
  --bg: #0c1a16;
  --bg-soft: #09140f;
  --surface: #12241e;
  --surface-alt: #1a3029;
  --media: #1b3129;
  --media-2: #16291f;
  --line: #24403a;
  --hl-1: #4ade80; --hl-2: #fb923c; --hl-3: #2fbd66; --hl-4: #fdba74;
  --success-bg: #123a2b;
  --success-fg: #62d9a0;
  --heart: #fb923c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.45);
  --sk-shine: rgba(255, 255, 255, .07);
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink-500);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--ink-900); letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- 3. LAYOUT ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 max(var(--gutter), calc((100% - var(--shell-inner)) / 2));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
/* Main width: wrap anything in .container to line it up with the page.
   Width comes from --content-max (main column) via --shell-inner. */
.container {
  width: 100%;
  max-width: calc(var(--shell-inner) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 28px;
  padding-block: 24px 64px;
  align-items: start;
}
.main { min-width: 0; border:1px solid var(--line); padding: 15px; border-radius: var(--r-lg); }
@media (max-width: 640px) {
  .main { border: none; border-radius: 0; padding: 0; }
}
.section { margin-top: 40px; }
/* Section heading: icon tile, title + subtitle, optional "view all" link.
   A hairline rule runs underneath with a short brand-coloured tab on the left. */
.section-head {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 4px 14px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.section-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 64px; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--accent-600);
}
.sh-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--accent-50); color: var(--accent-700);
}
.section-head h2 { font-size: var(--fs-h4); font-weight: 700; line-height: 1.2; color: var(--accent-700); }
.section-head p { margin-top: 2px; color:var(--accent-700); font-size: var(--fs-sm); }
.sh-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; color: var(--accent-700);
  background: var(--accent-50);
  transition: background .15s, gap .15s;
}
.sh-link:hover { background: var(--accent-100); gap: 9px; }
.sh-link .i { font-size: 14px; }
@media (max-width: 640px) {
  /* Let the title and subtitle join the grid so the link can sit beside the subtitle */
  .section-head { gap: 2px 12px; align-items: center; }
  .sh-text { display: contents; }
  .sh-icon { grid-row: 1 / span 2; align-self: start; width: 38px; height: 38px; font-size: 18px; }
  .section-head h2 { grid-column: 2 / -1; grid-row: 1; font-size: 1.25rem; }
  .section-head p { grid-column: 2; grid-row: 2; margin-top: 0; font-size: var(--fs-xs); line-height: 1.4; }
  .sh-link { grid-column: 3; grid-row: 2; padding: 4px 10px; font-size: var(--fs-xs); white-space: nowrap; }
  .sh-link .i { font-size: 12px; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
  .pillnav { display: none; }
}

/* ---------- 4. COMPONENTS ---------- */

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600); font-size: 16px;
}
.brand-name { display: block; font-weight: 700; color: var(--ink-900); font-size: .95rem; line-height: 1.1; }
.brand-sub  { display: block; font-size: .625rem; font-weight: 500; color: var(--ink-500); margin-top: 3px; white-space: nowrap; }

/* Pill nav */
.pillnav {
  display: flex; gap: 2px; padding: 6px;
  background: var(--accent-100); border-radius: var(--r-pill);
}
.pillnav a {
  padding: 8px 20px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; color: var(--accent-700);
  transition: background .15s, color .15s;
}
.pillnav a:hover { color: var(--ink-900); }
.pillnav a[aria-current="page"] { background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-sm); }
@media (max-width: 960px) { .pillnav { display: none; } }

/* Mobile menu button + dropdown */
.menu-btn {
  display: none; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; font-size: 18px;
  background: var(--surface-alt); color: var(--ink-700); border: 1px solid var(--line);
}
.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-open { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }
.mobile-menu {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  padding: 10px var(--gutter) 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.mm-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r-md);
  font-size: var(--fs-md); font-weight: 500; color: var(--ink-700);
}
.mm-link .i { font-size: 17px; color: var(--ink-400); }
.mm-link:hover { background: var(--surface-alt); color: var(--ink-900); }
.mm-link[aria-current="page"] { background: var(--accent-50); color: var(--accent-700); }
.mm-link[aria-current="page"] .i { color: var(--accent-700); }
.mm-label { padding: 12px 12px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; color: var(--ink-400); }
.mm-auth { display: flex; gap: 10px; margin-top: 12px; }
.mm-auth .btn { flex: 1; }
.btn-ghost { background: var(--surface); color: var(--ink-900); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-alt); }
@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .mobile-menu.open { display: block; }
}
@media (max-width: 560px) { 
  .actions { gap: 10px; }
  .hide-xs { display: none !important;}
  .logo img{width:140px;}
}
@media (max-width: 400px) {
  .brand-sub { display: none; }
}

/* Header actions + theme toggle */
.actions { display: flex; align-items: center; gap: 14px; justify-self: end; }
.actions .user { justify-self: auto; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px;
  background: var(--surface-alt); color: var(--ink-700);
  border: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.theme-toggle:hover { background: var(--accent-50); color: var(--accent-700); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* User chip */
.user { display: flex; align-items: center; gap: 10px; justify-self: end; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-600); color: #fff;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.user-text { line-height: 1.25; }
.user-text b { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-900); }
.user-text small { font-size: var(--fs-xs); color: var(--ink-500); }
@media (max-width: 560px) { .user-text { display: none; } }

/* Sidebar */
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + 24px);
  /* background: var(--surface); */
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 14px 14px;
}
.menu-label { padding: 0 12px 12px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-500); letter-spacing: .06em; }
.menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500);
  transition: background .15s, color .15s;
}
.menu a .i { font-size: 15px; }
.menu a:hover { background: var(--surface-alt); color: var(--ink-900); }
.menu a[aria-current="page"] { background: var(--accent-100); color: var(--accent-700); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 12px;
  background: var(--accent-100); border-radius: var(--r-md); 
}
.sidebar-user .avatar { width: 34px; height: 34px; }
.avatar-guest { background: var(--accent-700); font-size: 16px; }
.sidebar-auth { display: flex; gap: 8px; margin-top: 10px; }
.sidebar-auth .btn { flex: 1; padding-inline: 0; }

/* Hero */
.hero .kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--ink-700);  
}
.hero .kicker svg { color: var(--gold); }
.hero h1, .hero .hero-title { font-size: var(--fs-h1); font-weight: 700; line-height: 1.15; margin: 6px 0 12px; text-align: center; }
.hero p.lead {  color: var(--ink-700); font-size: var(--fs-md); text-align: center; }

/* Sliding headline: slides stack in one grid cell (height = tallest slide),
   the active one rises into view while the previous one slides up and out. */
.hero-slider { display: grid; overflow: hidden; padding-bottom: 4px; }
.hero-slide {
  grid-area: 1 / 1; text-align: center;
  opacity: 0; visibility: hidden; transform: translateY(70%);
  transition: transform .65s cubic-bezier(.22, .8, .3, 1), opacity .45s ease, visibility 0s linear .65s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.hero-slide.is-leaving { opacity: 0; visibility: visible; transform: translateY(-70%); }
.hero .hero-title { color: var(--ink-900); text-wrap: balance; transition: color .3s; }
.hero-slide .lead { margin-inline: auto; }
/* max-width: 60ch;  */
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transform: none !important; transition: opacity .4s ease, visibility 0s linear .4s !important; }
  .hero-slide.is-active { transition-delay: 0s !important; }
}
.hero-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.hero-dots button {
  position: relative; width: 8px; height: 8px; border-radius: var(--r-pill);
  background: var(--line);
  transition: width .3s, background .3s;
}
.hero-dots button::before { content: ""; position: absolute; inset: -10px -4px; }  /* bigger tap target */
.hero-dots button[aria-current="true"] { width: 26px; background: var(--c); }

/* Search bar */
.search {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, .9fr) auto;
  align-items: center;
  margin-top: 20px; padding: 8px 8px 8px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  /* box-shadow: var(--shadow-md); */
}
.search-field { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 16px; color: var(--ink-400); }
.search-field:first-child { padding-left: 0; }
.search-field + .search-field { border-left: 1px solid var(--line); }
.search-field input, .search-field select {
  width: 100%; min-width: 0; border: 0; background: transparent; outline: 0;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-900);
  appearance: none; -webkit-appearance: none;
}
.search-field input::placeholder { color: var(--ink-400); font-weight: 400; }
.search-field:focus-within { color: var(--brand-600); }
.search-field .chev { margin-left: auto; font-size: 12px; }
@media (max-width: 760px) {
  .search { grid-template-columns: 1fr; border-radius: var(--r-lg); padding: 12px; gap: 4px; }
  .search-field, .search-field:first-child { padding: 10px 6px; }
  .search-field + .search-field { border-left: 0; border-top: 1px solid var(--line); }
  .search .btn { width: 100%; margin-top: 8px; }
}

/* Popular searches */
.chips { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: var(--fs-xs); }
.chips > span { color: var(--ink-500); margin-right: 4px; }
.chip {
  padding: 5px 14px; border-radius: var(--r-pill);
  background: var(--accent-100); color: var(--accent-700);
  font-size: var(--fs-xs); font-weight: 600;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--accent-50); color: var(--accent-700); }
button.chip { border: 0; cursor: pointer; font-family: var(--font); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 30px; border-radius: var(--r-lg);
  font-size: var(--fs-sm); font-weight: 600;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-primary { background: var(--accent-600); color: #fff; }
.btn-primary:hover { background: var(--accent-700); }
.btn-primary:active { transform: translateY(1px); }
.btn { white-space: nowrap; }
.btn-sm { padding: 9px 18px; }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; background: #fff;
    padding: 10px;
    border-radius: 20px;}
@media (max-width: 640px) {
  .cat-grid {
    display: flex; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    /* bleed to the screen edges so cards slide under the page margin */
    margin-inline: calc(var(--gutter) * -1);
    padding: 6px var(--gutter) 14px;
  }
  .cat-grid::-webkit-scrollbar { display: none; }
  .cat { flex: 0 0 auto; min-width: 176px; scroll-snap-align: start; }
}
.cat {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--surface);
  /* border: 1px solid var(--line); */
  border-radius: var(--r-lg);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat:hover { border-color: var(--accent-100); 
/* box-shadow: var(--shadow-md); transform: translateY(-2px);  */
}
.cat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--media); color: var(--ink-700);
}
.cat b { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-900); line-height: 1.3; }
.cat small { font-size: var(--fs-xs); color: var(--ink-400); }

/* Tabs + sort row */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  padding: 7px 16px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-500);
  border: 1px solid var(--line); background: var(--surface);
  transition: all .15s;
}
.tab:hover { color: var(--ink-900); }
.tab[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--bg); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 16px; }
.toolbar .count { font-size: var(--fs-sm); color: var(--ink-500); }
.toolbar .count b { color: var(--ink-900); }
.sort { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--ink-500); }
.select {
  display: flex; align-items: center; gap: 24px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-900);
}
.select select { border: 0; background: transparent; outline: 0; appearance: none; -webkit-appearance: none; font-weight: 600; padding-right: 8px; }

/* Custom dropdown (replaces the native select popup) */
.has-dd { position: relative; }
.has-dd > svg:last-child { transition: transform .15s; }
.has-dd.dd-open > svg:last-child { transform: rotate(180deg); }
.dd-native { display: none; }
.dd { flex: 1; min-width: 0; }
.dd-btn {
  display: block; width: 100%; padding: 0; text-align: left;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.select .dd-btn { font-size: var(--fs-xs); font-weight: 600; }
.dd-list {
  display: none;
  position: absolute; left: 0; top: calc(100% + 12px); z-index: 40;
  min-width: 100%; width: max-content; max-width: min(280px, 86vw); max-height: 280px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.select .dd-list { left: auto; right: -14px; top: calc(100% + 18px); }
.dd.open .dd-list { display: block; animation: dd-in .14s ease-out; }
.dd-title { display: none; }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 12px; border-radius: 10px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-700);
  cursor: pointer; white-space: nowrap;
}
.dd-opt .i { font-size: 15px; opacity: 0; }
.dd-opt:hover, .dd-opt.is-active { background: var(--surface-alt); color: var(--ink-900); }
.dd-opt.is-selected { background: var(--accent-50); color: var(--accent-700); font-weight: 600; }
.dd-opt.is-selected .i { opacity: 1; }
.dd-backdrop { display: none; position: fixed; inset: 0; z-index: 39; background: rgba(8, 20, 15, .45); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes dd-sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  /* On phones the list opens as a bottom sheet */
  .dd-backdrop.show { display: block; }
  .dd-list, .select .dd-list {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; min-width: 0; max-width: none; max-height: 65vh;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0; border-bottom: 0;
  }
  .dd.open .dd-list { animation: dd-sheet .2s ease-out; }
  .dd-title {
    display: block; padding: 14px 12px 8px; position: relative;
    font-size: var(--fs-sm); font-weight: 700; color: var(--ink-900);
  }
  .dd-title::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 36px; height: 4px;
    margin-left: -18px; border-radius: 4px; background: var(--line);
  }
  .dd-opt { padding: 14px 12px; font-size: var(--fs-md); }
}
@media (prefers-reduced-motion: reduce) { .dd.open .dd-list { animation: none !important; } }

/* Listing card */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ad {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  /* border: 1px solid var(--line); */
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.ad:hover { box-shadow: var(--shadow-md);   border-color: transparent; cursor: pointer;}
.ad-media {
  position: relative; height: 168px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--media) 0%, var(--media-2) 100%);
  color: var(--ink-400); font-size: 44px;
}
.ad-media .i { stroke-width: 1.3; }
.ad-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ad:hover .ad-img { transform: scale(1.04); }
.ad-media .tag-featured, .ad-media .fav { z-index: 2; }

/* Loading placeholders
   JS adds .is-loading to .ad-media while its photo is still downloading.
   The shimmer shows instead of the category icon, then the photo fades in.
   Without JS nothing changes: the icon shows behind the photo as before. */
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.ad-media.is-loading::before,
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--sk-shine) 50%, transparent 70%) 0 0 / 200% 100%;
  animation: sk-shimmer 1.6s linear infinite;
}
.ad-media.is-loading::before { z-index: 1; }
.ad-media.is-loading .ad-fallback { visibility: hidden; }
.ad-media.is-loading .ad-img { opacity: 0; }
.ad-img { transition: transform .35s ease, opacity .3s ease; }

/* Skeleton card: same footprint as .ad, so the grid does not jump when real ads arrive */
.ad-grid.is-loading .ad:not(.ad--skeleton) { display: none; }
.ad--skeleton, .ad--skeleton:hover { transform: none; box-shadow: none; pointer-events: none; }
.ad--skeleton .ad-media { background: var(--media); }
.sk { position: relative; overflow: hidden; background: var(--media); border-radius: var(--r-sm); }
.sk-price { width: 42%; height: 18px; }
.sk-line  { width: 100%; height: 12px; }
.sk-line.short { width: 68%; }
.sk-meta  { width: 55%; height: 10px; }
@media (prefers-reduced-motion: reduce) {
  .ad-media.is-loading::before, .sk::after { animation: none; }
}
.tag-featured {
  position: absolute; top: 12px; left: 12px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .625rem; font-weight: 600; color: #fff;
  background: var(--accent-600); box-shadow: var(--shadow-sm);
}
.fav {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink-700); font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, color .15s;
}
.fav:hover { transform: scale(1.08); }
.fav[aria-pressed="true"] { color: var(--heart); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.ad-body { display: flex; flex-direction: column; gap: 6px; padding: 16px; flex: 1; min-height: 130px; }
.price { font-size: 1.02rem; font-weight: 700; color: var(--accent-700); }
.price small { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-500); margin-left: 2px; }
.ad h3 {
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-xs); color: var(--ink-400); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.ad-foot {display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: var(--fs-sm); color: var(--ink-700); }

/* Horizontal ad scroller (e.g. "Verified sellers") */
.hscroll { position: relative; margin-top: 6px; }
.hscroll-viewport {
  display: flex; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 4px 2px 10px; cursor: grab;
}
.hscroll-viewport::-webkit-scrollbar { display: none; }
.hscroll-viewport.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.hscroll-item { flex: 0 0 auto; width: 232px; scroll-snap-align: start; }
.hscroll-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; z-index: 3;
  background: var(--surface); color: var(--ink-700);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  transition: opacity .15s, transform .15s, background .15s;
}
.hscroll-nav:hover { background: var(--surface-alt); }
.hscroll-nav.is-hidden { opacity: 0; pointer-events: none; }
.hscroll-prev { left: -6px; }
.hscroll-prev .i { transform: rotate(180deg); }
.hscroll-next { right: -6px; }
@media (max-width: 640px) {
  .hscroll-nav { display: none; } /* touch users swipe instead */
  .hscroll-viewport { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
}

/* Recent listings (compact row list) */
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px; 
  /* border: 1px solid var(--line);  */
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.recent-row:hover { box-shadow: var(--shadow-md); border-color: transparent; cursor: pointer; }
.recent-thumb {
  position: relative; flex: none; width: 76px; height: 76px; overflow: hidden;
  border-radius: var(--r-md);
  display: grid; place-items: center; font-size: 26px; color: var(--ink-400);
  background: linear-gradient(180deg, var(--media) 0%, var(--media-2) 100%);
}
.recent-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-thumb .i { stroke-width: 1.3; }
.recent-info { flex: 1; min-width: 0; }
.recent-info h3 {
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 5px; font-size: var(--fs-xs); color: var(--ink-400); }
.recent-meta span { display: inline-flex; align-items: center; gap: 4px; }
.recent-price { flex: none; font-size: var(--fs-md); font-weight: 700; color: var(--accent-700); text-align: right; }
.recent-price small { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-500); }
@media (max-width: 480px) {
  .recent-thumb { width: 60px; height: 60px; }
  .recent-price { font-size: var(--fs-sm); }
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .625rem; font-weight: 600;
}
.badge-verified { background: var(--success-bg); color: var(--success-fg); }
.badge-verified .i { font-size: 11px; }

/* Frequently searched */
.freq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
@media (max-width: 640px) {
  .freq-grid {
    display: flex; gap: 10px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 10px;
  }
  .freq-grid::-webkit-scrollbar { display: none; }
  .freq { flex: 0 0 auto; min-width: 210px; scroll-snap-align: start; }
}
.freq {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  /* border: 1px solid var(--line); */
  border-radius: var(--r-lg);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.freq:hover { border-color: var(--accent-100); box-shadow: var(--shadow-sm); }
.freq-icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-size: 16px;
  background: var(--media); color: var(--ink-700);
}
.freq-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.freq-text b { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.freq-text small { font-size: var(--fs-xs); color: var(--ink-400); }
.freq-arrow { flex: none; font-size: 13px; color: var(--ink-400); transition: transform .15s, color .15s; }
.freq:hover .freq-arrow { transform: translateX(2px); color: var(--accent-700); }

/* Sell in three steps */
.sell { display: grid; gap: 4px; }
.sell .section-head { margin-top: 28px; }
.sell-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
  padding: 28px 32px;
  background: var(--accent-100);
  border-radius: var(--r-lg);
}
.sell-top h2 { font-size: var(--fs-h3); font-weight: 700; color: var(--accent-700); }
.sell-top p { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-700); max-width: 52ch; }
.sell-actions { display: flex; align-items: center; gap: 22px; }
.btn .i { font-size: 14px; }
.link-quiet { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-900); border: 1px solid var(--line);}
.link-quiet:hover { color: var(--accent-700); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step {
  padding: 22px;
  /* background: var(--surface); */
  /* border: 1px solid var(--line); */
  border-radius: var(--r-lg);
}
.step-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--accent-100); color: var(--accent-700);
  margin-bottom: 16px;
}
.step h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: 6px; }
.step p { font-size: var(--fs-sm); color: var(--ink-500); line-height: 1.6; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .sell-top { padding: 22px; }
}

/* Footer */
.footer {
  padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  font-size: var(--fs-xs); color: var(--ink-400);
}
.footer .brand-mini { display: flex; align-items: center; gap: 8px; }
.footer .brand-mini .brand-mark { width: 18px; height: 18px; border-radius: 5px; background: var(--brand-600); color: #fff; font-size: 10px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer nav a { font-weight: 600; color: var(--ink-500); }
.footer nav a:hover { color: var(--accent-700); }

/* ---------- 5. UTILITIES ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* Avatar image (replaces initials when set) */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar { overflow: hidden; }