/* ═══════════════════════════════════════════════════════════════════════
   LAYER 1 — TOKENS
   Every design decision the storefront makes lives here as a CSS custom
   property. No other file in this system may declare a raw hex colour, a
   bare px/rem magic number for spacing/type, or a literal shadow/easing —
   everything downstream consumes a var(--token). This is what lets
   theme.css re-skin the whole store by overriding a handful of variables
   instead of hunting through component rules.

   Base identity (the "modern" preset, also the system default before any
   [data-theme] override applies): a deep navy brand on a bright
   editorial-white canvas, with a cool light-grey tray behind product
   photography so images read as staged goods, not cut-outs floating on
   white. Navy + antique gold replaced the previous ink-teal + sand pairing
   on 2026-08-24 (store-redesign S1) to match the founder-supplied MIZA
   storefront comp; the STRUCTURE below is unchanged — only these values
   moved, which is the whole point of keeping them in one layer. This is
   a deliberate departure from the three AI-storefront defaults (cream +
   terracotta + serif · near-black + acid accent · broadsheet hairlines) —
   see theme.css header for the other four merchant presets built on the
   same structural system.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Neutral ramp — ink scale, warm-grey undertone ─────────────────── */
    /* ⭐ FOUNDER-SPECIFIED PALETTE (2026-08-25). These hex values are given
       verbatim in the founder's design brief §1 — they are the brand identity,
       not a designer's choice to re-derive. Only --neutral-300 and --brand-900
       are derived (the brief names no "stronger border" or "deeper navy"), and
       both are marked below. MEASURED contrast, all AA-passing:
         #ffffff on #081A36 → 17.34   ·   #172033 on #C99A2E → 6.31
         #172033 on #F7F8FA → 15.31   ·   #667085 on #ffffff →  4.97
       ⛔ #ffffff on #C99A2E → 2.58 — FAILS. Gold carries ink, never white. */
    --neutral-0:    #ffffff;   /* Surface */
    --neutral-50:   #f7f8fa;   /* Background */
    --neutral-100:  #f7f8fa;   /* paper-muted surfaces (filter rail, meta rows) */
    --neutral-150:  #f7f8fa;   /* the tray behind product photography */
    --neutral-200:  #e6e8ec;   /* Border */
    --neutral-300:  #d0d5dd;   /* DERIVED — stronger borders / input borders */
    --neutral-500:  #667085;   /* Secondary Text */
    --neutral-600:  #667085;   /* Secondary Text */
    --neutral-900:  #172033;   /* Main Text */

    /* ── Brand ramp — deep navy ─────────────────────────────────────────── */
    --brand-100:    #eef1f6;   /* brand tint — hover fills, active nav underlines' halo */
    --brand-700:    #081a36;   /* Primary Navy — header, nav, primary buttons */
    --brand-800:    #102849;   /* Navy Hover — LIGHTER than primary, per the brief */
    --brand-900:    #050f1f;   /* DERIVED — utility bar / footer, one step deeper */
    --brand-on:     #ffffff;   /* text/icon colour placed on top of --brand-700 */

    /* ── Semantic ramp — status colours, each with base / tint / line ──── */
    --success-base: #1f9d61;   /* founder brief §1 — Success */
    --success-tint: #e5f4ec;
    --success-line: #bfe3cf;
    --success-on:   #ffffff;

    --warning-base: #a06a12;
    --warning-tint: #fbf1de;
    --warning-line: #eed6a6;
    --warning-on:   #1c1206;

    --danger-base:  #d92d20;   /* founder brief §1 — Error */
    --danger-tint:  #fbeae7;
    --danger-line:  #f0c9c0;
    --danger-on:    #ffffff;

    --info-base:    #1f5f8b;
    --info-tint:    #e5f0f7;
    --info-line:    #bcdaeb;
    --info-on:      #ffffff;

    /* Ramp value only — the CONSUMED name is `--gold`, computed in theme.css's
       override block as var(--merchant-accent, var(--preset-gold)). This must NOT
       be called `--gold` itself: until 2026-08-24 it was, so the modern preset's
       `--preset-gold: var(--gold)` and the override's `--gold: var(--preset-gold)`
       formed a cycle, which CSS resolves by making BOTH invalid at computed-value
       time. MEASURED before the fix: getComputedStyle(:root)['--gold'] === "" on
       the live store — every gold accent on the shipped theme rendered as nothing.
       The other four presets escaped it only because they set a literal here. */
    --gold-base:    #c99a2e;   /* founder brief §1 — Gold Primary */  /* accent — CTAs, "compare at" ribbons, price emphasis.
                                 NOT white-safe: MEASURED white-on-gold = 2.80:1 (fails AA),
                                 MEASURED ink(#14171c)-on-gold = 6.41:1 (passes AA).
                                 So gold buttons carry --neutral-900 ink, never white. */

    /* ── Typography ──────────────────────────────────────────────────────────
       Arabic and Latin are NOT the same font at the same leading — Arabic
       needs a taller line-height for diacritics/ascenders, and pairing one
       Latin family onto an Arabic-tuned metric reads visually smaller and
       cramped. So there is no single --font-display/--font-body here.
       Every preset in theme.css declares FOUR family tokens (display/body ×
       ar/en) and TWO leading multipliers (ar/en); base.css resolves the
       consumed --font-display/--font-body/--leading-* names via :lang(),
       so every component below still writes plain var(--font-body) and
       gets the right language's face without knowing which language it is
       looking at. This is the mechanism, not the values — actual per-theme
       families live in theme.css. ────────────────────────────────────── */

    --leading-tight-ar:   1.35;  --leading-tight-en:   1.2;
    --leading-snug-ar:    1.45;  --leading-snug-en:    1.3;
    --leading-normal-ar:  1.7;   --leading-normal-en:  1.5;
    --leading-relaxed-ar: 1.95;  --leading-relaxed-en: 1.75;

    --text-xs:   .75rem;     /* 12px — badges, timestamps */
    --text-sm:   .8125rem;   /* 13px — captions, meta */
    --text-base: .875rem;    /* 14px — dense UI copy (filters, form labels) */
    --text-md:   1rem;       /* 16px — body copy, base */
    --text-lg:   1.125rem;   /* 18px — card titles, lead paragraphs */
    --text-xl:   1.25rem;    /* 20px — section sub-headings */
    --text-2xl:  1.5rem;     /* 24px — section headings */
    --text-3xl:  2rem;       /* 32px — page headings */
    --text-4xl:  2.5rem;     /* 40px — feature headings */
    --text-5xl:  clamp(2rem, 5vw, 3.2rem); /* hero title, fluid */

    --weight-regular:  400;
    --weight-medium:   500;
    --weight-semibold: 600;
    --weight-bold:     700;

    --leading-tight:   1.2;
    --leading-snug:    1.3;
    --leading-normal:  1.5;
    --leading-relaxed: 1.75;

    /* ── Spacing — 4px grid ──────────────────────────────────────────────── */
    --space-1:  .25rem;  /* 4px  */
    --space-2:  .5rem;   /* 8px  */
    --space-3:  .75rem;  /* 12px */
    --space-4:  1rem;    /* 16px */
    --space-5:  1.25rem; /* 20px */
    --space-6:  1.5rem;  /* 24px */
    --space-8:  2rem;    /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    --space-20: 5rem;    /* 80px */
    --space-24: 6rem;    /* 96px */

    /* ── Radii — merchant-overridable via theme.css ─────────────────────── */
    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   20px;
    --radius-full: 999px;

    /* ── Shadows ─────────────────────────────────────────────────────────── */
    --shadow-sm:    0 1px 2px rgba(20, 23, 28, .06);
    --shadow-card:  0 1px 2px rgba(20, 23, 28, .04), 0 10px 26px rgba(20, 23, 28, .07);
    --shadow-pop:   0 12px 28px rgba(0, 0, 0, .28);
    --shadow-inset: inset 0 0 0 1px rgba(20, 23, 28, .08);

    /* ── Motion — 150–250ms band, three easings ─────────────────────────── */
    --duration-fast: 150ms;
    --duration-base: 200ms;
    --duration-slow: 250ms;
    --ease-standard:    cubic-bezier(.4, 0, .2, 1);
    --ease-decelerate:  cubic-bezier(0, 0, .2, 1);
    --ease-accelerate:  cubic-bezier(.4, 0, 1, 1);

    /* ── Z-index scale ───────────────────────────────────────────────────── */
    --z-dropdown: 30;
    --z-sticky:   40;
    --z-overlay:  90;
    --z-drawer:   100;
    --z-modal:    100;
    --z-toast:    110;

    /* ── Breakpoints — documented values (CSS custom properties cannot be
       referenced inside @media feature queries per spec); every file that
       needs a breakpoint repeats the literal px value and cites this token
       name in a comment so the source of truth stays this one block. ──── */
    --bp-xs:  480px;  /* 2-up product grid collapse */
    --bp-sm:  640px;  /* container gutter tightens */
    --bp-md:  768px;  /* footer columns stack */
    --bp-lg:  900px;  /* filter rail stacks above results */
    --bp-xl:  1280px; /* container max-width ceiling */

    /* ── Container ───────────────────────────────────────────────────────── */
    --container-max:        1280px;   /* founder brief §2 — content container */  /* 1280 → 1400 on 2026-08-24: at 1280 the home
                                        page's 72/28 split left the 6-up featured row
                                        ~153px per card, which wrapped "أضف إلى السلة"
                                        onto three lines. MEASURED on screen, not guessed. */
    --container-padding:    1.5rem;
    --container-padding-sm: 1rem;

    /* ── Image ratios ────────────────────────────────────────────────────── */
    --ratio-square: 1 / 1;
    --ratio-4-3:    4 / 3;
    --ratio-16-9:   16 / 9;
    --ratio-3-4:    3 / 4;

    /* ── Country-variable layout hooks ───────────────────────────────────────
       These are SHAPE-ONLY. The field set for an address, the phone country
       code, the tax wording — all of that is core-supplied content (one
       backend, per the founder's standing rule); nothing here encodes which
       fields a given country has. --form-field-min sizes a CSS Grid that
       accepts however many fields the core sends, laying itself out at any
       count from 2 to 8 without a template rewrite. ─────────────────────── */
    --form-field-min: 220px;
}
