/* =========================================================
   Cookiva — کوکیوا
   Minimal, mobile-first, RTL storefront styles
   ========================================================= */

/* ---------- Fonts ----------
   Primary: IRANYekanX (same family Digikala uses). It is a commercial
   font from Fontiran — after buying a web license, put the files in
   assets/fonts/ (see assets/fonts/README.md). Until then the browser
   falls back to Vazirmatn (free, loaded from Google Fonts). */
/* Vazirmatn (OFL), served from this site — no Google Fonts request, which can be blocked or slow in Iran */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
/* IRANYekanX (the Digikala font): after buying the license and copying IRANYekanXVF.woff2 into assets/fonts/,
   remove the comment markers around this block. Until then it stays off, so pages don't request a missing file.
@font-face {
  font-family: "IRANYekanX";
  src: url("../fonts/IRANYekanXVF.woff2") format("woff2-variations"),
       url("../fonts/IRANYekanXVF.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
*/

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --vanilla-cream: #FFF7E6;
  --blush-petal: #F7C8D3;
  --midnight-lagoon: #2D3A47;

  /* Semantic colors */
  --bg: var(--vanilla-cream);
  --surface: #FFFFFF;
  --surface-sunken: #F7EDD8;
  --text: var(--midnight-lagoon);
  --text-muted: #5E6A76;
  --border: #EADDC4;
  --frame-line: rgba(184, 146, 74, .38);   /* «first edition» hairline: soft foil gold */
  --frame-line-on-white: rgba(184, 146, 74, .38);
  /* TEST curved edge (S7-edge style): sides shade off as if the surface bends away */
  --edge-light: inset 7px 0 7px -6px rgba(45, 58, 71, .10), inset -7px 0 7px -6px rgba(45, 58, 71, .10), inset 0 -2px 3px -2px rgba(45, 58, 71, .06), 0 1px 2px rgba(45, 58, 71, .06);
  --edge: var(--edge-light);
  --edge-right: inset -7px 0 7px -6px rgba(45, 58, 71, .10);
  --border-strong: #D9C8A8;
  --primary: var(--midnight-lagoon);
  --primary-hover: #212B35;
  --on-primary: var(--vanilla-cream);
  --accent: var(--blush-petal);
  --accent-soft: #FCE7EC;
  --accent-ink: #8C2A45;      /* text on blush, 5.9:1 */
  --lagoon-soft: #E7ECF0;
  --success: #1E7A4C;
  --success-soft: #E3F3EA;
  --danger: #B3261E;
  --ring: var(--midnight-lagoon);
  --accent-hover: #F3B6C4;
  --on-accent: #8C2A45;
  --warn: #9A5B00;
  --star: #C98A1B;
  --selected-bg: #FFFCF6;
  --focus-shadow: rgba(45, 58, 71, .12);
  --header-bg: rgba(255, 247, 230, .92);
  --overlay-btn: rgba(255, 255, 255, .92);
  --scrim: rgba(33, 43, 53, .45);
  --discount-bg: #8C2A45;
  --discount-fg: #FFFFFF;
  --deals-bg: var(--blush-petal);
  --deals-ink: var(--midnight-lagoon);
  --countdown-bg: var(--midnight-lagoon);
  --countdown-fg: var(--vanilla-cream);
  --banner-bg: var(--midnight-lagoon);
  --banner-fg: var(--vanilla-cream);
  --banner-border: var(--midnight-lagoon);
  --banner-muted: #D6DCE2;
  --toast-bg: var(--midnight-lagoon);
  --toast-fg: var(--vanilla-cream);
  --toast-accent: var(--blush-petal);
  --logo-bg: var(--midnight-lagoon);
  --logo-fg: var(--vanilla-cream);
  --blob-2: var(--vanilla-cream);
  --media-ic: var(--midnight-lagoon);

  /* Media tints for product image wells */
  --tint-1: #FBEFF2;
  --tint-2: #F6EBD3;
  --tint-3: #E9EEF2;
  color-scheme: light;

  /* Type */
  --font: "IRANYekanX", "Vazirmatn", Tahoma, system-ui, sans-serif;
  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.875rem;  /* 14 */
  --fs-md: 1rem;      /* 16 */
  --fs-lg: 1.125rem;  /* 18 */
  --fs-xl: 1.375rem;  /* 22 */
  --fs-2xl: 1.75rem;  /* 28 */
  --fs-3xl: 2.25rem;  /* 36 */

  /* Spacing (4pt) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Shape & depth */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(45, 58, 71, .06);
  --shadow-md: 0 4px 16px rgba(45, 58, 71, .08);
  --shadow-lg: 0 12px 40px rgba(45, 58, 71, .16);
  --shadow-up: 0 -4px 20px rgba(45, 58, 71, .06);

  /* Motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 150ms;
  --t-med: 240ms;

  /* Layout */
  --container: 1200px;
  --gutter: 16px;
  --header-h: 64px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Z-index scale */
  --z-header: 20; --z-tabbar: 30; --z-floating: 35; --z-sheet: 40; --z-toast: 50;
}

/* ---------- Dark theme ----------
   Same palette, just darker: Midnight Lagoon becomes the canvas,
   Vanilla Cream the text and primary buttons, Blush Petal stays the accent.
   <html data-theme="dark"> is set by the inline script in each page's <head>
   (saved choice, otherwise the device setting). */
:root[data-theme="dark"] {
  --bg: #18212A;
  --surface: #222D38;
  --surface-sunken: #2A3644;
  --text: var(--vanilla-cream);
  --text-muted: #C8BFAF;
  --border: #34424F;
  --frame-line: rgba(231, 200, 115, .2);
  /* TEST curved edge (dark) */
  --edge: inset 1px 0 0 rgba(255, 255, 255, .07), inset -1px 0 0 rgba(255, 255, 255, .07), inset 7px 0 7px -6px rgba(0, 0, 0, .35), inset -7px 0 7px -6px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25);
  --edge-right: inset -1px 0 0 rgba(255, 255, 255, .07), inset -7px 0 7px -6px rgba(0, 0, 0, .35);
  --border-strong: #4A5A69;
  --primary: var(--vanilla-cream);
  --primary-hover: #F1E3C6;
  --on-primary: var(--midnight-lagoon);
  --accent: var(--blush-petal);
  --accent-soft: #3B2A35;
  --accent-ink: var(--blush-petal);
  --accent-hover: #F3B6C4;
  --on-accent: #5C1A2E;
  --success: #7DD3A8;
  --success-soft: #1E3A30;
  --danger: #FF9A90;
  --warn: #F2C078;
  --star: #F0B955;
  --ring: var(--vanilla-cream);
  --selected-bg: #283441;
  --focus-shadow: rgba(255, 247, 230, .16);
  --header-bg: rgba(24, 33, 42, .88);
  --overlay-btn: rgba(34, 45, 56, .92);
  --scrim: rgba(0, 0, 0, .6);
  --discount-bg: var(--blush-petal);
  --discount-fg: #5C1A2E;
  --deals-bg: var(--blush-petal);       /* the special-discounts strip stays solid blush in dark mode too */
  --deals-ink: var(--midnight-lagoon);
  --countdown-bg: var(--midnight-lagoon);
  --countdown-fg: var(--vanilla-cream);
  --banner-bg: #222D38;
  --banner-fg: var(--vanilla-cream);
  --banner-border: #34424F;
  --banner-muted: #C8BFAF;
  --toast-bg: var(--vanilla-cream);
  --toast-fg: var(--midnight-lagoon);
  --toast-accent: #8C2A45;
  --logo-bg: var(--vanilla-cream);
  --logo-fg: var(--midnight-lagoon);
  --blob-2: #2E2C27;
  --media-ic: #E9DFCC;
  --tint-1: #2E2833;
  --tint-2: #2E2C27;
  --tint-3: #26323F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  --shadow-up: 0 -4px 20px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
.theme-ready body, .theme-ready .hdr, .theme-ready .tabbar, .theme-ready .card, .theme-ready .panel {
  transition: background-color var(--t-med) var(--ease-out), border-color var(--t-med), color var(--t-med);
}
.theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
.hdr-row > .theme-toggle { flex: none; }
.admin-jump { flex: none; padding-inline: var(--s-3); min-height: 40px; }
.admin-jump span { display: none; }
@media (min-width: 1024px) { .admin-jump span { display: inline; } }

/* ---------- 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.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.has-buybar, body.has-actionbar { padding-bottom: calc(var(--tabbar-h) + 72px + var(--safe-bottom)); }
@media (min-width: 1024px) {
  body, body.has-buybar, body.has-actionbar { padding-bottom: 0; }
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; font-weight: 800; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important; min-height: 0 !important;
}
.skip-link {
  position: absolute; inset-inline-start: var(--s-4); top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--s-2); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

.ic { width: 20px; height: 20px; stroke-width: 1.75; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-md); font-weight: 700; font-size: var(--fs-md);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--text); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 var(--s-4); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r-full); color: var(--text);
  transition: background-color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-sunken); }
.link { color: var(--text); font-weight: 700; display: inline-flex; align-items: center; gap: var(--s-1); }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.hdr-row { display: flex; align-items: center; gap: var(--s-3); height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 900; font-size: var(--fs-xl); letter-spacing: -.01em; flex: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--logo-bg); color: var(--logo-fg);
  display: grid; place-items: center; position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--blush-petal); inset-block-start: -3px; inset-inline-start: -3px;
  border: 2px solid var(--bg);
}
.logo-text { display: none; }
@media (min-width: 380px) { .logo-text { display: inline; } }

.search { position: relative; flex: 1; max-width: 560px; }
.search input {
  width: 100%; height: 44px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface);
  padding-inline: 44px var(--s-4); font-size: var(--fs-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--focus-shadow); }
.search .search-ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search input::-webkit-search-cancel-button { display: none; }
/* suggestions panel under the search box (phones: full width under the header) */
.search-pop {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: calc(var(--z-header) + 2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding-block: var(--s-2); max-height: min(72vh, 600px); overflow-y: auto; overscroll-behavior: contain;
  animation: rise 160ms var(--ease-out);
}
.search-pop[hidden] { display: none; }
@media (max-width: 1023.98px) {
  .search-pop { position: fixed; top: calc(var(--header-h) + 4px); inset-inline: 8px; max-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - 20px); }
}
.sp-sec { padding: var(--s-2) var(--s-4); }
.sp-sec + .sp-sec, .sp-list + .sp-sec { border-top: 1px solid var(--border); }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: 32px; margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 800; }
.sp-head > span { display: inline-flex; align-items: center; gap: 6px; }
.sp-head .ic { color: var(--text-muted); }
.sp-clear { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--text-muted); }
.sp-clear:hover { background: var(--surface-sunken); color: var(--danger); }
.sp-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sp-chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 var(--s-3); border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--text); font-size: var(--fs-sm); }
.sp-chip .ic { width: 14px; height: 14px; color: var(--accent-ink); }
.sp-chip:hover, .sp-chip.is-active { border-color: var(--text); }
.sp-row { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: var(--s-1) var(--s-4); color: var(--text); font-size: var(--fs-sm); }
.sp-row:hover, .sp-row.is-active { background: var(--surface-sunken); }
.sp-row > .ic { color: var(--text-muted); }
.sp-row .sp-faint { opacity: .5; }
.sp-grow { flex: 1; min-width: 0; }
.sp-row mark { background: none; color: inherit; font-weight: 800; }
.sp-in { color: var(--accent-ink); font-weight: 700; }
.sp-count { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.sp-brand { flex: none; width: 48px; height: 30px; display: grid; place-items: center; background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.sp-brand img { max-width: 80%; max-height: 70%; object-fit: contain; }
.sp-brand b { font-family: "Segoe UI", system-ui, sans-serif; font-size: 10px; color: #2D3A47; }
.sp-prods { padding-inline: 0; }
.sp-label { padding: 0 var(--s-4) var(--s-1); font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted); }
.sp-thumb { flex: none; width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden; }
.sp-thumb img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.sp-thumb .ic { width: 24px; height: 24px; color: var(--media-ic); }
.sp-pname { display: grid; gap: 2px; }
.sp-pname b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-price { font-size: var(--fs-xs); color: var(--text-muted); }
.sp-price.is-sale { color: var(--accent-ink); font-weight: 700; }
.sp-all { display: flex; align-items: center; justify-content: center; gap: 4px; height: 40px; margin: var(--s-2) var(--s-4) 0; border-radius: var(--r-md); background: var(--surface-sunken); font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.sp-all:hover, .sp-all.is-active { box-shadow: inset 0 0 0 1.5px var(--text); }
.sp-empty { padding: var(--s-2) var(--s-4) 0; font-size: var(--fs-sm); color: var(--text-muted); }

.hdr-actions { display: none; align-items: center; gap: var(--s-1); margin-inline-start: auto; }
.hdr-actions a { position: relative; }
.badge-count {
  position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full); background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
  border: 2px solid var(--bg); box-sizing: content-box;
}
.badge-count[hidden] { display: none; }

.catnav { display: none; border-top: 1px solid var(--border); }
.catnav-links a {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 48px; padding: 0 var(--s-3);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.catnav-links a:hover, .catnav-links a[aria-current="page"] { color: var(--text); border-color: var(--text); }
.catnav-links .deal-link { color: var(--accent-ink); }

@media (min-width: 1024px) {
  :root { --header-h: 76px; }
  .hdr-actions { display: flex; }
  .catnav { display: block; }
  .search { margin-inline: var(--s-6); }
}

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-tabbar);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  box-shadow: var(--shadow-up);
}
.tabbar ul { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tabbar a {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  transition: color var(--t-fast);
}
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--text);
}
.tabbar .badge-count { top: 6px; inset-inline-end: calc(50% - 22px); }
@media (min-width: 1024px) { .tabbar { display: none; } }

/* Product page swaps the tab bar for a buy bar on phones */
.buybar {
  position: fixed; inset-inline: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: var(--z-floating);
  background: var(--surface); border-top: 1px solid var(--border);
  padding: var(--s-3) var(--gutter);
  display: flex; align-items: center; gap: var(--s-3);
}
.buybar .btn { flex: 1; }
.buybar-price { display: flex; flex-direction: column; line-height: 1.4; }
@media (min-width: 1024px) { .buybar { display: none; } }

/* ---------- Sections ---------- */
.section { padding-block: var(--s-8); }
.section-tight { padding-block: var(--s-4); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.section-title { font-size: var(--fs-xl); }
.section-sub { color: var(--text-muted); font-size: var(--fs-sm); }
@media (min-width: 768px) { .section { padding-block: var(--s-12); } .section-title { font-size: var(--fs-2xl); } }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s-4) var(--s-2); }
.hero-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: var(--s-6); display: grid; gap: var(--s-6);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2); align-self: start; justify-self: start;
  background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 700;
  padding: var(--s-1) var(--s-3); border-radius: var(--r-full);
}
.hero h1 { font-size: var(--fs-2xl); line-height: 1.35; }
.hero p { color: var(--text-muted); font-size: var(--fs-md); max-width: 44ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero-ctas .btn { flex: 1 1 128px; padding-inline: var(--s-3); }
@media (max-width: 767.98px) {
  .hero-card { padding: var(--s-5); gap: var(--s-4); }
  .hero h1 { font-size: var(--fs-xl); }
  .hero p { font-size: var(--fs-sm); }
}
.hero-art {
  display: none; position: relative; aspect-ratio: 1; align-self: center; justify-self: center; width: min(360px, 100%);
}
.hero-art .blob { position: absolute; inset: 6%; border-radius: 50%; background: var(--accent); }
.hero-art .blob-2 { position: absolute; inset: auto auto 4% 0; width: 38%; aspect-ratio: 1; border-radius: 50%; background: var(--blob-2); border: 1px solid var(--border); }
.hero-art .hero-ic { position: absolute; inset: 0; display: grid; place-items: center; color: var(--midnight-lagoon); }
.hero-art .hero-ic svg { width: 46%; height: 46%; stroke-width: 1.1; }
.hero-stats { display: flex; gap: var(--s-6); padding-top: var(--s-2); border-top: 1px dashed var(--border); }
.hero-stats strong { display: block; font-size: var(--fs-lg); }
.hero-stats span { font-size: var(--fs-xs); color: var(--text-muted); }
@media (min-width: 768px) {
  .hero { padding-block: var(--s-8) var(--s-4); }
  .hero-card { grid-template-columns: 1.2fr 1fr; padding: var(--s-12); align-items: center; }
  .hero h1 { font-size: var(--fs-3xl); }
  .hero-art { display: block; }
  .hero-ctas .btn { flex: 0 0 auto; }
}

/* ---------- Banner slideshow (home, top) ----------
   Native scroll-snap = smooth finger swiping with no library; app.js adds autoplay, dots and arrows. */
/* full-width (edge to edge), tall store banner: desktop 3:1 (1920×640), phones 4:3 (1080×810) */
/* the slideshow sits in a framed box: a thin mat around the images, the hairline frame as their border */
.slider-wrap { max-width: var(--container); margin: var(--s-3) auto 0; padding-inline: var(--gutter); }
@media (min-width: 768px) { .slider-wrap { max-width: none; padding-inline: var(--s-3); } } /* desktop: full width, same frame */
.slider { position: relative; overflow: hidden; background: var(--surface-sunken); isolation: isolate; }
/* a faint inner frame on banners, like a print mat; sits under the dots/arrows (z-index 2) */
/* a thin frosted-glass mat around the banner (the page's soft color wash shows through, blurred) */
.slider-wrap .slider {
  padding: 4px; border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface) 38%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 20px rgba(45, 58, 71, .08);
  backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px);
}
:root[data-theme="dark"] .slider-wrap .slider { background: color-mix(in srgb, var(--surface) 45%, transparent); border-color: rgba(255, 255, 255, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 20px rgba(0, 0, 0, .25); }
.slider-wrap .slides { border-radius: calc(var(--r-xl) - 5px); }
.slider-wrap .slider::after { content: ""; position: absolute; inset: 4px; z-index: 1; pointer-events: none; border: 1px solid var(--frame-line); border-radius: calc(var(--r-xl) - 5px); }
.slider-wrap .slider-progress { inset-inline: 4px; bottom: 4px; border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; aspect-ratio: 3 / 1; max-height: 620px; display: block; position: relative; }
@media (max-width: 767.98px) { .slider.m-2x1 .slide { aspect-ratio: 4 / 3; max-height: none; } }
.slider-wrap + * { margin-top: var(--s-2); }
.slide picture, .slide img { display: block; width: 100%; height: 100%; }
.slide img { object-fit: cover; }
.slide:focus-visible { outline-offset: -4px; }
.slider-dots {
  /* sits in the end corner (left in RTL) next to the pause button, away from banner text/buttons */
  position: absolute; bottom: var(--s-3); inset-inline-end: calc(var(--s-3) + 40px); width: max-content; z-index: 2;
  display: flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: var(--r-full);
  background: rgba(45, 58, 71, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.slider-dots button { width: 24px; height: 24px; display: grid; place-items: center; }
.slider-dots button::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-full); background: rgba(255, 255, 255, .6); transition: width var(--t-med) var(--ease-out), background-color var(--t-med); }
.slider-dots button[aria-current="true"]::before { width: 20px; background: #FFFFFF; }
.slider-nav {
  position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  display: none; place-items: center; background: var(--overlay-btn); color: var(--text); box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity var(--t-med), transform var(--t-fast);
}
.slider-nav.prev { inset-inline-start: var(--s-6); }
.slider-nav.next { inset-inline-end: var(--s-6); }
@media (min-width: 768px) { .slider-nav { width: 52px; height: 52px; margin-top: -26px; } }
.slider:hover .slider-nav, .slider-nav:focus-visible { opacity: 1; }
.slider-nav:active { transform: scale(.92); }
@media (hover: hover) and (min-width: 768px) { .slider-nav { display: grid; } }
.slider-pause {
  position: absolute; bottom: var(--s-3); inset-inline-end: var(--s-3); z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(45, 58, 71, .28); color: #FFFFFF; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.slider-pause .ic { width: 14px; height: 14px; }
.slider-pause .ic-play { display: none; }
.slider-pause[aria-pressed="true"] .ic-play { display: block; }
.slider-pause[aria-pressed="true"] .ic-pause { display: none; }
.slider-progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; z-index: 2; background: transparent; }
.slider-progress span { display: block; height: 100%; width: 100%; background: rgba(255, 255, 255, .7); transform: scaleX(0); transform-origin: right; }
.slider.is-playing .slider-progress span { animation: slide-progress var(--slide-ms, 5000ms) linear forwards; }
@keyframes slide-progress { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .slider-progress { display: none; } }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3) var(--s-2); }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center; }
.cat-tile .cat-ic {
  width: 100%; max-width: 76px; aspect-ratio: 1; border-radius: var(--r-lg);
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.cat-tile .cat-ic svg { width: 30px; height: 30px; stroke-width: 1.5; }
.cat-tile:hover .cat-ic { border-color: var(--text); }
.cat-tile:active .cat-ic { transform: scale(.96); }
.cat-tile span { font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; }
/* category with an uploaded picture: white tile so photos/logos with white backgrounds blend in */
.cat-tile .cat-ic.has-img { background: #FFFFFF; padding: 10%; overflow: hidden; }
.cat-ic.has-img img, .li-ic.has-img img { width: 100%; height: 100%; object-fit: contain; }
.list .li-ic.has-img { background: #FFFFFF; border: 1px solid var(--border); padding: 4px; overflow: hidden; }
.cat-tile.is-deal .cat-ic { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(8, 1fr); gap: var(--s-4); }
  .cat-tile span { font-size: var(--fs-sm); }
}

/* ---------- Deals strip ---------- */
.deals {
  background: var(--deals-bg); border-radius: var(--r-xl); padding: var(--s-5) 0 var(--s-5);
  overflow: hidden; position: relative; isolation: isolate;
}
.deals::before, .deals::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; background: rgba(255, 247, 230, .45); }
.deals::before { width: 340px; height: 340px; inset-block-start: -190px; inset-inline-end: -80px; }
.deals::after { width: 200px; height: 200px; inset-block-end: -110px; inset-inline-start: 22%; background: rgba(140, 42, 69, .08); }
.deals .card { border-color: transparent; }
@media (min-width: 768px) { .deals-title h2 { font-size: var(--fs-2xl); } }
.deals .section-head { padding-inline: var(--s-5); }
.deals-title { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.deals-title h2 { font-size: var(--fs-xl); color: var(--deals-ink); }
.countdown { display: inline-flex; align-items: center; gap: 4px; direction: ltr; }
.countdown b {
  display: inline-grid; place-items: center; min-width: 34px; height: 32px; padding: 0 4px;
  background: var(--countdown-bg); color: var(--countdown-fg); border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums;
}
.countdown i { font-style: normal; font-weight: 800; color: var(--deals-ink); }
.deals .link { color: var(--deals-ink); }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 46%);
  gap: var(--s-3); overflow-x: auto; scroll-snap-type: x mandatory;
  padding-inline: var(--s-5); scroll-padding-inline: var(--s-5);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 768px) { .rail { grid-auto-columns: minmax(200px, 23%); } }
@media (min-width: 1024px) { .rail { grid-auto-columns: calc((100% - 4 * var(--s-3) - 2 * var(--s-5)) / 5); } }

/* ---------- Arrow rows (home sections scroll sideways, ‹ › in the header) ---------- */
.head-actions { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.rail-nav { display: flex; gap: var(--s-1); }
.rail-nav[hidden] { display: none; }
.rail-btn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm);
  transition: background-color var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}
.rail-btn:hover:not(:disabled) { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.rail-btn:active:not(:disabled) { transform: scale(.92); }
.rail-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
@media (min-width: 768px) { .rail-btn { width: 40px; height: 40px; } }
/* on colored strips */
.deals .rail-btn { background: rgba(255, 255, 255, .7); border-color: transparent; color: var(--midnight-lagoon); }
.event-strip .rail-btn { background: color-mix(in srgb, var(--ev-on) 18%, transparent); border-color: transparent; color: var(--ev-on); box-shadow: none; }
.event-strip .rail-btn:hover:not(:disabled) { background: var(--ev-on); color: var(--ev); }
/* plain rows inside a container: no inner padding, cards line up with the page edge */
.rail-plain { padding-inline: 0; scroll-padding-inline: 0; padding-bottom: var(--s-2); }
.rail-cats { grid-auto-columns: 84px; gap: var(--s-3); }
@media (min-width: 768px) { .rail-cats { grid-auto-columns: 112px; gap: var(--s-4); } }
.rail-cats .cat-tile .cat-ic { max-width: none; }
/* every category tile takes the full column width (same icon size), and names get the same 2-line space */
.rail-cats > [role="listitem"] > .cat-tile { flex: 1; min-width: 0; }
.rail-cats .cat-tile > span:last-child { min-height: 3em; display: flex; align-items: flex-start; justify-content: center; }
.rail-brands { grid-auto-columns: 132px; gap: var(--s-3); }
@media (min-width: 768px) { .rail-brands { grid-auto-columns: 172px; } }
.rail-brands li { list-style: none; }
.rail-brands > li > .brand-tile { flex: 1; min-width: 0; } /* same width for every brand card in the row */

/* ---------- Product grid & card ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; transition: box-shadow var(--t-med) var(--ease-out), border-color var(--t-med);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-media { position: relative; display: grid; place-items: center; aspect-ratio: 1; margin: var(--s-2); border-radius: var(--r-md); overflow: hidden; }
.card > .card-media { aspect-ratio: 5 / 4; } /* product cards: a little shorter than square (cart/compare keep square) */
.card-media .media-ic svg { width: 44%; height: 44%; stroke-width: 1.15; color: var(--media-ic); }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
/* uploaded product photos: white rounded "photo card" with breathing room, so any photo fits the theme */
.has-photo { background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(45, 58, 71, .06); }
.has-photo img { width: 100%; height: 100%; object-fit: contain; padding: 8%; border-radius: inherit; }
[data-theme="dark"] .has-photo { box-shadow: none; }
.media-ic { display: grid; place-items: center; width: 100%; height: 100%; }
.tint-1 { background: var(--tint-1); } .tint-2 { background: var(--tint-2); } .tint-3 { background: var(--tint-3); }
.card-badges { position: absolute; top: 6px; inset-inline-start: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 var(--s-2);
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 800; line-height: 1;
}
.pill-discount { background: var(--discount-bg); color: var(--discount-fg); }
.pill-soft { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-muted { background: var(--surface-sunken); color: var(--text-muted); }
.card-wish {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2;
  width: 30px; height: 30px; box-shadow: 0 1px 4px rgba(45, 58, 71, .12); border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--overlay-btn); color: var(--text);
  transition: transform var(--t-fast), color var(--t-fast);
}
.card-wish:active { transform: scale(.9); }
.card-wish[aria-pressed="true"] { color: var(--accent-ink); }
.card-wish[aria-pressed="true"] svg { fill: currentColor; }
.card-body { display: flex; flex-direction: column; gap: var(--s-1); padding: 0 var(--s-3) var(--s-3); flex: 1; }
/* brand: a small framed tab that rises out of the description over the image's bottom-right corner
   (its bottom stays joined to the description) */
.card-brand-tab {
  position: relative; z-index: 1; align-self: flex-start; max-width: calc(46% + var(--s-3)); margin-top: -20px;
  margin-inline-start: calc(-1 * var(--s-3)); /* reach the card's right edge */
  padding-block: 2px 0; padding-inline: var(--s-3) var(--s-2);
  background: var(--card-bg, var(--surface));
  border-top: 1px solid var(--frame-line); border-inline-end: 1px solid var(--frame-line);
  border-start-end-radius: 10px;
  box-shadow: var(--edge-right, 0 0 #0000), inset 0 1px 0 var(--glass-rim, transparent);
  font-size: 11px; font-weight: 700; line-height: 1.7; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* rating: a tiny pill on the image's bottom-left corner */
.card-rating {
  position: absolute; bottom: 9px; inset-inline-end: 6px; z-index: 1;
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px;
  border-radius: var(--r-full); background: var(--overlay-btn); box-shadow: 0 1px 4px rgba(45, 58, 71, .12);
  font-size: 11px; font-weight: 700; line-height: 1; color: var(--text);
}
.card-rating svg { width: 11px; height: 11px; color: var(--star); fill: currentColor; }
.card-rating small { font-size: 10px; font-weight: 600; color: var(--text-muted); }
/* one line; a long name ends with «…» (the full name shows on hover and on the product page) */
.card-title { font-size: var(--fs-sm); font-weight: 700; line-height: 1.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); }
.rating svg { width: 14px; height: 14px; color: var(--star); fill: currentColor; }
.rating b { color: var(--text); font-weight: 700; }
.price-block { margin-top: auto; padding-top: var(--s-1); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.price-row { display: flex; align-items: center; gap: var(--s-2); }
.price-old { font-size: var(--fs-xs); color: var(--text-muted); text-decoration: line-through; }
.price { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.price .cur, .cur { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-inline-start: 2px; }
.inst-line { font-size: var(--fs-xs); color: var(--text-muted); }
.inst-line b { color: var(--text); }
/* per-product sale countdown: a pill under the badges at the image's top-right (adds no height to the card) */
.card-timer {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 var(--s-2); border-radius: var(--r-full); white-space: nowrap;
  background: var(--discount-bg); color: var(--discount-fg); font-size: var(--fs-xs); font-weight: 800; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(45, 58, 71, .2);
}
.card-timer.is-over { background: var(--surface-sunken); color: var(--text-muted); box-shadow: none; }
/* every card keeps the same lines so prices, timers and buttons line up across a row */
.price-row { min-height: 24px; }
.price-row.is-empty, .inst-line.is-empty { visibility: hidden; }
/* card prices: big, heavy digits so they don't get lost; «تومان» stays small and muted.
   A sale price sits in a soft tint of the sale color (same pill shape as the sale timer, no shadow).
   Every card price keeps the pill's height (padding-block) so rows stay even with or without a sale. */
.card .price { font-size: 1.08rem; font-weight: 900; letter-spacing: -.01em; color: var(--text); padding-block: 3px; line-height: 1.5; }
.card .price .cur { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.card .price.is-sale { padding-inline: var(--s-3); border-radius: var(--r-full); max-width: 100%; white-space: nowrap;
  background: color-mix(in srgb, var(--discount-bg) 13%, var(--surface)); color: var(--discount-bg); }
.card .price.is-sale .cur { color: inherit; opacity: .75; }
@media (max-width: 767.98px) { .card .price { font-size: .98rem; } .card .price.is-sale { padding-inline: var(--s-2); } }
.inst-line.is-empty { min-height: 1.7em; }
/* cards in arrow rows stretch to the tallest card */
.rail > [role="listitem"], .rail-brands > li { display: flex; }
.rail > [role="listitem"] > .card { flex: 1; min-width: 0; }
.deals-sub { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--deals-ink); opacity: .8; }
.card-actions { position: relative; z-index: 2; display: flex; gap: var(--s-2); padding: 0 var(--s-3) var(--s-3); }
.card-actions .btn { flex: 1; min-height: 40px; font-size: var(--fs-sm); padding: 0 var(--s-2); }
.card-actions .icon-btn { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.card-actions .icon-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
/* compact product cards: tighter inner spacing (sizes of text, prices and buttons stay readable/tappable) */
.card > .card-media { margin-bottom: 6px; }
.card .card-body { gap: 2px; padding-bottom: var(--s-2); }
.card .price-row { min-height: 22px; }
.card .card-actions { padding-bottom: var(--s-2); }
.card .card-actions .btn { min-height: 38px; }
.card .card-actions .icon-btn { width: 38px; height: 38px; }
.card.is-out .card-media { opacity: .55; }
.stepper {
  display: inline-flex; align-items: center; justify-content: space-between; flex: 1;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); min-height: 40px; background: var(--surface);
}
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text); }
.stepper button:hover { background: var(--surface-sunken); }
.stepper output { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper-lg { min-height: 48px; border-radius: var(--r-md); }
.stepper-lg button { width: 48px; height: 48px; }

/* ---------- Installments («خرید اقساطی»): cream card + navy numbers, home section and installments.html ---------- */
.provider-logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--vanilla-cream); color: var(--midnight-lagoon); font-weight: 900; font-size: var(--fs-md); overflow: hidden;
}
.provider-logo img { width: 100%; height: 100%; object-fit: contain; }
.inst2 {
  display: grid; gap: var(--s-5); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  outline: 1px solid var(--frame-line); outline-offset: -7px;
}
.inst2-info { display: grid; gap: var(--s-2); align-content: start; }
.inst2-kicker { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px var(--s-3); border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 800; }
.inst2 h1, .inst2 h2 { font-size: var(--fs-xl); line-height: 1.5; }
.inst2-info p { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.9; }
.inst2-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); margin-top: var(--s-2); }
/* the three providers: small cards with a big monogram (tinted by `color` in payments.js when set) */
.pcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.pcard {
  display: grid; justify-items: center; gap: 2px; padding: var(--s-4) var(--s-2); text-align: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.pcard-mark {
  width: 48px; height: 48px; margin-bottom: var(--s-2); border-radius: 14px; display: grid; place-items: center; overflow: hidden;
  background: var(--pc, var(--midnight-lagoon)); color: #FFFFFF; font-size: 1.35rem; font-weight: 900;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--pc, var(--midnight-lagoon)) 28%, transparent);
}
.pcard-mark img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.pcard b { font-size: var(--fs-md); font-weight: 900; }
.pcard small { font-size: var(--fs-xs); color: var(--text-muted); }
@media (hover: hover) { .pcard:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); } }
:root[data-theme="dark"] .pcard-mark { background: var(--pc, var(--vanilla-cream)); color: var(--pc, var(--midnight-lagoon)); }
:root[data-theme="dark"] .pcard-mark[style], :root[data-theme="dark"] .pcard[style] .pcard-mark { color: #FFFFFF; }
@media (min-width: 900px) {
  .inst2 { grid-template-columns: 1fr 1.2fr; align-items: center; gap: var(--s-8); padding: var(--s-8); }
}
/* provider name badges (installments page cards) */
.pbadge { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding-inline: 5px var(--s-3); border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--pc, var(--text)); font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; }
.pbadge-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--pc, var(--text)); color: var(--surface); font-size: 12px; font-weight: 900; }
.pbadge-mark img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
/* installments page */
.isteps { display: grid; gap: var(--s-3); counter-reset: none; }
.istep { position: relative; display: grid; gap: var(--s-2); padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.istep > .ic { width: 28px; height: 28px; stroke-width: 1.5; color: var(--text); }
.istep-num { position: absolute; top: var(--s-4); inset-inline-end: var(--s-4); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: var(--fs-sm); }
.istep h3 { font-size: var(--fs-md); }
.istep p { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.9; }
.iprov-grid { display: grid; gap: var(--s-3); }
.iprov { display: grid; gap: var(--s-2); justify-items: start; padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.iprov p { font-size: var(--fs-sm); color: var(--text-muted); }
.iprov-n { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 800; }
.ifaq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ifaq details + details { border-top: 1px solid var(--border); }
.ifaq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 56px; padding: var(--s-3) var(--s-5); cursor: pointer; font-weight: 700; font-size: var(--fs-sm); }
.ifaq summary::-webkit-details-marker { display: none; }
.ifaq summary .chev { flex: none; transition: transform var(--t-fast); }
.ifaq details[open] summary .chev { transform: rotate(180deg); }
.ifaq details p { padding: 0 var(--s-5) var(--s-4); font-size: var(--fs-sm); color: var(--text-muted); line-height: 2; }
.ifinal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-block: var(--s-8) var(--s-4); padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface-sunken); }
.ifinal b { font-size: var(--fs-lg); }
@media (min-width: 768px) { .isteps, .iprov-grid { grid-template-columns: repeat(3, 1fr); } }
.inst-box .inst-more { justify-content: center; }
.inst-box .inst-more .link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
/* ---------- Brands ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-4);
  border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface);
  font-size: var(--fs-sm); font-weight: 600; transition: border-color var(--t-fast), background-color var(--t-fast);
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip-remove { padding-inline-end: var(--s-2); }
.chip-remove svg { width: 16px; height: 16px; }

/* ---------- Events (sales like «حراج پاییزه») ----------
   Each event brings its own color via --ev (and --ev-on for text on it); everything else stays Cookiva. */
.ev-scope { --ev-soft: color-mix(in srgb, var(--ev) 13%, var(--surface)); --ev-line: color-mix(in srgb, var(--ev) 35%, transparent); }
/* solid event color, like Digikala's offer strip; product cards stay on their own surface so they pop */
.event-strip { background: var(--ev); color: var(--ev-on); border-radius: var(--r-xl); padding: var(--s-5) 0; overflow: hidden; position: relative; isolation: isolate; }
.event-strip::before, .event-strip::after { /* soft decorative circles in the event color */
  content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; background: color-mix(in srgb, var(--ev-on) 10%, transparent);
}
.event-strip::before { width: 360px; height: 360px; inset-block-start: -200px; inset-inline-end: -90px; }
.event-strip::after { width: 220px; height: 220px; inset-block-end: -120px; inset-inline-start: 18%; }
.event-strip .section-head { padding-inline: var(--s-5); position: relative; }
.event-head { display: grid; gap: var(--s-1); }
.event-kicker { display: inline-flex; align-items: center; gap: var(--s-1); align-self: start; justify-self: start; background: var(--ev); color: var(--ev-on);
  font-size: var(--fs-xs); font-weight: 800; padding: 2px var(--s-3); border-radius: var(--r-full); }
.event-strip .event-kicker { background: var(--ev-on); color: var(--ev); }
.event-strip h2 { font-size: var(--fs-xl); color: var(--ev-on); }
.event-strip .countdown b { background: var(--ev-on); color: var(--ev); }
.event-strip .countdown i, .event-strip .cd-label { color: var(--ev-on); }
.event-hero .countdown b { background: var(--ev); color: var(--ev-on); }
.event-hero .countdown i { color: var(--text); }
.event-strip .link { color: var(--ev-on); white-space: nowrap; align-self: start; }
/* event strip header, centered: [title] with the big timer on its left; arrows + «همه» centered underneath.
   On narrow phones the timer wraps under the title (still centered). */
/* one row, vertically centered: [title + timer] on the right … arrows + «همه ۸ کالا» on the left (as before) */
.event-strip .section-head { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-3); }
.event-strip .event-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); min-width: 0; }
.event-title { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); }
.event-strip .bigcd { margin-top: 0; }
.event-strip .head-actions { align-self: center; flex: none; }
.event-strip .head-actions .link { white-space: nowrap; }
/* phones: title + timer use the full width; arrows and «همه ۸ کالا» sit on their own line at the left */
@media (max-width: 767.98px) {
  .event-strip .section-head { flex-wrap: wrap; row-gap: var(--s-3); }
  .event-strip .event-head { flex: 1 1 100%; flex-wrap: nowrap; justify-content: space-between; gap: var(--s-2); }
  .event-strip .event-title { min-width: 0; }
  .event-strip h2 { font-size: var(--fs-lg); line-height: 1.4; }
  .event-strip .head-actions { margin-inline-start: auto; }
  /* compact timer beside the title */
  .event-strip .bigcd { flex: none; gap: 4px; }
  .event-strip .bc-row { gap: 4px; }
  .event-strip .bc-box { min-width: 30px; padding: 5px 4px; border-radius: var(--r-sm); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
  .event-strip .bc-num { font-size: 1rem; }
  .event-strip .bc-unit { font-size: var(--fs-xs); margin-inline: 1px 6px; }
  .event-strip .bc-sep { font-size: 1rem; margin: 0 -1px; }
  .event-strip .bc-urgent { font-size: var(--fs-xs); padding: 2px var(--s-2); }
}
/* big labeled countdown: روز | ساعت | دقیقه | ثانیه (right to left) */
.bigcd { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-2); }
.bc-row { display: flex; align-items: stretch; gap: var(--s-2); direction: ltr; } /* left to right, like a clock */
.bc-unit { align-self: center; font-size: var(--fs-sm); font-weight: 800; color: var(--ev-on); margin-inline: 2px var(--s-3); } /* «روز» beside the days box */
@media (min-width: 768px) { .bc-unit { font-size: var(--fs-md); } }
.bc-sep { align-self: center; font-size: 1.4rem; font-weight: 900; color: var(--ev-on); margin: 0 -2px; }
@media (min-width: 768px) { .bc-sep { font-size: 1.8rem; } }
.bc-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 50px; padding: var(--s-2);
  border-radius: var(--r-md); background: var(--ev-on); color: var(--ev); box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.bc-num { font-size: 1.4rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bc-lbl { font-size: 10px; font-weight: 700; opacity: .8; margin-top: 1px; }
.bc-urgent { display: none; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 800; color: var(--ev-on);
  background: color-mix(in srgb, var(--ev-on) 18%, transparent); padding: 4px var(--s-3); border-radius: var(--r-full); }
.bigcd.is-urgent .bc-urgent { display: inline-flex; }
.bigcd.is-urgent .bc-box { animation: urgent-pulse 1.6s ease-in-out infinite; }
.bigcd.is-urgent .bc-d { display: none; } /* under a day: the days box (۰) gives way */
@keyframes urgent-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ev-on) 25%, transparent); } }
@media (min-width: 768px) {
  .bc-box { min-width: 62px; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); }
  .bc-num { font-size: 1.8rem; }
  .bc-lbl { font-size: 11px; }
}
.event-strip .card { border-color: transparent; }
@media (min-width: 768px) { .event-strip h2 { font-size: var(--fs-2xl); } }
.countdown .cd-days { min-width: auto; padding: 0 8px; }
.countdown .cd-label { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); margin-inline: 2px 4px; }
.pill-event { background: var(--ev); color: var(--ev-on); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-badges { max-width: calc(100% - 42px); }
.card-timer { font-size: 11px; }
.card-timer .ic { width: 12px; height: 12px; }

/* ---------- Event themes: seasonal artwork behind the content (assets/js/themes.js) ---------- */
[data-ev-themed] { background: var(--ev-bg) !important; }
[data-ev-themed]::before, [data-ev-themed]::after { background: rgba(255, 255, 255, .12) !important; }
/* product cards inside a themed box keep the event's own color */
[data-ev-themed] .card { --ev: var(--ev-card); --ev-on: var(--ev-card-on); }
.ev-deco { position: absolute; inset: 0; container-type: size; overflow: hidden; pointer-events: none; z-index: 0; border-radius: inherit; }
.event-strip > :not(.ev-deco), .event-hero.is-plain > :not(.ev-deco) { position: relative; z-index: 1; }
.deco-p { position: absolute; left: var(--x); top: var(--y); width: calc(var(--s) * var(--w)); height: calc(var(--s) * var(--h)); opacity: var(--o); will-change: transform; }
.deco-p svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .14)); }
/* the fall distance follows the box height (container units) so pieces are on screen the whole loop */
.deco-p.m-fall, .deco-p.m-snow, .deco-p.m-drift { top: -70px; animation: deco-fall var(--t) linear var(--d) infinite; }
.deco-p.m-snow { animation-name: deco-snow; animation-duration: calc(var(--t) * 1.3); }
.deco-p.m-drift { animation-name: deco-drift; animation-duration: calc(var(--t) * 1.15); }
@keyframes deco-fall {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--r)); }
  25%  { transform: translate3d(22px, calc(25cqh + 35px), 0) rotate(calc(var(--r) + 90deg)); }
  50%  { transform: translate3d(-14px, calc(50cqh + 70px), 0) rotate(calc(var(--r) + 180deg)); }
  75%  { transform: translate3d(18px, calc(75cqh + 105px), 0) rotate(calc(var(--r) + 270deg)); }
  100% { transform: translate3d(0, calc(100cqh + 140px), 0) rotate(calc(var(--r) + 360deg)); }
}
@keyframes deco-snow {
  0%   { transform: translate3d(0, 0, 0) rotate(0); }
  50%  { transform: translate3d(16px, calc(50cqh + 70px), 0) rotate(60deg); }
  100% { transform: translate3d(-8px, calc(100cqh + 140px), 0) rotate(120deg); }
}
/* tags, fruit, gifts: fall while rocking gently, so text is never upside down */
@keyframes deco-drift {
  0%   { transform: translate3d(0, 0, 0) rotate(-14deg); }
  25%  { transform: translate3d(18px, calc(25cqh + 35px), 0) rotate(10deg); }
  50%  { transform: translate3d(-10px, calc(50cqh + 70px), 0) rotate(-12deg); }
  75%  { transform: translate3d(14px, calc(75cqh + 105px), 0) rotate(12deg); }
  100% { transform: translate3d(0, calc(100cqh + 140px), 0) rotate(-14deg); }
}
/* lanterns hang from the top edge and sway */
.deco-p.m-hang { top: -2px; transform-origin: 50% 0; animation: deco-sway calc(var(--t) / 3) ease-in-out var(--d) infinite alternate; }
@keyframes deco-sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
/* goldfish swim side to side */
.deco-p.m-swim { animation: deco-swim var(--t) ease-in-out var(--d) infinite alternate; }
@keyframes deco-swim { 0% { transform: translate3d(-24px, 0, 0) rotate(-4deg); } 50% { transform: translate3d(0, -10px, 0) rotate(3deg); } 100% { transform: translate3d(24px, 4px, 0) rotate(-3deg); } }
/* sun: turns slowly in place */
.deco-p.m-spin { animation: deco-spin calc(var(--t) * 3) linear var(--d) infinite; }
@keyframes deco-spin { to { transform: rotate(360deg); } }
.deco-p.m-float { animation: deco-float var(--t) ease-in-out var(--d) infinite alternate; }
@keyframes deco-float { from { transform: translateY(-8px) rotate(calc(var(--r) - 8deg)); } to { transform: translateY(10px) rotate(calc(var(--r) + 8deg)); } }
/* stars, crescents: twinkle in place */
.deco-p.m-twinkle { animation: deco-twinkle calc(var(--t) / 3) ease-in-out var(--d) infinite alternate; }
@keyframes deco-twinkle { from { opacity: calc(var(--o) * .4); transform: scale(.82); } to { opacity: var(--o); transform: scale(1.08); } }
.ev-deco.is-paused .deco-p { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .ev-deco .deco-p { animation: none !important; top: var(--y) !important; transform: rotate(calc(var(--r) / 8)); }
  .ev-deco .deco-p.m-hang { top: -2px !important; transform: none; }
}
/* Event page */
.event-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); margin-top: var(--s-4); }
.event-hero.is-plain {
  background: var(--ev); color: var(--ev-on); padding: var(--s-8) var(--s-6); display: grid; gap: var(--s-3); isolation: isolate;
}
.event-hero.is-plain::before, .event-hero.is-plain::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; background: color-mix(in srgb, var(--ev-on) 12%, transparent); }
.event-hero.is-plain::before { width: 280px; height: 280px; inset-inline-end: -60px; inset-block-start: -90px; }
.event-hero.is-plain::after { width: 160px; height: 160px; inset-inline-end: 160px; inset-block-end: -80px; }
.event-hero h1 { font-size: var(--fs-2xl); line-height: 1.3; }
.event-hero p { opacity: .9; max-width: 52ch; }
.event-hero.is-plain .countdown b { background: var(--ev-on); color: var(--ev); }
.event-hero.is-plain .countdown i, .event-hero.is-plain .cd-label { color: var(--ev-on); }
.event-hero .slide { aspect-ratio: 3 / 1; max-height: 560px; }
@media (max-width: 767.98px) { .event-hero.m-2x1 .slide { aspect-ratio: 4 / 3; max-height: none; } }
.event-timer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
  background: var(--ev-soft); border: 1px solid var(--ev-line); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); margin-top: var(--s-3); font-weight: 700; font-size: var(--fs-sm); }
.event-timer-row { background: var(--ev); color: var(--ev-on); border-color: transparent; }
.event-timer-row .countdown b { background: var(--ev-on); color: var(--ev); }
.event-timer-row .countdown i, .event-timer-row .cd-label { color: var(--ev-on); }
.ev-toolbar { display: grid; gap: var(--s-3); }
.ev-chips { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-block: 2px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.ev-chips::-webkit-scrollbar { display: none; }
.ev-chips .chip { white-space: nowrap; flex: none; }
.ev-chips .chip[aria-pressed="true"] { background: var(--ev); border-color: var(--ev); color: var(--ev-on); }
.ev-toolbar .select-wrap { max-width: 220px; }
@media (min-width: 768px) { .ev-toolbar { grid-template-columns: 1fr auto; align-items: center; } .ev-chips { margin: 0; padding-inline: 0; flex-wrap: wrap; } }
.event-note { text-align: center; padding: var(--s-3); border-radius: var(--r-md); background: var(--ev-soft); font-weight: 700; }
@media (min-width: 768px) { .event-hero.is-plain { padding: var(--s-12) var(--s-10); } .event-hero h1 { font-size: var(--fs-3xl); } }
/* product page: event bar */
.event-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); background: var(--ev); color: var(--ev-on);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-weight: 800; font-size: var(--fs-sm); }
.event-bar .countdown b { background: var(--ev-on); color: var(--ev); }
.event-bar .countdown i, .event-bar .cd-label { color: var(--ev-on); }

/* ---------- Brand logo cards ----------
   Logos sit on white in both themes (most brand logos are designed for light backgrounds). */
.brand-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 640px) { .brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .brand-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.brand-tile { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center; }
.brand-logo {
  width: 100%; aspect-ratio: 3 / 2; display: grid; place-items: center; padding: var(--s-2);
  background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: border-color var(--t-fast), box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
/* before app.js measures the logo, keep it modest; then it gets a shape-based width (see fitLogo) */
.brand-logo img { max-width: 78%; max-height: 58%; object-fit: contain; height: auto; }
.brand-logo img.is-fitted { max-width: none; max-height: none; }
.brand-word {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-weight: 800; letter-spacing: -.01em;
  font-size: clamp(.82rem, 3.4vw, 1.25rem); color: #2D3A47; line-height: 1.2; overflow-wrap: break-word; hyphens: none;
}
.brand-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
@media (hover: hover) {
  .brand-tile:hover .brand-logo { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
}
.brand-tile:active .brand-logo { transform: scale(.97); }
[data-theme="dark"] .brand-logo { border-color: transparent; }

/* ---------- All brands page + one brand's page ---------- */
.brands-search { max-width: 520px; margin: 0; }
.brand-grid-all .brand-name { color: var(--text); font-size: var(--fs-sm); font-weight: 700; display: flex; flex-direction: column; align-items: center; line-height: 1.5; }
.brand-en { font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
.brand-count { font-size: var(--fs-xs); color: var(--text-muted); }
.brand-tile.is-empty .brand-logo { opacity: .55; }
.brand-hero {
  display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-3); padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
}
.brand-hero-logo { width: 112px; flex: none; aspect-ratio: 3 / 2; }
.brand-hero-text { min-width: 0; display: grid; gap: var(--s-2); }
.brand-hero h1 { font-size: var(--fs-lg); line-height: 1.5; }
.brand-hero h1 .brand-en { font-size: var(--fs-md); font-weight: 700; }
.brand-hero p { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.9; max-width: 70ch; }
.brand-stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.brand-stats span { display: inline-flex; align-items: center; gap: 4px; }
@media (min-width: 768px) { .brand-hero { padding: var(--s-6); gap: var(--s-6); } .brand-hero-logo { width: 180px; } .brand-hero h1 { font-size: var(--fs-2xl); } }
@media (max-width: 479.98px) { .brand-hero { flex-direction: column; align-items: flex-start; } .brand-hero-logo { width: 140px; } }

/* ---------- Trust strip ---------- */
.trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.trust-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.trust-item .ic { width: 28px; height: 28px; stroke-width: 1.5; }
.trust-item strong { display: block; font-size: var(--fs-sm); }
.trust-item span { display: block; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.6; }
@media (min-width: 1024px) { .trust { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Footer ---------- */
.ftr { margin-top: var(--s-12); background: var(--surface); border-top: 1px solid var(--border); padding-block: var(--s-10) var(--s-6); }
.ftr-grid { display: grid; gap: var(--s-8); }
.ftr h3 { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.ftr p, .ftr li { font-size: var(--fs-sm); color: var(--text-muted); }
.ftr li a { display: inline-block; padding-block: 6px; }
.ftr li a:hover { color: var(--text); }
.trust-seals { display: flex; gap: var(--s-3); margin-top: var(--s-4); }
/* social logos (Instagram / Telegram) under the shop description */
.ftr-social { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.ftr-social[hidden] { display: none; }
.social-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.social-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.social-btn:hover { color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); }
.seal {
  width: 88px; height: 88px; border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  display: grid; place-items: center; text-align: center; font-size: 11px; color: var(--text-muted); padding: var(--s-2);
}
.ftr-bottom { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); }
@media (min-width: 768px) { .ftr-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

/* ---------- Page header / breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); font-size: var(--fs-xs); color: var(--text-muted); padding-top: var(--s-4); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); padding-block: var(--s-3) var(--s-4); }
.page-head h1 { font-size: var(--fs-xl); }
.page-head .count { color: var(--text-muted); font-size: var(--fs-sm); }
@media (min-width: 768px) { .page-head h1 { font-size: var(--fs-2xl); } }

/* ---------- Category mega menu (desktop) ---------- */
.catnav-row { display: flex; align-items: center; gap: var(--s-4); }
.catnav-links { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.mega-wrap { position: relative; flex: none; }
.mega-btn {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 48px; padding: 0 var(--s-3);
  font-size: var(--fs-sm); font-weight: 800; color: var(--text); border-bottom: 2px solid transparent;
}
.mega-btn .chev { transition: transform var(--t-fast); }
.mega-btn[aria-expanded="true"] { border-color: var(--text); }
.mega-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.mega {
  position: absolute; top: 100%; inset-inline-start: 0; z-index: calc(var(--z-header) + 1);
  width: min(820px, calc(100vw - 48px)); min-height: 340px; display: grid; grid-template-columns: 240px 1fr;
  background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: rise 180ms var(--ease-out);
}
.mega[hidden] { display: none; }
.mega-mains { border-inline-end: 1px solid var(--border); padding: var(--s-2) 0; background: var(--surface-sunken); max-height: 70vh; overflow-y: auto; }
.mega-mains a { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-4); min-height: 44px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); border: 0; height: auto; }
.mega-mains a span { flex: 1; }
.mega-mains a .chev { opacity: 0; transition: opacity var(--t-fast); }
.mega-mains a.is-on { background: var(--surface); color: var(--text); font-weight: 800; }
.mega-mains a.is-on .chev { opacity: 1; }
.mega-panel { padding: var(--s-4) var(--s-5); max-height: 70vh; overflow-y: auto; }
.mega-panel-head a { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: var(--fs-md); color: var(--text); height: auto; border: 0; padding: 0; }
.mega-panel-head { margin-bottom: var(--s-3); padding-bottom: var(--s-3); border-bottom: 1px dashed var(--border); }
.mega-subs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--s-4); }
.mega-subs a { display: flex; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) var(--s-2); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text); font-weight: 500; height: auto; border: 0; }
.mega-subs a:hover { background: var(--surface-sunken); }
.mega-subs a span { color: var(--text-muted); font-size: var(--fs-xs); }
@media (min-width: 1200px) { .mega-subs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* categories page (phones): main categories open into subcategories */
.cat-acc summary { list-style: none; display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-3) var(--s-4); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; }
.cat-acc summary::-webkit-details-marker { display: none; }
.cat-acc summary .chev { margin-inline-start: auto; color: var(--text-muted); transition: transform var(--t-fast); }
.cat-acc[open] summary .chev { transform: rotate(180deg); }
.cat-acc[open] summary { background: var(--selected-bg); }
.cat-subs { padding: var(--s-1) var(--s-4) var(--s-3); padding-inline-start: 72px; animation: rise 200ms var(--ease-out); }
.list .cat-subs li + li { border-top: 0; }
.list .cat-subs a { min-height: 44px; padding: var(--s-2) var(--s-2); font-weight: 500; justify-content: space-between; border-radius: var(--r-sm); }
.subcat-chips { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-block: 2px var(--s-3); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.subcat-chips .chip { white-space: nowrap; flex: none; }
.opt-sub { padding-inline-start: var(--s-6); font-size: var(--fs-xs); min-height: 40px; }

/* ---------- Listing layout ---------- */
.listing { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 1024px) { .listing { grid-template-columns: 272px 1fr; } }
.toolbar {
  position: sticky; top: var(--header-h); z-index: 10; background: var(--bg);
  display: flex; align-items: center; gap: var(--s-2); padding-block: var(--s-2); margin-bottom: var(--s-2);
}
.toolbar .btn { min-height: 44px; }
.select-wrap { position: relative; flex: 1; max-width: 260px; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 44px; padding-inline: var(--s-4) 40px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-sm); font-weight: 600;
}
.select-wrap svg { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; width: 18px; height: 18px; }
.active-filters { margin-bottom: var(--s-4); }
.active-filters:empty { display: none; }
@media (min-width: 1024px) { .toolbar .filter-open { display: none; } .toolbar { position: static; } }

/* Filters: sidebar on desktop, bottom sheet on phones */
.filters { background: var(--surface); }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.filters-head h2 { font-size: var(--fs-lg); }
.filters-body { padding: var(--s-2) var(--s-5) var(--s-5); overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; scrollbar-width: thin; }
.filters-foot { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-5) calc(var(--s-3) + var(--safe-bottom)); border-top: 1px solid var(--border); }
.filters-foot .btn-primary { flex: 1; }
.fgroup { border-bottom: 1px solid var(--border); padding-block: var(--s-4); }
.fgroup:last-child { border-bottom: 0; }
.fgroup legend, .fgroup h3 { font-size: var(--fs-sm); font-weight: 800; margin-bottom: var(--s-1); padding: 0; }
.fgroup legend { float: inline-start; width: 100%; }
.fgroup legend + * { clear: both; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; font-size: var(--fs-sm); }
.opt input[type="checkbox"], .opt input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.opt .opt-count { margin-inline-start: auto; color: var(--text-muted); font-size: var(--fs-xs); }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--border-strong); transition: background-color var(--t-fast); }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t-med) var(--ease-out); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(-18px); }
[dir="ltr"] .switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }

@media (max-width: 1023.98px) {
  .filters {
    position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-sheet);
    max-height: 88dvh; display: flex; flex-direction: column;
    border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); visibility: hidden;
    transition: transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
  }
  .filters.is-open { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease-out); }
  .filters::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: var(--s-2) auto 0; }
}
@media (min-width: 1024px) {
  .filters { position: sticky; top: calc(var(--header-h) + var(--s-4)); border: 1px solid var(--border); border-radius: var(--r-lg); max-height: calc(100dvh - var(--header-h) - 32px); display: flex; flex-direction: column; }
  .filters .sheet-only { display: none; }
}
.scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-sheet) - 1); background: var(--scrim);
  opacity: 0; visibility: hidden; transition: opacity var(--t-med), visibility 0s linear var(--t-med);
}
.scrim.is-open { opacity: 1; visibility: visible; transition: opacity var(--t-med); }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 700; }
.field .req { color: var(--danger); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: var(--s-2) var(--s-4); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.8; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--focus-shadow); }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field .error { font-size: var(--fs-xs); color: var(--danger); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.field .error:empty { display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.ltr-input { direction: ltr; text-align: right; }
.form-grid { display: grid; gap: var(--s-4); }
@media (min-width: 768px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); }
.panel + .panel { margin-top: var(--s-4); }
.panel-title { font-size: var(--fs-lg); margin-bottom: var(--s-4); display: flex; align-items: center; gap: var(--s-2); }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: var(--fs-sm); font-weight: 800; flex: none; }

/* Radio cards (shipping & payment) */
.radio-cards { display: grid; gap: var(--s-3); }
.radio-card {
  position: relative; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4);
  border: 1.5px solid var(--border); border-radius: var(--r-md); cursor: pointer; background: var(--surface);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin: 0; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--selected-bg); }
.radio-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.radio-card .rc-main { flex: 1; min-width: 0; }
.radio-card .rc-title { font-weight: 800; font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.radio-card .rc-desc { font-size: var(--fs-xs); color: var(--text-muted); }
.radio-card .rc-aside { font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; }
.radio-card .provider-logo, .inst-box .provider-logo { background: var(--surface-sunken); color: var(--text); }
.pay-group-title { font-size: var(--fs-sm); font-weight: 800; color: var(--text-muted); margin: var(--s-5) 0 var(--s-3); display: flex; align-items: center; gap: var(--s-2); }
.pay-group-title:first-child { margin-top: 0; }

/* ---------- Summary ---------- */
.two-col { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 360px; } .sticky-aside { position: sticky; top: calc(var(--header-h) + var(--s-4)); } }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding-block: var(--s-2); font-size: var(--fs-sm); }
.summary-row .muted { color: var(--text-muted); }
.summary-row.total { border-top: 1px solid var(--border); margin-top: var(--s-2); padding-top: var(--s-4); font-weight: 800; font-size: var(--fs-md); }
.summary-row .save { color: var(--accent-ink); font-weight: 700; }
.progress { height: 8px; border-radius: var(--r-full); background: var(--surface-sunken); overflow: hidden; margin-top: var(--s-2); }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width var(--t-med) var(--ease-out); }
.note { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-xs); color: var(--text-muted); background: var(--surface-sunken); border-radius: var(--r-md); padding: var(--s-3); line-height: 1.8; }
.note .ic { width: 16px; height: 16px; margin-top: 3px; }

/* Sticky mobile action bar (cart/checkout) */
.actionbar {
  position: fixed; inset-inline: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: var(--z-floating);
  background: var(--surface); border-top: 1px solid var(--border); padding: var(--s-3) var(--gutter);
  display: flex; align-items: center; gap: var(--s-3);
}
.actionbar .btn { flex: 1; }
.actionbar .ab-total { display: flex; flex-direction: column; line-height: 1.4; font-size: var(--fs-xs); color: var(--text-muted); }
.actionbar .ab-total strong { font-size: var(--fs-md); color: var(--text); }
@media (min-width: 1024px) { .actionbar { display: none; } }

/* ---------- Cart ---------- */
.cart-item { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: var(--s-3); padding-block: var(--s-4); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .cart-item { grid-template-columns: 112px minmax(0, 1fr); gap: var(--s-4); } }
.two-col > *, .listing > * { min-width: 0; }
.cart-item:last-child { border-bottom: 0; }
.cart-item .card-media { margin: 0; border-radius: var(--r-md); }
.cart-item .card-media .media-ic svg { width: 50%; height: 50%; }
.ci-title { font-size: var(--fs-sm); font-weight: 700; line-height: 1.8; }
.ci-meta { font-size: var(--fs-xs); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-top: 2px; }
.ci-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ci-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); margin-top: var(--s-3); }
.ci-foot .stepper { flex: 0 0 auto; width: 120px; }
.ci-remove { color: var(--text-muted); }
.ci-remove:hover { color: var(--danger); }

/* ---------- Product page ---------- */
.pdp { display: grid; gap: var(--s-5); padding-top: var(--s-3); }
.gallery { position: relative; }
.gallery-main { aspect-ratio: 1; border-radius: var(--r-xl); display: grid; place-items: center; border: 1px solid var(--border); overflow: hidden; }
.gallery-main.has-photo img { padding: 6%; }
.gallery-main .media-ic svg { width: 46%; height: 46%; stroke-width: 1; color: var(--media-ic); }
.gallery-tools { position: absolute; top: var(--s-3); inset-inline-end: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }
.gallery-tools .icon-btn { background: var(--overlay-btn); box-shadow: var(--shadow-sm); }
.gallery-tools .icon-btn[aria-pressed="true"] { color: var(--accent-ink); }
.gallery-tools .icon-btn[aria-pressed="true"] svg { fill: currentColor; }
.gallery-tools .icon-btn.compare-on { background: var(--primary); color: var(--on-primary); }
.gallery-thumbs { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.gallery-thumbs span { width: 64px; height: 64px; border-radius: var(--r-md); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); }
.gallery-thumbs span:first-child { border-color: var(--text); }
.gallery-thumbs svg { width: 26px; height: 26px; stroke-width: 1.4; }
.pdp-brand { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 700; }
.pdp-brand a:hover { color: var(--text); }
.pdp h1 { font-size: var(--fs-xl); line-height: 1.6; margin-top: var(--s-1); }
.pdp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--text-muted); }
.pdp-features { margin-top: var(--s-5); display: grid; gap: var(--s-2); }
.pdp-features li { display: flex; gap: var(--s-2); font-size: var(--fs-sm); line-height: 1.8; }
.pdp-features li .ic { width: 18px; height: 18px; margin-top: 4px; color: var(--success); }
.buybox { display: grid; gap: var(--s-4); }
.buybox .price { font-size: var(--fs-xl); }
.deal-timer { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); background: var(--deals-bg); color: var(--deals-ink); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-weight: 800; font-size: var(--fs-sm); }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; }
.stock.ok { color: var(--success); }
.stock.low { color: var(--warn); }
.stock.out { color: var(--danger); }
.service-list { display: grid; gap: var(--s-3); }
.service-list li { display: flex; gap: var(--s-3); align-items: center; font-size: var(--fs-sm); }
.service-list .ic { color: var(--text-muted); }
.inst-box { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.inst-box summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-4); cursor: pointer; font-size: var(--fs-sm); font-weight: 700; min-height: 48px; }
.inst-box summary::-webkit-details-marker { display: none; }
.inst-box summary .chev { transition: transform var(--t-fast); }
.inst-box[open] summary .chev { transform: rotate(180deg); }
.inst-box ul { border-top: 1px solid var(--border); }
.inst-box li { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); }
.inst-box li + li { border-top: 1px solid var(--border); }
.inst-box li .provider-logo { width: 32px; height: 32px; font-size: var(--fs-sm); background: var(--surface-sunken); }
.inst-box li .amt { margin-inline-start: auto; font-weight: 800; white-space: nowrap; }
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--header-h); background: var(--bg); z-index: 5; }
.tabs a { padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:hover, .tabs a.is-active { color: var(--text); border-color: var(--text); }
.pdp-section { padding-block: var(--s-6); scroll-margin-top: calc(var(--header-h) + 56px); }
.pdp-section h2 { font-size: var(--fs-lg); margin-bottom: var(--s-4); }
.pdp-section p { color: var(--text-muted); max-width: 70ch; line-height: 2; }
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec-table th, .spec-table td { text-align: start; padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { color: var(--text-muted); font-weight: 600; width: 40%; }
.review-summary { display: flex; align-items: center; gap: var(--s-4); }
.review-score { font-size: var(--fs-3xl); font-weight: 900; line-height: 1; }
@media (min-width: 1024px) {
  .pdp { grid-template-columns: 1fr 1.1fr 360px; gap: var(--s-8); padding-top: var(--s-6); }
  .pdp .buybox { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
  .pdp h1 { font-size: var(--fs-2xl); }
}

/* ---------- Compare ---------- */
.compare-grid { --cols: 2; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--s-3); }
.compare-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); position: relative; }
.compare-col .card-media { margin: 0; }
.compare-col .ci-title { min-height: 3.6em; font-size: var(--fs-xs); }
.compare-col .price { font-size: var(--fs-sm); }
.compare-col .price .cur { display: block; margin: 0; }
.compare-col .btn { padding-inline: var(--s-2); }
@media (max-width: 420px) { .compare-grid, .spec-row .vals { gap: var(--s-2); } .compare-col { padding: var(--s-2); } }
.compare-col .remove { position: absolute; top: var(--s-2); inset-inline-end: var(--s-2); z-index: 2; background: var(--overlay-btn); width: 36px; height: 36px; }
.compare-add { border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); display: grid; place-items: center; text-align: center; padding: var(--s-4); color: var(--text-muted); font-size: var(--fs-sm); min-height: 200px; gap: var(--s-2); }
.compare-specs { margin-top: var(--s-5); }
.spec-row { padding-block: var(--s-3); border-bottom: 1px solid var(--border); }
.spec-row h3 { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 700; margin-bottom: var(--s-1); }
.spec-row .vals { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--s-3); font-size: var(--fs-sm); font-weight: 600; }
.spec-row.diff .vals { color: var(--text); }
.spec-row.diff h3::after { content: " • متفاوت"; color: var(--accent-ink); }
.compare-float {
  position: fixed; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--s-3)); inset-inline-start: 50%; transform: translateX(50%);
  z-index: var(--z-floating); box-shadow: var(--shadow-lg); border-radius: var(--r-full);
}
.has-buybar .compare-float, .has-actionbar .compare-float { bottom: calc(var(--tabbar-h) + 72px + var(--safe-bottom) + var(--s-3)); }
@media (min-width: 1024px) { .compare-float, .has-buybar .compare-float, .has-actionbar .compare-float { bottom: var(--s-6); } }
/* ---------- Support bubble (home + product pages, bottom-left): small circle, one-time nudge, compact panel
   styled like the product cards (surface, thin gold frame line, soft corners) ---------- */
.sup {
  position: fixed; z-index: var(--z-floating); inset-inline-end: var(--s-4); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--s-3));
  display: grid; justify-items: end; gap: var(--s-2); pointer-events: none;
}
.sup > * { pointer-events: auto; }
.has-buybar .sup, .has-actionbar .sup { bottom: calc(var(--tabbar-h) + 72px + var(--safe-bottom) + var(--s-3)); }
@media (min-width: 1024px) {
  .sup, .has-buybar .sup, .has-actionbar .sup { bottom: var(--s-6); inset-inline-end: var(--s-6); }
  /* toasts share the bottom-left corner on desktop: keep them above the circle */
  .toasts, .has-buybar .toasts, .has-actionbar .toasts { bottom: calc(var(--s-6) + 62px); }
}
.sup-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-md);
  outline: 1px solid var(--frame-line); outline-offset: 3px; transition: transform var(--t-fast) var(--ease-out);
}
.sup-btn:active { transform: scale(.94); }
.sup-btn .ic { width: 20px; height: 20px; }
.sup-btn .sup-ic-close, .sup.is-open .sup-btn .sup-ic-open { display: none; }
.sup.is-open .sup-btn .sup-ic-close { display: block; }
.sup-btn { animation: sup-float 3.2s ease-in-out infinite alternate; }
.sup-btn .sup-ic-open { transform-origin: 50% 60%; }
@keyframes sup-float { from { translate: 0 0; } to { translate: 0 -3px; } }
@keyframes sup-tilt { 0%, 88%, 100% { rotate: 0deg; } 91% { rotate: -14deg; } 94% { rotate: 10deg; } 97% { rotate: -4deg; } }
.sup.is-open .sup-btn, .sup-btn:hover, .sup.is-open .sup-btn .sup-ic-open, .sup-btn:hover .sup-ic-open { animation-play-state: paused; }
.sup-btn.is-nudging { animation: sup-ring 1.4s ease-out 2; }
@keyframes sup-ring { 0% { box-shadow: var(--shadow-md), 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: var(--shadow-md), 0 0 0 12px transparent; } }
/* one-time nudge */
.sup-nudge {
  position: relative; display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px var(--s-3);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-full); box-shadow: var(--shadow-md);
  animation: rise 220ms var(--ease-out);
}
.sup-nudge[hidden] { display: none; }
.sup-nudge-text { font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }
.sup-nudge-x { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--text-muted); }
.sup-nudge-x .ic { width: 14px; height: 14px; }
.sup-nudge-x:hover { background: var(--surface-sunken); }
/* compact panel */
.sup-panel {
  width: 232px; padding: var(--s-2);
  background: var(--card-bg, var(--surface)); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  outline: 1px solid var(--frame-line); outline-offset: -5px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform-origin: left bottom; animation: sup-pop 300ms cubic-bezier(.2, .9, .3, 1.15);
}
.sup-panel.is-closing { animation: sup-pop-out 170ms ease-in forwards; pointer-events: none; }
@keyframes sup-pop { from { opacity: 0; transform: translateY(10px) scale(.85); } }
@keyframes sup-pop-out { to { opacity: 0; transform: translateY(8px) scale(.9); } }
/* the hours line and rows arrive one after another */
.sup-head, .sup-row { animation: sup-row-in 320ms var(--ease-out) both; }
.sup-head { animation-delay: 60ms; }
.sup-row:nth-child(1) { animation-delay: 100ms; }
.sup-row:nth-child(2) { animation-delay: 145ms; }
.sup-row:nth-child(3) { animation-delay: 190ms; }
.sup-row:nth-child(n + 4) { animation-delay: 235ms; }
@keyframes sup-row-in { from { opacity: 0; transform: translateX(-10px); } }
/* the circle's icon spins over: headset ⇄ × */
.sup.is-open .sup-btn .sup-ic-close { animation: sup-spin-in 260ms var(--ease-out); }
.sup:not(.is-open) .sup-btn .sup-ic-open { animation: sup-spin-in 260ms var(--ease-out), sup-tilt 8s ease-in-out 2s infinite; }
@keyframes sup-spin-in { from { opacity: 0; transform: rotate(-90deg) scale(.6); } }
.sup-panel { --card-bg: color-mix(in srgb, var(--surface) 94%, transparent); }
.sup-panel[hidden] { display: none; }
.sup-head { display: flex; align-items: center; gap: 6px; padding: var(--s-1) var(--s-2) var(--s-2); margin-bottom: 2px; border-bottom: 1px dashed var(--border); font-size: 11px; font-weight: 600; color: var(--text-muted); }
.sup-head .ic { width: 13px; height: 13px; }
.sup-rows { display: grid; gap: 2px; }
.sup-row { display: flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-2); border-radius: var(--r-md); color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
.sup-row .ic { color: var(--accent-ink); }
.sup-row:hover, .sup-row:focus-visible { background: var(--surface-sunken); }
.sup-txt { flex: 1; }
.sup-row small { font-size: 11px; font-weight: 600; color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .sup-btn, .sup-btn .ic, .sup-btn.is-nudging, .sup-nudge, .sup-panel, .sup-head, .sup-row { animation: none !important; } }

/* ---------- Lists (categories page, account) ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list a, .list button.list-item {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 60px; padding: var(--s-3) var(--s-4);
  font-weight: 700; font-size: var(--fs-sm); text-align: start; transition: background-color var(--t-fast);
}
.list li + li { border-top: 1px solid var(--border); }
.list a:hover { background: var(--selected-bg); }
.list .li-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface-sunken); display: grid; place-items: center; flex: none; }
.list .li-sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; }
.list .chev { margin-inline-start: auto; color: var(--text-muted); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: var(--s-12) var(--s-4); display: grid; justify-items: center; gap: var(--s-3); }
.empty-ic { width: 88px; height: 88px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.empty-ic svg { width: 40px; height: 40px; stroke-width: 1.5; }
.empty-ic.is-warn { background: var(--surface-sunken); color: var(--text-muted); }
.empty h2 { font-size: var(--fs-lg); }
.empty p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 36ch; }

/* ---------- Toast ---------- */
.toasts { position: fixed; inset-inline: var(--s-4); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--s-3)); z-index: var(--z-toast); display: grid; gap: var(--s-2); justify-items: center; pointer-events: none; }
.has-buybar .toasts, .has-actionbar .toasts { bottom: calc(var(--tabbar-h) + 72px + var(--safe-bottom) + var(--s-3)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); width: min(440px, 100%);
  background: var(--toast-bg); color: var(--toast-fg); border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
  box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 600;
  animation: toast-in var(--t-med) var(--ease-out);
}
.toast .ic { color: var(--toast-accent); }
.toast a, .toast button { margin-inline-start: auto; color: var(--toast-accent); font-weight: 800; padding: var(--s-1) var(--s-2); }
.toast.is-leaving { animation: toast-out 160ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (min-width: 1024px) { .toasts, .has-buybar .toasts, .has-actionbar .toasts { bottom: var(--s-6); inset-inline: auto var(--s-6); } }

/* ---------- Account, auth & support ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-sunken); border-radius: var(--r-md); margin-bottom: var(--s-4); }
.seg button { min-height: 44px; border-radius: var(--r-sm); font-weight: 700; color: var(--text-muted); transition: background-color var(--t-fast), color var(--t-fast); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pw-wrap { position: relative; }
/* The input itself is LTR (passwords), so its "inline-start" is the left side.
   Reserve room on the physical side where the eye button sits instead. */
[dir="rtl"] .pw-wrap input { padding-right: 52px; padding-left: var(--s-4); }
[dir="ltr"] .pw-wrap input { padding-left: 52px; padding-right: var(--s-4); }
.pw-toggle { position: absolute; inset-inline-start: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-muted); border-radius: var(--r-sm); }
.pw-toggle[aria-pressed="true"] { color: var(--text); }
.error-box { color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.error-box:empty { display: none; }
.profile-card { display: flex; align-items: center; gap: var(--s-4); }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: var(--fs-xl); flex: none; }
.order-list { display: grid; gap: var(--s-3); }
.order-row { padding: 0; }
.order-row summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-4); cursor: pointer; }
.order-row summary::-webkit-details-marker { display: none; }
.order-row .order-main { display: flex; flex-direction: column; flex: 1 1 160px; font-size: var(--fs-sm); line-height: 1.6; }
.order-row .order-main .muted { font-size: var(--fs-xs); }
.order-row[open] summary { border-bottom: 1px solid var(--border); }
.order-row > :not(summary) { margin-inline: var(--s-4); }
.order-row > :last-child { margin-bottom: var(--s-4); display: inline-flex; }
.order-items li { display: flex; justify-content: space-between; gap: var(--s-3); padding-block: var(--s-2); font-size: var(--fs-sm); border-bottom: 1px dashed var(--border); }
.order-row p { display: flex; gap: 4px; align-items: center; margin-top: var(--s-3); }
.thread { display: grid; gap: var(--s-3); }
.bubble { max-width: min(560px, 88%); padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); line-height: 1.9; }
.bubble.from-me { justify-self: start; border-start-start-radius: 4px; }
.bubble.from-staff { justify-self: end; background: var(--accent-soft); border-color: transparent; border-start-end-radius: 4px; }
.bubble-meta { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--s-1); }
.bubble-meta b { color: var(--text); }
.motion .bubble:last-child { animation: rise 320ms var(--ease-out); }

/* ---------- Success ---------- */
.success-card { max-width: 520px; margin: var(--s-10) auto; text-align: center; }
.success-card .empty-ic { background: var(--success-soft); color: var(--success); margin-inline: auto; }

/* ---------- Utilities ---------- */
.muted { color: var(--text-muted); }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.row { display: flex; align-items: center; gap: var(--s-2); }
.between { justify-content: space-between; }
[hidden] { display: none !important; }
@media (max-width: 1023.98px) { .hide-mobile { display: none !important; } }
@media (min-width: 1024px) { .hide-desktop { display: none !important; } }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Motion — minimal, CSS-only (+ a tiny observer in app.js)
   Only transform/opacity are animated, so it stays cheap.
   `.motion` is added to <html> by app.js unless the user
   prefers reduced motion; without JS everything is visible.
   ========================================================= */
:root {
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-slow: 480ms;
}

/* Page-to-page crossfade (Chrome/Edge/Safari 18+; others just navigate) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root) { animation: 140ms ease-in both vt-out; }
::view-transition-new(root) { animation: 220ms var(--ease-out) both vt-in; }
.hdr { view-transition-name: site-header; }
.tabbar { view-transition-name: site-tabbar; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* Scroll reveal: fade + small rise, staggered per batch via --d */
.motion [data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.motion [data-reveal].is-in { opacity: 1; transform: none; }
/* app.js removes data-reveal once the reveal finishes, so hover effects work normally afterwards */

/* Hero entrance on load */
.motion .hero-copy > * { animation: rise var(--t-slow) var(--ease-out) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: 60ms; }
.motion .hero-copy > :nth-child(3) { animation-delay: 120ms; }
.motion .hero-copy > :nth-child(4) { animation-delay: 180ms; }
.motion .hero-copy > :nth-child(5) { animation-delay: 240ms; }
.motion .hero-art .blob { animation: grow-in 700ms var(--ease-spring) both 120ms; }
.motion .hero-art .blob-2 { animation: grow-in 700ms var(--ease-spring) both 260ms; }
.motion .hero-art .hero-ic svg { animation: float 6s ease-in-out infinite 900ms; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes grow-in { from { opacity: 0; transform: scale(.85); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(-2deg); } }

/* Cards: gentle lift on real hover devices only */
@media (hover: hover) {
  .card { transition: box-shadow var(--t-med) var(--ease-out), border-color var(--t-med), transform var(--t-med) var(--ease-out), opacity var(--t-slow) var(--ease-out); }
  .card:hover { transform: translateY(-3px); }
  .card-media .media-ic svg, .card-media img { transition: transform var(--t-slow) var(--ease-out); }
  .card:hover .card-media .media-ic svg, .card:hover .card-media img { transform: scale(1.06); }
  .cat-tile:hover .cat-ic { transform: translateY(-2px); }
}
.icon-btn:active, .chip:active, .card-wish:active { transform: scale(.92); }
.icon-btn, .chip { transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out); }

/* Feedback micro-interactions (classes toggled in app.js) */
.pop { animation: pop 420ms var(--ease-spring); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.badge-count.bump { animation: bump 460ms var(--ease-spring); }
@keyframes bump { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.swap-in { animation: swap-in 260ms var(--ease-out); }
@keyframes swap-in { from { opacity: 0; transform: scale(.94); } }
.stepper output.tick { animation: tick 220ms var(--ease-out); }
@keyframes tick { from { opacity: .2; transform: translateY(-6px); } }

/* Theme toggle icon spin */
.theme-toggle svg { transition: transform var(--t-slow) var(--ease-spring); }
.theme-toggle:active svg { transform: rotate(-30deg) scale(.9); }
.theme-toggle .ic-sun, .theme-toggle .ic-moon { animation: grow-in 360ms var(--ease-spring); }

/* Tab bar: active indicator slides in */
.tabbar a[aria-current="page"]::before { animation: indicator 360ms var(--ease-out) both; }
.tabbar a[aria-current="page"] .ic { animation: pop 420ms var(--ease-spring) both 80ms; }
@keyframes indicator { from { transform: scaleX(0); } }

/* Small reveals */
.inst-box[open] ul { animation: rise 260ms var(--ease-out); }
.progress span { transform-origin: right; animation: grow-x 700ms var(--ease-out) both 150ms; }
[dir="ltr"] .progress span { transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } }
.empty-ic { animation: grow-in 520ms var(--ease-spring) both; }
.active-filters .chip { animation: swap-in 220ms var(--ease-out); }
.countdown b.cd-s { animation: tick 300ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .motion [data-reveal] { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- «first edition» frame: a second hairline just inside the box edge, with a small gap ----------
   Drawn with outline + negative offset, in each box's padding, so it never crosses photos, text or buttons. */
.card { outline: 1px solid var(--frame-line); outline-offset: -5px; }
.cat-tile .cat-ic { outline: 1px solid var(--frame-line); outline-offset: -5px; }
.brand-logo { outline: 1px solid var(--frame-line-on-white); outline-offset: -5px; }   /* logo tiles are white in both themes */
.gallery-main { outline: 1px solid var(--frame-line); outline-offset: -8px; }
.buybox.panel, .trust-item { outline: 1px solid var(--frame-line); outline-offset: -6px; }

/* ---------- TEST: curved edge (Galaxy S7 edge style) — delete this block + the --edge tokens to revert ---------- */
.card, .cat-tile .cat-ic, .gallery-main, .buybox.panel, .trust-item { box-shadow: var(--edge); }
.brand-logo { box-shadow: var(--edge-light); }
.card:hover { box-shadow: var(--shadow-md), var(--edge); }
@media (hover: hover) { .brand-tile:hover .brand-logo { box-shadow: var(--shadow-md), var(--edge-light); } }

/* ---------- TEST: frosted glass (delete this whole block to revert) ----------
   A very soft, fixed wash of the brand colors sits behind the page; cards and panels become milky glass
   with a bright top rim. Real blur (backdrop-filter) only where content scrolls behind: header, tab bar, mega menu. */
:root {
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 249, 238, .66);
  --glass-line: rgba(255, 255, 255, .7);
  --glass-rim: rgba(255, 255, 255, .9);
  --glass-wash:
    radial-gradient(60vmax 45vmax at 88% 6%, rgba(247, 200, 211, .55), transparent 70%),
    radial-gradient(50vmax 40vmax at 6% 38%, rgba(45, 58, 71, .09), transparent 70%),
    radial-gradient(55vmax 45vmax at 82% 92%, rgba(247, 200, 211, .38), transparent 70%),
    radial-gradient(45vmax 35vmax at 20% 100%, rgba(255, 236, 200, .7), transparent 70%);
}
:root[data-theme="dark"] {
  --glass: rgba(34, 45, 56, .55);
  --glass-strong: rgba(24, 33, 42, .6);
  --glass-line: rgba(255, 255, 255, .08);
  --glass-rim: rgba(255, 255, 255, .1);
  --glass-wash:
    radial-gradient(60vmax 45vmax at 88% 6%, rgba(247, 200, 211, .12), transparent 70%),
    radial-gradient(50vmax 40vmax at 6% 38%, rgba(110, 145, 180, .16), transparent 70%),
    radial-gradient(55vmax 45vmax at 82% 92%, rgba(247, 200, 211, .08), transparent 70%);
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--glass-wash); }
.card, .cat-tile .cat-ic, .trust-item, .panel, .gallery-main {
  background-color: var(--glass); border-color: var(--glass-line);
  box-shadow: var(--edge, 0 0 #0000), inset 0 1px 0 var(--glass-rim);
}
.card:hover { box-shadow: var(--shadow-md), var(--edge, 0 0 #0000), inset 0 1px 0 var(--glass-rim); }
.cat-tile.is-deal .cat-ic { background-color: var(--accent); }
/* on the colored strips (event, deals) the glass is thicker so artwork and strong color don't sit behind the text */
/* product cards: frosted but nearly solid, so text reads easily (the header/tab bar keep their lighter glass) */
.card { --card-bg: color-mix(in srgb, var(--surface) 90%, transparent); background-color: var(--card-bg); }
.event-strip .card, .deals .card { --card-bg: color-mix(in srgb, var(--surface) 94%, transparent); }
.hdr, .tabbar, .mega {
  background-color: var(--glass-strong); border-color: var(--glass-line);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
}
/* the desktop category dropdown: solid so its links are easy to read */
.mega { background-color: var(--surface); }
.mega-mains { background: var(--surface-sunken); }

/* ---------- «دسته‌بندی‌ها» tiles: inverted scheme — dark tiles in light mode, light tiles in dark mode ----------
   (the blush «تخفیف‌های ویژه» tile and photo tiles keep their own look; names under the tiles follow the page) */
.cat-tile:not(.is-deal) .cat-ic:not(.has-img) { background-color: #222D38; border-color: #34424F; color: var(--vanilla-cream); }
.cat-tile:not(.is-deal):hover .cat-ic:not(.has-img) { border-color: var(--vanilla-cream); }
:root[data-theme="dark"] .cat-tile:not(.is-deal) .cat-ic:not(.has-img) { background-color: #FFFFFF; border-color: #EADDC4; color: var(--midnight-lagoon); outline-color: var(--frame-line-on-white); box-shadow: var(--edge-light, none); }
:root[data-theme="dark"] .cat-tile:not(.is-deal):hover .cat-ic:not(.has-img) { border-color: var(--midnight-lagoon); }

/* ---------- TEST: pinkish glass (delete this block to go back) ----------
   The see-through parts (header, tab bar, tiles, panels) get a soft Blush Petal tint; product cards and the dropdown stay as they are. */
:root:not([data-theme="dark"]) {
  --glass: rgba(255, 238, 243, .62);
  --glass-strong: rgba(253, 228, 236, .7);
  --glass-line: rgba(255, 255, 255, .75);
}
:root[data-theme="dark"] {
  --glass: rgba(58, 40, 54, .58);
  --glass-strong: rgba(48, 32, 45, .64);
  --glass-line: rgba(247, 200, 211, .12);
}

/* ---------- TEST: edge-to-edge product images (delete this block to go back) ----------
   The image fills the card's full width and top (only the card's own corners round it); the badges, heart,
   rating and brand tab sit closer to the corners. The card's inner gold frame line is off here, since it
   would otherwise run across the photo. */
.card > .card-media { margin: 0; border-radius: 0; }
.card > .card-media.has-photo { box-shadow: none; }
.card > .card-media.has-photo img { padding: 6%; }
.card { outline: none; }
.card .card-badges { top: 8px; inset-inline-start: 8px; }
.card .card-wish { top: 8px; inset-inline-end: 8px; }
.card .card-rating { bottom: 8px; inset-inline-end: 8px; }
.card .card-body { padding-top: 2px; }
.card .card-brand-tab { margin-top: -16px; }

/* ---------- Sign in with an SMS code ---------- */
.seg.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg-3 button { font-size: var(--fs-sm); }
.otp-step2 { display: grid; gap: var(--s-4); }
.otp-step2[hidden] { display: none; }
.otp-sent { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.9; }
.otp-input { text-align: center !important; font-size: 1.5rem !important; font-weight: 800; letter-spacing: .5em; font-variant-numeric: tabular-nums; padding-inline: var(--s-4) calc(var(--s-4) - .5em) !important; }
.otp-resend { font-size: var(--fs-sm); color: var(--text-muted); text-align: center; margin-top: calc(-1 * var(--s-2)); }
.otp-demo { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--warn); }
.otp-demo[hidden] { display: none; }

/* ---------- «مجله کوکیوا» (blog) ---------- */
/* header icon: visible on phones too (the other header icons live in the bottom tab bar there) */
.mag-btn { position: relative; flex: none; }
.mag-btn[aria-current="page"] { background: var(--surface-sunken); }
.mag-dot {
  position: absolute; top: 9px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-ink); border: 2px solid var(--bg); box-sizing: content-box;
}
.mag-dot[hidden] { display: none; }
.motion .mag-dot { animation: pop 420ms var(--ease-out) 600ms both; }

/* the one-time «تازه در مجله» bubble under the icon (placed by app.js) */
.mag-pop {
  position: fixed; z-index: calc(var(--z-header) + 3); width: min(300px, calc(100vw - 24px));
  display: flex; align-items: flex-start; gap: var(--s-1); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-1);
  background: var(--toast-bg); color: var(--toast-fg); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.mag-pop::before {
  content: ""; position: absolute; top: -5px; left: var(--arrow, 50%); width: 12px; height: 12px;
  background: inherit; border-radius: 2px; transform: translateX(-50%) rotate(45deg);
}
.motion .mag-pop { animation: rise 220ms var(--ease-out); }
.mag-pop.is-leaving { opacity: 0; transform: translateY(-4px); }
.mag-pop-link { position: relative; flex: 1; min-width: 0; display: grid; gap: 2px; color: inherit; }
.mag-pop-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--toast-accent); }
.mag-pop-link b { font-size: var(--fs-sm); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mag-pop-link:hover b { text-decoration: underline; text-underline-offset: 3px; }
.mag-pop-x { position: relative; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: inherit; opacity: .7; }
.mag-pop-x:hover { opacity: 1; background: rgba(127, 127, 127, .18); }

/* cards */
.post-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  transition: box-shadow var(--t-med) var(--ease-out), border-color var(--t-med);
}
@media (hover: hover) { .post-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); } }
.post-cover { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-sunken); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
@media (hover: hover) { .post-card:hover .post-cover img { transform: scale(1.03); } }
.post-cover .media-ic svg { width: 28%; height: 28%; stroke-width: 1.15; color: var(--media-ic); }
.post-card-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-4) var(--s-4); flex: 1; min-width: 0; }
.post-topic { align-self: flex-start; font-size: var(--fs-xs); font-weight: 800; color: var(--accent-ink); }
a.post-topic:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-card-title { font-size: var(--fs-md); font-weight: 800; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-title a::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
.post-excerpt { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .post-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); }

.post-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .post-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } }
@media (max-width: 1023.98px) { .post-grid.is-compact .post-excerpt { display: none; } }
/* phones: compact rows (small square photo beside the title), so the home page stays short */
@media (max-width: 639.98px) {
  .post-grid.is-compact { gap: var(--s-3); }
  .post-grid.is-compact .post-card { flex-direction: row; }
  .post-grid.is-compact .post-cover { flex: none; width: 108px; aspect-ratio: auto; min-height: 108px; }
  .post-grid.is-compact .post-card-body { padding: var(--s-3); gap: var(--s-1); justify-content: center; }
  .post-grid.is-compact .post-card-title { font-size: var(--fs-sm); }
  .post-grid.is-compact .post-card .post-meta { margin-top: 0; }
}

/* blog page */
.blog-head { display: grid; gap: var(--s-1); padding-block: var(--s-4); }
.blog-head h1 { font-size: var(--fs-2xl); }
.blog-head p { color: var(--text-muted); font-size: var(--fs-sm); }
@media (min-width: 768px) { .blog-head h1 { font-size: var(--fs-3xl); } .blog-head p { font-size: var(--fs-md); } }
.blog-topics { margin-bottom: var(--s-5); }
.blog-topics:empty { display: none; }
@media (max-width: 767.98px) {
  .blog-topics { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .blog-topics::-webkit-scrollbar { display: none; }
  .blog-topics .chip { flex: none; }
}
.post-feature { margin-bottom: var(--s-5); }
@media (min-width: 768px) {
  .post-card.is-big { flex-direction: row; }
  .post-card.is-big .post-cover { flex: 0 0 56%; aspect-ratio: 16 / 10; }
  .post-card.is-big .post-card-body { justify-content: center; gap: var(--s-3); padding: var(--s-6) var(--s-8); }
  .post-card.is-big .post-card-title { font-size: var(--fs-xl); line-height: 1.7; -webkit-line-clamp: 3; }
  .post-card.is-big .post-excerpt { -webkit-line-clamp: 3; font-size: var(--fs-md); }
  .post-card.is-big .post-meta { margin-top: var(--s-2); }
}
.blog-more { display: flex; justify-content: center; padding-block: var(--s-6) var(--s-2); }
.blog-more[hidden] { display: none; }

/* post page */
.post { max-width: 760px; margin-inline: auto; padding-top: var(--s-4); }
.post-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.post-head h1 { font-size: var(--fs-2xl); line-height: 1.6; }
@media (min-width: 768px) { .post-head h1 { font-size: var(--fs-3xl); line-height: 1.5; } }
.post-head .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); color: var(--text-muted); }
.post-head .post-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.post-share { margin-inline-start: auto; width: 40px; height: 40px; border: 1px solid var(--border); }
.post-hero { margin: 0 0 var(--s-6); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-sunken); }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }
.post-toc { margin-bottom: var(--s-6); padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); font-size: var(--fs-sm); }
.post-toc b { display: block; margin-bottom: var(--s-2); }
.post-toc ol { display: grid; gap: 6px; padding-inline-start: var(--s-5); list-style: persian; }
.post-toc a { color: var(--text-muted); }
.post-toc a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.post-body { font-size: 1.0625rem; line-height: 2.1; overflow-wrap: anywhere; }
.post-body > * + * { margin-top: var(--s-4); }
.post-body h2 { font-size: var(--fs-xl); line-height: 1.7; margin-top: var(--s-8); scroll-margin-top: calc(var(--header-h) + 16px); }
.post-body h3 { font-size: var(--fs-lg); line-height: 1.7; margin-top: var(--s-6); }
.post-body ul, .post-body ol { display: grid; gap: var(--s-2); padding-inline-start: var(--s-6); }
.post-body ul { list-style: disc; }
.post-body ol { list-style: persian; }
.post-body li::marker { color: var(--accent-ink); font-weight: 700; }
.post-body a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post-body strong { font-weight: 800; }
.post-body figure { margin-block: var(--s-6); }
.post-body figure img { width: 100%; height: auto; border-radius: var(--r-lg); background: var(--surface-sunken); }
.post-body figcaption { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
.post-tip { padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--accent-soft); border-inline-start: 4px solid var(--accent-ink); font-size: var(--fs-md); }
.post-preview { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-sunken); color: var(--warn); font-size: var(--fs-sm); font-weight: 700; }

/* ---------- Product reviews (دیدگاه‌ها) ---------- */
.rating.is-empty svg { color: var(--border-strong); fill: none; }
.pill-warn { background: transparent; color: var(--warn); border: 1px solid currentColor; }
.rv-stars { display: inline-flex; gap: 1px; }
.rv-stars svg { width: 15px; height: 15px; color: var(--border-strong); }
.rv-stars svg.is-on, .rv-dist svg.is-on { color: var(--star); fill: currentColor; }
#rv { display: grid; gap: var(--s-5); max-width: 760px; }
.rv-summary { display: grid; gap: var(--s-4); padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
@media (min-width: 640px) { .rv-summary { grid-template-columns: auto 1fr; align-items: center; gap: var(--s-8); } }
.rv-score { display: grid; justify-items: center; gap: 4px; }
.rv-score b { font-size: var(--fs-3xl); font-weight: 900; line-height: 1.1; }
.rv-score .rv-stars svg { width: 18px; height: 18px; }
.rv-score > span:last-child { font-size: var(--fs-xs); color: var(--text-muted); }
.rv-dist { display: grid; gap: 6px; }
.rv-dist li { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); }
.rv-dist li > span:first-child { display: inline-flex; align-items: center; gap: 3px; }
.rv-dist svg { width: 12px; height: 12px; }
.rv-bar { height: 8px; border-radius: var(--r-full); background: var(--surface-sunken); overflow: hidden; }
.rv-bar i { display: block; height: 100%; border-radius: inherit; background: var(--star); }
.rv-n { text-align: end; }
.rv-empty, .rv-login { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); font-size: var(--fs-sm); }
.rv-empty > svg, .rv-login > svg { width: 28px; height: 28px; flex: none; color: var(--accent-ink); }
.rv-empty div { display: grid; gap: 2px; }
.rv-empty span { color: var(--text-muted); font-size: var(--fs-xs); }
.rv-login { flex-wrap: wrap; }
.rv-login span { flex: 1 1 180px; }
.rv-form, .rv-mine { display: grid; gap: var(--s-3); padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.rv-form-title { font-size: var(--fs-md); }
.rv-mine-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.rv-mine .btn { justify-self: start; }
.rv-mine .rv-item { padding: 0; border: 0; }
.rv-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.rv-pick legend { font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s-1); width: 100%; }
/* 5 → 1 in the page, shown reversed, so ★ 1 is on the right and hovering a star lights it and every star before it */
.rv-pick-stars { display: inline-flex; flex-direction: row-reverse; }
.rv-pick-stars label { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; color: var(--border-strong); border-radius: var(--r-sm); }
.rv-pick-stars label svg { width: 30px; height: 30px; transition: transform var(--t-fast) var(--ease-out); }
.rv-pick-stars input:checked ~ label, .rv-pick-stars label:hover, .rv-pick-stars label:hover ~ label { color: var(--star); }
.rv-pick-stars input:checked ~ label svg, .rv-pick-stars label:hover svg, .rv-pick-stars label:hover ~ label svg { fill: currentColor; }
.rv-pick-stars label:hover svg { transform: scale(1.12); }
.rv-pick-stars input:focus-visible + label { outline: 2px solid var(--ring); outline-offset: 1px; }
.rv-pick-word { font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); }
.rv-list { display: grid; }
.rv-item { display: grid; gap: var(--s-2); padding-block: var(--s-4); border-bottom: 1px solid var(--border); }
.rv-list .rv-item:last-child { border-bottom: 0; }
.rv-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); font-size: var(--fs-sm); }
.rv-buyer { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--success); }
.rv-date { margin-inline-start: auto; font-size: var(--fs-xs); color: var(--text-muted); }
.pdp-section .rv-body { color: var(--text); max-width: none; line-height: 2; overflow-wrap: anywhere; }
.rv-reply { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-sunken); font-size: var(--fs-sm); }
.rv-reply b { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.pdp-section .rv-reply p { color: var(--text); line-height: 1.9; }