/* =====================================================================
   boutique.les-nioches.com — Feuille de style maîtresse
   Source unique de vérité de la DA Les Nioches.
   Encre + papier · Fraunces / Source Serif 4 / Source Sans 3 / JetBrains Mono
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..700,0;1,9..144,300..700,0&family=JetBrains+Mono:ital,wght@0,400..600;1,400..600&family=Source+Sans+3:ital,wght@0,300..700;1,300..700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300..700;1,8..60,300..700&display=swap');

/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */
:root {
  /* Couleurs DA Les Nioches — encre + papier exclusivement */
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --ink-quiet: #6b6b6b;
  --paper: #f6f4ee;
  --paper-darker: #ece8de;
  --paper-line: #d8d2c2;

  /* Typographies */
  --fraunces: 'Fraunces', Georgia, serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Espacement — échelle 8px */
  --s1: 0.5rem;  --s2: 1rem;   --s3: 1.5rem; --s4: 2rem;  --s5: 2.5rem;
  --s6: 3rem;    --s8: 4rem;   --s10: 5rem;  --s12: 6rem; --s16: 8rem;

  /* Animation */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-mid: 300ms;
  --dur-reveal: 900ms;

  --maxw: 1180px;
}

/* ---------------------------------------------------------------------
   2. Reset & base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------------
   3. Typographie
   --------------------------------------------------------------------- */
h1, h2, .font-fraunces {
  font-family: var(--fraunces);
  font-variation-settings: "SOFT" 0;          /* SOFT axis désactivé partout */
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.1;
  color: var(--ink);
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }

/* Italique Fraunces : UNIQUEMENT sur mots-clés conceptuels (signature).
   Ne jamais appliquer à un nom propre. */
h1 em, h2 em, .italic-key {
  font-style: italic;
  font-weight: 500;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.3;
}
h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.35;
}

p { margin: 0 0 var(--s2); }

/* Titres de produits — Fraunces */
.product-title {
  font-family: var(--fraunces);
  font-variation-settings: "SOFT" 0;
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.15;
}

/* Lead / citations — Source Serif 4 italique */
.lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.12rem, 1.7vw, 1.32rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Corps de texte enrichi */
.prose p { margin-bottom: var(--s3); }
.prose p:last-child { margin-bottom: 0; }

/* Eyebrow / codifications — JetBrains Mono */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.mono { font-family: var(--mono); }
.muted { color: var(--ink-quiet); }

/* ---------------------------------------------------------------------
   4. Layout
   --------------------------------------------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--s4); }
.section { padding: var(--s12) 0; }
.section-sm { padding: var(--s8) 0; }

.divider { height: 1px; background: var(--paper-line); border: 0; margin: 0; }

/* ---------------------------------------------------------------------
   5. Grain (texture optionnelle)
   --------------------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   6. En-tête
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 238, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.logo {
  font-family: var(--fraunces);
  font-variation-settings: "SOFT" 0;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.logo em { font-style: italic; }                /* « Les » en italique */

.site-nav { display: flex; align-items: center; gap: var(--s4); }
.site-nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color var(--dur-mid) var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

.cart-link { position: relative; }
.cart-count {
  display: inline-block;
  min-width: 1.25em;
  padding: 0 0.25em;
  margin-left: 0.35em;
  font-size: 0.7rem;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 1em;
}
.cart-count[data-count="0"] { display: none; }

/* ---------------------------------------------------------------------
   7. Pied de page (encre)
   --------------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: var(--s16);
  padding: var(--s10) 0 var(--s6);
}
.site-footer a { color: var(--paper); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: var(--s8);
  flex-wrap: wrap;
  padding-bottom: var(--s6);
  border-bottom: 1px solid rgba(246, 244, 238, 0.16);
}
.footer-top .logo { color: var(--paper); }
.footer-blurb {
  font-family: var(--serif);
  font-style: italic;
  max-width: 30ch;
  color: var(--paper);
  opacity: 0.82;
  margin-top: var(--s2);
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 244, 238, 0.6);
  margin-bottom: var(--s2);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.45rem; }
.footer-col a { font-size: 0.92rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  padding-top: var(--s4);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(246, 244, 238, 0.55);
}

/* ---------------------------------------------------------------------
   8. Boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-mid) var(--ease), color var(--dur-mid) var(--ease), opacity var(--dur-mid) var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 1.15rem 2rem; font-size: 0.85rem; }
.btn[disabled], .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn[disabled]:hover { background: transparent; color: var(--ink); }
.btn-ink[disabled]:hover { background: var(--ink); color: var(--paper); }

.link-arrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--paper-line);
  padding: 0 0 2px;
  cursor: pointer;
  transition: border-color var(--dur-mid) var(--ease);
}
.link-arrow:hover { border-color: var(--ink); }

/* ---------------------------------------------------------------------
   9. Grille & cartes produit
   --------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
}
.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-darker);
  border: 1px solid var(--paper-line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-reveal) var(--ease); }
.product-card:hover .media img { transform: scale(1.035); }
.media-placeholder {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.product-card .pc-body { padding-top: var(--s2); }
.product-card .pc-ref {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-quiet);
  margin-bottom: 0.35rem;
}
.product-card .product-title { font-size: 1.32rem; margin-bottom: 0.3rem; }
.product-card .pc-price {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------------
   10. Formulaires
   --------------------------------------------------------------------- */
.field { margin-bottom: var(--s3); }
.field label, .field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin-bottom: 0.45rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 0;
  padding: 0.82rem 0.95rem;
  transition: border-color var(--dur-mid) var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--ink); }
.field input:disabled { background: var(--paper-darker); color: var(--ink-quiet); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}

/* Sélecteurs d'options (taille / couleur) — codification mono */
.option-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.option-btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 0.6rem 1rem;
  min-width: 3rem;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  cursor: pointer;
  transition: background var(--dur-mid) var(--ease), color var(--dur-mid) var(--ease), border-color var(--dur-mid) var(--ease);
}
.option-btn:hover { border-color: var(--ink); }
.option-btn.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.option-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ---------------------------------------------------------------------
   11. Messages
   --------------------------------------------------------------------- */
.notice {
  font-family: var(--sans);
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--paper-line);
  background: var(--paper-darker);
  margin-bottom: var(--s3);
}
.notice-error { border-color: var(--ink); border-left-width: 3px; }

/* ---------------------------------------------------------------------
   12. État vide / chargement
   --------------------------------------------------------------------- */
.loading {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  text-align: center;
  padding: var(--s10) 0;
}

/* ---------------------------------------------------------------------
   13. Récapitulatifs de commande (checkout / confirmation / espace)
   --------------------------------------------------------------------- */
.recap { margin-top: var(--s3); }
.recap-line {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--paper-line);
  font-size: 0.95rem;
}
.recap-line:last-child { border-bottom: 0; }
.recap-line .mono { white-space: nowrap; }
.recap-total {
  font-family: var(--fraunces);
  font-variation-settings: "SOFT" 0;
  font-size: 1.25rem;
  font-weight: 500;
  border-top: 1px solid var(--ink);
  border-bottom: 0;
  margin-top: 0.2rem;
  padding-top: 0.9rem;
}
.recap-total .mono { font-size: 1.05rem; }

/* Timeline de suivi de commande */
.timeline {
  list-style: none;
  display: flex;
  margin: var(--s4) 0;
}
.tl-step {
  flex: 1;
  position: relative;
  text-align: center;
  padding-top: 1.7rem;
}
.tl-step::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: -50%;
  width: 100%;
  height: 1px;
  background: var(--paper-line);
}
.tl-step:first-child::before { display: none; }
.tl-step.done::before { background: var(--ink); }
.tl-dot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--paper-line);
}
.tl-step.done .tl-dot { background: var(--ink); border-color: var(--ink); }
.tl-step.current .tl-dot {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper-darker);
}
.tl-label {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.tl-step.done .tl-label, .tl-step.current .tl-label { color: var(--ink); }

/* ---------------------------------------------------------------------
   14. Révélation au scroll
   --------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

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

/* ---------------------------------------------------------------------
   15. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 860px) {
  .container, .container-narrow { padding: 0 var(--s3); }
  .section { padding: var(--s10) 0; }
  .product-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .site-header .container { height: 64px; }
  .site-nav { gap: var(--s2); }
  .site-nav a { font-size: 0.72rem; }
  .field-row { grid-template-columns: 1fr; }
  .site-footer { margin-top: var(--s12); }
  .footer-top { gap: var(--s5); }
  .tl-label { font-size: 0.58rem; }
}

@media (max-width: 560px) {
  .logo { font-size: 1.3rem; }
}
