/* Les Cochons de Bébert — public site. Palette and type from the mockup (~/repos/website).
   Fonts are self-hosted: loading them from Google would send every visitor's IP to Google. */

@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/playfair-display-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/lato-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/lato-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lato-latin-700-normal.woff2") format("woff2"); }

:root {
  --vert: #8eb5b4;
  --vd: #6a9a99;
  --vp: #4a7a79;
  --pale: #c5dcdb;
  --beige: #e6ddc6;
  --chene: #cfaf89;
  --brun: #8b5e3c;
  --bx: #6a1f2b;
  --noir: #2b2b2b;
  --blanc: #faf8f3;
  --texte: #5e554b;
  --muted: #8a7a6e;
  --ok: #2e7d5e;
  --ok-bg: #e8f5ee;
  --warn: #9a4d12;
  --warn-bg: #fdf0e6;
  --danger: #8b1a1a;
  --danger-bg: #fae8e8;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 6px;
  --shadow: 0 8px 28px rgba(74, 122, 121, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* In-page links (#ferme, #retraits…) land just below the sticky header instead of under it. */
[id] { scroll-margin-top: 62px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: var(--sans); background: var(--blanc); color: var(--noir); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--vp); }
a:hover { color: var(--bx); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--chene); outline-offset: 2px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
/* Loading placeholders only show if loading takes a while: a fast load goes straight from blank to
   content instead of flashing "Chargement…". */
.loading { animation: loading-appear 0.2s ease 0.4s both; }
@keyframes loading-appear { from { opacity: 0; } to { opacity: 1; } }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── header / nav ── */
.site-header { background: var(--vp); position: sticky; top: 0; z-index: 50; border-bottom: 2px solid var(--vd); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 44px; width: auto; background: var(--blanc); border-radius: 6px; padding: 3px 6px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 10px; border-radius: 4px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--chene); }
.nav a.cta { background: var(--bx); color: #fff; }
.nav a.cta:hover { background: #8a2f3e; color: #fff; }
.basket-count { display: inline-block; min-width: 1.4em; padding: 0 5px; margin-left: 4px; border-radius: 10px; background: var(--chene); color: var(--noir); font-weight: 700; text-align: center; font-size: 0.75rem; }

/* ── typography ── */
.label { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--vd); font-weight: 700; margin-bottom: 0.6rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; color: var(--noir); }
h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
p + p { margin-top: 0.9rem; }
.lead { color: var(--texte); font-size: 1.02rem; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; text-decoration: none; padding: 0.85rem 1.5rem; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; border-radius: var(--radius); transition: background 0.15s, opacity 0.15s; }
.btn-primary { background: var(--chene); color: var(--noir); }
.btn-primary:hover { background: #e0c49a; color: var(--noir); }
.btn-green { background: var(--vp); color: #fff; }
.btn-green:hover { background: var(--vd); color: #fff; }
.btn-dark { background: var(--bx); color: #fff; }
.btn-dark:hover { background: #8a2f3e; color: #fff; }
.btn-ghost { background: transparent; color: var(--vp); border: 1px solid var(--pale); }
.btn-ghost:hover { border-color: var(--vp); }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); }
.btn-outline-light:hover { border-color: #fff; color: #fff; }
.btn-link { background: none; border: none; color: var(--vp); text-decoration: underline; cursor: pointer; padding: 0; font-size: 0.9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ── home ── */
.hero { background: var(--vp); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 80% at 0% 100%, rgba(255, 255, 255, 0.08), transparent 70%); }
.hero .container { position: relative; display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 3.5rem; align-items: center; }
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero h1 em { color: var(--chene); }
.hero p { color: rgba(255, 255, 255, 0.82); max-width: 34rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-logo { background: var(--blanc); border-radius: 12px; padding: 1.5rem; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); max-width: 420px; justify-self: center; width: 100%; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1rem; justify-content: center; }
.tag { background: var(--blanc); color: var(--vp); border: 1px solid var(--pale); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 3px; }
@media (min-width: 860px) { .hero .container { grid-template-columns: 1.2fr 0.8fr; padding-top: 4.5rem; padding-bottom: 5rem; } }

.band { background: var(--vert); color: #fff; }
.band ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 2rem; padding: 0.8rem 0; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }

section.block { padding: 3.5rem 0; }
section.block.beige { background: var(--beige); }
.two-cols { display: grid; gap: 2rem; }
@media (min-width: 860px) { .two-cols { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; } }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1.5rem; }
.card { background: #fff; border: 1px solid #ede8de; border-radius: var(--radius); padding: 1.4rem; }
.card .icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.card p { color: var(--texte); font-size: 0.92rem; }
.steps { counter-reset: step; list-style: none; display: grid; gap: 1rem; margin-top: 1.5rem; }
/* The number in its own column, so a long description stays aligned with the title. */
.steps li { counter-increment: step; display: grid; grid-template-columns: 1.3rem 1fr; column-gap: 0.9rem; align-items: start; background: #fff; border-left: 4px solid var(--vert); padding: 1rem 1.2rem; border-radius: var(--radius); }
.steps li::before { content: counter(step); grid-row: span 2; font-family: var(--serif); font-size: 1.8rem; color: var(--vd); line-height: 1; }
.steps strong { display: block; grid-column: 2; font-family: var(--serif); font-weight: 400; font-size: 1.05rem; }
.steps span { grid-column: 2; color: var(--texte); font-size: 0.92rem; }

.pickup-list { list-style: none; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1.8rem; }
.pickup-list > li { background: #fff; border-radius: var(--radius); padding: 1.2rem 1.3rem; border: 1px solid #ede8de; border-top: 4px solid var(--vert); }
.pickup-list h3 { margin: 0; }
.pickup-list .where { font-size: 0.85rem; color: var(--muted); }
.pickup-list .when { color: var(--texte); font-size: 0.95rem; margin: 0.4rem 0 0.9rem; }
.pickup-list .dates { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pickup-list .dates a { display: inline-block; background: var(--beige); color: var(--noir); padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.pickup-list .dates a:hover { background: var(--chene); color: var(--noir); }

.cta-band { background: var(--bx); color: #fff; text-align: center; padding: 3rem 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.85); margin-bottom: 1.4rem; }

/* ── footer ── */
.site-footer { background: var(--vp); color: rgba(255, 255, 255, 0.75); padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom)); font-size: 0.88rem; }
.site-footer .container { display: grid; gap: 1.5rem; }
.site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer a:hover { color: var(--chene); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; }
@media (min-width: 760px) { .site-footer .container { grid-template-columns: 2fr 1fr; } }

/* ── page header ── */
.page-head { background: var(--vp); color: #fff; padding: 2.2rem 0; }
.page-head h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.page-head p { color: rgba(255, 255, 255, 0.8); margin-top: 0.4rem; }
main.page { padding: 2rem 0 4rem; }

/* ── notices ── */
.notice { border-radius: var(--radius); padding: 0.85rem 1rem; font-size: 0.92rem; border-left: 4px solid; margin: 1rem 0; }
.notice.info { background: #eef5f5; border-color: var(--vp); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn); }
.notice.error { background: var(--danger-bg); border-color: var(--danger); }

/* ── forms ── */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label, .field .legend { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--texte); }
.input, textarea.input { width: 100%; border: 1px solid #d8d2c6; background: #fff; border-radius: var(--radius); padding: 0.7rem 0.8rem; font-size: 1rem; }
.input:focus { outline: none; border-color: var(--vp); box-shadow: 0 0 0 3px rgba(74, 122, 121, 0.15); }
.code-input { letter-spacing: 0.25em; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; margin: 0.6rem 0 1rem; }
.check input { margin-top: 0.3rem; width: 18px; height: 18px; accent-color: var(--vp); flex-shrink: 0; }
.grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ── shop (reserver) ── */
.shop { display: grid; gap: 2rem; }
.shop > * { min-width: 0; } /* lets the type tabs scroll instead of widening the page */
@media (min-width: 960px) { .shop { grid-template-columns: 1fr 340px; align-items: start; } }
.type-section { margin-bottom: 2.5rem; }
.type-section > h2 { font-size: 1.4rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--pale); margin-bottom: 1rem; }
.type-note { font-size: 0.85rem; color: var(--muted); margin: -0.5rem 0 1rem; }
.products { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.product { background: #fff; border: 1px solid #ede8de; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product .photo { aspect-ratio: 4 / 3; background: var(--pale); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.product .photo img { width: 100%; height: 100%; object-fit: cover; }
.product .photo.empty { aspect-ratio: auto; height: 88px; font-size: 2rem; }
.product .body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.product h3 { margin: 0; }
.product .desc { font-size: 0.85rem; color: var(--texte); white-space: pre-line; }
.product details.desc summary { cursor: pointer; color: var(--vp); font-size: 0.82rem; }
.format { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--beige); margin-top: auto; }
.format + .format { margin-top: 0; }
.format .price { font-family: var(--serif); font-size: 1.05rem; color: var(--vp); }
.format .sub { font-size: 0.75rem; color: var(--muted); display: block; overflow: hidden; }
/* "15,80 €/kg · pièce d'environ 500 g" on one line when it fits, otherwise broken between the two
   parts, and the dot never starts a line: each part's dot sits in its left padding, and the row is
   shifted left by that padding and clipped, so the first part of every line loses its dot. */
.format .parts { display: flex; flex-wrap: wrap; margin-left: -0.9em; }
.format .parts > span { position: relative; padding-left: 0.9em; }
.format .parts > span::before { content: "·"; position: absolute; left: 0; width: 0.9em; text-align: center; }
.format .flag { font-size: 0.72rem; font-weight: 700; color: var(--warn); }
.stepper { display: inline-flex; align-items: center; border: 1px solid #d8d2c6; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.stepper button { width: 36px; height: 36px; border: none; background: #fff; cursor: pointer; font-size: 1.1rem; }
.stepper button:hover:not([disabled]) { background: var(--pale); }
.stepper button[disabled] { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 2.2em; text-align: center; font-weight: 700; }
.badge { display: inline-block; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 3px; }
.badge.fresh { background: #f5ead8; color: var(--brun); }
.badge.stock { background: var(--pale); color: var(--vp); }
.badge.soldout { background: #ede8de; color: var(--muted); }
.product .weeks-note { font-size: 0.8rem; font-weight: 700; color: var(--warn); margin-top: 0.5rem; }

.basket { background: #fff; border: 1px solid #ede8de; border-radius: var(--radius); padding: 1.2rem; position: sticky; top: 76px; }
.basket h2 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.basket ul { list-style: none; display: grid; gap: 0.5rem; margin-bottom: 0.8rem; }
.basket li { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.9rem; }
.basket .total { display: flex; justify-content: space-between; font-family: var(--serif); font-size: 1.15rem; border-top: 1px solid var(--beige); padding-top: 0.6rem; margin-bottom: 0.4rem; }
.basket .hint { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.9rem; }
@media (max-width: 959px) {
  .basket { position: fixed; left: 0; right: 0; bottom: 0; top: auto; border-radius: 12px 12px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12); z-index: 40; padding: 0.9rem 16px calc(0.9rem + env(safe-area-inset-bottom)); }
  .basket ul, .basket h2, .basket .hint { display: none; }
  body.has-basket main.page { padding-bottom: 9rem; }
  .basket.empty { display: none; }
}
@media (max-width: 520px) {
  .nav a.secondary { display: none; }
  .brand img { height: 40px; }
}

.steps-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.steps-nav span[aria-current="step"] { color: var(--vp); }
.slots { display: grid; gap: 0.7rem; }
.slot { display: flex; gap: 0.8rem; align-items: flex-start; background: #fff; border: 2px solid #ede8de; border-radius: var(--radius); padding: 0.9rem 1rem; cursor: pointer; }
.slot:hover { border-color: var(--vert); }
.slot input { margin-top: 0.3rem; accent-color: var(--vp); width: 18px; height: 18px; flex-shrink: 0; }
.slot.selected { border-color: var(--vp); background: #f3f8f8; }
.slot strong { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; display: block; }
.slot .meta { font-size: 0.85rem; color: var(--texte); }
.week-title { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 1rem 0 0.4rem; }
.recap { background: #fff; border: 1px solid #ede8de; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.recap ul { list-style: none; display: grid; gap: 0.35rem; margin: 0.5rem 0; }
.recap li { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.92rem; }

/* ── account ── */
.orders { display: grid; gap: 1rem; }
.order { background: #fff; border: 1px solid #ede8de; border-radius: var(--radius); padding: 1rem 1.2rem; }
.order header { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; align-items: baseline; margin-bottom: 0.4rem; }
.order h3 { margin: 0; }
.order ul { list-style: none; display: grid; gap: 0.3rem; margin: 0.6rem 0; font-size: 0.92rem; }
.order li { display: flex; justify-content: space-between; gap: 0.6rem; }
.order li s { color: var(--muted); }
.order .messages { background: var(--blanc); border-left: 3px solid var(--chene); padding: 0.6rem 0.8rem; font-size: 0.9rem; margin: 0.6rem 0; }
.status { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 3px; }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.status.confirmed, .status.ready { background: var(--ok-bg); color: var(--ok); }
.status.collected { background: var(--pale); color: var(--vp); }
.status.refused, .status.cancelled, .status.not_collected { background: var(--danger-bg); color: var(--danger); }
.panel { background: #fff; border: 1px solid #ede8de; border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.5rem; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.account-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.account-head p { overflow-wrap: anywhere; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.75rem; }
.tabs { position: relative; display: flex; box-shadow: inset 0 -1px 0 #e0d9cc; margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: thin; }
.tabs > a, .tabs > button { flex-shrink: 0; padding: 0.75rem 1rem; text-decoration: none; color: var(--muted); font-weight: 700; white-space: nowrap; background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; }
.tabs > a:hover, .tabs > button:hover { color: var(--vp); }
.tabs > [aria-current="page"], .tabs > [aria-current="true"] { color: var(--vp); border-bottom-color: var(--vp); }
.tabs .short { display: none; }
@media (max-width: 520px) {
  .tabs > a { flex: 1; text-align: center; padding: 0.7rem 0.3rem; }
  .tabs > button { padding: 0.7rem 0.8rem; }
  .tabs .long { display: none; }
  .tabs .short { display: inline; }
}

/* ── legal pages ── */
.prose h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
.prose p, .prose li { color: var(--texte); }
.prose ul { padding-left: 1.2rem; margin: 0.6rem 0; }
.prose .todo { background: var(--warn-bg); padding: 0 0.3rem; border-radius: 3px; }
