/* ═══════════════════════════════════════════════════════════
   Brae — BLACK NOVEMBER theme (loads AFTER styles.css)
   Near-black + warm cream + Brazilian gold.
   Flips the palette via the --brae-* variables so every existing
   component re-themes, then adds the sale components.
   Remove this file (and the 2 <link>s + tailwind colours) to revert.

   TYPOGRAPHY (bn3): the real Brae brand fonts, as used by the live
   braehaircare.co.uk theme (Shopify theme settings: --font-headline
   Merriweather 400, --font-base / --font-button / --font-price Figtree).
   Both are SIL OFL Google Fonts, loaded in <head>.
     serif  Merriweather — headlines only (light 300 / regular 400)
     sans   Figtree      — everything else (UI, body, buttons, prices)
   Scale (px):  11 label · 12 caption · 14 small/UI · 16 body ·
                20 title · 24 headline · 30/40 display · 64/80 stat
   Rules: caps+tracking only on the single per-view eyebrow and on
   buttons (the brand's own button style); no italics; prices are
   Figtree lining + tabular; nothing below 12px except the one label.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Black November tokens */
  --bn-bg:        #0B0A09;
  --bn-surface:   #12100D;
  --bn-surface-2: #1A1612;
  --bn-line:      rgba(243,237,226,0.10);
  --bn-line-2:    rgba(243,237,226,0.22);
  --bn-text:      #F3EDE2;
  --bn-muted:     rgba(243,237,226,0.60);
  --bn-gold:      #D6A94E;
  --bn-gold-hi:   #EBCB7E;
  --bn-gold-lo:   #A9781F;
  --bn-gold-ink:  #1A1308;                 /* text on gold */
  --bn-gold-grad: linear-gradient(135deg, #EBCB7E 0%, #D6A94E 48%, #B3832A 100%);
  --bn-warn:      #F2A68B;                 /* low-stock accent */

  /* Brand type */
  --f-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --f-sans:  'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Re-point the existing Brae palette */
  --brae-white:    var(--bn-surface);
  --brae-paper:    var(--bn-bg);
  --brae-smoke:    var(--bn-surface-2);
  --brae-cream:    #15120E;
  --brae-rose:     #2A231D;
  --brae-text:     var(--bn-text);
  --brae-gold:     var(--bn-gold);
  --brae-gold-soft: rgba(214,169,78,0.16);
  --brae-muted:    var(--bn-muted);
  --brae-border:   var(--bn-line);
  --brae-border-strong: var(--bn-line-2);
  --brae-shadow-1: 0 2px 8px rgba(0,0,0,0.35);
  --brae-shadow-2: 0 2px 8px rgba(0,0,0,0.30), 0 14px 30px -14px rgba(0,0,0,0.55);
}

html { color-scheme: dark; background: var(--bn-bg); }
/* soft gold glow at the top of every page (no hard edges: it's a page background, not a box) */
body {
  background-color: var(--bn-bg);
  background-image: radial-gradient(90% 100% at 50% 0%, rgba(214,169,78,0.13), rgba(214,169,78,0) 70%);
  background-repeat: no-repeat;
  background-size: 100% 520px;
  color: var(--bn-text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  font-kerning: normal;
}
::selection { background: rgba(214,169,78,0.35); color: #fff; }

/* Logo is black-on-transparent → white on dark */
img[src*="logo-brae"] { filter: brightness(0) invert(1); }

/* ═══════════════════════════════════════════════════════════
   TYPE SYSTEM
   ═══════════════════════════════════════════════════════════ */

/* Legacy hooks (Tailwind config + styles.css) now resolve to the brand fonts */
.font-display, .font-display-bold { font-family: var(--f-serif); font-weight: 300; letter-spacing: -0.01em; }
.font-body, .font-ui              { font-family: var(--f-sans); }

/* Serif — headlines only */
body .t-display {
  font-family: var(--f-serif); font-weight: 300; font-optical-sizing: auto;
  font-size: clamp(25px, 7.8vw, 30px); line-height: 1.2; letter-spacing: -0.015em;  /* 30px from 385px up; shrinks so the 2-line hero never orphans a word */
  text-wrap: balance; hyphens: manual;
}
body .t-headline {
  font-family: var(--f-serif); font-weight: 300; font-optical-sizing: auto;
  font-size: 24px; line-height: 1.25; letter-spacing: -0.01em;
  text-wrap: balance; hyphens: manual;
}
body .t-title {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 20px; line-height: 1.3; letter-spacing: -0.005em;
}
body .t-sub {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 16px; line-height: 1.35; letter-spacing: -0.005em;
}
body .t-stat {
  font-family: var(--f-serif); font-weight: 300; font-optical-sizing: auto;
  font-size: 64px; line-height: 1; letter-spacing: -0.02em;
}

/* Sans — Figtree */
body .t-body    { font-family: var(--f-sans); font-weight: 400; font-size: 16px; line-height: 1.6;  text-wrap: pretty; }
body .t-small   { font-family: var(--f-sans); font-weight: 400; font-size: 14px; line-height: 1.55; text-wrap: pretty; }
body .t-caption { font-family: var(--f-sans); font-weight: 400; font-size: 12px; line-height: 1.45; letter-spacing: 0.01em; }
body .t-ui      { font-family: var(--f-sans); font-weight: 500; font-size: 14px; line-height: 1.35; }
body .t-label   { font-family: var(--f-sans); font-weight: 500; font-size: 11px; line-height: 1.2; letter-spacing: 0.16em; text-transform: uppercase; }
body .t-num     { font-variant-numeric: lining-nums tabular-nums; }
body .t-figure  { font-family: var(--f-sans); font-weight: 600; font-size: 20px; line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }

@media (min-width: 768px) {
  body .t-display  { font-size: 40px; line-height: 1.15; }
  body .t-headline { font-size: 32px; line-height: 1.2; }
  body .t-stat     { font-size: 80px; }
}
@media (min-width: 1024px) {
  /* the desktop side panel is a poster: headline stays at the same size, just roomier */
  body .t-display  { letter-spacing: -0.02em; }
}

/* ─── Tailwind utility safety nets (markup uses a handful of light-theme classes) ─── */
.bg-white            { background-color: var(--bn-surface) !important; }
.bg-white\/95        { background-color: rgba(11,10,9,0.92) !important; }
.border-black\/8     { border-color: var(--bn-line) !important; }
.hover\:bg-black\/5:hover { background-color: rgba(243,237,226,0.08) !important; }
.bg-black\/55        { background-color: rgba(0,0,0,0.74) !important; }
.text-black\/55      { color: rgba(243,237,226,0.66) !important; }
.text-black\/45      { color: rgba(243,237,226,0.56) !important; }
.text-black\/35      { color: rgba(243,237,226,0.50) !important; }
.bg-brae-text        { background-color: #070605 !important; }       /* the one dark panel (sell slide) */
/* Faint captions: lift to readable on dark (≥ ~4.5:1) */
.text-brae-text\/20  { color: rgba(243,237,226,0.34) !important; }   /* decorative only */
.text-brae-text\/25  { color: rgba(243,237,226,0.44) !important; }
.text-brae-text\/30  { color: rgba(243,237,226,0.52) !important; }
.text-brae-text\/35  { color: rgba(243,237,226,0.54) !important; }
.text-brae-text\/40  { color: rgba(243,237,226,0.56) !important; }
.text-brae-text\/45  { color: rgba(243,237,226,0.60) !important; }
.text-brae-text\/50  { color: rgba(243,237,226,0.64) !important; }
.text-brae-text\/55  { color: rgba(243,237,226,0.68) !important; }
.text-brae-text\/65  { color: rgba(243,237,226,0.76) !important; }
input[type="checkbox"] { accent-color: var(--bn-gold); }
.bn-error { color: var(--bn-warn); }

/* ─── Existing components, re-skinned ─── */
.progress-track { background: rgba(243,237,226,0.12); }
.progress-fill  { background: var(--bn-gold-grad); }

/* Buttons: the brand's own button voice (Figtree 500, caps, wide tracking) */
.btn-primary {
  background: var(--bn-gold-grad);
  color: var(--bn-gold-ink);
  box-shadow: 0 6px 28px -8px rgba(214,169,78,0.55), inset 0 1px 0 rgba(255,255,255,0.35);
  text-shadow: none;
  font-family: var(--f-sans); font-weight: 600; font-size: 12px; line-height: 1.2;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.9375rem 1.25rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.btn-primary:hover { background: linear-gradient(135deg, #F2D58C 0%, #E0B55A 48%, #BE8D31 100%); box-shadow: 0 10px 34px -8px rgba(214,169,78,0.7), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-primary:focus-visible { outline-color: var(--bn-gold-hi); }
.btn-primary:disabled { opacity: 0.5; }
.btn-secondary {
  color: var(--bn-text); border-color: var(--bn-line-2);
  font-family: var(--f-sans); font-weight: 500; font-size: 12px; line-height: 1.2;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.btn-secondary:hover { background: var(--bn-surface-2); border-color: var(--bn-gold); }

/* Answer cards */
.quiz-card, .quiz-icon-card { background: var(--bn-surface); border-color: var(--bn-line); }
.quiz-card:hover, .quiz-icon-card:hover { border-color: var(--bn-line-2); box-shadow: 0 10px 28px -10px rgba(0,0,0,0.7); }
.quiz-card.selected, .quiz-icon-card.selected { border-color: var(--bn-gold); background: var(--bn-surface-2); }
.quiz-card.selected::after, .quiz-icon-card.selected::after { color: var(--bn-gold-ink); font-family: var(--f-sans); }
.quiz-img-card.selected { border-color: var(--bn-gold); }
.quiz-img-card.selected::after { background: var(--bn-gold); color: var(--bn-gold-ink); font-family: var(--f-sans); }
.quiz-img-card .card-label { font-family: var(--f-sans); font-weight: 500; font-size: 14px; line-height: 1.3; padding: 1.1rem 0.75rem 0.75rem; }
.quiz-img-card .card-hint  { font-family: var(--f-sans); font-weight: 400; font-size: 12px; line-height: 1.35; opacity: 0.78; margin-top: 0.15rem; }
.quiz-icon-card .icon-label { font-family: var(--f-sans); font-weight: 500; font-size: 14px; line-height: 1.3; }
.quiz-icon-card .icon-hint  { font-family: var(--f-sans); font-weight: 400; font-size: 12px; line-height: 1.4; margin-top: 0.2rem; }
.quiz-trust-strip {
  background: transparent; color: var(--bn-text); opacity: 0.62;
  border-top: 1px solid var(--bn-line); border-radius: 0;
  margin-top: 1.5rem; padding: 0.9rem 0 0; justify-content: flex-start;
  font-family: var(--f-sans); font-size: 12px; font-weight: 400; letter-spacing: 0.01em; text-align: left;
}
.colour-swatch { border-color: rgba(255,255,255,0.45); }

/* Form */
.form-input { background: var(--bn-surface-2); border-color: var(--bn-line-2); color: var(--bn-text); font-family: var(--f-sans); font-size: 16px; font-weight: 400; }
.form-input:focus { border-color: var(--bn-gold); box-shadow: 0 0 0 3px rgba(214,169,78,0.20); }
.form-input::placeholder { color: rgba(243,237,226,0.34); }

.spinner { border-color: rgba(243,237,226,0.14); border-top-color: var(--bn-gold); }
.loading-dot { background: var(--bn-gold); }

/* Diagnosis tags: quiet tags, not pills */
.diag-tag { font-family: var(--f-sans); font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 0.25rem 0.6rem; border-radius: 0.25rem; }

/* Role labels: plain text, no coloured badges */
.role-badge { font-family: var(--f-sans); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; padding: 0; border-radius: 0; background: none; color: var(--bn-muted); }
.role-cleanser, .role-conditioner, .role-treatment, .role-finisher, .role-protector, .role-boost { background: none; color: var(--bn-muted); }

.sticky-cta {
  background: rgba(11,10,9,0.96);
  border-top: 1px solid rgba(214,169,78,0.28);
  box-shadow: 0 -10px 30px -8px rgba(0,0,0,0.7);
}
.brae-divider { background: var(--bn-line); }
*:focus-visible { outline-color: var(--bn-gold-hi); }

/* ─── Black November components ─── */

/* Top ribbon (inside the sticky header): sentence case, one calm line */
.bn-header {
  background: rgba(11,10,9,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bn-line);
}
.bn-ribbon {
  background: var(--bn-gold-grad);
  color: var(--bn-gold-ink);
  font-family: var(--f-sans);
  font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: 0.01em;
  text-align: center;
  padding: 8px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: lining-nums;
}
.bn-ribbon b { font-weight: 700; }
.bn-ribbon .sep { opacity: 0.45; margin: 0 0.6em; }
@media (max-width: 360px) {
  .bn-ribbon { font-size: 11px; padding: 8px 6px; }
  .bn-ribbon .sep { margin: 0 0.4em; }
}

/* Landing: eyebrow → headline → offer. Left-aligned, editorial. */
.bn-lockup { display: block; margin-bottom: 1.25rem; }
.bn-eyebrow {
  display: block;
  font-family: var(--f-sans);
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bn-gold);
  margin-bottom: 1.1rem;
}
.bn-offer {
  display: flex; flex-direction: column; gap: 0.2rem;
  margin: 1.5rem 0 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(214,169,78,0.34);
}
.bn-wordmark {
  font-family: var(--f-serif);
  font-weight: 400; font-size: 20px; line-height: 1.25; letter-spacing: -0.005em;
  color: var(--bn-gold-hi);
}
.bn-pill {
  display: block;
  font-family: var(--f-sans);
  font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: 0;
  color: rgba(243,237,226,0.80);
  font-variant-numeric: lining-nums;
}
/* Sale line inside the desktop photo panel */
.bn-aside-sale {
  font-family: var(--f-sans);
  font-size: 14px; font-weight: 500; line-height: 1.4; letter-spacing: 0;
  color: var(--bn-gold-hi);
  font-variant-numeric: lining-nums;
}

/* Countdown */
.bn-countdown { display: inline-flex; gap: 0.5rem; align-items: stretch; }
.bn-countdown .cell {
  min-width: 3.4rem; text-align: center;
  background: var(--bn-surface-2); border: 1px solid var(--bn-line);
  border-radius: 0.5rem; padding: 0.55rem 0.4rem 0.45rem;
}
.bn-countdown .num { display: block; font-family: var(--f-sans); font-weight: 500; font-size: 24px; line-height: 1; color: var(--bn-gold-hi); font-variant-numeric: lining-nums tabular-nums; }
.bn-countdown .lab { display: block; font-family: var(--f-sans); font-size: 12px; font-weight: 400; line-height: 1.2; letter-spacing: 0.01em; text-transform: none; color: var(--bn-muted); margin-top: 4px; }

/* Bundle card */
.bn-bundle {
  background: linear-gradient(180deg, rgba(214,169,78,0.07) 0%, var(--bn-surface) 140px);
  border: 1px solid rgba(214,169,78,0.34);
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.4);
  overflow: hidden;
}
.bn-bundle__head { padding: 1.1rem 1.1rem 0.9rem; }
/* "Save 40%" — plain gold text, not a badge */
.bn-save-pill {
  display: inline-block;
  color: var(--bn-gold-hi);
  font-family: var(--f-sans); font-weight: 600;
  font-size: 14px; line-height: 1.35; letter-spacing: 0; text-transform: none;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* Product row */
.bn-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--bn-line);
}
.bn-item__img {
  position: relative; flex-shrink: 0;
  width: 64px; height: 64px; border-radius: 0.75rem;
  background: #EFE9DD; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.bn-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-item__img.ph { background: var(--bn-surface-2); border: 1px solid var(--bn-line); color: var(--bn-gold); font-size: 1.25rem; }
/* Every row already says "Save N%"; the extra SALE corner tag is redundant noise */
.bn-sale-tag { display: none; }

/* Prices: Figtree, lining + tabular. Sale > original (struck) > "Save N%". */
.bn-price {
  font-family: var(--f-sans); font-weight: 600; font-size: 16px; line-height: 1.1; letter-spacing: 0;
  color: var(--bn-gold-hi); font-variant-numeric: lining-nums tabular-nums;
}
.bn-was {
  font-family: var(--f-sans); font-weight: 400; font-size: 12px; line-height: 1.2; letter-spacing: 0;
  color: rgba(243,237,226,0.50); text-decoration: line-through; text-decoration-thickness: 1px;
  margin-top: 3px; font-variant-numeric: lining-nums tabular-nums;
}
.bn-off {
  display: block; margin-top: 3px;
  font-family: var(--f-sans); font-weight: 500; font-size: 12px; line-height: 1.2; letter-spacing: 0; text-transform: none;
  color: var(--bn-gold); background: none; border-radius: 0; padding: 0;
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-lowstock {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--f-sans); font-weight: 500;
  font-size: 12px; line-height: 1.2; letter-spacing: 0;
  color: var(--bn-warn); background: none; padding: 0; border-radius: 0;
  font-variant-numeric: lining-nums;
}
.bn-lowstock::before { content: ''; width: 5px; height: 5px; border-radius: 99px; background: var(--bn-warn); }

/* Totals */
.bn-total {
  background: var(--bn-surface-2);
  border-top: 1px solid var(--bn-line);
  padding: 1.1rem;
}
.bn-total .row { display: flex; align-items: baseline; justify-content: space-between; }
.bn-total .lbl { font-family: var(--f-sans); font-size: 14px; line-height: 1.5; color: var(--bn-muted); }
.bn-total .val { font-family: var(--f-sans); font-size: 14px; line-height: 1.5; color: var(--bn-muted); font-variant-numeric: lining-nums tabular-nums; }
.bn-total .val.strike { text-decoration: line-through; text-decoration-thickness: 1px; }
.bn-total .val.save { color: var(--bn-gold-hi); font-weight: 600; }
.bn-total .big { font-family: var(--f-sans); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -0.01em; color: var(--bn-text); font-variant-numeric: lining-nums tabular-nums; }

/* Skeleton while the bundle resolves */
@keyframes bn-shimmer { from { background-position: -240px 0; } to { background-position: 240px 0; } }
.bn-skel {
  background: linear-gradient(90deg, var(--bn-surface-2) 0%, rgba(243,237,226,0.07) 50%, var(--bn-surface-2) 100%);
  background-size: 480px 100%; animation: bn-shimmer 1.4s linear infinite;
  border-radius: 0.6rem;
}

/* Notices */
.bn-notice {
  border: 1px solid rgba(214,169,78,0.35); background: rgba(214,169,78,0.07);
  border-radius: 0.9rem; padding: 0.9rem 1rem;
  font-family: var(--f-sans); font-size: 14px; line-height: 1.55; color: rgba(243,237,226,0.82);
}
.bn-notice.err { border-color: rgba(242,166,139,0.4); background: rgba(242,166,139,0.08); }

/* Routine block (result) */
.routine-block { background: var(--bn-surface); border: 1px solid var(--bn-line); }
.routine-step { border-top: 1px solid var(--bn-line); }
.step-num { background: var(--bn-gold-grad); color: var(--bn-gold-ink); }

/* Upsell */
.upsell-item { background: var(--bn-surface-2); border-color: var(--bn-line); }
.upsell-item:hover { border-color: var(--bn-line-2); }
.upsell-item.selected { border-color: var(--bn-gold); background: rgba(214,169,78,0.08); }
.upsell-item .ui-img-ph { background: var(--bn-surface); border-color: var(--bn-line); color: var(--bn-gold); }
.upsell-item .ui-check { background: var(--bn-surface); border-color: var(--bn-line-2); }
.upsell-item.selected .ui-check { background: var(--bn-gold); border-color: var(--bn-gold); }
.upsell-item .bn-price { font-size: 16px; }
.upsell-item .bn-off { display: inline; margin: 0; }
.upsell-item .bn-was { margin: 0; }

/* Marquee ticker on the sell slide: quiet sentence case, not a caps strip */
.ticker-item { font-family: var(--f-sans); font-size: 12px; font-weight: 400; letter-spacing: 0.02em; text-transform: none; color: rgba(243,237,226,0.46); }
.ticker-item.bn { color: var(--bn-gold); }

@media (min-width: 480px) {
  .bn-item { padding: 0.9rem 1.35rem; }
  .bn-bundle__head { padding: 1.3rem 1.35rem 1rem; }
  .bn-total { padding: 1.3rem 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bn-skel { animation: none; }
}
