/* ==========================================================================
   BIBIFORME — Design tokens & core UI components  (v1.0 · 2026-12-01)
   Source of truth for: brand-identity.html, child theme style.css,
   theme.json (mirrors these values), e-mail templates (inline copies).
   Rule: never hard-code a colour/size in templates — use these variables.
   ========================================================================== */

:root {
  /* ---- Colour: core ---- */
  --bf-plum:        #3B1734;  /* Prune Bibi   — primary ink, headings, logo   */
  --bf-plum-700:    #2A0F25;  /* hover / pressed on plum                      */
  --bf-plum-100:    #EFE4EC;  /* tinted backgrounds, selected states          */
  --bf-rose:        #B8336A;  /* Rose Galbe   — CTA, links, prices on sale    */
  --bf-rose-700:    #962553;  /* CTA hover                                    */
  --bf-rose-100:    #FBE8EF;  /* badges, soft highlights                      */
  --bf-gold:        #C9A35C;  /* Or Satin     — decorative only (lines, drop) */
  --bf-gold-text:   #8A6A2F;  /* Or Profond   — gold when used as TEXT (AA)   */
  --bf-nude:        #F7ECE8;  /* Nude Soie    — section backgrounds           */
  --bf-blush:       #F1CFC4;  /* Pêche Poudrée — illustrations, dividers      */

  /* ---- Colour: neutrals (warm, plum-biased) ---- */
  --bf-white:       #FFFFFF;  /* dominant background (60 %+)                  */
  --bf-ink:         #221A22;  /* body text                                    */
  --bf-taupe:       #6B5E68;  /* secondary text, captions                     */
  --bf-line:        #EADDE0;  /* borders, hairlines                           */
  --bf-mist:        #FBF7F6;  /* inputs, table stripes                        */

  /* ---- Colour: semantic ---- */
  --bf-success:     #2F6F4E;  --bf-success-bg: #E7F3EC;
  --bf-warning:     #8A5A00;  --bf-warning-bg: #FFF4DC;
  --bf-error:       #B42318;  --bf-error-bg:   #FDECEA;
  --bf-info:        #3B1734;  --bf-info-bg:    #EFE4EC;

  /* ---- Typography ---- */
  --bf-font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --bf-font-body:    "Jost", "Century Gothic", "Segoe UI", Arial, sans-serif;
  /* Fluid type scale (ratio ~1.25, 360px → 1440px) */
  --bf-fs-xs:   0.8125rem;                               /* 13 — legal, badges   */
  --bf-fs-sm:   0.9375rem;                               /* 15 — captions, meta  */
  --bf-fs-base: 1.0625rem;                               /* 17 — body            */
  --bf-fs-lg:   clamp(1.125rem, 1.05rem + .3vw, 1.3125rem); /* 18-21 lead       */
  --bf-fs-h4:   clamp(1.25rem, 1.15rem + .45vw, 1.5rem);
  --bf-fs-h3:   clamp(1.5rem, 1.3rem + .8vw, 2rem);
  --bf-fs-h2:   clamp(1.875rem, 1.5rem + 1.6vw, 2.875rem);
  --bf-fs-h1:   clamp(2.375rem, 1.8rem + 2.6vw, 4rem);
  --bf-lh-tight: 1.12; --bf-lh-snug: 1.3; --bf-lh-body: 1.65;
  --bf-tracking-label: .14em;

  /* ---- Space (4-pt base) ---- */
  --bf-s-1: .25rem; --bf-s-2: .5rem; --bf-s-3: .75rem; --bf-s-4: 1rem;
  --bf-s-5: 1.5rem; --bf-s-6: 2rem;  --bf-s-7: 3rem;   --bf-s-8: 4rem; --bf-s-9: 6rem;

  /* ---- Shape & depth ---- */
  --bf-radius-sm: 6px; --bf-radius: 12px; --bf-radius-lg: 20px; --bf-radius-pill: 999px;
  --bf-shadow-1: 0 1px 2px rgba(59,23,52,.06), 0 2px 8px rgba(59,23,52,.05);
  --bf-shadow-2: 0 8px 28px rgba(59,23,52,.10);
  --bf-focus: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--bf-rose);

  /* ---- Layout ---- */
  --bf-container: 1240px; --bf-container-text: 720px; --bf-header-h: 76px;
  --bf-ease: cubic-bezier(.2,.7,.2,1); --bf-dur: .22s;
}

/* ---------- Base ---------- */
.bf-scope, .bf-scope * { box-sizing: border-box; }
.bf-scope { font-family: var(--bf-font-body); font-size: var(--bf-fs-base); line-height: var(--bf-lh-body); color: var(--bf-ink); background: var(--bf-white); }
.bf-h1,.bf-h2,.bf-h3 { font-family: var(--bf-font-display); font-weight: 600; color: var(--bf-plum); line-height: var(--bf-lh-tight); text-wrap: balance; margin: 0; }
.bf-h1 { font-size: var(--bf-fs-h1); } .bf-h2 { font-size: var(--bf-fs-h2); } .bf-h3 { font-size: var(--bf-fs-h3); }
.bf-h4 { font-family: var(--bf-font-body); font-weight: 500; font-size: var(--bf-fs-h4); color: var(--bf-plum); margin: 0; }
.bf-eyebrow { font-family: var(--bf-font-body); font-size: var(--bf-fs-xs); font-weight: 500; letter-spacing: var(--bf-tracking-label); text-transform: uppercase; color: var(--bf-rose); }
.bf-lead { font-size: var(--bf-fs-lg); color: var(--bf-taupe); }
.bf-link { color: var(--bf-rose); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bf-link:hover { color: var(--bf-rose-700); }

/* ---------- Buttons ---------- */
.bf-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1.75rem; border-radius: var(--bf-radius-pill); border: 1.5px solid transparent; font: 500 .9375rem/1 var(--bf-font-body); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; text-decoration: none; transition: background var(--bf-dur) var(--bf-ease), color var(--bf-dur) var(--bf-ease), border-color var(--bf-dur) var(--bf-ease), transform var(--bf-dur) var(--bf-ease); }
.bf-btn:focus-visible { outline: none; box-shadow: var(--bf-focus); }
.bf-btn:active { transform: translateY(1px); }
.bf-btn--primary   { background: var(--bf-rose);  color: #fff; }
.bf-btn--primary:hover { background: var(--bf-rose-700); }
.bf-btn--dark      { background: var(--bf-plum);  color: #fff; }
.bf-btn--dark:hover { background: var(--bf-plum-700); }
.bf-btn--outline   { background: transparent; color: var(--bf-plum); border-color: var(--bf-plum); }
.bf-btn--outline:hover { background: var(--bf-plum); color: #fff; }
.bf-btn--ghost     { background: transparent; color: var(--bf-rose); padding-inline: .25rem; min-height: auto; text-decoration: underline; text-underline-offset: 4px; }
.bf-btn[disabled], .bf-btn.is-disabled { background: var(--bf-line); color: var(--bf-taupe); border-color: var(--bf-line); cursor: not-allowed; }

/* ---------- Badges & chips ---------- */
.bf-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: var(--bf-radius-pill); font: 500 var(--bf-fs-xs)/1 var(--bf-font-body); letter-spacing: .08em; text-transform: uppercase; }
.bf-badge--sale  { background: var(--bf-rose); color: #fff; }
.bf-badge--new   { background: var(--bf-plum); color: #fff; }
.bf-badge--best  { background: var(--bf-nude); color: var(--bf-gold-text); border: 1px solid var(--bf-gold); }
.bf-badge--vegan { background: var(--bf-success-bg); color: var(--bf-success); }
.bf-badge--stock { background: var(--bf-warning-bg); color: var(--bf-warning); }

/* ---------- Forms ---------- */
.bf-field { display: grid; gap: .4rem; }
.bf-label { font-size: var(--bf-fs-sm); font-weight: 500; color: var(--bf-plum); }
.bf-input { width: 100%; min-height: 48px; padding: .7rem 1rem; border: 1.5px solid var(--bf-line); border-radius: var(--bf-radius-sm); background: var(--bf-mist); font: 400 1rem var(--bf-font-body); color: var(--bf-ink); }
.bf-input:focus { outline: none; border-color: var(--bf-rose); background: #fff; box-shadow: 0 0 0 3px var(--bf-rose-100); }
.bf-input.is-invalid { border-color: var(--bf-error); background: var(--bf-error-bg); }
.bf-help { font-size: var(--bf-fs-xs); color: var(--bf-taupe); }

/* ---------- Notices (map to WooCommerce .woocommerce-message / -info / -error) ---------- */
.bf-notice { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--bf-radius); font-size: var(--bf-fs-sm); border-left: 4px solid; }
.bf-notice--success { background: var(--bf-success-bg); border-color: var(--bf-success); color: #1F4A34; }
.bf-notice--info    { background: var(--bf-info-bg);    border-color: var(--bf-plum);    color: var(--bf-plum); }
.bf-notice--error   { background: var(--bf-error-bg);   border-color: var(--bf-error);   color: #7A1A12; }

/* ---------- Product card (WooCommerce loop item) ---------- */
.bf-card { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--bf-radius); overflow: hidden; transition: box-shadow var(--bf-dur) var(--bf-ease), transform var(--bf-dur) var(--bf-ease); }
.bf-card:hover { box-shadow: var(--bf-shadow-2); transform: translateY(-2px); }
.bf-card__media { aspect-ratio: 4 / 5; background: var(--bf-nude); display: grid; place-items: center; max-width: 100%; }
.bf-card__badges { position: absolute; top: .75rem; left: .75rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.bf-card__body { display: grid; gap: .35rem; padding: 1rem 1rem 1.25rem; }
.bf-card__cat { font-size: var(--bf-fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--bf-taupe); }
.bf-card__title { font: 500 1.0625rem/1.35 var(--bf-font-body); color: var(--bf-ink); margin: 0; }
.bf-card__rating { color: var(--bf-gold); font-size: .875rem; letter-spacing: 2px; }
.bf-price { display: flex; align-items: baseline; gap: .5rem; font-variant-numeric: tabular-nums; }
.bf-price__now { font: 600 1.125rem var(--bf-font-body); color: var(--bf-plum); }
.bf-price__was { font-size: .9375rem; color: var(--bf-taupe); text-decoration: line-through; }
.bf-price--sale .bf-price__now { color: var(--bf-rose); }

/* ---------- Free-shipping progress bar ---------- */
.bf-shipbar { display: grid; gap: .5rem; padding: .9rem 1.1rem; background: var(--bf-nude); border-radius: var(--bf-radius); font-size: var(--bf-fs-sm); color: var(--bf-plum); }
.bf-shipbar__track { height: 6px; border-radius: 999px; background: #fff; overflow: hidden; }
.bf-shipbar__fill { height: 100%; background: linear-gradient(90deg, var(--bf-rose), var(--bf-gold)); border-radius: inherit; }

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .bf-scope *, .bf-btn, .bf-card { transition: none !important; animation: none !important; }
}
