/*
 * SIGMAN design tokens — ported 1:1 from the Shopify latest theme:
 *  - config/settings_data.json  (palette, typography, buttons, badges, cards)
 *  - snippets/sgm-design-system.liquid  (--sgm-* scales)
 * Horizon-compatible variable names are kept (--color-foreground-rgb etc.) so the
 * ported section CSS from the Shopify theme works unchanged.
 */
:root {
  /* Color palette (settings_data.json → color_palette) */
  --color-background: #ffffff;
  --color-foreground: #000000;
  --color-background-rgb: 255 255 255;
  --color-foreground-rgb: 0 0 0;
  --color-primary: #09244f;        /* color1 — SIGMAN navy */
  --color-primary-rgb: 9 36 79;
  --color-ink: #333333;            /* color2 */
  --color-border: #dfdfdf;         /* color4 */

  /* Typography — global system: Bebas Neue (display) + DM Sans (body/UI).
     The system fallbacks (Segoe UI / Tahoma / Arial) also carry Arabic glyphs,
     so mixed-language text degrades gracefully — neither webfont has Arabic. */
  --font-body-family: 'DM Sans', -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-body-weight: 400;
  --font-heading-family: var(--font-display-family);
  --font-heading-weight: 400;
  /* Display face — all major headings (see sgm-display-type.css + base.css). */
  --font-display-family: 'Bebas Neue', 'DM Sans', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-display-tracking: 0.05em;
  --font-subheading-weight: 500;
  --font-size-body: 15px;
  --line-height-body: 1.65;        /* DM Sans reads best slightly looser */
  --font-size-h1: 64px;            /* Bebas is condensed — sizes run larger */
  --font-size-h2: 48px;
  --font-size-h3: 36px;
  --font-size-h4: 22px;
  --font-size-h5: 14px;
  --font-size-h6: 12px;
  --line-height-display-tight: 1.08;
  --letter-spacing-heading-tight: 0.03em; /* Bebas needs positive tracking */

  /* Aliases used by CSS ported from the Shopify theme (double-dash names).
     Previously undefined on most pages — they silently fell back to
     sans-serif; now every consumer resolves to the system faces. */
  --font-heading--family: var(--font-display-family);
  --font-body--family: var(--font-body-family);
  --font-paragraph--family: var(--font-body-family);

  /* Layout: page_width = narrow */
  --page-width: 1200px;
  --page-margin: 20px;

  /* Buttons (primary: navy bg, white text, square; secondary: outline, square) */
  --button-primary-bg: var(--color-primary);
  --button-primary-text: #ffffff;
  --button-radius: 0;
  --button-secondary-bg: rgba(0, 0, 0, 0);
  --button-secondary-text: var(--color-foreground);
  --button-secondary-border: 1px solid var(--color-foreground);

  /* Cards / products */
  --card-corner-radius: 4px;
  --product-corner-radius: 0;

  /* Badges: top-right, pill — sale + low-stock in SIGMAN red */
  --badge-radius: 100px;
  --color-sale: #e11900; /* the one brand red: sale, alerts, active heart, errors */
  --badge-sale-bg: var(--color-sale);
  --badge-sale-text: #ffffff;
  --badge-soldout-bg: #eef1ea;
  --badge-soldout-text: #000000cf;

  /* Variant buttons: square, selected = inverted */
  --variant-border: #00000021;
  --variant-selected-bg: var(--color-foreground);
  --variant-selected-text: var(--color-background);
  --variant-radius: 0;

  /* Inputs */
  --input-bg: #ffffffc7;
  --input-text: var(--color-ink);
  --input-border: 1px solid var(--color-border);
  --input-radius: 4px;

  /* Popovers / drawers */
  --popover-radius: 14px;
  --drawer-bg: var(--color-background);
  --drawer-text: #000000cf;

  /* ── sgm-design-system.liquid — spacing scale (4 → 96) ── */
  --sgm-space-4: 4px;   --sgm-space-8: 8px;   --sgm-space-12: 12px;
  --sgm-space-16: 16px; --sgm-space-20: 20px; --sgm-space-24: 24px;
  --sgm-space-32: 32px; --sgm-space-40: 40px; --sgm-space-48: 48px;
  --sgm-space-64: 64px; --sgm-space-80: 80px; --sgm-space-96: 96px;
  /* Section rhythm: one scale for the vertical space between page sections. */
  --section-space: clamp(48px, 5vw, 72px);
  --section-space-tight: clamp(24px, 2.6vw, 36px);

  /* Radius scale */
  --sgm-radius-sm: 4px;
  --sgm-radius-md: 8px;
  --sgm-radius-lg: 14px;
  --sgm-radius-pill: 999px;

  /* Elevation */
  --sgm-shadow-sm: 0 1px 2px rgb(var(--color-foreground-rgb) / 0.04),
                   0 2px 8px rgb(var(--color-foreground-rgb) / 0.05);
  --sgm-shadow-md: 0 6px 18px rgb(var(--color-foreground-rgb) / 0.08),
                   0 12px 30px rgb(var(--color-foreground-rgb) / 0.06);
  --sgm-shadow-lg: 0 18px 50px rgb(var(--color-foreground-rgb) / 0.12);

  /* Motion */
  --sgm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sgm-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sgm-dur: 0.4s;
  --sgm-dur-fast: 0.2s;

  /* Price component (sgm-product-type.css) — one voice for every amount on
     the site: DM Sans, lining tabular figures, currency set as a quiet label. */
  --price-family: var(--font-body-family);
  --price-weight: 600;
  --price-tracking: -0.012em;
  --price-cur-size: max(0.62em, 11px); /* never below 11px: was 9.4px on mobile cards */
  --price-cur-weight: 500;
  --price-cur-tracking: 0.1em;
  --price-cur-opacity: 0.72;
  --price-compare-size: 0.8em;
  --price-compare-opacity: 0.72; /* 0.42 rendered #949494 on white, 3.0:1 */
  --price-size-sm: 0.85rem;   /* sticky bar, cart table unit price */
  --price-size-md: 1rem;      /* product cards, drawer lines, wishlist, checkout rows */
  --price-size-lg: 1.85rem;   /* PDP hero price */

  /* Type accents */
  --sgm-text-eyebrow: 0.72rem;
  --sgm-tracking-wide: 0.16em;
  --sgm-tracking-eyebrow: 0.22em;
}

/* ── Global refinements (sgm-design-system.liquid) ── */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: rgb(var(--color-foreground-rgb) / 0.14); }
.rte { line-height: 1.7; }
img, svg, video, iframe { max-width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
