/* ═══════════════════════════════════════════════════════════════════
   DigiShop — Digikala-style theme (digivirtual.ir original branding)
   Font: Dana · Primary: #a855f7 · RTL
   ═══════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Dana'; src: url('../fonts/dana-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Dana'; src: url('../fonts/dana-medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Dana'; src: url('../fonts/dana-demibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Dana'; src: url('../fonts/dana-bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Dana'; src: url('../fonts/dana-extrabold.woff') format('woff'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Dana'; src: url('../fonts/dana-black.woff') format('woff'); font-weight: 900; font-display: swap; }

:root {
  --primary: #a855f7;
  --primary-dark: #9333ea;
  --primary-soft: #f5f3ff;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --surface-3: #fafafa;
  --text: #333333;
  --muted: #8b8b8b;
  --border: #e6e6e6;
  --ok: #16a34a; --ok-soft: #dcfce7;
  --err: #dc2626; --err-soft: #fee2e2;
  --warn: #d97706; --warn-soft: #fef3c7;
  --topbar: #1f1f1f;
  --footer-bg: #faf5ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.1), 0 16px 40px rgba(0,0,0,.09);
}
html[data-theme="dark"] {
  --bg: #141414; --surface: #1d1d1d; --surface-2: #262626; --surface-3: #1a1a1a;
  --text: #e8e8e8; --muted: #9a9a9a; --border: #303030;
  --primary-soft: #241a3b; --topbar: #000; --footer-bg: #1b1526;
  --shadow: 0 1px 3px rgba(0,0,0,.5);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Dana', Vazirmatn, Tahoma, 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans Thai', 'Noto Sans Devanagari', system-ui, sans-serif; background: var(--surface-3); color: var(--text); line-height: 1.9; font-size: 14.5px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.5rem; font-weight: 800; } h2 { font-size: 1.2rem; font-weight: 800; } h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: .8rem; } .center { text-align: center; }
.container { max-width: 1280px; margin-inline: auto; padding-inline: 1rem; }
.narrow { max-width: 800px; }

/* ── top bar ── */
.topbar { background: var(--topbar); color: #cfcfcf; font-size: .78rem; }
/* chat38: wrap + min-width:0 — the topbar can never force horizontal scroll
   anymore (flex children used to refuse shrinking below their content). */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-block: .35rem; gap: .35rem 1rem; flex-wrap: wrap; min-width: 0; }
.topbar-links { display: flex; gap: 1.2rem; align-items: center; min-width: 0; flex-wrap: wrap; }
.topbar-links a { color: #cfcfcf; }
.topbar-links a:hover { color: #fff; }
.topbar a.active { color: #fff; font-weight: 600; }

/* ── header ── */
.site-header { background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.05); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 1.6rem; padding-block: .8rem; }
.brand { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.brand-logo { display: flex; align-items: center; gap: .45rem; }
.brand-mark-wrap { display: inline-flex; align-items: center; }
.brand-mark-img { height: 40px; width: auto; }
.brand-text { font-size: 1.32rem; font-weight: 900; color: var(--text); line-height: 1; }
.brand-text-accent { color: var(--primary); }
.footer-brand { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
.footer-brand b { font-size: 1.15rem; font-weight: 900; }
.footer-brand .brand-mark-img { height: 34px; }
.admin-login-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: 0 auto 1rem; }
.admin-login-brand b { font-size: 1.25rem; font-weight: 900; }
.admin-login-brand .brand-mark-img { height: 44px; }
.brand-logo .logo-badge { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #c084fc); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: .72rem; letter-spacing: .5px; box-shadow: 0 4px 14px rgba(168,85,247,.35); }
.brand-logo .logo-text { font-size: 1.28rem; font-weight: 900; color: var(--text); }
.brand-logo .logo-text span { color: var(--primary); }

.header-search { flex: 1; max-width: 560px; position: relative; }
.header-search input { width: 100%; background: var(--surface-2); border: none; border-radius: 999px; padding: .68rem 1.2rem; padding-inline-start: 2.9rem; font: inherit; color: var(--text); outline: none; transition: box-shadow .15s; } /* chat79 FIX: was physical `padding: .68rem 2.9rem .68rem 1.2rem` — the 2.9rem icon room sat on the RIGHT only, fine in RTL (icon side) but in LTR languages the icon (inset-inline-start = left) ended up UNDER the placeholder text. Logical padding puts the room on whichever side the icon renders. */
.header-search input:focus { box-shadow: 0 0 0 2px var(--primary); background: var(--surface); }
.header-search button { position: absolute; inset-inline-start: .55rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1.05rem; padding: .3rem; }
.header-actions { display: flex; align-items: center; gap: .6rem; margin-inline-start: auto; }
.cart-btn { position: relative; display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: none; border-radius: 999px; padding: .55rem 1.1rem; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; transition: background .15s; }
.cart-btn:hover { background: var(--primary-soft); color: var(--primary); }
.cart-btn .cart-count { background: var(--primary); color: #fff; min-width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; padding-inline: .3rem; }
.icon-btn { background: var(--surface-2); border: none; border-radius: 999px; width: 38px; height: 38px; cursor: pointer; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--primary-soft); }

/* ── nav bar ── */
.main-nav { background: var(--surface); border-top: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; gap: 1.4rem; padding-block: .55rem; }
.cats-btn { background: var(--primary); color: #fff; border-radius: 8px; padding: .45rem 1rem; font: inherit; font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: .5rem; cursor: pointer; border: none; transition: background .15s; }
.cats-btn:hover { background: var(--primary-dark); color: #fff; }
.nav-links { display: flex; gap: 1.1rem; align-items: center; overflow-x: auto; }
.nav-links a { color: var(--text); font-size: .88rem; font-weight: 500; padding: .25rem .2rem; white-space: nowrap; }
.nav-links a:hover { color: var(--primary); }
.nav-side { margin-inline-start: auto; display: flex; gap: .4rem; align-items: center; }

/* ── alerts ── */
.alert { position: relative; margin: .75rem 0; padding: .75rem 1.1rem; border-radius: var(--radius); font-size: .88rem; font-weight: 600; padding-inline-end: 2.7rem; }
.alert-error { background: var(--err-soft); color: var(--err); }
.alert-success { background: var(--ok-soft); color: var(--ok); }
/* chat35 — "selling temporarily closed" notice (amber, not an error) */
.alert-warn { background: var(--warn-soft); color: var(--warn); }
/* chat34 — dismiss button; messages stay until the user closes them */
.alert-dismiss { position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: inherit; opacity: .6;
  font-size: 1.3rem; line-height: 1; padding: .25rem .4rem; border-radius: 6px; }
.alert-dismiss:hover { opacity: 1; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 8px; padding: .5rem 1.2rem; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; transition: all .15s; }
/* chat35 — purchases-closed state for buy buttons (span, not a link) */
.btn.btn-disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(168,85,247,.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--muted); border: none; padding: .3rem .6rem; }
.btn-ghost:hover { color: var(--primary); }
.btn-sm { padding: .32rem .85rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.7rem; font-size: .98rem; border-radius: 10px; }
.btn-block { width: 100%; margin-block: .3rem; }

/* ── sections ── */
.section { padding-block: 1.6rem; }
/* chat61 — margin-top: the head used to stick to the section above (it only had bottom spacing) */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .55rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: .6rem; font-size: 1.12rem; font-weight: 800; }
.section-title::before { content: ''; width: 4px; height: 22px; background: var(--primary); border-radius: 2px; }
.more { font-size: .84rem; color: var(--primary); font-weight: 600; }
.more:hover { color: var(--primary-dark); }
.grid { display: grid; gap: .8rem; }
.products-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ── product card ── */
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: all .18s; position: relative; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: transparent; }
.product-thumb { position: relative; aspect-ratio: 1/1; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: .6rem; inset-inline-start: .6rem; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; padding: .15rem .6rem; border-radius: 6px; }
.product-body { padding: .8rem .9rem .9rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-title { font-weight: 600; color: var(--text); font-size: .86rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.product-title:hover { color: var(--primary); }
.product-meta { display: flex; gap: .3rem; flex-wrap: wrap; }
.product-footer { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; }
.price { display: flex; flex-direction: column; align-items: flex-start; }
.price b { color: var(--text); font-size: .98rem; font-weight: 800; }
.price s { font-size: .75rem; color: var(--muted); }
.price-lg b { font-size: 1.3rem; }
.add-btn { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: .38rem .9rem; font: inherit; font-size: .8rem; font-weight: 600; color: var(--text); cursor: pointer; transition: all .15s; white-space: nowrap; }
.add-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── chips ── */
.chip { display: inline-block; background: var(--surface-2); color: var(--muted); border-radius: 6px; padding: .08rem .55rem; font-size: .72rem; font-weight: 600; }
/* chat131 — the CATEGORY badge on every product card (grid, slider, shop,
   related): a solid box in its category's STABLE accent color (the same
   color the home categories grid uses for that category — injected as
   --chipc inline from Category::accentColor()) with white text and the
   category icon, exactly like the home cat-icon boxes. Tag chips and the
   neutral info chips (sales/views/…) keep the plain .chip look. */
.chip-cat { display: inline-flex; align-items: center; gap: .3rem; background: var(--chipc, var(--primary)); color: #fff; max-width: 100%; }
.chip-cat i { font-size: .95em; line-height: 1; flex-shrink: 0; }
.chip-cat-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-tag.active, .side-list a.active { background: var(--primary-soft); color: var(--primary); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .35rem; margin-block: .5rem; }

/* ── home: hero banner — chat130 redesign: multi-format positioning ──
     deeper three-stop gradient, format chips (PSD/PDF/Word/Excel) above
     the title, and a pure-CSS layered-files art panel on the inline-end
     side (logical properties → RTL/LTR neutral). The old ::after
     «لایه‌باز» watermark is gone — the brand no longer leads with a
     layered-files-only message. Text keeps ~60% width so the art breathes. */
.hero-banner { border-radius: 20px; overflow: hidden; background: linear-gradient(118deg, #a10028 0%, var(--primary) 42%, #c084fc 100%); color: #fff; padding: 2.5rem 2.7rem 2.3rem; position: relative; box-shadow: 0 16px 46px rgba(168,85,247,.3); }
.hero-banner::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1.3px, transparent 1.4px); background-size: 16px 16px; -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.75), transparent 55%); mask-image: linear-gradient(to top, rgba(0,0,0,.75), transparent 55%); pointer-events: none; }
.hero-chips { position: relative; display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .3px; padding: .32rem .78rem; backdrop-filter: blur(3px); }
.hero-chip i { font-size: .95rem; line-height: 1; }
.hero-banner h1 { position: relative; font-size: 1.95rem; font-weight: 900; line-height: 1.65; max-width: 58%; }
.hero-banner p { position: relative; opacity: .94; margin-block: .45rem .2rem; font-size: .96rem; line-height: 1.9; max-width: 58%; }
.hero-banner .btn { position: relative; background: #fff; color: var(--primary); border: none; font-weight: 700; margin-top: .95rem; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.hero-banner .btn:hover { transform: translateY(-2px); }
/* layered-files art: three stacked sheets + two floating format chips */
.hero-art { position: absolute; top: 50%; inset-inline-end: 3.2rem; transform: translateY(-50%); width: 225px; height: 285px; pointer-events: none; }
.hero-sheet { position: absolute; inset: 0; border-radius: 15px; }
.hero-sheet-b { transform: rotate(-9deg) translate(-16px, 7px); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); }
.hero-sheet-m { transform: rotate(-3deg) translate(-7px, 3px); background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.3); }
.hero-sheet-f { transform: rotate(5deg); background: rgba(255,255,255,.95); box-shadow: 0 18px 44px rgba(0,0,0,.22); }
.hero-sheet-f::before { content: ''; position: absolute; top: 22%; inset-inline: 16%; height: 10px; border-radius: 6px; background: var(--primary); opacity: .85; }
.hero-sheet-f::after { content: ''; position: absolute; top: 38%; inset-inline: 16%; bottom: 22%; background: repeating-linear-gradient(to bottom, rgba(31,31,31,.16) 0 4.5px, transparent 4.5px 12px); border-radius: 4px; }
.hero-file-chip { position: absolute; z-index: 2; font-size: .72rem; font-weight: 900; letter-spacing: .4px; border-radius: 9px; padding: .34rem .62rem; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.hero-file-chip-psd { top: 15%; inset-inline-end: 12%; transform: rotate(7deg); background: #fff; color: var(--primary); }
.hero-file-chip-pdf { bottom: 13%; inset-inline-end: 58%; transform: rotate(-6deg); background: var(--primary); color: #fff; }

/* ── home: promo card (in product grids) — chat116 redesign: layered SVG
     art + dot-pattern + glow + white CTA pill fill the tall grid cell —
     works in RTL/LTR via logical properties, art is language-neutral ── */
.promo-card { background: linear-gradient(160deg, var(--primary), #ff6b95); border-radius: var(--radius); color: #fff; padding: 1.25rem 1.15rem 1.15rem; display: flex; flex-direction: column; min-height: 100%; position: relative; overflow: hidden; }
.promo-card::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.26) 1.3px, transparent 1.4px); background-size: 15px 15px; -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.8), transparent 62%); mask-image: linear-gradient(to top, rgba(0,0,0,.8), transparent 62%); pointer-events: none; }
.promo-card::after { content: ''; position: absolute; width: 210px; height: 210px; inset-inline-end: -75px; top: -85px; background: radial-gradient(circle, rgba(255,255,255,.26), transparent 68%); pointer-events: none; }
.promo-art { position: absolute; top: 1.15rem; inset-inline-end: 1.05rem; width: 44%; max-width: 130px; aspect-ratio: 140/108; display: block; }
.promo-art svg { width: 100%; height: 100%; overflow: visible; }
.promo-copy { position: relative; display: flex; flex-direction: column; gap: .3rem; margin-top: auto; }
.promo-copy b { font-size: 1.12rem; font-weight: 800; line-height: 1.75; }
.promo-copy span { font-size: .8rem; opacity: .92; line-height: 1.75; }
.promo-cta { position: relative; align-self: flex-start; display: inline-flex; align-items: center; gap: .3rem; background: #fff; color: var(--primary); border-radius: 999px; padding: .45rem 1.05rem; font-size: .82rem; font-weight: 700; margin-top: .85rem; transition: transform .16s, box-shadow .16s; }
.promo-cta i { font-size: 1.05rem; line-height: 1; }
[dir="rtl"] .promo-cta i { transform: scaleX(-1); }
.promo-card:hover .promo-cta { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
/* floating layers + twinkling sparkles (chat116) */
.promo-art .promo-art-f, .promo-art .promo-art-b { transform-box: fill-box; transform-origin: center; }
.promo-art .promo-art-f { animation: chat116Float 3.4s ease-in-out infinite alternate; }
.promo-art .promo-art-b { animation: chat116Float 3.4s .5s ease-in-out infinite alternate-reverse; }
.promo-art .promo-art-s1 { animation: chat116Twinkle 2.2s ease-in-out infinite; }
.promo-art .promo-art-s2 { animation: chat116Twinkle 2.2s 1.1s ease-in-out infinite; }
.promo-art .promo-art-dot { animation: chat116Twinkle 3s .4s ease-in-out infinite; }
@keyframes chat116Float { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@keyframes chat116Twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .promo-art svg * { animation: none !important; } }

/* ── home: stats bar ── */
.stats-bar { background: linear-gradient(120deg, var(--primary), #c084fc); border-radius: 14px; color: #fff; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); overflow: hidden; box-shadow: 0 8px 30px rgba(168,85,247,.22); }
.stats-bar > div { text-align: center; padding: 1.15rem .8rem; position: relative; }
.stats-bar > div:not(:last-child)::after { content: ''; position: absolute; inset-inline-end: 0; top: 25%; height: 50%; width: 1px; background: rgba(255,255,255,.25); }
.stats-bar b { display: block; font-size: 1.45rem; font-weight: 900; }
.stats-bar span { font-size: .8rem; opacity: .92; }

/* ── home: category cards — chat116: per-slug icon + per-position accent hue ── */
.cats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.cat-card { --cacc: var(--primary); position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem .8rem .95rem; display: flex; flex-direction: column; gap: .45rem; color: var(--text); transition: transform .18s, border-color .18s, box-shadow .18s; text-align: center; align-items: center; }
.cat-card::before { content: ''; position: absolute; inset-inline-start: -30px; top: -30px; width: 76px; height: 76px; border-radius: 50%; background: color-mix(in srgb, var(--cacc) 12%, transparent); transition: transform .3s; pointer-events: none; }
.cat-card:hover { border-color: var(--cacc); transform: translateY(-3px); box-shadow: 0 12px 26px color-mix(in srgb, var(--cacc) 22%, transparent); }
.cat-card:hover::before { transform: scale(2); }
.cat-icon { position: relative; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--cacc) 13%, transparent); color: var(--cacc); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; transition: background .2s, color .2s, transform .2s; }
.cat-card:hover .cat-icon { background: var(--cacc); color: #fff; transform: scale(1.08) rotate(-5deg); }
.cat-card b { font-size: .88rem; line-height: 1.65; }
.cat-count { font-size: .7rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .14rem .6rem; line-height: 1.7; }
/* 8-hue accent cycle — stable per grid position, no per-slug CSS needed */
.cats-grid > a:nth-child(8n+2) { --cacc: #7c3aed; }
.cats-grid > a:nth-child(8n+3) { --cacc: #0284c7; }
.cats-grid > a:nth-child(8n+4) { --cacc: #059669; }
.cats-grid > a:nth-child(8n+5) { --cacc: #d97706; }
.cats-grid > a:nth-child(8n+6) { --cacc: #db2777; }
.cats-grid > a:nth-child(8n+7) { --cacc: #0d9488; }
.cats-grid > a:nth-child(8n+8) { --cacc: #6366f1; }
/* chat117 — the special «countries» card: same footprint as the category
   cards but brand-gradient + white chrome, so it reads as the gateway to
   the countries hub in BOTH themes (the gradient carries its own contrast).
   Sits first in the grid; nth-child(1) keeps the default hue, overridden. */
.cat-card--countries { --cacc: #a855f7; background: linear-gradient(140deg, #a855f7 0%, #c40031 55%, #8f0023 100%); border-color: transparent; color: #fff; box-shadow: 0 10px 24px rgba(168, 85, 247, .28); }
.cat-card--countries::before { background: rgba(255, 255, 255, .10); }
.cat-card--countries .cat-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.cat-card--countries b { color: #fff; }
.cat-card--countries .cat-count { background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .92); }
.cat-card--countries:hover { border-color: rgba(255, 255, 255, .45); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(168, 85, 247, .42); }
.cat-card--countries:hover .cat-icon { background: #fff; color: #a855f7; }
.cat-card--countries:hover .cat-count { background: #fff; color: #c40031; }

/* ── home: features ── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
.feature-card .f-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.feature-card b { font-size: .9rem; }
.feature-card span { font-size: .76rem; color: var(--muted); }

/* ── home: blog cards ── */
/* chat137 — fixed 3-column posts grid (home «از وبلاگ» + /blog/ index); the
   covers are true 16:9 files (1200x675) so every card image renders an exact
   16:9 box at any column width. Collapses 3→2→1 on the breakpoints the rest
   of the site already uses (900px post-layout, 600px small screens). */
.posts-grid { grid-template-columns: repeat(3, 1fr); }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; color: var(--text); transition: all .15s; }
.post-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.post-card b { font-size: .92rem; line-height: 1.8; }
.post-card.post-card-lg { padding: 1.35rem; }
/* chat58: featured cover image on post cards (home blog section)
   chat137: now on /blog/ index boxes too; img attrs carry the real file
   size (1200x675 = exact 16:9) so intrinsic ratio always matches the box.
   height:auto is REQUIRED: without it the HTML height attribute acts as a
   presentational hint (fixed px) and aspect-ratio is ignored — images then
   render squashed instead of 16:9. */
.post-card-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
@media (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .posts-grid { grid-template-columns: 1fr; } }

/* ── shop layout ── */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.1rem; align-items: start; }
/* chat118 — short description under the shop heading when a category/tag
   filter is active (seo.{cat,tag}_intro template, localized). */
.shop-intro { margin: -0.25rem 0 1.3rem; max-width: 72ch; color: var(--muted); font-size: .93rem; line-height: 2; }
.shop-side { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 1rem; }
.shop-side h3 { font-size: .92rem; font-weight: 700; padding-inline-start: .3rem; }
.side-list { list-style: none; display: flex; flex-direction: column; gap: .1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; }
.side-list a { display: flex; justify-content: space-between; align-items: center; padding: .4rem .7rem; border-radius: 8px; color: var(--text); font-size: .86rem; }
.side-list a:hover { background: var(--surface-2); color: var(--primary); }
.side-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.search-box { display: flex; gap: .4rem; }
.search-box input { flex: 1; }
.search-wide { max-width: 430px; margin-bottom: 1rem; }
.sort-bar { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .95rem; margin-bottom: 1rem; font-size: .86rem; }
.sort-bar select { border: none; background: transparent; font: inherit; color: var(--primary); font-weight: 700; cursor: pointer; }
/* chat117 — active-filter chips (combined shop filters): one removable
   chip per active dimension (category / tag / search) + a clear-all link.
   Sits between the breadcrumb area and the sort bar. */
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1rem; }
.chip-filter { display: inline-flex; align-items: center; gap: .4rem; background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 600; line-height: 1.6; transition: background .15s, color .15s, border-color .15s; }
.chip-filter b { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-filter i { font-size: 1rem; margin-inline-start: .1rem; opacity: .75; transition: transform .15s, opacity .15s; }
.chip-filter:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip-filter:hover i { opacity: 1; transform: rotate(90deg); }
.chip-filter-clear { font-size: .78rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding-inline: .35rem; }
.chip-filter-clear:hover { color: var(--primary); }

/* ── forms ── */
label { display: block; margin-bottom: .85rem; font-weight: 600; font-size: .88rem; }
input, select, textarea { width: 100%; margin-top: .3rem; padding: .6rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"] { width: auto; margin: 0; margin-inline-start: .3rem; }
/* chat61 — radios were NOT exempted from the 100% width rule, so every radio
   option row stretched the bullet into a full-width box (broken payment
   method pickers). Same exemption as checkboxes. */
input[type="radio"] { width: auto; margin: 0; padding: 0; }
input[type="file"] { padding: .5rem; background: var(--surface-2); }
.check-label { display: flex; align-items: center; }
.qty-input { width: 68px; text-align: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.form-grid .span2 { grid-column: span 2; }

/* ── tables ── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: right; padding: .7rem .9rem; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 700; }
.table td { padding: .65rem .9rem; border-top: 1px solid var(--border); vertical-align: middle; }
.row-actions { display: flex; gap: .25rem; align-items: center; }
.inline-form { display: flex; gap: .35rem; align-items: center; }
.inline-form input { margin-top: 0; padding: .35rem .55rem; }
.w-16 { width: 64px; }

/* ── product page ── */
/* chat70 — breadcrumb v2: chip trail with chevron separators (replaces
   the raw "/" separated links). RTL flips the chevron; the current page
   is a bold non-link chip (aria-current="page"); levels above it link. */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .3rem .4rem; margin-bottom: 1.1rem;
  font-size: .8rem; line-height: 1.6;
}
.breadcrumb .crumb {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .24rem .7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  /* chat146 — responsive width: a chip grows to fill the row instead of the
     old fixed 230px cap; when it cannot fit it wraps to its own line
     (.breadcrumb is flex-wrap) and only truncates via the .crumb-name
     ellipsis when it alone is wider than the full row. Chips never go
     multi-line. */
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.breadcrumb .crumb .crumb-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb .crumb i { font-size: .95rem; flex: 0 0 auto; }
.breadcrumb a.crumb:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.breadcrumb .crumb-current { color: var(--text); font-weight: 700; background: var(--surface-2); border-color: transparent; }
.breadcrumb .crumb-sep { display: inline-flex; align-items: center; color: var(--muted); opacity: .55; font-size: 1.02rem; }
html[dir="rtl"] .breadcrumb .crumb-sep i { transform: scaleX(-1); }
@media (max-width: 768px) {
  .breadcrumb { font-size: .74rem; }
  /* chat146 — 160px cap dropped: same responsive full-row width as desktop */
  .breadcrumb .crumb { padding: .2rem .55rem; }
}
.product-detail { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; align-items: start; }
.product-detail-media { display: flex; flex-direction: column; gap: 1rem; }
.product-image-wrap { position: relative; }
.product-image-wrap > img { border-radius: var(--radius); border: 1px solid var(--border); aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.product-badges { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.feature-list { list-style: none; margin-top: 1rem; display: flex; flex-direction: column; gap: .35rem; color: var(--muted); font-size: .87rem; }
.buy-row { display: flex; align-items: end; gap: .9rem; flex-wrap: wrap; }
.buy-row label { margin: 0; }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; line-height: 2.1; }

/* ── chat80 — product info column: unified features block
       Replaces the legacy one-liner <ul.feature-list> with a 2-column
       grid of icon+text rows, six in total (download policy + 4 trust
       pillars + secure link). Lives at the BOTTOM of the info column so
       it stretches to match the image's height on desktop and stacks
       below the buy buttons on mobile. */
.features-block { margin-top: 1.2rem; padding: 1rem 1.1rem; background: var(--surface-2, #f6f6f6); border: 1px solid var(--border); border-radius: 12px; }
.features-title { display: flex; align-items: center; gap: .5rem; font-size: .98rem; font-weight: 800; color: var(--text); margin-bottom: .8rem; }
.features-title i { color: var(--primary); font-size: 1.15rem; }
.features-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .9rem; }
.features-list li { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--text); line-height: 1.5; }
.features-list li i { color: var(--primary); font-size: 1.05rem; flex-shrink: 0; }
.features-list li span { min-width: 0; }

/* ── product media column: what's included (file list with sizes) ── */
.whats-included { background: var(--surface-2, #f6f6f6); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; margin-top: 1.2rem; }
.wi-title { display: flex; align-items: center; gap: .5rem; font-size: .95rem; font-weight: 800; color: var(--text); margin-bottom: .55rem; }
.wi-title i { color: var(--primary); font-size: 1.1rem; }
.wi-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.wi-row { position: relative; flex-wrap: wrap; }
.wi-list li { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 8px; font-size: .82rem; }
.wi-list li i { color: var(--muted); font-size: 1rem; flex-shrink: 0; }
.wi-list .wi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.wi-list .wi-size { flex-shrink: 0; }

/* chat81 — ZIP row is clickable, with a caret that rotates when expanded. */
.wi-toggle { cursor: pointer; user-select: none; transition: background .12s, border-color .12s; }
.wi-toggle:hover { border-color: var(--primary); background: var(--primary-soft, #f5f3ff); }
.wi-toggle > i:first-child { color: var(--primary, #a855f7); }
.wi-caret { transition: transform .18s ease; color: var(--muted); }
.wi-toggle[aria-expanded="true"] .wi-caret { transform: rotate(180deg); color: var(--primary); }
.wi-toggle[aria-expanded="true"] { border-color: var(--primary); }

/* Dropdown panel: file list inside the ZIP, revealed on click.
   min-width:0 + max-width:100% on the flex item, and overflow-x:auto on
   the inner tree, mean long filenames scroll INSIDE the panel instead of
   pushing the parent row wider. */
.wi-zip-panel { flex-basis: 100%; min-width: 0; max-width: 100%; background: var(--surface-3, #fafafa); padding: .55rem .55rem .7rem; max-height: 360px; overflow: hidden; display: flex; flex-direction: column; }
.wi-zip-panel[hidden] { display: none; }
.wi-zip-loading { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.wi-zip-loading .ri-spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.wi-zip-summary { display: flex; align-items: center; gap: .5rem; margin: 0 .25rem .45rem; color: var(--muted); font-size: .76rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.wi-zip-summary i { color: var(--primary); }
.wi-zip-summary .wi-zip-truncated { color: var(--warn, #d97706); font-size: .72rem; }

/* Tree view — Plex-style. Real connector lines (not just a left border
   on the parent ul) so siblings are visually chained. inline-start
   properties auto-mirror for RTL, no left/right hardcoded anywhere.
   Layout per level: 0.55rem center + 0.95rem row offset = 1.5rem indent. */
.wi-zip-tree { font-family: ui-monospace, SFMono-Regular, Menlo, Menlo, monospace; font-size: .82rem; line-height: 1.7; overflow-x: auto; overflow-y: auto; min-width: 0; max-width: 100%; }
.wi-zip-tree, .wi-zip-tree ul { list-style: none; padding: 0; margin: 0; }
.wi-zip-tree ul { padding-inline-start: 1.5rem; }

/* Tree view — Plex-style connector lines. We build the tree as
   <ul><li><span.row>icon+name</span><ul>...</ul></li></ul>. The vertical
   line on each li is the standard "│" connector, the ::after on each
   li is the "─" connector going from the vertical line to the row.
   Last li gets a half-height line so it forms an "└" shape. Root
   children get no connectors (they're siblings at the top level).
   ── Geometry: 0.5rem center + 1rem row offset = 1.5rem indent.
   Row content has 1.45rem inline-end padding so it starts AFTER the
   line + connector and doesn't overlap them. */
.wi-zip-tree { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; line-height: 1.7; overflow-x: auto; overflow-y: auto; min-width: 0; max-width: 100%; }
.wi-zip-tree, .wi-zip-tree ul { list-style: none; padding: 0; margin: 0; }
.wi-zip-tree ul { padding-inline-start: 1.5rem; }

.wi-zip-tree li { position: relative; padding: 0; background: none !important; border: none !important; border-radius: 0 !important; display: block !important; flex: none !important; align-items: normal !important; gap: 0 !important; }
.wi-zip-tree li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0, 0, 0, .5);
  border-radius: 1px;
}
.wi-zip-tree li::after {
  content: '';
  position: absolute;
  inset-inline-start: 0.5rem;
  top: 1.05rem;
  width: 0.95rem;
  height: 2px;
  background: rgba(0, 0, 0, .5);
  border-radius: 1px;
}
.wi-zip-tree li:last-child::before { bottom: auto; height: 1.05rem; }
.wi-zip-tree > li::before, .wi-zip-tree > li::after { display: none; }

/* Row layout — flex with the icon at the inline-end (right in RTL).
   Higher specificity than .wi-list li to win the padding fight. */
.wi-zip-tree .wi-tree-row { display: flex !important; align-items: center; gap: .5rem; padding: .15rem 0 !important; padding-inline-start: 1.45rem !important; padding-inline-end: .15rem !important; border: none !important; border-radius: 4px; min-width: max-content; }
.wi-zip-tree .wi-tree-row:hover { background: rgba(0, 0, 0, .04); }
.wi-zip-tree .wi-tree-icon { color: var(--muted); font-size: 1rem; flex-shrink: 0; width: 1.1rem; text-align: center; line-height: 1; }
.wi-zip-tree .wi-tree-dir > .wi-tree-row > .wi-tree-icon { color: var(--primary); }
.wi-zip-tree .wi-tree-name { flex: 1; color: var(--text); white-space: nowrap; }
.wi-zip-tree .wi-tree-dir > .wi-tree-row > .wi-tree-name { font-weight: 600; }
.wi-zip-tree .wi-tree-size { flex-shrink: 0; color: var(--muted); font-size: .72rem; padding-inline-start: .75rem; }

/* Dark mode */
html[data-theme="dark"] .wi-zip-tree li::before,
html[data-theme="dark"] .wi-zip-tree li::after { background: rgba(255, 255, 255, .55); }
html[data-theme="dark"] .wi-zip-tree .wi-tree-row:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .wi-zip-tree .wi-tree-dir > .wi-tree-row > .wi-tree-icon { color: var(--primary); }
.wi-zip-error { color: var(--err, #dc2626); display: flex; align-items: center; gap: .45rem; font-size: .8rem; padding: .4rem .6rem; }
.wi-zip-empty { color: var(--muted); font-size: .8rem; padding: .4rem .6rem; }
@media (max-width: 600px) {
  .features-list { grid-template-columns: 1fr; }
  .wi-zip-tree { font-size: .76rem; }
  .wi-zip-tree ul { padding-inline-start: 1.15rem; }
  .wi-zip-panel { max-height: 260px; }
}

/* ── comments ── */
.comment-form textarea { margin-bottom: .6rem; }
.comments { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.2rem; }
.comment-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .3rem; }

/* ── cart/checkout ── */
.cart-summary { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; flex-wrap: wrap; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.3rem; }
.cart-total { font-size: 1.05rem; }
.cart-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.checkout-stack { display: flex; flex-direction: column; gap: 1.2rem; max-width: 720px; margin-inline: auto; }
.checkout-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.2rem; align-items: start; }
.order-summary-compact { padding: 0.9rem 1.1rem; }
.order-summary-compact h3 { font-size: 1rem; margin: 0 0 0.6rem; padding: 0; border: 0; }
.sum-row { display: flex; justify-content: space-between; padding-block: .35rem; font-size: .9rem; }
.sum-row.total { font-size: 1.05rem; border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .8rem; font-weight: 800; }

/* ── status pills ── */
.status { display: inline-block; padding: .12rem .7rem; border-radius: 6px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.err { background: var(--err-soft); color: var(--err); }
.status.warn { background: var(--warn-soft); color: var(--warn); }

/* ── misc ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.empty-state { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 3rem 1rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: .8rem; align-items: center; }
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.6rem; flex-wrap: wrap; }
.pagination a { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; }
.pagination a.active, .pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.big-icon { font-size: 3rem; margin-bottom: .5rem; }
.dl-list { display: flex; flex-direction: column; margin-block: .8rem; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.dl-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; color: var(--text); }
.dl-item:hover { border-color: var(--primary); }
.dl-item.expired { opacity: .55; }
.account-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.2rem; align-items: start; margin-bottom: 1.2rem; }
.post-cover { border-radius: var(--radius); margin-block: 1rem; border: 1px solid var(--border);
  display: block; width: 100%; height: auto; object-fit: contain; }
.thumb-preview { max-height: 90px; border-radius: 8px; margin-block: .4rem; border: 1px solid var(--border); width: auto; }
.plain-list { padding-inline-start: 1.2rem; }

/* ── footer ── */
.site-footer { background: var(--footer-bg); border-top: 1px solid #ffd6e0; margin-top: 2.5rem; }
/* chat81 — 4 footer columns: brand + quick links + tools + trust/second */
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding-block: 2.2rem; }
/* chat70 — a11y: footer column titles are <p> now (h4 skipped heading
   levels), so the h4 selector stays only as a legacy fallback. */
.footer-inner h4, .footer-inner .footer-heading { font-weight: 800; margin-bottom: .8rem; font-size: .95rem; color: var(--text); }
.footer-inner nav { display: flex; flex-direction: column; gap: .45rem; font-size: .86rem; }
.footer-inner nav a { color: var(--muted); }
.footer-inner nav a:hover { color: var(--primary); }
.footer-news { display: flex; gap: .4rem; margin-top: .8rem; }
.footer-news input { background: var(--surface); }
.footer-news .btn { border-radius: 8px; }
.footer-badge { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 1.6rem; }
.footer-bottom { background: var(--primary); color: #fff; text-align: center; padding-block: .65rem; font-size: .8rem; }

/* ── chat70: cookie consent banner (first-visit notice) ──
   Physical RIGHT corner on purpose: the chat launcher sits at the
   physical left bottom (chat-widget.css), so the two never overlap in
   either direction. Mobile goes full-width above it (dismissed once). */
.cookie-consent {
  position: fixed; bottom: 18px; right: 18px;
  z-index: 9995;
  max-width: 430px; width: calc(100vw - 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: .9rem 1rem;
  animation: ccIn .28s ease;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent.cc-out { opacity: 0; transform: translateY(10px); transition: opacity .22s ease, transform .22s ease; }
.cookie-consent-inner { display: flex; flex-direction: column; gap: .55rem; }
.cookie-consent-icon { font-size: 1.35rem; color: var(--primary); }
.cookie-consent-text { font-size: .82rem; color: var(--text); line-height: 1.8; margin: 0; }
.cookie-consent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-consent-actions .btn { flex: 1 1 auto; justify-content: center; }
@keyframes ccIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 768px) {
  .cookie-consent { bottom: 12px; right: 12px; left: 12px; width: auto; max-width: none; }
}

/* ── admin ── */
.admin-body { background: var(--surface-3); }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { background: var(--surface); border-inline-end: 1px solid var(--border); padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-brand { font-weight: 900; color: var(--text); }
.admin-brand span { display: block; font-size: .76rem; color: var(--muted); font-weight: 600; }
.admin-nav { display: flex; flex-direction: column; gap: .15rem; }
.admin-nav a { color: var(--muted); padding: .5rem .8rem; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.admin-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.admin-side-footer { margin-top: auto; display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; }
.admin-main { padding: 1.6rem 1.8rem; }
.admin-main h1 { margin-bottom: 1.1rem; }
.admin-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.1rem; align-items: start; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.4rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; text-align: center; }
.stat-card b { display: block; font-size: 1.3rem; color: var(--primary); }
.stat-card span { color: var(--muted); font-size: .8rem; }
.stat-card.warn b { color: var(--warn); }
.stat-card.accent b { font-size: 1rem; }
.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-tabs a { padding: .3rem .85rem; border-radius: 8px; border: 1px solid var(--border); font-size: .84rem; font-weight: 600; color: var(--muted); background: var(--surface); }
.filter-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.comment-admin { margin-bottom: .8rem; }
.admin-login-box { max-width: 380px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2.2rem; box-shadow: var(--shadow); }
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(60% 50% at 50% 0%, var(--primary-soft), transparent), var(--surface-3); }
.admin-login-logo { height: 64px; margin: 0 auto 1rem; display: block; }
.admin-login-box h1 { text-align: center; font-size: 1.15rem; margin-bottom: 1.2rem; }
.admin-login-box h1 i { color: var(--primary); }
.admin-login-back { display: block; text-align: center; margin-top: 1rem; font-size: .84rem; color: var(--muted); }
.admin-login-back:hover { color: var(--primary); }

/* ── responsive ── */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 900px) {
  .shop-layout, .admin-shell, .product-detail, .checkout-grid, .account-grid, .admin-cols { grid-template-columns: 1fr; }
  /* chat35 — on single-column layouts the shop sidebar must NOT stay
     sticky: cards scrolled "under" the pinned aside and overlapped it.
     Reset to static so the aside is just the first block of the page. */
  .shop-side { position: static; top: auto; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .header-inner { flex-wrap: wrap; }
  .hero-banner h1 { font-size: 1.4rem; }
  /* chat130 — the layered art (which replaced the old ::after watermark)
     gives way on narrow screens so the text spans full width */
  .hero-art { display: none; }
  .hero-banner h1, .hero-banner p { max-width: none; }
  .hero-banner { padding: 1.9rem 1.4rem 1.7rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  /* chat38 FIX — the old rule targeted a DESCENDANT of .topbar-links
     (space between the two classes), but .hide-mobile sits on the group
     element itself, so the rule never matched: the whole topbar stayed
     visible on phones and overflowed, causing horizontal scroll. */
  .topbar-links.hide-mobile { display: none; }
  .topbar-links { gap: .8rem; }
  .topbar-inner { gap: .3rem .6rem; }
  /* long account names / emails must truncate, not push the layout */
  .topbar-auth a { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* product page on mobile: tighter padding, smaller grids */
  .product-detail { gap: 1rem; padding: 1rem; }
  .product-image-wrap > img { aspect-ratio: 1/1; }
  .features-block, .whats-included { padding: .85rem .95rem; }
  .features-list { grid-template-columns: 1fr 1fr; gap: .45rem .6rem; }
}
@media (max-width: 480px) {
  .features-list { grid-template-columns: 1fr; }
  .wi-list .wi-size { display: none; }  /* tighten on phones */
}

/* ── icon polish (Remix Icon) ── */
i[class^="ri-"], i[class*=" ri-"] { vertical-align: middle; line-height: 1; }
.empty-icon { font-size: 2.6rem; color: var(--primary); opacity: .6; }
.cart-product { display: flex; align-items: center; gap: .7rem; }
.cart-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.footer-logo { height: 52px; margin-bottom: .6rem; }
.badge i, .btn i { font-size: 1em; }
.header-search button { font-size: 1.15rem; color: var(--muted); }
.cats-btn i { font-size: 1.1em; }
.cart-btn i { font-size: 1.15rem; }
.section-title i { color: var(--primary); font-size: 1.15rem; }

/* Laravel app additions */
.link-btn { background: none; border: none; color: #cfcfcf; font: inherit; cursor: pointer; padding: 0; }
.link-btn:hover { color: #fff; }
.maintenance-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 50% at 50% 0%, #f5f3ff, transparent), #fafafa; padding: 1.5rem; }
.maintenance-box { max-width: 460px; width: 100%; text-align: center; background: #fff; border: 1px solid #eee; border-radius: 20px; padding: 3rem 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.maintenance-brand { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.6rem; }
.maintenance-brand img { height: 52px; }
.maintenance-brand b { font-size: 1.5rem; font-weight: 900; }
.maintenance-brand b span { color: #a855f7; }
.maintenance-gear { font-size: 3rem; display: inline-block; animation: mspin 4s linear infinite; margin-bottom: 1rem; color: #a855f7; }
@keyframes mspin { to { transform: rotate(360deg); } }
.maintenance-box h1 { font-size: 1.35rem; font-weight: 900; margin-bottom: .6rem; }
.maintenance-box p { color: #777; font-size: .95rem; line-height: 2; }
.maintenance-dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #a855f7; margin: 1.4rem .18rem 0; animation: mblink 1.4s infinite; }
.maintenance-dots span:nth-child(2) { animation-delay: .2s; }
.maintenance-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes mblink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
.maintenance-box small { display: block; margin-top: 1.8rem; color: #aaa; font-size: .78rem; }
/* product image from storage */
.product-thumb img { object-fit: cover; }
.pagination-wrap { display: flex; justify-content: center; margin-top: 1.6rem; }
.pagination-wrap .pagination a, .pagination-wrap .pagination span {
    min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    margin-inline: .15rem; padding-inline: .5rem; font-size: .85rem;
}
.pagination-wrap .pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── CKEditor 5 rich-content output (posts + product descriptions) ── */
.prose-html figure.image { margin: 1rem 0; text-align: center; }
.prose-html figure.image img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.prose-html figure.image figcaption,
.prose-html figcaption { font-size: .78rem; color: var(--muted); margin-top: .4rem; text-align: center; }
.prose-html img { max-width: 100%; height: auto; }
.prose-html figure.table { margin: 1rem 0; overflow-x: auto; }
.prose-html table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.prose-html table td, .prose-html table th { border: 1px solid var(--border); padding: .45rem .65rem; text-align: right; }
.prose-html table th { background: var(--surface-2); font-weight: 700; }
.prose-html pre { background: #1e293b; color: #e2e8f0; border-radius: 10px; padding: .9rem 1.1rem; overflow-x: auto; direction: ltr; text-align: left; font-size: .82rem; line-height: 1.8; }
.prose-html pre code { background: transparent; color: inherit; padding: 0; }
.prose-html code { background: var(--surface-2); border-radius: 6px; padding: .1rem .35rem; font-size: .85em; direction: ltr; display: inline-block; }
.prose-html blockquote { border-inline-start: 3px solid var(--primary); background: var(--surface-3); border-radius: 10px; padding: .6rem 1rem; margin: 1rem 0; color: var(--muted); }
.prose-html hr { border: none; border-top: 1px solid var(--border); margin: 1.4rem 0; }
.prose-html .media { text-align: center; margin: 1rem 0; }
.prose-html .image-style-align-left { float: left; margin-inline-end: 1rem; max-width: 50%; }
.prose-html .image-style-align-right { float: right; margin-inline-start: 1rem; max-width: 50%; }
.prose-html .image-style-align-center { margin-inline: auto; display: table; }

/* ═══════════════════════════════════════════════════════════
   Theme customizer additions — menus with dropdowns, categories
   panel, announcement bar, social links (managed from /admin/theme)
   ═══════════════════════════════════════════════════════════ */

/* NOTE: no overflow-x on .nav-links — it clips the absolutely-positioned
   dropdowns (see the :root override below is NOT enough; this replaces the
   original rule at line ~93 which we cannot remove in an append-only file). */
:root .nav-links { overflow-x: visible; flex-wrap: wrap; }

/* open state (touch / click toggling from app.js) */
.nav-item.open > .nav-dropdown { opacity: 1; visibility: visible; transform: none; }
.nav-item.open > a .nav-caret { transform: rotate(180deg); color: var(--primary); }

/* ── nav dropdowns (2-level menus from فهرست‌ها) ── */
.nav-links { flex-wrap: wrap; }
.nav-item { display: inline-flex; position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: .28rem; color: var(--text); font-size: .88rem; font-weight: 500; padding: .25rem .2rem; white-space: nowrap; }
.nav-item > a:hover { color: var(--primary); }
.nav-item > a i[class^="ri-"]:first-child { color: var(--primary); font-size: 1.05rem; }
.nav-caret { font-size: 1rem; color: var(--muted); transition: transform .18s ease; }
.nav-item:hover .nav-caret { transform: rotate(180deg); color: var(--primary); }
.nav-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-hover); padding: .45rem; z-index: 130;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-item:hover > .nav-dropdown, .nav-item:focus-within > .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown a { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 8px; color: var(--text); font-size: .84rem; white-space: nowrap; }
.nav-dropdown a i[class^="ri-"] { color: var(--primary); font-size: 1.05rem; }
.nav-dropdown a:hover { background: var(--surface-2); color: var(--primary); }

/* ── categories panel attached to «همه دسته‌بندی‌ها» button ── */
.cats-wrap { position: relative; }
.cats-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 260px; max-width: 320px;
  max-height: min(420px, 60vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-hover); padding: .45rem; z-index: 140;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.cats-wrap:hover > .cats-panel,
.cats-wrap:focus-within > .cats-panel,
.cats-wrap.open > .cats-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.cats-panel a {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem;
  border-radius: 8px; color: var(--text); font-size: .84rem; white-space: nowrap;
}
.cats-panel a i { color: var(--primary); font-size: 1.05rem; }
.cats-panel a:hover { background: var(--surface-2); color: var(--primary); }
.cats-panel .cats-panel-all { font-weight: 700; border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; margin-bottom: .3rem; }

/* ── announcement bar ── */
.announce-bar { background: linear-gradient(90deg, var(--primary-dark), var(--primary)); color: #fff; font-size: .82rem; }
.announce-inner { display: flex; align-items: center; justify-content: center; gap: .45rem; padding-block: .45rem; }
.announce-inner a, .announce-inner span { color: #fff; font-weight: 600; text-decoration: none; }
.announce-inner a:hover { text-decoration: underline; }
.announce-inner i { font-size: 1rem; }

/* ── footer social links ── */
.footer-socials { display: flex; align-items: center; gap: .5rem; margin-top: .9rem; }
.footer-socials a {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 1.15rem;
  transition: all .16s ease;
}
.footer-socials a:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); }
/* chat145 — footer social networks: muted section label + Telegram brand
   tint on the locale-aware channel button (fa → @digivirtual_ir, every
   other locale → @digivirtual_en). The generic hover rule above still
   flips the button to the brand primary. Works light AND dark theme:
   #229ed9 is a mid-tone that reads on both surfaces. */
.footer-socials-label { font-size: .8rem; color: var(--muted); }
.footer-socials a.footer-social-tg { color: #229ed9; }

/* ── header/logo options from theme settings ── */
.site-header.header-static { position: static; }
.brand-mark-img { object-fit: contain; }

/* ── mobile: only the nav bar stays pinned (chat81) ──
   app.js sets the sticky header's `top` offset to -(header-inner
   height) on phones, so everything above .main-nav scrolls away
   NATURALLY and once you scroll past it the nav row alone sits at the
   viewport top — a real sticky offset, no animated collapse. The old
   nav-collapsed hide/show rules were removed with this change. */
@media (max-width: 768px) {
  :root .nav-links { overflow-x: visible; }
  .cats-panel { right: 0; left: auto; min-width: 250px; }
  .nav-dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none;
    background: transparent; padding: 0 .8rem; }
  .nav-dropdown a { padding: .3rem .4rem; color: var(--muted); }
  .nav-caret { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   Site pagination (replaces Laravel's Tailwind default) — RTL,
   Persian numerals, theme colors. Used by partials/pagination.
   ═══════════════════════════════════════════════════════════ */
.site-pagination { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: 1.6rem; }
.pagination-info { font-size: .8rem; color: var(--muted); margin: 0; }
.pagination { display: flex; align-items: center; gap: .3rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; justify-content: center; }
.pagination li { display: inline-flex; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: .86rem; font-weight: 600; padding-inline: .55rem; transition: all .15s ease;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.pagination a i, .pagination span i { font-size: 1.15rem; color: inherit; }
.pagination span.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination li.disabled span { opacity: .45; cursor: not-allowed; }
.pagination .dots { border: none; background: transparent; min-width: 24px; opacity: .6; }

/* ── hierarchical shop sidebar ── */
.side-list .side-group > a { font-weight: 700; }
.side-list .side-group ul { list-style: none; padding-inline-start: 1rem; margin: .25rem 0 .35rem; display: flex; flex-direction: column; gap: .2rem; }
.side-list .side-group ul a { font-size: .84rem; color: var(--muted); }
.side-list .side-group ul a:hover, .side-list .side-group ul a.active { color: var(--primary); }

/* ═══ chat11: discount badges + product files + account download files ═══ */
.badge-off { background: #ef4444; color: #fff; }
.off-chip { display: inline-block; background: #ef4444; color: #fff; font-weight: 800; font-size: .8rem; padding: .2rem .75rem; border-radius: 8px; width: fit-content; margin-bottom: .35rem; }
.price-lg s.muted { font-size: 1rem; }
.files-note { display: flex; align-items: center; gap: .45rem; background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; border-radius: 8px; padding: .5rem .8rem; font-size: .88rem; margin: .8rem 0 .35rem; }
.files-note i { color: #0284c7; }
ul.files-list { list-style: none; margin: .3rem 0 .9rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
ul.files-list li { display: flex; align-items: center; gap: .5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .75rem; font-size: .88rem; }
ul.files-list li i { color: var(--primary); }
.dl-item-head { display: flex; flex-direction: column; gap: .15rem; }
.dl-files { display: flex; flex-direction: column; gap: .4rem; margin-top: .55rem; }
.dl-file { display: flex; align-items: center; gap: .55rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .8rem; text-decoration: none; color: var(--text); font-size: .9rem; transition: all .15s; }
.dl-file:hover { border-color: var(--primary); color: var(--primary); }
.dl-file i { color: var(--primary); }
.dl-file small { margin-inline-start: auto; color: var(--muted); }
.dl-item.expired .dl-file { pointer-events: none; opacity: .6; }

/* ── chat40: country flag badge (circular, bottom-left of product thumbs) ── */
.product-thumb { position: relative; }
.flag-badge {
  position: absolute; bottom: 10px; left: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  display: flex; align-items: center; justify-content: center;
  z-index: 2; pointer-events: none;
}
.flag-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-detail-media { position: relative; }
/* chat57: owner-approved values — 72px badge, lifted off the frame edge (bottom 48px) */
.product-detail-media .flag-badge { width: 72px; height: 72px; bottom: 48px; left: 16px; }
@media (max-width: 640px) {
  .flag-badge { width: 28px; height: 28px; bottom: 8px; left: 8px; border-width: 2px; }
  .product-detail-media .flag-badge { width: 72px; height: 72px; bottom: 36px; left: 12px; }
}

/* ── chat41: countries directory page (/countries) ── */
.countries-hero { margin-bottom: 1.6rem; }
.countries-subtitle { margin: .2rem 0 1rem; font-size: .95rem; }
.countries-search { position: relative; display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .55rem 1rem; max-width: 420px; box-shadow: var(--shadow); }
.countries-search i { color: var(--muted); font-size: 1.05rem; }
.countries-search input { border: 0; background: none; outline: none; font: inherit; color: var(--text); flex: 1; min-width: 0; }
.countries-search input::placeholder { color: var(--muted); }
.countries-search-count { font-size: .8rem; white-space: nowrap; }
.countries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.country-card { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem .6rem .9rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
.country-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-hover); }
.country-flag { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); display: flex; align-items: center; justify-content: center; background: var(--surface-2); flex: none; }
.country-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.country-flag-empty i { font-size: 1.6rem; color: var(--muted); }
.country-name { font-weight: 700; font-size: .88rem; line-height: 1.4; }
.country-count { font-size: .75rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .12rem .6rem; }
.country-count.has { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.country-card.none { opacity: .72; }
.country-card.none:hover { opacity: 1; }
@media (max-width: 640px) {
  .countries-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
  .country-flag { width: 44px; height: 44px; }
  .country-name { font-size: .8rem; }
  .countries-search { max-width: 100%; }
}

/* ── chat36: security-code captcha + honeypot ── */
.captcha-field { margin: .5rem 0 .2rem; }
.captcha-field > label { display: block; font-weight: 600; }
.captcha-row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: .35rem; }
.captcha-row img { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; height: 60px; width: 170px; background: var(--surface-2, #f4f5f7); cursor: pointer; flex: none; }
.captcha-row input { max-width: 140px; min-width: 110px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.captcha-refresh { background: none; border: none; padding: .25rem 0; margin-top: .25rem; color: var(--muted, #6b7280); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline dotted; }
.captcha-refresh:hover { color: var(--primary, #a855f7); }
/* the hidden honeypot field — visually hidden but in the DOM so bots
   still fill it. Uses clip-path + 1×1 size (W3C sr-only pattern) so it
   does NOT push the body horizontally the way `left: -9999px` did (chat78
   fix — Firefox + mobile browsers scrolled the whole page 9999px to the
   left when a comment form was on the page, i.e. every product / blog). */
.hp-field { position: absolute !important; left: 0 !important; top: 0 !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; pointer-events: none !important; }

/* ── chat56: blog promo banner under the posts grid (moved from latest-products)
     chat116 — redesigned: copy + CTA pill inline-start, quill art inline-end ── */
.promo-card.blog-promo { flex-direction: row; align-items: center; justify-content: flex-start; gap: 1.2rem; margin-top: 1.2rem; min-height: 0; padding: 1.35rem 1.5rem; }
.promo-card.blog-promo .promo-art { position: relative; top: auto; inset-inline-end: auto; width: 96px; max-width: 96px; flex-shrink: 0; margin-inline-start: auto; }
.promo-card.blog-promo .promo-copy { margin-top: 0; }
.promo-card.blog-promo .promo-cta { margin-top: .6rem; }

/* ── chat57: product image lightbox — click featured image to preview at full size ── */
.product-detail-media > img { cursor: zoom-in; }
.product-detail-media > img:hover { filter: brightness(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 999; background: rgba(8, 9, 12, .92); display: flex; align-items: center; justify-content: center; padding: 28px; cursor: zoom-out; animation: lbIn .18s ease; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1080px, 94vw); max-height: 92vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 18px 70px rgba(0, 0, 0, .55); }
.lightbox-close { position: absolute; top: 12px; inset-inline-end: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }


/* ===== chat78 — language + currency switcher (moved from the layout
   view; identical rules) ===== */
.lang-switcher { position: relative; display: inline-block; }
.lang-trigger {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #ffffff !important; font: inherit; font-size: .85rem;
  cursor: pointer; line-height: 1.6;
  transition: background .15s, border-color .15s;
}
.lang-trigger:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.42); color: #ffffff !important; }
.lang-trigger .lang-current-name { font-weight: 500; color: #ffffff; }
.lang-trigger .lang-caret { font-size: 1rem; opacity: .85; transition: transform .2s; color: #ffffff; }
.lang-trigger[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-dropdown {
  position: absolute; top: calc(100% + .35rem); inset-inline-start: 0;
  min-width: 180px; max-width: 90vw;
  max-height: min(60vh, 26rem); overflow-y: auto;  /* chat26: 30 languages — scroll */
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  padding: .35rem 0; margin: 0; list-style: none;
  z-index: 1000;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.lang-dropdown[hidden] { display: none; }
.lang-dropdown li { margin: 0; }
.lang-option {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .85rem;
  color: var(--text, #111827) !important; text-decoration: none;
  font-size: .9rem; line-height: 1.4;
  transition: background .12s;
}
.lang-option:hover, .lang-option:focus { background: var(--surface-2, #f3f4f6); color: var(--primary, #a855f7) !important; }
.lang-option.active { color: var(--primary, #a855f7) !important; font-weight: 600; background: var(--primary-soft, #f5f3ff); }
.lang-check { font-size: 1rem; flex: 0 0 1.1rem; color: var(--primary, #a855f7); }
.lang-check.invisible { visibility: hidden; }
.lang-option-name { flex: 1; color: inherit; }
.lang-option-code { font-size: .75rem; color: var(--muted, #6b7280); font-weight: 600; letter-spacing: .04em; }

/* RTL/LTR adjustments */
html[dir="rtl"] .lang-trigger { font-size: .9rem; }
html[dir="rtl"] .lang-dropdown { inset-inline-start: 0; right: auto; }

/* Mobile: dropdown goes full-width-ish below trigger */
@media (max-width: 768px) {
  .lang-dropdown { min-width: 160px; }
  /* chat38: anchor the dropdown to the inline-END edge of its trigger so it
     grows toward the viewport center — the controls sit at the topbar edge,
     a start-anchored dropdown could overflow the screen edge on phones. */
  .lang-dropdown { inset-inline-start: auto; inset-inline-end: 0; }
}


/* ── header live-search (chat82) ─────────────────────────────────────
   The search input is wrapped in .header-search-wrap; the floating
   dropdown panel is .header-search-dropdown. JS in /assets/js/header.js
   drives it (debounced fetch → JSON → render). Position: absolute
   under the form, full-width, sticks to the input on scroll.
   ─────────────────────────────────────────────────────────────────── */
.header-search-wrap { position: relative; flex: 1; max-width: 480px; }
.header-search-dropdown {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  top: calc(100% + .35rem);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e6e6e6);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  z-index: 100;
  max-height: 70vh;
  overflow-y: auto;
  padding: .35rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.header-search-dropdown[hidden] { display: none; }
.hsd-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .6rem;
  border-radius: 8px;
  color: var(--text, #333);
  text-decoration: none;
  transition: background .12s ease;
}
.hsd-item:hover, .hsd-item:focus-visible { background: var(--surface-2, #f6f6f6); }
.hsd-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--surface-2, #f6f6f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #8b8b8b);
  font-size: 1.2rem;
}
.hsd-thumb-empty { border: 1px solid var(--border, #e6e6e6); }
.hsd-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hsd-title {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.hsd-price {
  font-size: .75rem;
  color: var(--muted, #8b8b8b);
  margin-top: 2px;
}
.hsd-loading, .hsd-empty, .hsd-hint {
  padding: .8rem .6rem;
  font-size: .85rem;
  color: var(--muted, #8b8b8b);
  text-align: center;
}
.hsd-loading { display: flex; align-items: center; justify-content: center; gap: .4rem; }
.hsd-loading .ri-spin { animation: spin 1s linear infinite; }
.hsd-footer {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .6rem;
  margin-top: 2px;
  border-top: 1px solid var(--border, #e6e6e6);
  border-radius: 0 0 8px 8px;
  font-size: .82rem;
  color: var(--primary, #a855f7);
  font-weight: 600;
  text-decoration: none;
}
.hsd-footer:hover { background: var(--surface-2, #f6f6f6); }
.hsd-footer .muted { color: var(--muted, #8b8b8b); font-weight: 400; }
@media (max-width: 600px) {
  .header-search-wrap { max-width: none; }
  .header-search-dropdown { max-height: 60vh; }
  .hsd-title { max-width: 220px; }
  .hsd-thumb { width: 36px; height: 36px; }
}


/* ── chat88 — country-flag chips in the language switcher ──
     The flags reuse the countries directory's square SVG set
     (/storage/flags/*.svg, flag-icons 512×512). They render as small
     rounded squares so no flag design gets cropped; the .lang-flag-none
     globe placeholder keeps row alignment for unmapped languages. The
     inset ring guarantees contrast on the dark topbar pill and on light
     dropdown surfaces alike. ── */
.lang-flag {
  width: 16px; height: 16px;
  object-fit: cover;
  border-radius: 2.5px;
  flex: 0 0 16px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
  background: var(--surface-2, #f3f4f6);
  display: inline-block;
  vertical-align: middle;
}
.lang-flag-none {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted, #6b7280);
}
.lang-flag-none i { font-size: .72rem; line-height: 1; }
/* Slightly larger chip inside the trigger pill for visual weight next
   to the .85rem label; dropdown rows keep the compact 16px chip. */
.lang-trigger .lang-flag { width: 16px; height: 16px; flex-basis: 16px; }
@media (max-width: 768px) {
  .lang-flag { flex: 0 0 15px; width: 15px; height: 15px; }
}

/* ── chat93: tools hub (/tools) + custom-pages blocks ── */
.tools-page { max-width: 1160px; }
.tools-hero { margin-bottom: 1.6rem; }
.tools-subtitle { margin: .2rem 0 1rem; font-size: .95rem; max-width: 760px; }
.tools-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.tools-badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: .32rem .8rem; font-size: .78rem; font-weight: 700; }
.tools-badge i { font-size: .95rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.tool-card { display: flex; flex-direction: column; gap: .55rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.2rem 1.05rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-hover); }
.tool-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.55rem; flex: none; }
.tool-name { font-weight: 800; font-size: 1rem; line-height: 1.5; }
.tool-desc { font-size: .83rem; color: var(--muted); line-height: 1.65; }
.tool-cta { margin-top: auto; padding-top: .5rem; font-size: .8rem; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: .3rem; }
.tool-cta i { transition: margin .15s ease; }
.tool-card:hover .tool-cta i { margin-inline-start: .3rem; }
/* footer «ابزارها» heading became a link to the hub (chat93) */
.footer-heading-link { text-decoration: none; }
.footer-heading-link:hover { text-decoration: underline; }
/* optional rich-content block on the custom pages (chat93) */
.custom-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-top: 1.7rem; }
.custom-content h2 { font-size: 1.08rem; margin: 1.1rem 0 .5rem; }
.custom-content h3 { font-size: .98rem; margin: 1rem 0 .4rem; }
.custom-content a { color: var(--primary); }
@media (max-width: 640px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tool-card { padding: 1.05rem 1rem .9rem; }
  .tool-icon { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 12px; }
  .tools-subtitle { font-size: .88rem; }
}

/* ── chat102: product gallery — WordPress-style thumbnails under the cover image.
     Per-language with group inheritance; clicking a thumb swaps the main image
     (product.js) and the lightbox follows. Also fixes the zoom cursor that the
     old `.product-detail-media > img` rule never actually applied (the img
     lives inside .product-image-wrap, one level deeper). ── */
.product-image-wrap > img.zoomable { cursor: zoom-in; }
.product-image-wrap > img.zoomable:hover { filter: brightness(1.04); }
.product-gallery-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.product-gallery-thumbs button { flex: 0 0 auto; width: 74px; height: 74px; padding: 0; border: 2px solid var(--border); border-radius: calc(var(--radius) - 4px); background: var(--surface-2); cursor: pointer; overflow: hidden; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.product-gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery-thumbs button:hover { border-color: var(--primary); transform: translateY(-2px); }
.product-gallery-thumbs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.product-gallery-thumbs button[aria-current="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
@media (prefers-reduced-motion: reduce) { .product-gallery-thumbs button { transition: none; } }

/* ── chat116: admin «ویرایش …» shortcut button in the black topbar ── */
.topbar-links a.topbar-edit { display: inline-flex; align-items: center; gap: .32rem; background: linear-gradient(135deg, var(--primary), #c084fc); color: #fff; font-weight: 700; border-radius: 999px; padding: .24rem .8rem; box-shadow: 0 2px 12px rgba(168,85,247,.38); transition: transform .15s, box-shadow .15s; }
.topbar-links a.topbar-edit:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(168,85,247,.55); }
.topbar-links a.topbar-edit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.topbar-links a.topbar-edit i { font-size: .95rem; line-height: 1; }
@media (max-width: 480px) { .topbar-links a.topbar-edit span { display: none; } .topbar-links a.topbar-edit { padding: .3rem .6rem; } }

/* ── chat121: VIP subscription banner under product posts ── */
.vip-banner { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 1.4rem; margin: 2.1rem 0 1.4rem; padding: 1.5rem 1.7rem; border-radius: 18px; color: #fff; background: radial-gradient(130% 170% at 88% -25%, rgba(251,191,36,.34), transparent 55%), radial-gradient(95% 130% at -12% 125%, rgba(244,64,65,.4), transparent 52%), linear-gradient(120deg, #260610 0%, #4a0e26 55%, #711439 100%); box-shadow: var(--shadow-hover); }
.vip-banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255,255,255,.15) 1.3px, transparent 1.4px); background-size: 17px 17px; -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.75), transparent 58%); mask-image: linear-gradient(to top, rgba(0,0,0,.75), transparent 58%); pointer-events: none; }
.vip-banner-copy { position: relative; min-width: 0; }
.vip-banner-title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 .35rem; color: #fff; font-size: 1.18rem; font-weight: 800; line-height: 1.6; }
.vip-banner-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .68rem .18rem; border-radius: 999px; background: linear-gradient(135deg, #fde68a, #f59e0b 60%, #d97706); color: #3b2205; font-size: .74rem; font-weight: 800; letter-spacing: .08em; box-shadow: 0 2px 10px rgba(245,158,11,.45); }
.vip-banner-badge i { font-size: .95rem; line-height: 1; }
.vip-banner-sub { margin: 0 0 .9rem; color: rgba(255,255,255,.85); font-size: .9rem; line-height: 1.9; max-width: 56ch; }
.vip-banner-cta { display: inline-flex; align-items: center; gap: .25rem; background: #fff; color: #8f0023; border-radius: 999px; padding: .5rem 1.15rem; font-size: .86rem; font-weight: 800; transition: transform .16s, box-shadow .16s; }
.vip-banner-cta i { font-size: 1.05rem; line-height: 1; }
[dir="rtl"] .vip-banner-cta i { transform: scaleX(-1); }
.vip-banner:hover .vip-banner-cta { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.vip-banner-art { flex: 0 0 128px; width: 128px; }
.vip-banner-art svg { width: 100%; height: auto; overflow: visible; display: block; }
.vip-banner .vb-f1, .vip-banner .vb-f2, .vip-banner .vb-crown { transform-box: fill-box; transform-origin: center; }
.vip-banner .vb-f1 { animation: chat121Float 3.6s ease-in-out infinite alternate; }
.vip-banner .vb-f2 { animation: chat121Float 3.6s .55s ease-in-out infinite alternate-reverse; }
.vip-banner .vb-crown { animation: chat121Crown 4.6s ease-in-out infinite; }
.vip-banner .vb-sp { transform-box: fill-box; transform-origin: center; animation: chat121Twinkle 3.2s ease-in-out infinite; }
.vip-banner .vb-sp2 { animation-delay: 1.1s; }
.vip-banner .vb-sp3 { animation-delay: 2.2s; }
@keyframes chat121Float { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes chat121Crown { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-4px) rotate(1.5deg); } }
@keyframes chat121Twinkle { 0%, 100% { opacity: .25; transform: scale(.72) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .vip-banner .vb-f1, .vip-banner .vb-f2, .vip-banner .vb-crown, .vip-banner .vb-sp { animation: none; } }
@media (max-width: 640px) {
  .vip-banner { flex-direction: column; text-align: center; gap: 1rem; padding: 1.35rem 1.1rem; }
  .vip-banner-art { order: -1; flex-basis: auto; width: 104px; }
  .vip-banner-title { justify-content: center; }
  .vip-banner-sub { margin-inline: auto; }
}

/* ── chat121: footer payment-method icons (crypto) ── */
.footer-pay-heading { margin-top: 1.15rem; }
.footer-pay { display: flex; flex-wrap: wrap; gap: .5rem; }
.pay-badge { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 34px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); transition: transform .18s ease, box-shadow .18s ease; }
.pay-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pay-badge img { width: 26px; height: 26px; }
.pay-badge--wide { width: auto; min-width: 92px; padding-inline: .55rem; }
.pay-badge--wide img { width: 76px; height: 24px; }
/* payment logos are brand marks — they stay on a white chip even in
   dark mode so the colored logos never lose contrast */
html[data-theme="dark"] .pay-badge { background: #fff; border-color: #303030; }
@media (max-width: 480px) { .footer-pay { gap: .4rem; } .pay-badge { width: 40px; height: 32px; } .pay-badge img { width: 24px; height: 24px; } .pay-badge--wide { min-width: 88px; } }

/* phase2 2026-10-19 — ZarinPal TrustCode badge + gateway-credit rules
   removed with the Toman rail (USD-only store; crypto brand icons above). */


/* ═══════════════════════════════════════════════════════════
   chat125 — RESTORE of the chat114 prose-link colors, which were
   lost when later css rebuilds (v46→v50) were cut from a base that
   predated the v45 fix. Symptom reported by owner: links inside
   product descriptions (e.g. /product/norway-id-card/) render in
   plain body text again — the global reset `a { color: inherit;
   text-decoration: none; }` at the top of this file leaves them
   indistinguishable. Rules are appended at the end so they win the
   cascade over both the global reset and the old
   `.custom-content a { color: var(--primary) }` (4.0:1 — below AA).
   Colors: light #9333ea on white ≈ 5.4:1, hover #a8002b ≈ 7.8:1;
   dark #c084fc on #1d1d1d ≈ 5.7:1 (WCAG AA in both themes). The
   underline keeps links identifiable without color vision; browsers
   without color-mix() drop only that declaration and fall back to a
   solid underline. ═════════════════════════════════════════════ */
:root { --link: #9333ea; --link-hover: #a8002b; }
html[data-theme="dark"] { --link: #c084fc; --link-hover: #ffa3bf; }

.prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); }
.prose a:hover { color: var(--link-hover); text-decoration-thickness: 2px; text-decoration-color: var(--link-hover); }
.prose a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

/* custom-content (static pages rich block): same treatment as .prose links */
.custom-content a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); }
.custom-content a:hover { color: var(--link-hover); text-decoration-thickness: 2px; text-decoration-color: var(--link-hover); }
/* end of chat125 restore */

/* ═══════════════════════════════════════════════════════════
   chat135 — blog two-column layout + automatic Table of Contents
   (post pages: content + sidebar as wide as blog index / product
   pages; WordPress-plugin-style collapsible, numbered TOC box)
   ═══════════════════════════════════════════════════════════ */

/* ── two-column post shell ──
   The post <article> moved from `section narrow` (800px) to `section`
   (1280px max, like the blog index / product pages). min-width:0 on both
   children so long prose can never force the grid wider than its track
   (chat38 lesson). Sticky sidebar mirrors .shop-side. */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.4rem; align-items: start; }
.post-main { min-width: 0; }
.post-side { min-width: 0; position: sticky; top: 130px; display: flex; flex-direction: column; gap: 1rem; }

/* ── sidebar widgets ── */
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.05rem; }
.side-box-title { display: flex; align-items: center; gap: .5rem; font-size: .95rem; font-weight: 800; margin-bottom: .8rem; }
.side-box-title i { color: var(--primary); font-size: 1.05rem; }
.side-posts { list-style: none; display: flex; flex-direction: column; }
.side-posts li + li { border-top: 1px dashed var(--border); }
.side-posts a { display: flex; flex-direction: column; gap: .12rem; padding: .5rem .55rem; border-radius: 8px; }
.side-posts a:hover { background: var(--surface-2); }
.side-posts a:hover b { color: var(--primary); }
.side-posts b { font-size: .88rem; font-weight: 600; line-height: 1.85; color: var(--text); }
.side-tools { list-style: none; display: flex; flex-direction: column; gap: .1rem; }
.side-tools a { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 8px; font-size: .87rem; color: var(--text); }
.side-tools a:hover { background: var(--surface-2); color: var(--primary); }
.side-tools a i { color: var(--primary); font-size: 1rem; flex-shrink: 0; }
.side-tools-all { display: inline-flex; align-items: center; gap: .3rem; margin-top: .7rem; font-size: .84rem; font-weight: 700; color: var(--primary); }
.side-tools-all:hover { color: var(--primary-dark); }
.side-tools-all i { transition: margin-inline-start .15s ease; }
.side-tools-all:hover i { margin-inline-start: .25rem; }

/* ── automatic Table of Contents (WordPress-plugin style) ──
   Collapsible box: header (icon + localized title + toggle button) +
   animated body (grid-template-rows trick) + numbered nested list
   (h2 = "1.", h3 = "1.1"). Open/closed state is a class the page
   script toggles (remembered in localStorage; mobile defaults closed). */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-block: 1.4rem; box-shadow: var(--shadow); overflow: hidden; }
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem 1.05rem; background: linear-gradient(0deg, var(--surface-3), var(--surface)); border-bottom: 1px solid var(--border); }
.toc-title { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 800; }
.toc-title i { color: var(--primary); font-size: 1.05rem; }
.toc-toggle { width: 30px; height: 30px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; cursor: pointer; padding: 0; transition: color .15s, border-color .15s; }
.toc-toggle:hover { color: var(--primary); border-color: var(--primary); }
.toc-toggle i { font-size: 1.05rem; line-height: 1; transition: transform .25s ease; }
.toc:not(.toc-closed) .toc-toggle i { transform: rotate(180deg); }
.toc-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.toc-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s ease, visibility .3s; }
.toc-body-inner { overflow: hidden; min-height: 0; }
.toc.toc-closed .toc-body { grid-template-rows: 0fr; }
.toc.toc-closed .toc-body-inner { visibility: hidden; }

.toc-list { list-style: none; margin: 0; padding: .65rem 1.05rem .9rem; counter-reset: toc; }
.toc-list > li { counter-increment: toc; }
.toc-list > li > a { display: flex; align-items: baseline; gap: .55rem; padding: .38rem .55rem; border-radius: 8px; font-size: .88rem; line-height: 1.9; color: var(--text); }
.toc-list > li > a::before { content: counter(toc) "."; flex-shrink: 0; min-width: 1.5rem; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc-sub { list-style: none; margin: 0; padding-inline-start: 1.95rem; counter-reset: tocsub; }
.toc-sub li { counter-increment: tocsub; }
.toc-sub li a { display: flex; align-items: baseline; gap: .55rem; padding: .3rem .55rem; border-radius: 8px; font-size: .84rem; line-height: 1.9; color: var(--muted); }
.toc-sub li a::before { content: counters(toc, ".") "." counter(tocsub); flex-shrink: 0; min-width: 2.1rem; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover { background: var(--surface-2); color: var(--primary); }
.toc a:hover .toc-text { color: var(--primary); }
.toc a.toc-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.toc a.toc-active::before { color: var(--primary); }
.toc a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.toc-text { min-width: 0; overflow-wrap: break-word; }

/* anchor offset: the sticky header must never cover a jumped-to heading
   (native anchor jumps AND scrollIntoView both honour scroll-margin) */
.prose-html h2, .prose-html h3, .prose-html h4 { scroll-margin-block-start: 105px; }

@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .toc-body { transition: none; }
  .toc-toggle i { transition: none; }
  .side-tools-all i { transition: none; }
}

/* chat135b — long unbreakable code runs (MRZ sample lines carry no spaces
   and cannot wrap) must never force horizontal PAGE scroll on mobile;
   they wrap inside their inline chip instead. Pre-existing issue that
   the new mobile QA pass surfaced. */
.prose-html code { overflow-wrap: anywhere; }

/* ═════════════════════════════════════════════════════════
   chat136 — blog sidebar RELATED-PRODUCTS SLIDER (.psl-*)
   chat136c — products ONLY (5 related-product slides; the three
   featured «ابزار ویژه» suites moved to the free-tools box as
   static premium cards — .side-suite-* below) and SQUARE 1:1
   product thumbs (owner spec: equal width and height). Slides
   stack in one grid cell (container = tallest slide, no height
   jumps), fade+rise transition (RTL-neutral), nav footer with
   round prev/next buttons and dot indicators.
   All colors from the theme vars — dark mode included.
   ═════════════════════════════════════════════════════════ */
.psl-box { padding: .9rem .9rem 1rem; }
.psl-box .side-box-title { margin-bottom: .7rem; }

.psl { position: relative; min-width: 0; }
.psl-track { display: grid; }
.psl-slide {
  grid-area: 1 / 1;
  visibility: hidden; opacity: 0;
  transform: translateY(10px) scale(.985);
  transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s;
  min-width: 0;
}
.psl-slide.is-active {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease, visibility 0s;
}

/* ── product slide card ── */
.psl-card {
  display: flex; flex-direction: column; min-width: 0; height: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.psl-slide.is-active .psl-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
/* chat136c — SQUARE thumbs (owner: عرض و ارتفاع عکس یکسان) */
.psl-thumb { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-3); overflow: hidden; }
.psl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.psl-slide.is-active .psl-card:hover .psl-thumb img { transform: scale(1.04); }
.psl-body { display: flex; flex-direction: column; gap: .45rem; padding: .8rem .85rem .9rem; min-width: 0; }
.psl-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; height: 3.5em;
  font-size: .9rem; font-weight: 700; line-height: 1.75; color: var(--text);
  overflow-wrap: break-word;
}
.psl-slide.is-active .psl-card:hover .psl-name { color: var(--primary); }
.psl-meta { display: flex; align-items: center; gap: .35rem; min-height: 1.55rem; }
.psl-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-top: auto; padding-top: .65rem; border-top: 1px dashed var(--border);
}
.psl-price { display: flex; align-items: baseline; gap: .45rem; min-width: 0; flex-wrap: wrap; }
.psl-price s { color: var(--muted); font-size: .72rem; }
.psl-price b { color: var(--primary); font-size: .95rem; font-weight: 800; }
.psl-cta {
  display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0;
  font-size: .76rem; font-weight: 700; line-height: 1;
  color: var(--primary); background: var(--primary-soft);
  border-radius: 999px; padding: .42rem .8rem;
  transition: background .18s ease, color .18s ease;
}
.psl-cta i { font-size: .95rem; line-height: 1; }
.psl-card:hover .psl-cta { background: var(--primary); color: #fff; }
.psl-card:hover .psl-cta i { margin-inline-start: .15rem; }

/* ── nav footer: [prev] dots [next] ── */
.psl-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .8rem; }
.psl-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: 1rem; cursor: pointer; padding: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.psl-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.psl-btn i { line-height: 1; }
.psl-dots { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.psl-dot {
  width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px;
  background: var(--border); cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.psl-dot:hover { background: var(--muted); }
.psl-dot.is-active { width: 20px; background: var(--primary); }

/* a11y: live region (visualy hidden) + focus rings */
.psl-status {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.psl-btn:focus-visible, .psl-dot:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .psl-slide { transition: none; }
  .psl-thumb img, .psl-card { transition: none; }
  .psl-dot { transition: none; }
}


/* ═══════════════════════════════════════════════════════════
   chat136c — the THREE featured «ابزار ویژه» suites in the
   sidebar's «ابزارهای آنلاین رایگان» box: static premium cards
   (NOT slider slides, NOT a carousel) whose look is deliberately
   distinct from the plain .side-tools rows — gradient panel,
   primary border, icon tile, badge pill, count chip, hover lift.
   ═══════════════════════════════════════════════════════════ */
.side-suites { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .95rem; }
.side-suite {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: .6rem; min-width: 0;
  padding: .6rem .68rem;
  background: linear-gradient(165deg, var(--primary-soft), var(--surface) 72%);
  border: 1.5px solid color-mix(in srgb, var(--primary) 45%, transparent);
  border-radius: 12px;
  text-decoration: none; color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.side-suite:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 75%, transparent);
  box-shadow: var(--shadow-hover);
}
.side-suite-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary); border-radius: 13px; font-size: 1.3rem;
}
.side-suite-main { display: flex; flex-direction: column; gap: .32rem; min-width: 0; }
.side-suite-name {
  font-size: .9rem; font-weight: 800; line-height: 1.6; color: var(--text);
  overflow-wrap: break-word;
}
.side-suite:hover .side-suite-name { color: var(--primary); }
.side-suite-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.side-suite-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--primary); color: #fff;
  border-radius: 999px; padding: .16rem .6rem;
  font-size: .66rem; font-weight: 800; line-height: 1.5;
}
.side-suite-badge i { font-size: .74rem; }
.side-suite-count {
  display: inline-flex; align-items: center; gap: .22rem;
  font-size: .7rem; font-weight: 800; line-height: 1.5; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 999px; padding: .16rem .6rem;
}
.side-suite-count i { font-size: .78rem; }
.side-suite-arrow {
  color: var(--muted); font-size: .95rem;
  transition: color .18s ease, margin-inline-start .18s ease;
}
.side-suite:hover .side-suite-arrow { color: var(--primary); margin-inline-start: .2rem; }
.side-suite:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .side-suite, .side-suite-arrow { transition: none; }
}

/* chat136b — product cards stretch to the track height (height:100%) and the
   price/CTA footer is pinned to the card bottom (margin-top:auto): slide
   interiors stay visually full and price rows align across slides instead of
   shorter cards leaving a blank gap above the dots row. */
/* chat136c — slider is products-only with square 1:1 thumbs; the featured
   «ابزار ویژه» suites render as static premium cards in the free-tools box
   (.side-suite-* above) and the autoplay follows the standard carousel
   rules (fresh countdown whenever a pause reason clears — see post.blade.php). */


/* ═══════════════════════════════════════════════════════════
   chat130 — HOME HOT-DEALS SLIDER (.hsl-*): the 10 products
   with the highest discount percentage. chat131 — EXACTLY 5
   equal cards per view (calc grid columns; 3 on tablets, 2 on
   phones), SQUARE 1:1 thumbs standardized like the latest-files
   cards, autoplay every 5s with a seamless clone-based loop (see
   the page script); progress bar removed. Native scroll-snap
   track (touch is native; mouse drag + button paging live in the
   page script), round prev/next buttons reuse the .psl-btn look.
   All colors from theme vars — dark mode included; logical
   properties keep it RTL/LTR neutral.
   ═══════════════════════════════════════════════════════════ */
.hsl-wrap { position: relative; min-width: 0; }
.hsl-title { display: inline-flex; align-items: center; gap: .45rem; }
.hsl-title i { color: var(--primary); font-size: 1.25rem; }
.hsl-btns { display: flex; align-items: center; gap: .45rem; }

/* the track: EXACTLY five equal cards fill the view (chat131 — owner
   spec: 5 products visible at any moment, no peeking partial cards);
   the script pages one card at a time and loops through clone twins */
.hsl-viewport {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * 1rem) / 5);
  gap: 1rem;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
  /* chat131: zero INLINE padding — with .2rem the sixth card peeked a
     ~3px sliver inside the padding box; 0 makes the 5-card fill exact */
  padding: .25rem 0 .4rem;
}
.hsl-viewport::-webkit-scrollbar { display: none; }
.hsl-viewport.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.hsl-viewport.is-dragging .hsl-card { pointer-events: none; }

/* slide card */
.hsl-card {
  scroll-snap-align: start;
  display: flex; flex-direction: column; min-width: 0; height: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.hsl-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.hsl-thumb { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-3); overflow: hidden; }
.hsl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.hsl-card:hover .hsl-thumb img { transform: scale(1.05); }
/* the discount badge: bigger and louder than the grid cards' one — this
   section IS about the discounts (reuses the global .badge/.badge-off) */
.hsl-off {
  font-size: .82rem; font-weight: 900; padding: .32rem .68rem;
  background: linear-gradient(135deg, var(--primary), #c084fc);
  box-shadow: 0 6px 18px rgba(168,85,247,.42);
}
.hsl-body { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: .8rem .85rem .9rem; min-width: 0; }
.hsl-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; height: 3.5em;
  font-size: .9rem; font-weight: 700; line-height: 1.75; color: var(--text);
  text-decoration: none; overflow-wrap: break-word;
}
.hsl-card:hover .hsl-name { color: var(--primary); }
.hsl-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; margin-top: auto; padding-top: .65rem; border-top: 1px dashed var(--border);
}
.hsl-foot .price { display: flex; align-items: baseline; gap: .45rem; min-width: 0; flex-wrap: wrap; }
.hsl-foot .price s { color: var(--muted); font-size: .72rem; }
.hsl-foot .price b { color: var(--primary); font-size: .92rem; font-weight: 800; }
.hsl-foot .add-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0; padding: 0;
  font-size: 1rem; border-radius: 999px;
}

/* focus rings */
.hsl-btns .psl-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* responsive per-view counts: 5 desktop / 3 tablet / 2 phone (the JS
   reads the actual card width, so the loop math adapts on its own) */
@media (min-width: 641px) and (max-width: 1023px) {
  .hsl-viewport { grid-auto-columns: calc((100% - 2 * .9rem) / 3); gap: .9rem; }
}
@media (max-width: 640px) {
  .hsl-viewport { grid-auto-columns: calc((100% - 1 * .8rem) / 2); gap: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hsl-card, .hsl-thumb img { transition: none; }
}

/* ════════════════════════════════════════════════════════════════════
   chat132 — homepage WIDGET BUILDER styles (v60, additive only)
   The shipped look of every existing section is untouched — the builder
   just re-orders the same partials. These rules serve the extra widgets:
   the popular-countries grid, the free text box and the CTA banner
   (cheapest-slider + bestsellers reuse the existing .hsl-* / product-
   card styles). Everything rides the CSS custom properties so the dark
   mode works for free. ══════════════════════════════════════════════ */

/* — popular countries grid (compact sibling of the countries hub) — */
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: .75rem; }
.cc-card { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .95rem .7rem; transition: transform .18s, border-color .18s, box-shadow .18s; }
.cc-card:hover { transform: translateY(-3px); border-color: var(--primary);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 16%, transparent); }
.cc-flag { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.cc-flag img { width: 100%; height: 100%; object-fit: cover; }
.cc-flag-empty { color: var(--muted); font-size: 1.3rem; }
.cc-name { font-weight: 700; font-size: .85rem; color: var(--text); }
.cc-count { font-size: .7rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .1rem .55rem; }

/* — free text box widget — */
.dv-text-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; color: var(--text); line-height: 2; box-shadow: var(--shadow); }
.dv-text-box h2, .dv-text-box h3, .dv-text-box h4 { margin: .8rem 0 .35rem; }
.dv-text-box p { margin: .45rem 0; }
.dv-text-box ul, .dv-text-box ol { margin: .5rem 0; padding-inline-start: 1.4rem; }
.dv-text-box img { border-radius: calc(var(--radius) - 4px); margin: .8rem auto; }
.dv-text-box a { color: var(--primary); }
.dv-text-box > :last-child { margin-bottom: 0; }

/* — CTA banner widget — */
.dv-cta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: .9rem 1.4rem; border-radius: 14px; padding: 1.25rem 1.5rem; }
.dv-cta-copy { display: flex; flex-direction: column; gap: .3rem; min-width: 220px; flex: 1; }
.dv-cta-copy b { font-size: 1.15rem; font-weight: 800; }
.dv-cta-copy span { font-size: .85rem; opacity: .85; }
.dv-cta--brand { background: linear-gradient(120deg, var(--primary), #c084fc); color: #fff;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 25%, transparent); }
.dv-cta--dark { background: linear-gradient(120deg, #1f1f1f, #3a3a3a); color: #fff; }
.dv-cta--soft { background: var(--primary-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); }
.dv-cta-btn { flex: none; }
.dv-cta--brand .dv-cta-btn, .dv-cta--dark .dv-cta-btn { background: #fff; color: var(--primary); border: none; }
.dv-cta--soft .dv-cta-btn { background: var(--primary); color: #fff; }
.dv-cta-btn i { font-size: 1rem; }

/* focus rings for the new widgets' interactive cards */
.cc-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dv-cta-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .cc-card { transition: none; }
  .cc-card:hover { transform: none; }
}
