/* ============================================================
   QUICK ERP B2B — Global design tokens
   Single source of truth for color, type, spacing, elevation.
   Components must consume these variables — never raw values.
   Design language: clean commerce UI, royal blue on slate neutrals.
   ============================================================ */

:root {
    /* ---- Brand type ---- */
    --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    /* Ürün kartı fiyatı — sade, ince grotesk (moda e-ticaret sitelerindeki
       gibi). Ek web fontu indirilmez; sistemdeki Helvetica/Arial kullanılır. */
    --font-price: 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* ---- Type scale (fluid) ---- */
    --text-xs: 0.72rem;
    --text-sm: 0.83rem;
    --text-md: 0.95rem;
    --text-lg: 1.1rem;
    --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
    --text-2xl: clamp(1.45rem, 1.2rem + 1.2vw, 2.1rem);
    --text-hero: clamp(1.8rem, 1.3rem + 2.6vw, 3.1rem);

    /* ---- Spacing scale ---- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;

    /* ---- Radii ---- */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* ---- Motion ---- */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 160ms;
    --dur-med: 320ms;
    --dur-slow: 640ms;

    /* ---- Z-index layers ---- */
    --z-header: 100;
    --z-dropdown: 200;
    --z-drawer: 300;
    --z-modal: 400;
    --z-toast: 500;

    /* ---- Imagery overlays (theme-independent: always dark over photos) ---- */
    --scrim: #0b1322;
    --on-scrim: #eef3fb;
    --on-scrim-soft: #c3cede;

    /* Koyu marka tonu — TEMA BAĞIMSIZ, koyu blokta ezilmez.
       ⚠️ Her iki temada da koyu kalan dekoratif yüzeyler (login paneli gibi)
       --primary-strong KULLANAMAZ: o token koyu temada AÇIK bir renge dönüyor
       (#6d9bff) ve üstündeki beyaz yazı 2.42:1'e düşüyor — AA sınırı 4.5.
       --brand-deep her zaman açık temanın koyu marka tonudur; brand.css onu
       seçilen markaya göre ezer. */
    --brand-deep: #1d4ed8;

    /* ---- Layout ---- */
    /* Full-width canvas: content spans the whole viewport with only a
       small edge padding — no boxed max-width. */
    --container-max: 100%;
    --container-pad: clamp(1rem, 2vw, 2rem);
    /* Height of the sticky header (condensed state) — sticky page
       elements (sidebars, summaries) offset by this */
    --header-offset: 6rem;
}

/* On mobile the sticky header is the single main row only */
@media (max-width: 960px) {
    :root {
        /* Mobilde header iki satır: [burger + logo] + [arama] ≈ 101px */
        --header-offset: 6.3rem;
    }
}

/* ---- Light theme (default) ---- */
:root,
:root[data-theme='light'] {
    color-scheme: light;

    --page-bg: #e7ebf1;         /* backdrop behind the app canvas */
    --canvas: #f5f7fa;          /* cool light-grey page background */
    --surface: #ffffff;         /* cards, panels */
    --surface-2: #f1f4f8;       /* subtle wells, hover fills */
    --surface-3: #e6eaf1;       /* pressed / deep wells */
    --ink: #0f172a;             /* primary text */
    --price-ink: #000000;       /* ürün kartı fiyatı — saf siyah */
    --ink-soft: #475569;        /* secondary text */
    --ink-faint: #94a3b8;       /* tertiary text, placeholders */
    --line: #e2e8f0;            /* hairlines, borders */
    --line-strong: #cbd5e1;

    --primary: #2563eb;         /* royal blue */
    --primary-strong: #1d4ed8;
    --primary-soft: #eff4ff;    /* tinted fills behind blue content */
    --on-primary: #ffffff;

    --accent: #3b82f6;          /* lighter blue for highlights */
    --accent-strong: #2563eb;
    --accent-soft: #ebf2ff;
    --on-accent: #ffffff;

    /* ⚠️ "-strong" varyantlar KÜÇÜK METİN İÇİN. Düz --success / --warning
       açık temada soft zeminde 3:1'in altında kalıyor; büyük rakamda sorun
       değil ama rozet gibi 0.66rem bir yazıda okunmuyor. Koyu temada tersi:
       strong olan DAHA AÇIK (--primary-strong ile aynı mantık). */
    --success: #16a34a;
    --success-soft: #e8f7ee;
    --success-strong: #14713a;
    --danger: #dc2626;
    --danger-soft: #fbe9e9;
    --danger-strong: #b91c1c;
    --warning: #d97706;
    --warning-soft: #fcf0dd;
    --warning-strong: #b45309;

    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05), 0 2px 8px rgb(15 23 42 / 0.04);
    --shadow-md: 0 2px 6px rgb(15 23 42 / 0.06), 0 10px 28px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 6px 16px rgb(15 23 42 / 0.09), 0 24px 56px rgb(15 23 42 / 0.13);
    --overlay: rgb(15 23 42 / 0.45);
    --glass: rgb(255 255 255 / 0.82);

    /* Footer follows the theme */
    --footer-bg: #ffffff;
    --footer-ink: #475569;
    --footer-strong: #0f172a;
}

/* ---- Dark theme ---- */
:root[data-theme='dark'] {
    color-scheme: dark;

    --page-bg: #050a12;         /* backdrop behind the app canvas */
    --canvas: #0b1322;          /* deep navy-slate */
    --surface: #131c2e;
    --surface-2: #1a2438;
    --surface-3: #223050;
    --ink: #e6eaf2;
    --price-ink: #ffffff;       /* koyu temada siyah okunmaz → beyaz */
    --ink-soft: #a5b1c6;
    --ink-faint: #64748b;
    --line: #223049;
    --line-strong: #31415e;

    --primary: #4c82f7;
    --primary-strong: #6d9bff;
    --primary-soft: #16233f;
    --on-primary: #ffffff;

    --accent: #4c82f7;
    --accent-strong: #6d9bff;
    --accent-soft: #152540;
    --on-accent: #ffffff;

    --success: #34c273;
    --success-soft: #123526;
    --success-strong: #56d68d;
    --danger: #ef6a5f;
    --danger-soft: #3a1917;
    --danger-strong: #ff8a80;
    --warning: #e8a13c;
    --warning-soft: #33260d;
    --warning-strong: #f0b45c;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4), 0 2px 8px rgb(0 0 0 / 0.3);
    --shadow-md: 0 2px 6px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 6px 16px rgb(0 0 0 / 0.5), 0 24px 56px rgb(0 0 0 / 0.55);
    --overlay: rgb(3 7 15 / 0.62);
    --glass: rgb(19 28 46 / 0.82);

    --footer-bg: #0b1322;
    --footer-ink: #a5b1c6;
    --footer-strong: #e6eaf2;
}
