/* ─── Premium Typography (Variable Font) ─────────────────────────────────── */
/* Using absolute path (/assets/...) so it works everywhere even when inlined via ESR */
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/Montserrat-VariableFont.woff2') format('woff2-variations'),
       url('/assets/fonts/Montserrat-VariableFont.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Albert Sans: the old site's face for product names and section titles. Self-hosted
   (latin subset, variable weight) like Montserrat, so no third-party font request. */
@font-face {
  font-family: 'Albert Sans';
  src: url('/assets/fonts/AlbertSans-VariableFont.woff2') format('woff2-variations'),
       url('/assets/fonts/AlbertSans-VariableFont.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — single source of truth for the storefront.
   Change a value here and it propagates everywhere.
   Every token's default equals the previously most-common hardcoded value, so
   introducing the tokens caused ZERO visual change (font swap aside).
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* ── Typography ─────────────────────────────────────────────────────────── */
  --font-primary: 'Montserrat', sans-serif;
  --font-heading: 'Albert Sans', var(--font-primary);

  /* Posh Palace: black and white with warm greys, one red for sales, gold only in the logo.
     Headings are heavy and tightly tracked; cards and photos have soft rounded corners. */
  --heading-weight: 700;
  --heading-tracking: -0.03em;

  /* The fixed black header's height. Every page's top offset is built on it, so it is
     changed here and nowhere else. */
  --topbar-h: 64px;

  /* ── Core monochrome ────────────────────────────────────────────────────── */
  --bg-color: #ffffff;     /* page background / surfaces (was #fff, #ffffff) */
  --surface: #ffffff;      /* semantic alias for cards/sheets on white */
  --text-color: #050505;   /* primary text */
  --color-ink: #050505;    /* near-black: header, strong buttons, headings */
  --color-ink-soft: #1a1a1a; /* slightly lifted ink: prices */
  --text-strong: #2b2b2b;  /* high-emphasis body text */

  /* ── Neutral gray scale (collapsed from 11 shades → 5) ──────────────────── */
  --gray-700: #444444;     /* absorbs #444, #555 */
  --gray-600: #666666;     /* absorbs #666, #707070, #777 — primary muted */
  --gray-500: #888888;     /* absorbs #888, #999 */
  --gray-400: #aaaaaa;     /* absorbs #aaa, #bbb */
  --gray-300: #cccccc;     /* absorbs #ccc, #ddd */

  /* Semantic text aliases (point into the gray scale) */
  --text-muted: #545454;           /* body copy and muted text */
  --text-subtle: var(--gray-500);  /* placeholders, captions */
  --price-strike: #a0a0a0;         /* struck-through original price */

  /* ── Surfaces (light backgrounds) ───────────────────────────────────────── */
  --surface-muted: #f2f2f2;  /* sold-out pill, quiet chips */
  --surface-alt: #f0f0f0;    /* absorbs #f0f0f0 */
  --surface-subtle: #fafafa; /* absorbs #fafafa, #f9f9f9, #f8f8f8, #fcfcfc */

  /* ── Borders / dividers ─────────────────────────────────────────────────── */
  --border-color: #e0e0e0;  /* standard border (absorbs #e5e5e5, #e8e8e8) */
  --border-light: #ebebeb;  /* lighter divider: top bar line, card edges */

  /* ── Brand accents ──────────────────────────────────────────────────────── */
  --color-sale: #db1215;        /* % OFF badges and the Buy now button */
  --offer-bg: #fbf8f1;          /* "Buy 2, save 10%" offer box */
  --offer-border: #e2d8c3;
  --offer-text: #24201a;
  --brand-gold-start: #b8862d;  /* the logo's gold, top to bottom */
  --brand-gold-end: #f7f08a;

  /* ── Status colors (each meaning unified to ONE hex) ────────────────────── */
  --color-danger: #ef4444;   /* errors, destructive (absorbs #e53935, #d32f2f, #e00) */
  --color-success: #22c55e;  /* success, in-stock (absorbs #10b981, #4caf50) */
  --color-warning: #f59e0b;  /* warnings, low-stock (absorbs #f97316, #ff9800) */
  --color-info: #3b82f6;     /* informational (absorbs #2196f3) */
  --color-accent: #8b5cf6;   /* accent / highlight (absorbs #9c27b0) */

  /* ── Brand promo gradient (Free Delivery badge) ─────────────────────────── */
  --promo-start: #050505;
  --promo-end: #3a3a3a;
  --gradient-promo: linear-gradient(135deg, var(--promo-start), var(--promo-end));

  /* ── Shadows (composite — full box-shadow values) ───────────────────────── */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);      /* subtle hairline lift */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);       /* default card/element */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);   /* card hover */
  --shadow-raised: 0 2px 6px rgba(0, 0, 0, 0.1);   /* raised control */
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);      /* popover / menu */
  --shadow-float: 0 4px 10px rgba(0, 0, 0, 0.2);   /* floating button */
  --shadow-dropdown: 0 10px 30px rgba(0, 0, 0, 0.05); /* dropdown panel */
  --shadow-drawer: -5px 0 15px rgba(0, 0, 0, 0.1); /* side drawer */
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.12); /* bottom sheet */
  --text-shadow-hero: 0 2px 4px rgba(0, 0, 0, 0.5); /* hero text legibility */

  /* ── Black overlays / scrims ────────────────────────────────────────────── */
  --overlay-faint: rgba(0, 0, 0, 0.02);   /* faint tint */
  --overlay-soft: rgba(0, 0, 0, 0.2);     /* light dim */
  --overlay-medium: rgba(0, 0, 0, 0.4);   /* medium dim */
  --overlay-scrim: rgba(0, 0, 0, 0.5);    /* modal / sheet backdrop (absorbs 0.45) */
  --overlay-heavy: rgba(0, 0, 0, 0.95);   /* near-opaque */

  /* ── White glass / frost ────────────────────────────────────────────────── */
  --glass-light: rgba(255, 255, 255, 0.85);  /* frosted bars (absorbs 0.82, 0.9) */
  --glass-strong: rgba(255, 255, 255, 0.95); /* heavy frost (absorbs 0.92) */

  /* ── White translucency (UI on dark surfaces) ───────────────────────────── */
  --white-a08: rgba(255, 255, 255, 0.08);
  --white-a12: rgba(255, 255, 255, 0.12);
  --white-a15: rgba(255, 255, 255, 0.15);
  --white-a18: rgba(255, 255, 255, 0.18);
  --white-a55: rgba(255, 255, 255, 0.55);

  /* ── Shapes ─────────────────────────────────────────────────────────────── */
  --radius-none: 0px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-full: 50%;   /* avatars, dots, swatches */
  --radius-pill: 50px;
  --radius-card: 14px;  /* product and collection cards */
  --radius-media: 10px; /* photos inside cards, banners */

  /* ── Spacing System ─────────────────────────────────────────────────────── */
  --gap-section: 64px;      /* Large gaps between major sections */
  --gap-section-sm: 40px;   /* Mobile section gap */
  --gap-element-lg: 32px;   /* Large element gap (e.g., between form sections) */
  --gap-element: 24px;      /* Standard element gap (e.g., below section titles) */
  --gap-element-sm: 16px;   /* Small element gap (e.g., between form inputs) */
  --gap-element-xs: 8px;    /* Extra small gap (e.g., between labels and inputs) */
}

html {
  overflow-x: hidden;  /* must be on html — body alone doesn't clip in all browsers */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  font-size: 0.875rem; /* 14px, the old site's body size */
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; /* Crisp text on macOS */
  line-height: 1.6; /* Better readability */
  text-rendering: optimizeLegibility;
  overflow-x: hidden;  /* prevent any element from causing horizontal page scroll */
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll — smoother feel on iPhone/iPad */
}

/* ─── Typography Refinements (Premium Look) ────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  letter-spacing: var(--heading-tracking);
  font-weight: var(--heading-weight);
}

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-primary);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Bootstrap Icons Global Alignment ─────────────────────────────────── */
/* Ensures all bi-* icons are vertically centered inline without per-component hacks */
i[class^="bi"],
i[class*=" bi"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}


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

/* Fields stay at 16px whatever the body size: below that iOS zooms the page on focus */
input,
select,
textarea {
  font-size: 1rem;
}

/* ─── Mobile Form Resets (iOS/Safari Fixes) ────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius-sm);
  background-color: var(--bg-color);
}

/* ─── Touch & Selection ──────────────────────────────────────────────────── */
a, button, label,
[onclick], [role="button"] {
  user-select: none;
  -webkit-touch-callout: none;
}

img {
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  /* NOTE: do NOT set `pointer-events: auto` here. `auto` is already the default,
     and this blanket rule overrode `pointer-events: none` on hidden overlay
     parents (e.g. the closed product lightbox), leaving an invisible image
     sitting fixed in the middle of the viewport that swallowed taps and killed
     touch-scroll. */
}

@media (max-width: 768px) {
  body {
    /* Prevent the fixed mobile bottom bar from overlapping content at the very bottom */
    padding-bottom: 70px;
  }
}

/* Global Select Options Styling - Override default blue highlight with black */
select option {
  background-color: var(--bg-color);
  color: var(--color-ink);
  padding: 8px 12px;
}
select option:hover,
select option:focus,
select option:active,
select option:checked {
  background-color: var(--color-ink) !important;
  background: var(--color-ink) !important;
  color: var(--bg-color) !important;
  cursor: pointer;
}
/* Inset shadow trick to override default blue selection color on Chrome/Edge/Firefox where supported */
select option:checked {
  box-shadow: 0 0 10px 100px var(--color-ink) inset !important;
  -webkit-box-shadow: 0 0 10px 100px var(--color-ink) inset !important;
  color: var(--bg-color) !important;
}

/* Read by screen readers, not shown */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
