/* ============================================================
   La Laiterie Douce — direction artistique « Crèmerie »
   Photos d'abord. Blanc lait, encre, un seul bleu (plaques
   émaillées des crémeries). Young Serif + Schibsted Grotesk.
   ============================================================ */
:root {
  --milk: #f6f3ee;       /* fond */
  --cream: #ece6db;      /* sections alternées, fonds photo */
  --white: #fffefb;
  --ink: #1c1a17;
  --ink-2: #5b554d;      /* texte secondaire, contraste ≈ 7:1 sur --milk */
  --line: #dcd5c9;
  --blue: #23407a;       /* bleu crémerie : boutons, liens, bandeaux */
  --blue-deep: #1a3263;
  --error: #a3283c;
  --ok: #3f6b3a;
  --maxw: 1240px;
  --header-h: 72px;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); scrollbar-gutter: stable; /* la page ne saute pas quand le panier s'ouvre */ }
body {
  margin: 0; background: var(--milk); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
p, figure, blockquote { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; touch-action: manipulation; } /* pas de zoom en tapant vite sur + */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(var(--maxw), 100% - 64px); margin-inline: auto; }
.price, .line-total, .totals dd, #checkout-total, #mb-total { font-variant-numeric: tabular-nums; }

.section { padding: 112px 0; }
.section-title { font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.06; letter-spacing: -0.01em; }
.section-lead { color: var(--ink-2); margin-top: 12px; }

/* ---------- Photos (avec repli si le fichier manque) ---------- */
.photo { position: relative; overflow: hidden; background: var(--tint, var(--cream)); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.is-missing img { display: none; }
.photo.is-missing::after {
  content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center;
  padding: 1rem; text-align: center; font-family: var(--serif); font-size: 1.15rem; color: var(--ink-2);
}
/* Mention sur les photos générées par IA (à retirer quand elles seront remplacées par de vraies photos) */
.photo:not(.is-missing):not(.cart-thumb)::before {
  content: "AI-generated"; position: absolute; right: 10px; bottom: 10px; z-index: 2; pointer-events: none;
  padding: 4px 8px; border-radius: 2px; background: rgba(28, 26, 23, .62); color: #f6f3ee;
  font-family: var(--sans); font-size: .7rem; font-weight: 500; letter-spacing: .02em; line-height: 1.2;
}

/* ---------- Boutons et liens ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 26px; border: 1px solid transparent; border-radius: 2px;
  font-family: var(--sans); font-size: .95rem; font-weight: 500; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-outline { background: transparent; border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--milk); }
.btn-light { background: var(--milk); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color .2s; }
.link:hover { color: var(--blue); }

/* ---------- Bandeau + en-tête ---------- */
.notice { background: var(--blue); color: #e8edf6; font-size: .82rem; text-align: center; padding: 9px 16px; }
.header { position: sticky; top: 0; z-index: 30; background: var(--milk); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.wordmark { font-family: var(--serif); font-size: 1.4rem; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 32px; }
.nav a { font-size: .95rem; color: var(--ink-2); text-decoration: none; transition: color .2s; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.cart-trigger { background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 4px; font-size: .95rem; font-weight: 500; }
.cart-trigger:hover { color: var(--blue); }
.cart-count { font-variant-numeric: tabular-nums; }
.cart-count.bump { animation: bump .4s var(--ease); display: inline-block; }
@keyframes bump { 40% { transform: translateY(-3px); color: var(--blue); } }
.burger { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 7px; }
.burger span { width: 22px; height: 1.5px; background: var(--ink); transition: transform .25s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

/* ---------- Accueil ---------- */
.hero { position: relative; }
.hero-media { aspect-ratio: 16 / 9; max-height: calc(100vh - var(--header-h) - 36px); min-height: 520px; width: 100%; }
.hero-media img { object-position: 70% 50%; }
.hero-inner { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; }
.hero-text { max-width: 30rem; pointer-events: auto; }
.hero-title { font-family: var(--serif); font-size: clamp(2.8rem, 5.6vw, 5rem); line-height: 1.02; letter-spacing: -0.02em; }
.hero-lead { margin-top: 22px; font-size: 1.1rem; max-width: 26rem; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 32px; }

/* ---------- Catalogue ---------- */
.shop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.shop-head .section-lead { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 36px 0 40px; border-bottom: 1px solid var(--line); }
.chip {
  background: none; border: 0; cursor: pointer; min-height: 44px; padding: 0; margin-bottom: -1px;
  font-size: .95rem; color: var(--ink-2); border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.chip small { font-size: .75rem; color: var(--ink-2); }

.catalogue { display: grid; grid-template-columns: repeat(4, 1fr); gap: 56px 24px; }
.product { display: flex; flex-direction: column; }
.product-media { aspect-ratio: 4 / 5; }
.product-media img { transition: transform .8s var(--ease); }
.product:hover .product-media img { transform: scale(1.035); }
.product-info { display: flex; flex-direction: column; flex: 1; padding-top: 18px; }
.product-tag { font-size: .8rem; font-weight: 500; color: var(--blue); margin-bottom: 4px; }
.product h3 { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; }
.product-desc { color: var(--ink-2); font-size: .92rem; line-height: 1.5; margin-top: 6px; flex: 1; }
.product-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.price { font-weight: 500; }
.price small { font-size: .8rem; font-weight: 400; color: var(--ink-2); margin-left: 4px; }
.add-btn {
  min-height: 44px; padding: 0 16px; background: none; border: 1px solid var(--ink); border-radius: 2px;
  font-size: .88rem; font-weight: 500; cursor: pointer; transition: background .2s, color .2s;
}
.add-btn:hover { background: var(--ink); color: var(--milk); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--ink); border-radius: 2px; }
.stepper button { width: 42px; height: 42px; background: none; border: 0; cursor: pointer; font-size: 1.05rem; transition: background .15s; }
.stepper button:hover { background: var(--cream); }
.stepper span { min-width: 24px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Coffret ---------- */
.coffret { background: var(--cream); padding: 96px 0; }
.coffret-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 72px; align-items: center; }
.coffret-media { aspect-ratio: 4 / 3; --tint: #e3dccf; }
.coffret-tag { font-size: .85rem; font-weight: 500; color: var(--blue); margin-bottom: 14px; }
.coffret-desc { color: var(--ink-2); margin-top: 18px; max-width: 30rem; }
.coffret-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; color: var(--ink); }
.coffret-list li::before { content: "—"; color: var(--ink-2); margin-right: 10px; }
.coffret-buy { display: flex; align-items: center; gap: 24px; margin-top: 32px; }
.coffret-buy .price { font-size: 1.25rem; }

/* ---------- Fabrication ---------- */
.steps-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; }
.steps-media { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; aspect-ratio: 4 / 5; }
.steps-photo { position: absolute; inset: 0; opacity: 0; transition: opacity .8s var(--ease); }
.steps-photo.is-active { opacity: 1; }
.steps-list { list-style: none; padding: 0; margin: 40px 0 0; counter-reset: step; }
.step { counter-increment: step; padding: 48px 0; border-top: 1px solid var(--line); transition: opacity .5s var(--ease); }
.step::before { content: counter(step); display: block; font-family: var(--serif); font-size: 1rem; color: var(--blue); margin-bottom: 12px; }
.step h3 { font-family: var(--serif); font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.15; }
.step p { color: var(--ink-2); margin-top: 14px; max-width: 30rem; }
.step-photo { display: none; aspect-ratio: 4 / 5; margin-bottom: 24px; }
.js-steps .step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .35; }
.js-steps .step.is-active { opacity: 1; }

/* ---------- Avis ---------- */
.reviews { background: var(--white); }
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 48px; }
.review { border-top: 1px solid var(--line); padding-top: 24px; }
.review blockquote { font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; }
.review figcaption { color: var(--ink-2); font-size: .9rem; margin-top: 16px; }
.footnote { color: var(--ink-2); font-size: .8rem; margin-top: 40px; }

/* ---------- Questions ---------- */
.faq-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 72px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  min-height: 64px; font-size: 1.05rem; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; background:
  linear-gradient(var(--ink), var(--ink)) center / 12px 1.5px no-repeat,
  linear-gradient(var(--ink), var(--ink)) center / 1.5px 12px no-repeat; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding: 0 40px 24px 0; }

/* ---------- Contact + pied ---------- */
.contact { background: var(--blue); color: #eef1f7; padding: 96px 0; }
.contact-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 72px; align-items: end; }
.contact-title { font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; color: #fff; max-width: 16ch; }
.contact-inner > div > p { margin: 16px 0 32px; color: #cdd6e6; }
.contact-info { font-style: normal; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact-info h3 { font-size: .85rem; font-weight: 500; color: #cdd6e6; margin-bottom: 8px; }
.contact-info address { font-style: normal; }
.footer { padding: 32px 0; font-size: .85rem; color: var(--ink-2); }
.footer-inner { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.footer-mark { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.footer-note { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-family: var(--serif); font-size: 1rem; color: var(--ink); }

/* ---------- Barre panier (téléphone) ---------- */
.mobile-bar { display: none; }

/* ---------- Panier ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(28, 26, 23, .45); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(460px, 100%);
  display: flex; flex-direction: column; background: var(--milk);
  transform: translateX(100%); visibility: hidden; /* fermé : hors de portée du clavier et des lecteurs d'écran */
  transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.drawer.open { transform: none; visibility: visible; transition: transform .35s var(--ease); box-shadow: -24px 0 60px rgba(28, 26, 23, .18); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 0 28px; height: var(--header-h); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--serif); font-size: 1.5rem; }
.drawer-close { background: none; border: 0; cursor: pointer; min-height: 44px; font-size: .95rem; text-decoration: underline; text-underline-offset: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer-foot { padding: 20px 28px 28px; border-top: 1px solid var(--line); }

.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-item:first-child { padding-top: 0; }
.cart-thumb { width: 64px; aspect-ratio: 4 / 5; }
.cart-thumb.is-missing::after { font-size: .7rem; }
.cart-item strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.08rem; line-height: 1.25; }
.cart-item small { color: var(--ink-2); font-size: .85rem; }
.cart-item .stepper { margin-top: 10px; }
.cart-item .stepper button { width: 36px; height: 36px; }
.cart-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.line-total { font-weight: 500; }
.remove { background: none; border: 0; cursor: pointer; min-height: 36px; padding: 0; font-size: .82rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.remove:hover { color: var(--error); }
.cart-empty { text-align: center; padding-top: 64px; display: grid; gap: 20px; justify-items: center; color: var(--ink-2); }

.progress { height: 3px; background: var(--line); margin-bottom: 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .4s var(--ease); }
.progress.is-full span { background: var(--ok); }
.free-hint { font-size: .85rem; color: var(--ink-2); margin-bottom: 14px; }
.totals { margin: 0 0 18px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-2); }
.totals dt, .totals dd { margin: 0; }
.total-row { color: var(--ink) !important; font-weight: 500; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px !important; }

.checkout h3 { font-family: var(--serif); font-size: 1.5rem; margin: 8px 0 22px; }
.checkout label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: 18px; }
.checkout input[type="text"], .checkout input[type="tel"], .checkout textarea {
  display: block; width: 100%; margin-top: 8px; min-height: 48px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: 2px;
  font: inherit; font-weight: 400; color: var(--ink); resize: vertical; transition: border-color .2s;
}
.checkout input:focus, .checkout textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.checkout fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.checkout legend { font-size: .9rem; font-weight: 500; margin-bottom: 8px; }
.checkout .radio { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; font-weight: 400; cursor: pointer; }
.checkout .radio input { width: 18px; height: 18px; accent-color: var(--blue); }
.field-error { display: block; color: var(--error); font-size: .82rem; font-weight: 500; margin-top: 6px; }
.pay-note { font-size: .88rem; color: var(--ink-2); margin-bottom: 18px; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.checkout-total strong { font-size: 1.2rem; font-weight: 500; }
.back-link { background: none; border: 0; cursor: pointer; padding: 0; min-height: 40px; font-size: .9rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; }
.done { text-align: center; padding-top: 64px; }
.done h3 { font-family: var(--serif); font-size: 1.7rem; margin-bottom: 16px; }
.done p { color: var(--ink-2); margin-bottom: 14px; }
.done .btn { margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--milk); padding: 14px 22px; border-radius: 2px; font-size: .9rem;
  transition: opacity .25s var(--ease), transform .25s var(--ease); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Tailles d'écran : 1100 / 820 / 560
   ============================================================ */
@media (max-width: 1100px) {
  .catalogue { grid-template-columns: repeat(3, 1fr); }
  .nav { gap: 22px; }
  .steps-inner, .coffret-inner, .faq-inner, .contact-inner { gap: 48px; }
}
@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .wrap { width: min(var(--maxw), 100% - 40px); }
  .section { padding: 72px 0; }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--milk); border-bottom: 1px solid var(--line); padding: 8px 20px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav a:last-child { border-bottom: 0; }
  .burger { display: flex; }

  .hero-media { aspect-ratio: 4 / 3; min-height: 0; max-height: none; }
  .hero-inner { position: static; display: block; }
  .hero-text { max-width: none; padding: 36px 0 8px; }

  .catalogue { grid-template-columns: repeat(2, 1fr); gap: 40px 16px; }
  .product h3 { font-size: 1.12rem; }
  .product-desc { font-size: .86rem; }
  .product-buy { flex-direction: column; align-items: stretch; gap: 10px; }
  .product-buy .add-btn, .product-buy .stepper { width: 100%; justify-content: space-between; }
  .product-buy .stepper span { flex: 1; }

  .coffret { padding: 64px 0; }
  .coffret-inner, .steps-inner, .faq-inner, .contact-inner { grid-template-columns: 1fr; }
  .steps-media { display: none; }
  .step-photo { display: block; }
  .js-steps .step { min-height: 0; opacity: 1; }
  .reviews-grid { grid-template-columns: 1fr; gap: 32px; }

  .mobile-bar { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35; }
  .mobile-bar .btn { justify-content: space-between; box-shadow: 0 10px 30px rgba(28, 26, 23, .25); }
  body.has-bar { padding-bottom: 80px; }
  body.has-bar .toast { bottom: 88px; }
}
@media (max-width: 560px) {
  .notice { font-size: .78rem; }
  .wordmark { font-size: 1.2rem; }
  .contact-info { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
