/* ============================================================
   FROST LABS — BASE STYLESHEET (loaded site-wide)
   Design System v1.0, verbatim. Tokens + global primitives +
   every SHARED component (navbar, buttons, badges, fields,
   product grid/card, tabs, COA card, accordion, trust strip,
   CTA band, footer). Page-specific styles live in home.css /
   shop.css / product.css etc. and are enqueued conditionally.
   No token is added, removed, or altered from v1.0.
   ============================================================ */

/* ---- DESIGN TOKENS (v1.0, verbatim) ---------------------- */
:root {
  /* Colors */
  --bg-base:       #0C0C0E;
  --bg-surface:    #131318;
  --bg-elevated:   #17171C;
  --bg-overlay:    #1E1E26;
  --border-subtle: #1E1E2A;
  --border-default:#28283A;
  --text-primary:  #FFFFFF;
  --text-secondary:#8B8FA8;
  --text-muted:    #7E82A0;
  --accent:        #2F80ED;
  --accent-strong: #2A72D8;
  --accent-light:  #4B96F5;
  --accent-dim:    rgba(47,128,237,0.12);
  --accent-glow:   rgba(47,128,237,0.25);
  --success:       #22C55E;
  --warning:       #F59E0B;
  --danger:        #EF4444;

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  10px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow:  0 4px 16px var(--accent-glow);

  /* Animation */
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --dur-fast: 200ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;

  /* Spacing — 8px base scale */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px;  --sp-8: 32px;  --sp-10:40px;
  --sp-12:48px; --sp-16:64px;  --sp-20:80px;  --sp-24:96px;

  /* Layout */
  --container: 1200px;
  --gutter: var(--sp-10);          /* 40px desktop */
  --section-gap: var(--sp-24);     /* 96px desktop */
  --nav-h: 64px;
  --z-nav: 50; --z-drawer: 60; --z-skip: 100;
}

/* ---- RESET & BASE --------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;                 /* v1.0 base */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { list-style: none; }
:where(h1, h2, h3, h4) { line-height: 1.15; font-weight: 700; }

/* ---- TYPE SCALE (v1.0) ---------------------------------- */
.t-display { font-size: clamp(40px, 8vw, 72px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.t-h1      { font-size: clamp(32px, 6vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.t-h2      { font-size: clamp(28px, 5vw, 36px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.t-h3      { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.t-h4      { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; }
.t-body-lg { font-size: 17px; line-height: 1.7; color: var(--text-secondary); }
.t-body    { font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.t-body-sm { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.t-label   { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

/* ---- ACCESSIBILITY UTILITIES ---------------------------- */
.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;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: var(--z-skip);
  background: var(--accent-strong); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-md); transition: top var(--dur-fast);
}
.skip-link:focus { top: var(--sp-4); }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-light); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- LAYOUT PRIMITIVES ---------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-gap); }
.section--surface { background: var(--bg-surface); }

/* Scroll-reveal (progressively enhanced; visible by default if no JS) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Reusable section header (kicker + h2 + intro) */
.section-header { max-width: 640px; margin-bottom: var(--sp-10); }
.section-header__kicker { display: block; margin-bottom: var(--sp-3); }
.section-header__title { color: var(--text-primary); }
.section-header__intro { margin-top: var(--sp-4); }
.section-header--center { margin-inline: auto; text-align: center; }

/* Progressive-enhancement visibility helpers (reuse the no-js→js swap) */
.js [data-nojs-only]   { display: none !important; }
.no-js [data-js-only]  { display: none !important; }

/* ---- BUTTONS (v1.0) ------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 12px 24px; border-radius: var(--radius-md); border: none;
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn-primary   { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-ghost     { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-default); }
.btn-link      { background: none; padding: 0; color: var(--accent); font-weight: 600; }
.btn-link:hover { color: var(--accent-light); }
.btn-sm  { padding: 8px 16px; font-size: 13px; }
.btn-lg  { padding: 16px 32px; font-size: 15px; }
.btn-full { width: 100%; }

/* ---- BADGES (v1.0, tinted, borderless) ------------------ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.badge-success { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-blue    { background: var(--accent-dim); color: var(--accent); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-muted   { background: var(--bg-overlay); color: var(--text-secondary); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---- FORM CONTROLS (search / newsletter inputs) --------- */
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.field {
  width: 100%; padding: 12px 16px; background: var(--bg-elevated);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color var(--dur-fast);
}
.field::placeholder { color: var(--text-muted); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Reusable feature-image blend utility (hero/calc/product treatments) */
.media-blend { mix-blend-mode: lighten; -webkit-mask-image: radial-gradient(120% 120% at 50% 48%, #000 62%, transparent 100%); mask-image: radial-gradient(120% 120% at 50% 48%, #000 62%, transparent 100%); }

/* ============================================================
   COMPONENT: Site header / navbar
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: var(--z-nav);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(12,12,14,0.85);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom-color: var(--border-subtle);
}
.nav { display: flex; align-items: center; gap: var(--sp-10); height: var(--nav-h); }
.nav__logo { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); }
.nav__logo span { color: var(--accent); }
.nav__menu { display: flex; gap: var(--sp-8); flex: 1; }
.nav__link {
  position: relative; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  padding-block: 2px; transition: color var(--dur-fast);
}
.nav__link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text-primary); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: var(--sp-2); }
.nav__icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); transition: border-color var(--dur-fast), color var(--dur-fast);
}
.nav__icon:hover { border-color: var(--accent); color: var(--accent); }
.nav__icon svg { width: 18px; height: 18px; }
.nav__cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-strong); color: #fff; font-size: 9px; font-weight: 700; border-radius: var(--radius-full);
}
.nav__toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); color: var(--text-primary); }
.nav__toggle svg { width: 20px; height: 20px; }
.nav__search { display: flex; gap: var(--sp-2); padding-bottom: var(--sp-4); }
.nav__search[hidden] { display: none; }

/* ============================================================
   COMPONENT: Announcement bar (admin-editable via Theme Settings)
   ============================================================ */
.announcement-bar { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.announcement-bar__inner { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); padding-block: var(--sp-2); text-align: center; }
.announcement-bar__text { font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--text-secondary); }
.announcement-bar__text a { color: var(--accent); font-weight: 600; }

/* ============================================================
   SECTION: Trust strip (shared: homepage + product page)
   ============================================================ */
.trust-strip { border-block: 1px solid var(--border-subtle); }
.trust-strip__list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-4) var(--sp-8); padding-block: var(--sp-6); }
.trust-strip__item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.trust-strip__item svg { width: 16px; height: 16px; color: var(--accent); }

/* ============================================================
   COMPONENT: Product grid + card (reusable)
   ============================================================ */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.product-grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid-cta { margin-top: var(--sp-8); text-align: center; }

.product-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.product-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
/* Photography integrated into the card: image area flows out of the card surface with
   one subtle studio stage; the render's black backdrop dissolves via 'lighten', and the
   vial is enlarged to lead the card. */
/* STANDARDIZED STUDIO RENDER — identical to the Single Product Page's .gallery__hero.
   Pure #000 stage (deep blacks, no gray haze) + contrast/brightness for crystal glass
   and bright speculars + mix-blend lighten + soft feathered floor reflection. Same
   framing/scale/alignment everywhere so every product reads as one studio. Card chrome
   (surface, border, radius, shadow, padding) is unchanged. */
.product-card__media { position: relative; aspect-ratio: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000 radial-gradient(58% 60% at 50% 48%, #101014 0%, #000 72%); }
.product-card__media img { width: auto; height: auto; max-width: 82%; max-height: 74%; object-fit: contain; transform-origin: center; mix-blend-mode: lighten; filter: contrast(1.08) brightness(1.03) saturate(1) drop-shadow(0 12px 20px rgba(0,0,0,0.5)); -webkit-box-reflect: below 2px linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.18) 6%, transparent 12%); transition: transform var(--dur-base) var(--ease-out); }
.product-card__flag { position: absolute; top: 12px; left: 12px; }
.product-card__body { display: flex; flex-direction: column; padding: var(--sp-4); flex: 1; }
.product-card__tag { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--sp-1); }
.product-card__stars { color: var(--warning); font-size: 11px; margin-bottom: var(--sp-2); }   /* amber = semantic rating (v1.0) */
.product-card__stars .count { color: var(--text-muted); }
.product-card__name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.product-card__name a { text-decoration: none; }
.product-card__name a::after { content: ''; position: absolute; inset: 0; }  /* stretched link → whole card focusable/clickable */
.product-card__name a:focus-visible { outline: none; }
.product-card:has(.product-card__name a:focus-visible) { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.product-card__stock { margin-top: var(--sp-1); }
.product-card__price { margin-top: var(--sp-2); font-size: 17px; font-weight: 700; color: var(--accent); }
.product-card__price del { color: var(--text-muted); font-weight: 400; font-size: 14px; margin-right: 6px; }
.product-card__action { margin-top: var(--sp-3); position: relative; z-index: 2; opacity: 0; transition: opacity var(--dur-fast); }
.product-card:hover .product-card__action,
.product-card:focus-within .product-card__action { opacity: 1; }

/* ============================================================
   COMPONENT: Tabs (Explore filter / product jump-nav)
   ============================================================ */
.tabs { display: inline-flex; gap: 4px; background: var(--bg-elevated); padding: 4px; border-radius: var(--radius-md); margin-bottom: var(--sp-8); }
.tab { padding: 8px 16px; border: none; background: transparent; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: background-color var(--dur-fast), color var(--dur-fast); }
.tab[aria-pressed="true"] { background: var(--bg-overlay); color: var(--text-primary); }
.tab[aria-pressed="false"]:hover { color: var(--text-primary); }
.product-card.is-hidden { display: none; }

/* ============================================================
   COMPONENT: Lab testing / COA cards
   ============================================================ */
.coa-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.coa-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.coa-card__thumb { position: relative; aspect-ratio: 3/2; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border-radius: var(--radius-md); color: var(--text-muted);
  font-size: 11px; font-weight: 500; letter-spacing: 0.05em; }
.coa-card__thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0.8; }
.coa-card__thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,12,14,0.30), rgba(12,12,14,0.55)); pointer-events: none; }
.coa-card__name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.coa-card__purity { display: flex; align-items: center; gap: 6px; }
.coa-card__bar { flex: 1; height: 3px; background: var(--border-default); border-radius: var(--radius-full); overflow: hidden; }
.coa-card__fill { height: 100%; background: var(--success); border-radius: var(--radius-full); }
.coa-card__pct { font-size: 12px; font-weight: 700; color: var(--success); }
.coa-card__meta { font-size: 11px; color: var(--text-muted); }
.coa-card__actions { display: flex; gap: var(--sp-2); margin-top: auto; }

/* ============================================================
   COMPONENT: FAQ accordion (shared: homepage + product + FAQ page)
   ============================================================ */
.faq { max-width: 720px; }
.accordion__item { border-bottom: 1px solid var(--border-subtle); }
.accordion__trigger {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) 0; background: none; border: none; text-align: left;
  font-size: 15px; font-weight: 500; color: var(--text-primary); transition: color var(--dur-fast);
}
.accordion__trigger:hover { color: var(--accent); }
.accordion__icon { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast); }
.accordion__trigger:hover .accordion__icon { border-color: var(--accent); color: var(--accent); }
.accordion__trigger[aria-expanded="true"] .accordion__icon { transform: rotate(45deg); }
.accordion__panel { overflow: hidden; }
.accordion__panel[hidden] { display: none; }
.accordion__panel-inner { padding-bottom: var(--sp-4); font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ============================================================
   COMPONENT: Pre-footer CTA band
   ============================================================ */
.cta-band { text-align: center; }
.cta-band__title { color: var(--text-primary); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-8); }

/* ============================================================
   COMPONENT: Footer
   ============================================================ */
.site-footer { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); padding-block: var(--sp-12) var(--sp-8); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-10); margin-bottom: var(--sp-10); }
.footer__logo { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: var(--sp-3); }
.footer__logo span { color: var(--accent); }
.footer__tagline { font-size: 13px; color: var(--text-secondary); line-height: 1.7; max-width: 260px; }
.footer__col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: var(--sp-4); }
.footer__link { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; transition: color var(--dur-fast); }
.footer__link:hover { color: var(--text-primary); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding-top: var(--sp-6); border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); }
.footer__social { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.footer__social a { color: var(--text-muted); transition: color var(--dur-fast); }
.footer__social a:hover { color: var(--accent); }
.footer__social svg { width: 18px; height: 18px; }

/* ============================================================
   RESPONSIVE (global / shared components)
   ============================================================ */
@media (max-width: 900px) {
  :root { --section-gap: var(--sp-16); --gutter: var(--sp-5); }
  .product-grid, .product-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .product-grid, .product-grid--4 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }

  /* Mobile nav: hide inline menu, show toggle + drawer */
  .nav__menu {
    position: fixed; inset: var(--nav-h) 0 auto 0; z-index: var(--z-drawer);
    flex-direction: column; gap: 0; background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle); padding: var(--sp-4) var(--sp-5);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity var(--dur-fast), transform var(--dur-fast);
  }
  .nav__menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__link { padding: var(--sp-3) 0; font-size: 15px; }
  .nav__toggle { display: inline-flex; }
}

/* Touch devices: enforce 44px minimum targets (v1.0) */
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .nav__icon { width: 44px; height: 44px; }
  .tab { min-height: 44px; }
  .product-card__action { opacity: 1; }  /* Quick Add always visible on touch */
}
