/* ==========================================================================
   Trendicator — سیستم طراحی فروشگاه اندیکاتور
   Single stylesheet · RTL-first · dark default + light override
   Tokens → Base → Layout → Components → Pages → Utilities
   ========================================================================== */

/* ---------- 0. Font ---------- */
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-var.woff2") format("woff2 supports variations"), url("../fonts/Vazirmatn-var.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}

/* ---------- 1. Tokens ---------- */
:root {
    /* Typography */
    --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    /* Dark palette (default) */
    --bg: #0b0f14;
    --bg-soft: #10161d;
    --panel: #131a23;
    --panel-2: #182230;
    --line: #223041;
    --line-soft: #1a2532;
    --text: #e8eef5;
    --text-2: #9fb0c3;
    --text-3: #64768a;
    --brand: #10b981; /* emerald */
    --brand-strong: #059669;
    --brand-soft: rgba(16, 185, 129, .12);
    --brand-line: rgba(16, 185, 129, .35);
    --on-brand: #04120c; /* text/icon color on a brand-colored fill */

    --up: #10b981; /* candle up   */
    --down: #f43f5e; /* candle down */
    --up-soft: rgba(16, 185, 129, .14);
    --down-soft: rgba(244, 63, 94, .14);
    --warn: #f59e0b;
    --info: #38bdf8;
    /* Elevation */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, .55);
    --shadow-3: 0 16px 48px -12px rgba(0, 0, 0, .65);
    --ring: 0 0 0 3px rgba(16, 185, 129, .28);
    /* Shape & motion */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-full: 999px;
    --t: 180ms cubic-bezier(.4, 0, .2, 1);
    --container: 1200px;
}

[data-theme="light"] {
    --bg: #f6f8fa;
    --bg-soft: #eef2f6;
    --panel: #ffffff;
    --panel-2: #f3f6f9;
    --line: #dbe3ec;
    --line-soft: #e7edf3;
    --text: #14202c;
    --text-2: #4e6076;
    --text-3: #8595a8;
    --brand: #059669;
    --brand-strong: #047857;
    --brand-soft: rgba(5, 150, 105, .1);
    --brand-line: rgba(5, 150, 105, .3);
    --on-brand: #ffffff; /* white on the darker green */

    --up: #059669;
    --down: #e11d48;
    --up-soft: rgba(5, 150, 105, .1);
    --down-soft: rgba(225, 29, 72, .1);
    --shadow-1: 0 1px 2px rgba(20, 32, 44, .06);
    --shadow-2: 0 8px 24px -10px rgba(20, 32, 44, .18);
    --shadow-3: 0 16px 48px -16px rgba(20, 32, 44, .22);
    --ring: 0 0 0 3px rgba(5, 150, 105, .22);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    transition: background var(--t), color var(--t);
}

img, svg, video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t);
}

    a:hover {
        color: var(--brand);
    }

button {
    font-family: inherit;
    cursor: pointer;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    line-height: 1.4;
    font-weight: 800;
}

h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
}

h2 {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

h3 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 1em;
}

ul, ol {
    padding-inline-start: 1.4em;
    margin: 0 0 1em;
}

::selection {
    background: var(--brand-soft);
    color: var(--text);
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--r-sm);
}

/* ---------- 3. Layout ---------- */
.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
}

.section {
    padding-block: 56px;
}

.section--soft {
    background: var(--bg-soft);
}

.section-head {
    max-width: 640px;
    margin-bottom: 32px;
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head .kicker {
    margin-bottom: 6px;
}

.section-head p {
    color: var(--text-2);
    margin: 0;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
    gap: 12px;
}

.flex--between {
    justify-content: space-between;
    align-items: center;
}

.flex--center {
    justify-content: center;
    align-items: center;
}

.flex--wrap {
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    /* Stats tiles keep 2 columns on phones (single-column feels sparse);
     everything else collapses to one column. */
    .grid--2, .grid--3 {
        grid-template-columns: 1fr;
    }

    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding-block: 40px;
    }
}

@media (max-width: 380px) {
    .grid--4 {
        grid-template-columns: 1fr;
    }
}

/* ---------- 4. Components ---------- */

/* Inline SVG icon system (Bootstrap Icons paths, inlined as <symbol> sprite —
   zero CDN requests). Usage: <svg class="ic"><use href="assets/img/icons.svg#i-gear"/></svg>
   The sprite file is inlined once per page right after <body>; external
   `use` works because the sprite ships with the template (same origin). */
.ic {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: currentColor;
    display: inline-block;
    vertical-align: -0.125em;
}

/* Kicker + badges */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    border-radius: var(--r-full);
    padding: 3px 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--line);
    color: var(--text-2);
    background: var(--panel-2);
}

.badge--brand {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand-line);
}

.badge--up {
    color: var(--up);
    background: var(--up-soft);
    border-color: transparent;
}

.badge--down {
    color: var(--down);
    background: var(--down-soft);
    border-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--r-md);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.6;
    border: 1px solid transparent;
    transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
    user-select: none;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn--primary {
    background: var(--brand);
    color: var(--on-brand);
}

    .btn--primary:hover {
        background: var(--brand-strong);
        color: var(--on-brand);
    }

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

    .btn--ghost:hover {
        border-color: var(--brand);
        color: var(--brand);
    }

.btn--soft {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: transparent;
}

    .btn--soft:hover {
        background: var(--brand);
        color: var(--on-brand);
    }

.btn--danger {
    background: transparent;
    color: var(--down);
    border-color: transparent;
}

    .btn--danger:hover {
        background: var(--down-soft);
    }

.btn--lg {
    padding: 14px 30px;
    font-size: 1.02rem;
}

.btn--sm {
    padding: 6px 14px;
    font-size: .82rem;
    border-radius: var(--r-sm);
}

.btn--block {
    width: 100%;
}

.btn[disabled] {
    opacity: .5;
    pointer-events: none;
}

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.card-pad {
    padding: 24px;
}

/* Product card */
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}

    .product-card:hover {
        transform: translateY(-4px);
        border-color: var(--brand-line);
        box-shadow: var(--shadow-2);
    }

.product-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line-soft);
    padding: 0;
    display: flex;
    align-items: stretch;
}

    .product-card__media svg {
        width: 100%;
        height: 100%;
    }

    .product-card__media img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.product-card__tags {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    display: flex;
    gap: 6px;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    flex: 1;
}

.product-card__title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

    .product-card__title a:hover {
        color: var(--brand);
    }

.product-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .78rem;
    color: var(--text-3);
}

.product-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

/* Price */
.price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 800;
    color: var(--brand);
    white-space: nowrap;
}

    .price small {
        font-size: .72em;
        font-weight: 600;
        color: var(--text-2);
    }

.price--lg {
    font-size: 1.5rem;
}

.price del {
    font-size: .8em;
    font-weight: 500;
    color: var(--text-3);
    margin-inline-end: 6px;
}

/* Header */
/* NOTE: backdrop-filter must live on ::before, not on .site-header itself.
   A backdrop-filter on an ancestor becomes the containing block for
   position:fixed descendants — it would collapse the fixed mobile nav
   into the 64px header box and the burger menu would never appear. */
.site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line-soft);
}

    .site-header::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: rgba(11, 15, 20, .85); /* fallback */
        background: color-mix(in srgb, var(--bg) 85%, transparent);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

[data-theme="light"] .site-header::before {
    background: rgba(246, 248, 250, .85); /* fallback */
    background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
}

    .logo img, .logo svg {
        width: 30px;
        height: 30px;
    }

    .logo b {
        color: var(--brand);
    }

.main-nav {
    display: flex;
    gap: 4px;
    margin-inline-start: 8px;
}

    .main-nav a {
        padding: 8px 12px;
        border-radius: var(--r-sm);
        font-size: .92rem;
        font-weight: 600;
        color: var(--text-2);
    }

        .main-nav a:hover {
            color: var(--text);
            background: var(--panel-2);
        }

        .main-nav a.is-active {
            color: var(--brand);
            background: var(--brand-soft);
        }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-2);
    transition: border-color var(--t), color var(--t), background var(--t);
}

    .icon-btn:hover {
        border-color: var(--brand);
        color: var(--brand);
    }

    .icon-btn svg {
        width: 18px;
        height: 18px;
    }

.icon-btn__count {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -6px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 800;
    color: var(--on-brand);
    background: var(--brand);
    border-radius: var(--r-full);
}

/* Mobile nav */
.nav-toggle {
    display: none;
}

@media (max-width: 860px) {
    .main-nav {
        position: fixed;
        inset-block: 64px 0;
        inset-inline: 0;
        flex-direction: column;
        gap: 2px;
        padding: 16px 20px;
        background: var(--bg);
        border-block-start: 1px solid var(--line);
        transform: translateX(-100%); /* RTL: slides from inline-start */
        transition: transform 240ms ease;
        overflow-y: auto;
        visibility: hidden; /* fully out of the a11y tree while closed */
        transition: transform 240ms ease, visibility 0s 240ms;
    }

    [dir="rtl"] .main-nav {
        transform: translateX(100%);
    }

    .main-nav.is-open {
        transform: translateX(0) !important;
        visibility: visible;
        transition: transform 240ms ease;
    }

    .main-nav a {
        padding: 12px;
        font-size: 1rem;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding-block: 72px 56px;
}

.hero__grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 40px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    line-height: 1.5;
}

    .hero h1 em {
        font-style: normal;
        color: var(--brand);
    }

.hero__lead {
    font-size: 1.05rem;
    color: var(--text-2);
    max-width: 52ch;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    margin-top: 36px;
}

    .hero__stats b {
        display: block;
        font-size: 1.4rem;
        color: var(--brand);
    }

    .hero__stats span {
        font-size: .8rem;
        color: var(--text-3);
    }

.hero__panel {
    position: relative;
}

.hero__glow {
    position: absolute;
    inset: -10%;
    z-index: -1;
    filter: blur(70px);
    opacity: .35;
    background: radial-gradient(closest-side, var(--brand), transparent 70%);
}

@media (max-width: 900px) {
    .hero__grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-block: 48px 40px;
    }
}

/* Ticker */
.ticker {
    border-block: 1px solid var(--line-soft);
    background: var(--bg-soft);
    overflow: hidden;
}

.ticker__track {
    display: flex;
    gap: 40px;
    padding-block: 10px;
    width: max-content;
    animation: ticker 30s linear infinite;
}

.ticker:hover .ticker__track {
    animation-play-state: paused;
}

.ticker__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    white-space: nowrap;
    color: var(--text-2);
}

    .ticker__item b {
        color: var(--text);
    }

@keyframes ticker {
    to {
        transform: translateX(-50%);
    }
}

[dir="rtl"] .ticker__track {
    animation-direction: reverse;
}

@media (prefers-reduced-motion: reduce) {
    .ticker__track {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
    }
}

/* Steps */
.steps {
    counter-reset: step;
}

.step {
    position: relative;
    padding-inline-start: 52px;
}

    .step::before {
        counter-increment: step;
        content: counter(step);
        position: absolute;
        inset-inline-start: 0;
        inset-block-start: 2px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        color: var(--brand);
        background: var(--brand-soft);
        border: 1px solid var(--brand-line);
        border-radius: var(--r-full);
    }

/* Testimonial */
.testimonial {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.testimonial__stars {
    color: var(--warn);
    letter-spacing: 2px;
    font-size: .85rem;
}

.testimonial__author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.testimonial__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    background: var(--panel-2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--brand);
}

.testimonial__author b {
    display: block;
    font-size: .9rem;
}

.testimonial__author span {
    font-size: .75rem;
    color: var(--text-3);
}

/* FAQ accordion */
.faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .faq details {
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        overflow: hidden;
    }

    .faq summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 14px 18px;
        cursor: pointer;
        font-weight: 700;
        list-style: none;
    }

        .faq summary::-webkit-details-marker {
            display: none;
        }

        .faq summary::after {
            content: "+";
            font-size: 1.2rem;
            color: var(--brand);
            transition: transform var(--t);
        }

    .faq details[open] summary::after {
        transform: rotate(45deg);
    }

    .faq details[open] summary {
        color: var(--brand);
        border-bottom: 1px solid var(--line-soft);
    }

.faq__a {
    padding: 14px 18px;
    color: var(--text-2);
}

/* Pricing / plans */
.plan {
    display: flex;
    flex-direction: column;
    position: relative;
}

.plan--featured {
    border-color: var(--brand-line);
    box-shadow: 0 0 0 1px var(--brand-line), var(--shadow-2);
}

.plan__flag {
    position: absolute;
    inset-block-start: -12px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    background: var(--brand);
    color: var(--on-brand);
    font-size: .72rem;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: var(--r-full);
}

.plan__price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 10px 0 4px;
}

    .plan__price b {
        font-size: 1.7rem;
        color: var(--brand);
    }

    .plan__price span {
        font-size: .8rem;
        color: var(--text-3);
    }

.plan ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.plan li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: .9rem;
    color: var(--text-2);
}

    .plan li::before {
        content: "✓";
        color: var(--brand);
        font-weight: 800;
    }

    .plan li.is-off {
        color: var(--text-3);
    }

        .plan li.is-off::before {
            content: "×";
            color: var(--text-3);
        }

.plan .btn {
    margin-top: 20px;
}

/* Forms */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

    .field label {
        font-size: .85rem;
        font-weight: 700;
    }

.input, .select, .textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: border-color var(--t), box-shadow var(--t);
}

    .input:focus, .select:focus, .textarea:focus {
        outline: none;
        border-color: var(--brand);
        box-shadow: var(--ring);
    }

    .input::placeholder, .textarea::placeholder {
        color: var(--text-3);
    }

.textarea {
    min-height: 120px;
    resize: vertical;
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
    background-position: calc(0% + 16px) 55%, calc(0% + 21px) 55%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.input-group {
    display: flex;
}

    .input-group .input {
        border-start-end-radius: 0;
        border-end-end-radius: 0;
    }

    .input-group .btn {
        border-start-start-radius: 0;
        border-end-start-radius: 0;
    }

.hint {
    font-size: .78rem;
    color: var(--text-3);
}

.error-text {
    font-size: .78rem;
    color: var(--down);
}

/* Validation states (ASP.NET Core + jquery.validate.unobtrusive)
   The framework adds .field-validation-{valid|error} to <span asp-validation-for>
   and .input-validation-error to the input — covers every form site-wide. */
.field [data-valmsg-for] {
    font-size: .78rem;
    line-height: 1.6;
    color: var(--down);
}

    .field [data-valmsg-for].field-validation-valid,
    .field [data-valmsg-for]:empty {
        display: none;
    }

    .field [data-valmsg-for].field-validation-error {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: -2px;
    }

        .field [data-valmsg-for].field-validation-error::before {
            content: "!";
            flex: none;
            width: 1.15em;
            height: 1.15em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--r-full);
            background: var(--down-soft);
            color: var(--down);
            font-weight: 800;
            font-size: .85em;
        }

.input.input-validation-error,
.select.input-validation-error,
.textarea.input-validation-error {
    border-color: var(--down);
    box-shadow: 0 0 0 3px var(--down-soft);
}

    .input.input-validation-error:focus,
    .select.input-validation-error:focus,
    .textarea.input-validation-error:focus {
        border-color: var(--down);
        box-shadow: 0 0 0 3px var(--down-soft);
    }

/* Form-level summary bubble */
.validation-summary-errors {
    background: var(--down-soft);
    border: 1px solid var(--down);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: .85rem;
    color: var(--down);
    margin-bottom: 16px;
}

    .validation-summary-errors ul {
        margin: 0;
        padding-inline-start: 1.2em;
    }

.validation-summary-valid {
    display: none;
}

/* Checkbox */
.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .88rem;
    color: var(--text-2);
    cursor: pointer;
}

    .check input {
        accent-color: var(--brand);
        margin-block-start: 5px;
    }

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--panel);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 640px;
}

    .table th, .table td {
        padding: 12px 16px;
        text-align: start;
        border-block-end: 1px solid var(--line-soft);
    }

    .table th {
        font-size: .78rem;
        color: var(--text-3);
        font-weight: 700;
        background: var(--panel-2);
    }

    .table tbody tr:last-child td {
        border-block-end: 0;
    }

    .table tbody tr:hover {
        background: var(--panel-2);
    }

    .table tfoot td {
        font-weight: 800;
        background: var(--panel-2);
    }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-block-end: 1px solid var(--line);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox: hide the scrollbar track */
}

    .tabs::-webkit-scrollbar {
        display: none;
    }
    /* Chrome/Edge/Safari */
    .tabs [role="tab"] {
        padding: 10px 18px;
        font-size: .92rem;
        font-weight: 700;
        color: var(--text-2);
        background: none;
        border: none;
        border-block-end: 2px solid transparent;
        margin-block-end: -1px;
        white-space: nowrap;
        transition: color var(--t), border-color var(--t);
    }

        .tabs [role="tab"]:hover {
            color: var(--text);
        }

        .tabs [role="tab"][aria-selected="true"] {
            color: var(--brand);
            border-color: var(--brand);
        }

[role="tabpanel"][hidden] {
    display: none;
}

/* Product detail tabs: cap panel width + even out the scrollbar gutter
   (the hidden scrollbar still reserves space in some engines, which the
   tabs container compensates for by being scrollable itself) */
[data-tabs] .tabs {
    margin-inline: 0;
}

[data-tabs] [role="tabpanel"] > :first-child {
    margin-top: 0;
}

/* Cart item row (mobile-friendly list) */
.cart-line {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-block-end: 1px solid var(--line-soft);
}

.cart-line__thumb {
    width: 72px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line-soft);
    padding: 4px;
}

    .cart-line__thumb svg {
        width: 100%;
        height: 100%;
    }

.cart-line__body {
    flex: 1;
    min-width: 0;
}

.cart-line__title {
    font-weight: 700;
    font-size: .92rem;
}

.cart-line__meta {
    font-size: .75rem;
    color: var(--text-3);
}

.qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}

    .qty button {
        width: 30px;
        height: 32px;
        background: var(--panel-2);
        border: none;
        color: var(--text-2);
        font-weight: 800;
    }

        .qty button:hover {
            color: var(--brand);
        }

    .qty span {
        min-width: 34px;
        text-align: center;
        font-weight: 700;
        font-size: .9rem;
    }

/* Gateway options (checkout) */
.gateway {
    position: relative;
}

    .gateway input {
        position: absolute;
        opacity: 0;
    }

.gateway__label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: border-color var(--t), background var(--t);
}

    .gateway__label:hover {
        border-color: var(--brand-line);
    }

.gateway input:checked + .gateway__label {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.gateway__logo {
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
    background: var(--panel-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--brand);
    font-size: .8rem;
}

.gateway b {
    display: block;
    font-size: .92rem;
}

.gateway span {
    font-size: .75rem;
    color: var(--text-3);
}

/* Account panel */
.account {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.account__side {
    position: sticky;
    inset-block-start: 84px;
    min-width: 0;
}

.account__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .account__nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 14px;
        border-radius: var(--r-sm);
        font-size: .92rem;
        font-weight: 600;
        color: var(--text-2);
    }

        .account__nav a .ic {
            color: var(--text-3);
            transition: color var(--t);
        }

        .account__nav a:hover .ic, .account__nav a.is-active .ic {
            color: var(--brand);
        }

        .account__nav a:hover {
            background: var(--panel-2);
            color: var(--text);
        }

        .account__nav a.is-active {
            background: var(--brand-soft);
            color: var(--brand);
        }

.account__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Mobile: side nav becomes an always-visible horizontal chip strip.
   (A collapse-behind-toggle version of this shipped before and was reported
   broken twice on phones — the strip is now simply always visible, which
   removes the interaction and its failure mode entirely.) */
@media (max-width: 800px) {
    .account {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .account__side {
        position: static;
    }

        .account__side .card {
            padding: 8px;
        }

    .account__nav {
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding: 2px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

        .account__nav::-webkit-scrollbar {
            display: none;
        }

        .account__nav a {
            flex-shrink: 0;
            white-space: nowrap;
            gap: 7px;
            padding: 8px 12px;
            font-size: .85rem;
            border: 1px solid var(--line);
        }

            .account__nav a.is-active {
                border-color: var(--brand-line);
            }

    .account__body > h1 {
        font-size: 1.2rem;
    }

    .account .stat {
        padding: 14px;
    }

        .account .stat b {
            font-size: 1.15rem;
        }
}

/* Mobile card-list fallback for data tables:
   .table--cards turns each row into a stacked card below 640px.
   Every td keeps a data-label used as its row heading. */
@media (max-width: 640px) {
    .table--cards {
        min-width: 0;
        border: 0;
        display: block;
    }

        .table--cards thead {
            display: none;
        }

        .table--cards tbody {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .table--cards tr {
            display: flex;
            flex-direction: column;
            gap: 6px;
            border: 1px solid var(--line-soft);
            border-radius: var(--r-md);
            padding: 12px 14px;
            background: var(--panel);
        }

        .table--cards td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            border: 0;
            padding: 0;
            text-align: start;
        }

            .table--cards td::before {
                content: attr(data-label);
                font-size: .75rem;
                font-weight: 700;
                color: var(--text-3);
                flex-shrink: 0;
            }

            .table--cards td[data-label=""]::before {
                content: none;
            }
}

/* Stat tiles */
.stat {
    padding: 18px 20px;
}

    .stat b {
        display: block;
        font-size: 1.45rem;
    }

    .stat span {
        font-size: .8rem;
        color: var(--text-3);
    }

.stat--brand b {
    color: var(--brand);
}

/* Progress */
.progress {
    height: 8px;
    background: var(--panel-2);
    border-radius: var(--r-full);
    overflow: hidden;
}

    .progress i {
        display: block;
        height: 100%;
        background: var(--brand);
        border-radius: var(--r-full);
    }

/* Toast */
.toast-region {
    position: fixed;
    inset-block-end: 20px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

[dir="rtl"] .toast-region {
    transform: translateX(-50%);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 10px 18px;
    box-shadow: var(--shadow-3);
    font-size: .9rem;
    font-weight: 600;
    animation: toast-in 240ms ease;
}

.toast--ok {
    border-color: var(--brand-line);
    color: var(--brand);
}

.toast--err {
    border-color: var(--down);
    color: var(--down);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* Breadcrumb */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: .8rem;
    color: var(--text-3);
    padding-block: 16px;
}

    .crumbs a:hover {
        color: var(--brand);
    }

    .crumbs li:not(:last-child)::after {
        content: "‹";
        margin-inline-start: 6px;
        color: var(--text-3);
    }

.crumbs {
    list-style: none;
    padding: 16px 0 0;
    margin: 0;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
}

    .pagination a {
        min-width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--line);
        border-radius: var(--r-sm);
        font-weight: 700;
        font-size: .9rem;
        color: var(--text-2);
    }

        .pagination a:hover {
            border-color: var(--brand);
            color: var(--brand);
        }

        .pagination a.is-active {
            background: var(--brand);
            border-color: var(--brand);
            color: var(--on-brand);
        }

/* Alerts */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: .88rem;
    border: 1px solid var(--line);
    background: var(--panel-2);
}

.alert--info {
    border-color: color-mix(in srgb, var(--info) 40%, transparent);
    background: color-mix(in srgb, var(--info) 8%, transparent);
}

.alert--warn {
    border-color: color-mix(in srgb, var(--warn) 40%, transparent);
    background: color-mix(in srgb, var(--warn) 8%, transparent);
}

    .alert--info b, .alert--warn b {
        color: inherit;
    }

.alert > span:has(> .ic) {
    color: var(--warn);
    margin-top: 2px;
}

/* Prose (article/legal pages) */
.prose {
    max-width: 760px;
}

    .prose h2 {
        font-size: 1.3rem;
        margin-top: 2em;
    }

    .prose h3 {
        font-size: 1.05rem;
        margin-top: 1.6em;
    }

    .prose ul li, .prose ol li {
        margin-bottom: .5em;
    }

    .prose blockquote {
        margin: 1.5em 0;
        padding: 12px 20px;
        border-inline-start: 3px solid var(--brand);
        background: var(--brand-soft);
        border-radius: var(--r-sm);
        color: var(--text-2);
    }

/* Comments (blog-post) */
.comments {
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comments__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8em;
    height: 1.8em;
    padding: 0 8px;
    margin-inline-start: 8px;
    border-radius: var(--r-full);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand);
    font-size: .85rem;
    font-weight: 800;
    vertical-align: middle;
}

.comments__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment {
    display: flex;
    gap: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 16px 18px;
}

.comment__avatar {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    color: var(--brand);
    font-weight: 800;
    font-size: 1.05rem;
}

.comment__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: .9rem;
}

    .comment__head b {
        font-weight: 800;
    }

.comment__time {
    font-size: .75rem;
    color: var(--text-3);
}

.comment p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.9;
    color: var(--text-2);
}

.comment__reply {
    margin-top: 10px;
    padding: 12px 14px;
    border-inline-start: 3px solid var(--brand);
    background: var(--brand-soft);
    border-radius: var(--r-sm);
}

.comments__form {
    display: flex;
    flex-direction: column;
}

    .comments__form .hint {
        font-size: .78rem;
    }

@media (max-width: 600px) {
    .comment {
        padding: 14px;
        gap: 10px;
    }

    .comment__avatar {
        width: 36px;
        height: 36px;
        font-size: .95rem;
    }
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

    .prose table th, .prose table td {
        border: 1px solid var(--line);
        padding: 8px 12px;
        text-align: start;
    }

/* Footer */
.site-footer {
    border-block-start: 1px solid var(--line);
    background: var(--bg-soft);
    margin-top: 56px;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding-block: 48px 32px;
}

.site-footer h4 {
    font-size: .95rem;
    margin-bottom: 14px;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer a {
    font-size: .88rem;
    color: var(--text-2);
}

    .site-footer a:hover {
        color: var(--brand);
    }

.site-footer__about p {
    font-size: .88rem;
    color: var(--text-2);
    max-width: 34ch;
}

.site-footer__bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-block: 18px;
    border-block-start: 1px solid var(--line-soft);
    font-size: .8rem;
    color: var(--text-3);
}

.trust-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 800px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
    }
}

/* Auth (login / OTP) */
.auth-wrap {
    max-width: 440px;
    margin-inline: auto;
}

.auth-card {
    padding: 32px 28px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-title {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 4px;
}

.auth-sub {
    text-align: center;
    font-size: .88rem;
    color: var(--text-2);
    margin-bottom: 24px;
}

.auth-alt {
    text-align: center;
    font-size: .85rem;
    color: var(--text-2);
    margin: 18px 0 0;
}

    .auth-alt a {
        color: var(--brand);
        font-weight: 700;
    }

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

    .auth-tabs button {
        flex: 1;
        padding: 10px;
        border-radius: var(--r-sm);
        font-weight: 700;
        font-size: .9rem;
        background: transparent;
        border: 1px solid var(--line);
        color: var(--text-2);
        transition: background var(--t), border-color var(--t), color var(--t);
    }

        .auth-tabs button[aria-selected="true"] {
            background: var(--brand-soft);
            border-color: var(--brand-line);
            color: var(--brand);
        }

.phone-input {
    direction: ltr;
    text-align: center;
    letter-spacing: 1px;
    font-weight: 700;
}

/* OTP boxes */
.otp {
    display: flex;
    gap: 10px;
    direction: ltr;
    justify-content: center;
    margin-block: 24px;
}

    .otp input {
        width: 52px;
        height: 60px;
        text-align: center;
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--text);
        background: var(--bg-soft);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        transition: border-color var(--t), box-shadow var(--t);
    }

        .otp input:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: var(--ring);
        }

@media (max-width: 400px) {
    .otp input {
        width: 44px;
        height: 54px;
        font-size: 1.3rem;
    }
}

.otp-timer {
    text-align: center;
    font-size: .85rem;
    color: var(--text-2);
    margin-bottom: 20px;
}

    .otp-timer b {
        color: var(--brand);
        font-variant-numeric: tabular-nums;
    }

.otp-resend {
    display: block;
    width: fit-content; /* shrink to the text, not the full row */
    margin-inline: auto;
    background: none;
    border: none;
    color: var(--brand);
    font-weight: 700;
    font-size: .88rem;
    padding: 4px;
}

    .otp-resend[disabled] {
        color: var(--text-3);
        cursor: not-allowed;
    }

/* Password visibility toggle */
.pass-field {
    position: relative;
}

    .pass-field .input {
        padding-inline-end: 44px;
        width: 100%;
    }

.pass-toggle {
    position: absolute;
    inset-inline-end: 6px;
    inset-block-start: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-3);
    border-radius: var(--r-sm);
}

    .pass-toggle:hover {
        color: var(--brand);
    }

    .pass-toggle svg {
        width: 18px;
        height: 18px;
    }

/* ---------- 5. Page-specific ---------- */

/* Shop sidebar */
.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
}

.shop-layout__side {
    position: sticky;
    inset-block-start: 84px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* Collapsible filter groups (shop sidebar) */
.filter-group summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    font-weight: 800;
    margin: 0;
    padding: 2px 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

    .filter-group summary::-webkit-details-marker {
        display: none;
    }

    .filter-group summary::after {
        content: "+";
        color: var(--brand);
        font-size: 1.1rem;
        font-weight: 700;
        transition: transform var(--t);
    }

.filter-group[open] summary::after {
    content: "−";
}

.filter-group ul {
    margin-top: 10px;
}

.filter-group .card-pad {
    padding: 16px 18px;
}

/* Shop sidebar on mobile: filters behind a toggle.
   The toggle button lives INSIDE the aside; when the aside is closed
   the whole sidebar (button included) hides. */
.shop-toggle {
    display: none;
}

@media (max-width: 900px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-toggle {
        display: inline-flex;
    }

    .shop-layout__side {
        position: static;
    }

        .shop-layout__side:not(.is-open) > :not(.shop-toggle) {
            display: none;
        }
}

.filter-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-group a, .filter-group label {
    display: flex;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    font-size: .88rem;
    color: var(--text-2);
    cursor: pointer;
}

    .filter-group a:hover {
        background: var(--panel-2);
        color: var(--text);
    }

    .filter-group a.is-active {
        background: var(--brand-soft);
        color: var(--brand);
        font-weight: 700;
    }

/* Product detail */
.product-hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 36px;
    align-items: start;
}

.product-hero__panel {
    position: sticky;
    inset-block-start: 84px;
}

.product-view {
    aspect-ratio: 16 / 10;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0;
    overflow: hidden;
}

    .product-view svg {
        width: 100%;
        height: 100%;
    }

    .product-view img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

@media (max-width: 900px) {
    .product-hero {
        grid-template-columns: 1fr;
    }

    .product-hero__panel {
        position: static;
    }
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .feature-list li {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        font-size: .92rem;
        color: var(--text-2);
    }

        .feature-list li::before {
            content: "✓";
            color: var(--brand);
            font-weight: 800;
        }

/* Checkout layout */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

.order-summary {
    position: sticky;
    inset-block-start: 84px;
}

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .order-summary {
        position: static;
    }
}

/* Blog */
.post-card {
    display: flex;
    flex-direction: column;
}

.post-card__thumb {
    aspect-ratio: 16 / 9;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: 2rem;
}

    .post-card__thumb .ic {
        width: 2.2rem;
        height: 2.2rem;
        opacity: .9;
    }

.post-card > img {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 1px solid var(--line-soft);
}

.post-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

    .post-card__body h3 {
        font-size: 1rem;
        margin: 0;
    }

    .post-card__body p {
        font-size: .85rem;
        color: var(--text-2);
        margin: 0;
    }

.post-meta {
    display: flex;
    gap: 14px;
    font-size: .75rem;
    color: var(--text-3);
}

/* ---------- 6. Utilities ---------- */
.text-brand {
    color: var(--brand);
}

.text-up {
    color: var(--up);
}

.text-down {
    color: var(--down);
}

.text-muted {
    color: var(--text-2);
}

.text-dim {
    color: var(--text-3);
}

.text-center {
    text-align: center;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 40px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.w-100 {
    width: 100%;
}

.num {
    font-variant-numeric: tabular-nums;
}

.hidden {
    display: none !important;
}

.otp + [data-valmsg-for].field-validation-error {
    justify-content: center;
}