/* =====================================================================
   Levain — fournil au levain, Saint-Gilles.
   Idée : le papier du sac (blanc farine), l'encre brun croûte, et le bleu
   émaillé des vieilles enseignes de boulangerie pour tout ce qui se touche.
   La page est un bon de commande : une règle horaire, une liste à prix
   vrais (pièce + kilo), une fournée qui se remplit à droite.
   ===================================================================== */
:root {
  --bg: #faf8f4; --surface: #ffffff; --surface-2: #f1ede6;
  --ink: #2a2119; --muted: #6b5f53; --line: #e2dbd0;
  --accent: #1f4e8c; --accent-ink: #ffffff; --danger: #b3261e; --ok: #2f6b3a;
  --font-display: Fraunces, Georgia, serif;
  --font-text: Manrope, system-ui, sans-serif;
  --radius: 12px; --radius-sm: 8px;
  --max: 1360px; --top-h: 68px;
  --night: #2a2119; --night-ink: #f3ede3; --night-muted: #b9ab98; --night-line: #4a3d31;
}
body { font-size: 16px; line-height: 1.55; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.02em; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.wrap { max-width: var(--max); }

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: var(--demobar-h); z-index: 50; height: var(--top-h);
  background: color-mix(in srgb, var(--bg) 97%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top__in { height: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.mark { display: inline-flex; align-items: baseline; gap: 12px; min-height: 44px; align-items: center; text-decoration: none; font: 600 27px/1 var(--font-display); letter-spacing: -.03em; }
.mark__sub { font: 500 13px/1 var(--font-text); letter-spacing: 0; color: var(--muted); padding-top: 6px; }
.top__nav { display: flex; align-items: center; gap: 30px; font-size: 15px; font-weight: 500; }
.top__nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--muted); transition: color var(--t-out) var(--ease-out); }
.top__nav a:hover { color: var(--ink); }
.top__cart { padding: 0 8px 0 16px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink) !important; }
.top__cart:hover { border-color: var(--ink); }
.top__cart .i { width: 18px; height: 18px; }
.top__n {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background-color var(--t-out), color var(--t-out);
}
.top__n.is-full { background: var(--ink); color: var(--bg); }

/* ---------- Ouverture ---------- */
.open {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  min-height: calc(100svh - var(--demobar-h) - var(--top-h));
}
.open__txt {
  display: grid; align-content: center; gap: 26px;
  padding: clamp(48px, 7vw, 96px) clamp(24px, 5vw, 72px) clamp(48px, 6vw, 80px) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.open__t { font-size: clamp(58px, 7.6vw, 124px); line-height: .92; letter-spacing: -.03em; font-weight: 500; }
.open__lede { font-size: 19px; line-height: 1.5; max-width: 40ch; color: var(--ink); }
.open__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 6px; }
.open__cta .btn { min-height: 54px; padding-inline: 26px; }
.open__cta .btn .i { transition: transform var(--t-out) var(--ease-out); }
.open__cta .btn:hover .i { transform: translateY(2px) rotate(90deg); }
.clock { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.clock .i { width: 18px; height: 18px; }
.clock b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.open__fig { margin: 0; position: relative; background: #1d2a33; overflow: hidden; }
.open__fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; }

/* ---------- La nuit du pain, à l'échelle ---------- */
.night { background: var(--night); color: var(--night-ink); padding-block: clamp(44px, 5.5vw, 72px); }
.night__t { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; max-width: 22ch; margin-bottom: 40px; }
.ruler { position: relative; list-style: none; margin: 0; padding: 0; height: 76px; border-top: 1.5px solid var(--night-line); }
.st { position: absolute; top: -1px; left: calc(var(--x) * 100%); display: grid; gap: 4px; padding-top: 22px; }
.st::before { content: ""; position: absolute; left: 0; top: -7px; width: 1.5px; height: 14px; background: var(--night-ink); }
.st b { font: 500 28px/1 var(--font-display); letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: lining-nums; }
.st span { font-size: 14px; color: var(--night-muted); white-space: nowrap; }
.st--end { transform: translateX(-100%); text-align: right; }
.st--end::before { left: auto; right: 0; }
.st--cold { width: calc(var(--w) * 100%); }
.st--cold::after {
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 9px; border-radius: 2px;
  background: repeating-linear-gradient(135deg, var(--night-muted) 0 2px, transparent 2px 7px);
  opacity: .7;
}

/* ---------- Les pains ---------- */
.shop { padding-block: clamp(72px, 9vw, 128px); }
.shop__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; align-items: start; }
.shop__head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 40px; }
.shop__t { font-size: clamp(40px, 5vw, 76px); line-height: .98; letter-spacing: -.025em; }
.shop__meta { font-size: 15px; color: var(--muted); }

.prods { grid-column: 1 / span 8; display: grid; }
.prod {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 330px); gap: 24px; align-items: start;
  padding: 24px 0; border-top: 1px solid var(--line);
}
.prod:last-child { border-bottom: 1px solid var(--line); }
.prod__img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.prod__info { display: grid; gap: 8px; padding-top: 4px; }
.prod__name { font-size: 28px; line-height: 1.05; letter-spacing: -.025em; }
.prod__facts { font-size: 15px; color: var(--muted); max-width: 34ch; }
.fmts { display: grid; gap: 10px; }
.fmt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: center;
  padding: 10px 0 10px 14px; border-left: 2px solid var(--line); transition: border-color var(--t-out) var(--ease-out);
}
.fmt.has-qty { border-left-color: var(--ink); }
.fmt__w { font-weight: 600; font-size: 15px; line-height: 1.25; text-wrap: balance; }
.fmt__left { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fmt__left.is-low { color: var(--ink); }
.fmt__p { display: grid; justify-items: end; gap: 1px; font-variant-numeric: tabular-nums; }
.fmt__p b { font-size: 16px; font-weight: 700; }
.fmt__p small { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fmt .stepper { background: var(--surface); }
.fmt .stepper output { min-width: 28px; }
.fmt.has-qty .stepper { border-color: var(--ink); }
.prods.is-locked .stepper { opacity: .45; pointer-events: none; }

/* ---------- La fournée (formulaire) ---------- */
.cart {
  grid-column: 9 / -1; position: sticky; top: calc(var(--demobar-h) + var(--top-h) + 20px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(42, 33, 25, .35);
  max-height: calc(100vh - var(--demobar-h) - var(--top-h) - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.cart__form { display: grid; gap: 14px; }
.cart__form[hidden] { display: none; }
.cart__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cart__t { font-size: 28px; letter-spacing: -.025em; }
.cart__count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart__lines { gap: 0; }
.empty { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 14.5px; }
.empty b { color: var(--ink); }
.empty[hidden] { display: none; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; }
.lines li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 8px;
  padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 15px;
  animation: line-in var(--t-in) var(--ease-out) both;
}
.lines li:first-child { border-top: 1px solid var(--line); }
.lines .q { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; }
.lines .l { color: var(--muted); font-size: 13px; display: block; }
.lines .p { font-weight: 600; font-variant-numeric: tabular-nums; }
.lines button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); }
.lines button:hover { color: var(--ink); background: var(--surface-2); }
.lines button .i { width: 18px; height: 18px; }
@keyframes line-in { from { opacity: 0; translate: 0 -4px; } }
.slots { gap: 6px; }
.slots .chip span { padding: 0 13px; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.slots .chip small { font-size: 12px; font-weight: 500; }
.slots .chip input:disabled + span { text-decoration: none; opacity: .55; border-style: dashed; background: transparent; }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.cart__total span { font-size: 14px; color: var(--muted); }
.cart__total output { font: 500 36px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; }
.cart .btn { min-height: 54px; }
.privacy { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.privacy .i { width: 16px; height: 16px; }
.bump { animation: bump 320ms var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* Succès */
.done { padding: 0; border: 0; background: none; gap: 16px; }
.done:focus { outline: none; }
.done__state { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-height: 22px; }
.done__state.is-sent { color: var(--ok); }
.done__state .i { width: 18px; height: 18px; }
.done .result__title { font-size: 34px; letter-spacing: -.03em; line-height: 1.05; }
.done .result__recap { grid-template-columns: max-content minmax(0, 1fr); padding: 14px 0; border-block: 1px solid var(--line); gap: 8px 16px; }
.done .result__recap ul { list-style: none; margin: 0; padding: 0; }
.done .notice { align-items: center; flex-wrap: wrap; }
.done .notice .btn { min-height: 44px; margin-left: auto; }
.done #again[hidden] { display: none; }
.is-pop { animation: pop var(--t-in) var(--ease-out) both; }
@keyframes pop { from { opacity: 0; translate: 0 8px; } }

/* ---------- Le fournil ---------- */
.infos { padding-block: clamp(72px, 9vw, 128px); background: var(--surface-2); }
.infos__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.infos__txt { grid-column: 1 / span 5; display: grid; gap: 22px; }
.infos__facts { grid-column: 7 / -1; padding-top: 10px; }
.infos__t { font-size: clamp(36px, 4.2vw, 60px); line-height: 1; letter-spacing: -.03em; max-width: 12ch; }
.infos__lede { font-size: 18px; max-width: 38ch; }
.facts { margin: 0; }
.facts > div:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.facts > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.facts dt { font-size: 14px; color: var(--muted); padding-top: 1px; }
.facts dd { margin: 0; }

/* ---------- Tablette ---------- */
@media (max-width: 1100px) {
  .prod { grid-template-columns: 112px minmax(0, 1fr); }
  .prod__img { width: 112px; height: 112px; }
  .fmts { grid-column: 2 / -1; }
}
@media (max-width: 960px) {
  .prods, .cart { grid-column: 1 / -1; }
  .cart { position: static; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --top-h: 60px; }
  .mark__sub { display: none; }
  .open { grid-template-columns: minmax(0, 1fr); min-height: calc(100svh - var(--demobar-h) - var(--top-h) - var(--tabbar-h)); align-content: start; }
  .open__fig { order: -1; aspect-ratio: 16 / 10; }
  .open__txt { padding: 28px var(--gutter) 40px; gap: 18px; }
  .open__t { font-size: clamp(48px, 14vw, 64px); }
  .open__lede { font-size: 17px; }
  .open__cta .btn { width: 100%; }
  .night { padding-block: 36px 40px; }
  .night__t { margin-bottom: 24px; }
  .ruler { height: auto; border-top: 0; border-left: 1.5px solid var(--night-line); display: grid; gap: 22px; padding: 4px 0 4px; }
  .st, .st--end, .st--cold { position: relative; left: auto; width: auto; translate: none; text-align: left; padding: 0 0 0 22px; top: 0; }
  .st::before, .st--end::before { left: -8px; right: auto; top: 10px; width: 14px; height: 1.5px; }
  .st--cold::after { left: -6px; right: auto; top: -8px; bottom: -8px; width: 9px; height: auto; background: repeating-linear-gradient(45deg, var(--night-muted) 0 2px, transparent 2px 7px); }
  .st b { font-size: 24px; }
  .prod { grid-template-columns: 84px minmax(0, 1fr); gap: 14px 16px; padding: 20px 0; }
  .prod__img { width: 84px; height: 84px; }
  .prod__name { font-size: 24px; }
  .prod__facts { font-size: 14px; }
  .fmts { grid-column: 1 / -1; }
  .fmt { padding-left: 12px; gap: 2px 12px; }
  .cart { padding: 20px 16px; border-radius: var(--radius); margin-inline: -4px; }
  .infos__txt, .infos__facts { grid-column: 1 / -1; }
  .infos__facts { padding-top: 32px; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tb-ico { position: relative; display: block; }
  .tb-n {
    position: absolute; top: -7px; left: 13px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  }
  .tb-n[hidden] { display: none; }
}
