/* Potager des Landelles : mise en page de l'application, à charger après tokens.css et bundle.css.
   Mobile d'abord. Les couleurs passent par les rôles du design system. Beaucoup de papier, pas d'ombre. */
:root {
  --step--1: 15px; --step-0: 17px; --step-1: 21px; --step-2: 22px; --step-3: 36px; --step-4: 36px;
  --tremble: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --tremble-2: 18px 225px 18px 255px / 255px 18px 225px 18px;
  --gutter-l: max(var(--espace-5), env(safe-area-inset-left, 0px));
  --gutter-r: max(var(--espace-5), env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 400 17px/26px var(--font-texte); font-variant-numeric: lining-nums; }
h1, h2, h3 { margin: 0; font-family: var(--font-titre); font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: var(--texte); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { max-width: 720px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.wide { max-width: 1120px; }
.muted { color: var(--texte-doux); }
.small { font-size: 15px; line-height: 20px; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Barres du haut */
.topbar { padding-top: env(safe-area-inset-top, 0px); }
.topbar .wrap { display: flex; align-items: center; gap: var(--espace-3); min-height: 44px; }
.clientbar .wrap { justify-content: flex-end; padding-block: var(--espace-2); }
.who-mini { font-size: 15px; line-height: 20px; color: var(--texte-doux); text-align: right; min-width: 0; }
.adminbar-top { position: sticky; top: 0; z-index: 20; background: var(--fond); border-bottom: var(--trait-fin) solid var(--filet); }
.adminbar-top .wrap { padding-block: var(--espace-1); }
.logo { height: 44px; width: auto; flex: none; display: block; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--espace-2); min-height: 48px; padding: 8px 20px;
  border: var(--trait-plume) solid var(--contour); border-radius: var(--tremble); background: var(--surface); color: var(--texte);
  font-weight: 700; font-size: 17px; line-height: 22px; text-decoration: none; cursor: pointer; transition: transform .12s ease, background-color .12s ease; }
.btn:hover { background: var(--survol); transform: rotate(-.8deg); }
.btn.primary { background: var(--action); color: var(--sur-action); font-weight: 800; }
.btn.primary:hover { background: var(--survol); }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; padding-inline: 6px; }
.btn.sm { min-height: 44px; padding: 6px 16px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--texte); text-decoration: underline; cursor: pointer; font: inherit; min-height: 24px; }

/* Pastilles : des taches de lavis, on écrit toujours en encre dessus */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 12px 16px 10px 18px; font-size: 15px; line-height: 22px; font-weight: 700; background: var(--filet); color: var(--texte); white-space: nowrap; }
.chip.leaf { background: var(--vert); }
.chip.pumpkin { background: var(--jaune); }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.flash { background: var(--vert); border-radius: var(--rayon-s); padding: 12px 16px; margin-block: 12px; }
.error { background: var(--rose); border-radius: var(--rayon-s); padding: 12px 16px; margin-block: 12px; font-weight: 700; }
.callout { background: var(--ciel); border-radius: var(--rayon-s); padding: 12px 16px; font-size: 15px; line-height: 20px; margin-block: 12px; }

/* ===== Page de commande ===== */
.pdl-bandeau { padding-top: var(--espace-3); gap: var(--espace-4); }
.pdl-bandeau__logo { width: 120px; }
.pdl-bandeau__titre { font-size: clamp(25px, 7.8vw, 36px); line-height: 1.2; }
.salut { margin-top: var(--espace-4); }
.entete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--espace-3); padding-top: var(--espace-3); }
.entete__mante { width: clamp(60px, 18vw, 130px); height: auto; display: block; }
.entete__nom { margin: 0; }
.entete__nom img { width: 100%; max-width: 380px; height: auto; display: block; margin-inline: auto; }
.entete__ab { width: clamp(40px, 12vw, 88px); height: auto; display: block; }
.vue-potager { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; margin-top: var(--espace-3); }
.retrait { margin: var(--espace-3) 0 0; text-align: center; font-size: clamp(15px, 4.8vw, 26px); line-height: 1.3; text-wrap: balance; }
.certif { margin: var(--espace-1) 0 0; text-align: center; color: var(--texte-doux); }
.votre-commande { margin: var(--espace-5) 0 0; }
@media (min-width: 720px) {
  .pdl-bandeau { gap: var(--espace-5); }
  .pdl-bandeau__logo { width: 140px; }
  .pdl-bandeau__titre { font-size: 56px; line-height: 60px; }
}

.cats { position: sticky; top: 0; z-index: 10; display: flex; gap: var(--espace-4); overflow-x: auto; scrollbar-width: none; margin: var(--espace-5) calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: var(--espace-2) var(--gutter-r) var(--espace-2) var(--gutter-l); background: var(--fond); }
.cats::-webkit-scrollbar { display: none; }
.cats a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; font-weight: 700; text-decoration: none; }

.section { padding-top: var(--espace-5); scroll-margin-top: 60px; }
.pdl-rubrique { font-weight: 400; }
.rows .pdl-ligne:last-child { border-bottom: 0; }
.pdl-ligne { align-items: start; }
.pdl-ligne__nom { font-family: var(--font-texte); }
.pdl-ligne__desc { margin: 2px 0 0; color: var(--texte-doux); }
.pdl-ligne .pdl-ligne__prix { margin-top: var(--espace-1); }
.pese { font-style: italic; white-space: nowrap; }
.vignette { display: block; width: 96px; height: 96px; padding: 0; border: 0; background: none; cursor: zoom-in; overflow: hidden; border-radius: var(--rayon-s); }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette.lavis-img { border-radius: 0; cursor: default; }
.vignette.lavis-img img { object-fit: contain; }
/* Pas de photo : une tache de lavis et l'initiale, à la main */
.tache { display: grid; place-items: center; width: 88px; height: 88px; margin: 4px; border-radius: 58% 42% 55% 45% / 47% 56% 44% 53%; font: 700 36px/1 var(--font-titre); color: var(--texte); }
.lavis-legumes { background: var(--vert); }
.lavis-courges { background: var(--jaune); }
.lavis-aromates { background: var(--ciel); }
.lavis-conserves, .lavis-fruits { background: var(--rose); }
.lavis-plants { background: var(--vert); }
.row-act { display: flex; align-items: center; flex-wrap: wrap; gap: var(--espace-2) var(--espace-3); }
.pdl-quantite { max-width: 100%; }
.pdl-quantite__valeur { white-space: nowrap; font-size: 19px; }
.est { font-size: 15px; line-height: 20px; color: var(--texte-doux); font-variant-numeric: lining-nums tabular-nums; }
.est.on { color: var(--texte); background: var(--vert); padding: 2px 10px; border-radius: 12px 16px 10px 18px; }
.pdl-ligne__nom { font-size: 17px; line-height: 22px; }
.prix-ligne { font-weight: 400; font-size: 16px; font-variant-numeric: lining-nums; }
@media (min-width: 720px) {
  .pdl-ligne__nom { font-size: 21px; line-height: 26px; }
  .prix-ligne { font-size: 20px; }
}
.est b { font-weight: 700; }
.fanes { display: flex; align-items: center; gap: var(--espace-2); min-height: 44px; }
.fanes[hidden] { display: none; }
.fanes input { width: 22px; height: 22px; accent-color: var(--encre); }

.closed { text-align: center; padding-block: var(--espace-6) var(--espace-7); display: grid; gap: var(--espace-4); justify-items: center; }
.closed img { width: min(320px, 100%); height: auto; }

.basket { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--fond); border-top: var(--trait-plume) solid var(--contour); padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(110%); transition: transform .25s ease; }
.basket.show { transform: none; }
.basket .wrap { display: flex; align-items: center; gap: var(--espace-3); padding-block: var(--espace-2); }
.basket .sum { flex: 1; min-width: 0; line-height: 20px; }
.basket .pdl-bouton { padding-inline: var(--espace-4); min-height: 52px; font-size: 18px; white-space: nowrap; }
.pad-bottom { height: 104px; }

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(28,27,25,.5); display: flex; justify-content: flex-end; align-items: flex-end; }
.panel { background: var(--fond); width: min(560px, 100%); max-height: 94%; overflow-y: auto; border-top: var(--trait-plume) solid var(--contour); padding: var(--espace-4) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + var(--espace-5)) var(--gutter-l); display: flex; flex-direction: column; gap: var(--espace-4); }
@media (min-width: 620px) { .overlay { align-items: stretch; } .panel { max-height: none; height: 100%; border-top: 0; border-left: var(--trait-plume) solid var(--contour); padding: var(--espace-5); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--espace-3); }
.x { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; background: transparent; cursor: pointer; font-size: 28px; line-height: 1; border-radius: var(--tremble-2); }
.x:hover { background: var(--survol); }
.recap-line { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--espace-3); padding-block: var(--espace-3); border-bottom: var(--trait-fin) solid var(--filet); }
.recap-line:last-child { border-bottom: 0; }
.recap-line b { font-weight: 700; font-size: 19px; }
.recap-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--espace-4); border-top: var(--trait-plume) solid var(--contour); font: 800 21px/26px var(--font-texte); font-variant-numeric: lining-nums tabular-nums; }
.done-page { display: grid; gap: var(--espace-4); padding-block: var(--espace-3) var(--espace-7); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(28,27,25,.85); display: grid; place-items: center; padding: var(--espace-4); }
.lightbox img { max-height: 85vh; border-radius: var(--rayon-s); }

.tabs2 { display: grid; grid-template-columns: 1fr 1fr; border: var(--trait-plume) solid var(--contour); border-radius: var(--tremble-2); overflow: hidden; }
.tabs2 button { border: 0; background: none; min-height: 44px; padding: 8px; cursor: pointer; font-weight: 700; }
.tabs2 button + button { border-left: var(--trait-fin) solid var(--contour); }
.tabs2 button:hover { background: var(--survol); }
.tabs2 button[aria-pressed="true"] { background: var(--action); }

/* Champs */
.field { display: grid; gap: var(--espace-1); }
.field > label, .lbl { font-weight: 700; }
.hint { font-size: 15px; line-height: 20px; color: var(--texte-doux); }
.input { width: 100%; min-width: 0; min-height: 46px; padding: 8px 12px; border: var(--trait-plume) solid var(--contour); border-radius: var(--rayon-s); background: var(--surface); font-size: 17px; }
.input::placeholder { color: var(--texte-doux); }
.cols { display: grid; gap: var(--espace-3); }
@media (min-width: 560px) { .cols { grid-template-columns: 1fr 1fr; } }
.radios { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.radios label { position: relative; }
.radios input { position: absolute; opacity: 0; }
.radios span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border: var(--trait-plume) solid var(--contour); border-radius: var(--tremble-2); cursor: pointer; font-size: 15px; font-weight: 700; }
.radios input:checked + span { background: var(--action); }
.radios input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 4px; }
.check { display: flex; gap: var(--espace-2); align-items: center; font-weight: 700; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--encre); }

/* ===== Backoffice ===== */
.adminbar { display: flex; gap: var(--espace-1); overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.adminbar::-webkit-scrollbar { display: none; }
.adminbar a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 10px; border-radius: var(--tremble-2); white-space: nowrap; text-decoration: none; font-weight: 700; color: var(--texte-doux); }
.adminbar a[aria-current="page"] { background: var(--action); color: var(--texte); }
.admin-head { padding-block: var(--espace-4) var(--espace-3); display: grid; gap: var(--espace-3); }
.admin-head h1, .login h1 { line-height: 42px; }
.weeknav { display: flex; align-items: center; gap: var(--espace-2); }
.weeknav h1 { font: 800 26px/30px var(--font-texte); flex: 1; text-align: center; font-variant-numeric: lining-nums; }
.weeknav a { display: grid; place-items: center; width: 44px; height: 44px; flex: none; text-decoration: none; font-size: 26px; border: var(--trait-plume) solid var(--contour); border-radius: var(--tremble-2); }
.weeknav a:hover { background: var(--survol); }
.status { display: flex; gap: var(--espace-2); flex-wrap: wrap; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.actions form { display: contents; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--espace-3); padding-block: var(--espace-4); }
.stat b { display: block; font: 800 26px/30px var(--font-texte); font-variant-numeric: lining-nums tabular-nums; }
.stat span { font-size: 15px; line-height: 20px; color: var(--texte-doux); }
.section > h2, .panel-box > h2 { padding-top: var(--espace-1); border-top: var(--trait-fin) solid var(--contour); font-weight: 400; font-size: 22px; line-height: 28px; }
.arow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--espace-3); align-items: center; padding-block: var(--espace-2); border-bottom: var(--trait-fin) solid var(--filet); scroll-margin-top: 80px; }
.rows .arow:last-child { border-bottom: 0; }
.arow.off { opacity: .55; }
.fanes-offre { grid-column: 2 / -1; }
.thumb { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 58% 42% 55% 45% / 47% 56% 44% 53%; background: var(--filet); font: 700 22px/1 var(--font-titre); color: var(--texte); }
.thumb:has(img) { border-radius: var(--rayon-s); background: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.arow .t { min-width: 0; }
.arow .t b { display: block; font-size: 19px; line-height: 24px; }
.arow .t span { font-size: 15px; line-height: 20px; color: var(--texte-doux); }
.switch { position: relative; display: inline-block; flex: none; width: 54px; height: 32px; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface); border: var(--trait-plume) solid var(--contour); border-radius: var(--tremble-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--encre); transition: transform .15s; }
.switch input:checked + span { background: var(--vert); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 4px; }
.order { display: grid; gap: var(--espace-2); padding-top: var(--espace-3); border-top: var(--trait-plume) solid var(--contour); scroll-margin-top: 80px; }
.order-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--espace-2); flex-wrap: wrap; }
.order-head h3 { font: 700 21px/26px var(--font-texte); }
.oline { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding-block: var(--espace-2); border-bottom: var(--trait-fin) solid var(--filet); }
.oline:last-of-type { border-bottom: 0; }
.weigh { display: flex; align-items: center; gap: 6px; }
.weigh input { width: 88px; text-align: right; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--espace-2); flex-wrap: wrap; font: 800 19px/24px var(--font-texte); font-variant-numeric: lining-nums tabular-nums; }
.list { display: grid; gap: var(--espace-5); padding-block: var(--espace-3) var(--espace-5); }
.panel-box { display: grid; gap: var(--espace-3); }
.photo-edit { display: flex; gap: var(--espace-3); align-items: center; flex-wrap: wrap; }
.photo-edit .thumb { width: 88px; height: 88px; }
.copy-field { display: flex; gap: var(--espace-2); }
.copy-field input { font-size: 15px; }

/* Cueillette */
.pick-cat { font-weight: 400; font-size: 22px; line-height: 28px; padding-top: var(--espace-1); border-top: var(--trait-fin) solid var(--contour); }
.pick { display: grid; grid-template-columns: 30px 1fr auto; gap: var(--espace-3); align-items: center; width: 100%; padding: var(--espace-3) 0; border: 0; border-bottom: var(--trait-fin) solid var(--filet); background: none; text-align: left; cursor: pointer; }
.pick .box { display: grid; place-items: center; width: 28px; height: 28px; border: var(--trait-plume) solid var(--contour); border-radius: 8px 12px 7px 11px; font-weight: 700; }
.pick.done { opacity: .55; }
.pick.done .box { background: var(--vert); }
.pick.done .name { text-decoration: line-through; }
.pick .name { font: 700 21px/26px var(--font-texte); }
.pick .qty { font: 800 21px/26px var(--font-texte); text-align: right; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.pick .sub { font-size: 15px; line-height: 20px; color: var(--texte-doux); }

.login { max-width: 380px; margin: 0 auto; padding: var(--espace-7) var(--espace-5); display: grid; gap: var(--espace-4); }
.login .big-logo { width: 160px; justify-self: center; transform: rotate(-3deg); }
footer.site { padding-block: var(--espace-6); color: var(--texte-doux); font-size: 15px; line-height: 20px; }

@media print {
  .topbar, .basket, .actions, .no-print, .weeknav a { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .pick, .order { break-inside: avoid; }
}

/* Chiffres alignés : Alegreya dessine par défaut des chiffres elzéviriens, moins lisibles dans un prix */
.pdl-quantite__valeur, .pdl-total, .pdl-ligne__prix, .total { font-variant-numeric: lining-nums tabular-nums; }
