/* Fruits de France — orange et blanc.
   Orange vif : surfaces et étiquettes (texte foncé dessus).
   Orange profond : actions (texte blanc dessus, contraste ≥ 4,5:1). */

:root {
  color-scheme: light;
  --white: #ffffff;
  --orange: #ff7a1a;
  --orange-deep: #c94f0a;
  --orange-tint: #fff1e6;
  --orange-line: #f6d9c3;
  --ink: #2b1708;
  --ink-soft: #6b5444;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
  padding-bottom: 5.5rem;
}

body:has(dialog[open]) { overflow: hidden; }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- En-tête ---------- */

.top { background: var(--white); border-bottom: 1px solid var(--orange-line); }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }

.brand {
  font: 800 1.35rem/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--orange-deep);
  text-decoration: none;
}

.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 2px solid var(--orange-deep); border-radius: 999px;
  background: var(--white); color: var(--orange-deep);
  font-weight: 600;
}
.cart-btn:hover { background: var(--orange-tint); }

.badge {
  min-width: 1.6em; padding: 0 .45em;
  border-radius: 999px; background: var(--orange-deep); color: var(--white);
  font-size: .85rem; line-height: 1.6; text-align: center;
}

/* ---------- Bandeau de recherche ---------- */

.band { background: var(--orange); padding: 28px 0 32px; }

.band h1 {
  font: 800 clamp(1.9rem, 6vw, 3rem)/1.05 var(--display);
  letter-spacing: -0.025em;
  max-width: 14em;
  margin-bottom: 18px;
}

.search { display: block; max-width: 520px; }
.zone-line { margin-top: 14px; max-width: 34em; font-weight: 500; }
.zone-line[hidden] { display: none; }

.search input {
  width: 100%; min-height: 52px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--white);
  font-size: 1.05rem;
}
.search input::placeholder { color: var(--ink-soft); }
.band :focus-visible { outline-color: var(--ink); }

/* ---------- Catégories ---------- */

.cats {
  position: sticky; top: 0; z-index: 5;
  background: var(--white); border-bottom: 1px solid var(--orange-line);
}

.chips { display: flex; gap: 8px; padding-top: 12px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none; min-height: 44px; padding: 0 18px;
  border: 2px solid var(--orange-line); border-radius: 999px;
  background: var(--white); font-weight: 600;
}
.chip:hover { border-color: var(--orange); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---------- Liste de produits ---------- */

.status { padding: 40px 0; text-align: center; color: var(--ink-soft); }
.status strong { display: block; color: var(--ink); font: 600 1.15rem var(--display); margin-bottom: 4px; }
.status .btn { margin-top: 16px; }

.list {
  display: grid; gap: 0 32px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  padding: 8px 0 24px;
}

.item {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--orange-line);
}

.ico {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--orange-tint); font-size: 1.9rem; line-height: 1;
}

.info { min-width: 0; }
.name { font: 600 1.05rem/1.25 var(--body); }
.origin { color: var(--ink-soft); font-size: .9rem; margin-bottom: 6px; }

/* L'étiquette de prix : le détail mémorable. */
.tag {
  position: relative; display: inline-flex; align-items: baseline; gap: 3px;
  padding: 3px 12px 3px 20px;
  background: var(--orange); color: var(--ink);
  font: 800 1.1rem/1.3 var(--display);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
}
.tag::before {
  content: ""; position: absolute; left: 9px; top: 50%;
  width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: var(--white);
}
.tag small { font: 600 .78rem var(--body); }

.item[data-off] .ico, .item[data-off] .info { opacity: .55; }
.item[data-off] .tag { background: var(--orange-line); }
.off { color: var(--ink-soft); font-weight: 600; font-size: .95rem; padding-right: 6px; }

/* ---------- Boutons et sélecteur de quantité ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 2px solid var(--orange-deep); border-radius: 999px;
  background: var(--white); color: var(--orange-deep);
  font-weight: 600;
}
.btn:hover { background: var(--orange-tint); }
.btn.primary { background: var(--orange-deep); color: var(--white); }
.btn.primary:hover { background: #a83f06; border-color: #a83f06; }
.btn.block { width: 100%; min-height: 52px; font-size: 1.05rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.stepper {
  display: inline-flex; align-items: center;
  border: 2px solid var(--orange-deep); border-radius: 999px; overflow: hidden;
}
.stepper button {
  width: 44px; height: 44px; border: 0; background: var(--orange-deep); color: var(--white);
  font-size: 1.4rem; line-height: 1;
}
.stepper button:hover:not(:disabled) { background: #a83f06; }
.stepper button:disabled { background: var(--orange-line); color: var(--ink-soft); cursor: not-allowed; }
/* Quantité : un vrai champ, on peut le retaper (750 g, 3 avocats…). */
.qty-field { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 4.6em; padding: 0 4px; background: var(--white); align-self: stretch; cursor: text; }
.qty-field input {
  width: 2.6ch; min-width: 0; padding: 0; border: 0; background: transparent;
  text-align: center; font-weight: 600; font-variant-numeric: tabular-nums;
}
.qty-field.is-weight input { width: 4.4ch; text-align: right; }
.qty-field .unit { color: var(--ink-soft); font-size: .9rem; font-weight: 600; }
.qty-field input:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 4px; border-radius: 4px; }

/* ---------- Barre panier flottante ---------- */

.cart-bar {
  position: fixed; z-index: 8; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: calc(100% - 2 * var(--gutter)); max-width: 460px; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--white);
  box-shadow: 0 8px 24px rgba(43, 23, 8, .28);
  font-weight: 600;
}
.cart-bar[hidden] { display: none; }
.cart-bar .bar-label { color: var(--orange); }
#barTotal { font: 800 1.1rem var(--display); }

/* ---------- Panier (tiroir / feuille) ---------- */

.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--white);
  margin: 0 0 0 auto; width: min(460px, 100vw); max-width: none;
  height: 100dvh; max-height: none;
}
.sheet[open] { display: flex; flex-direction: column; animation: slide-in .22s ease-out; }
.sheet::backdrop { background: rgba(43, 23, 8, .5); }

@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--orange-line);
}
.sheet-head h2 { font: 800 1.4rem var(--display); letter-spacing: -0.02em; }

.close {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--orange-tint); font-size: 1.6rem; line-height: 1;
}
.close:hover { background: var(--orange-line); }

.step { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.step[hidden] { display: none; }

.sheet-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }

.sheet-foot { padding: 14px 20px 20px; border-top: 1px solid var(--orange-line); background: var(--white); }

.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total strong { font: 800 1.5rem var(--display); }

.lines .line {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--orange-line);
}
.line .ico { width: 40px; height: 40px; border-radius: 12px; font-size: 1.4rem; }
.line .name { font-size: 1rem; }
.line .sub { grid-column: 2; color: var(--ink-soft); font-size: .9rem; }
.line .amount { font: 800 1.05rem var(--display); text-align: right; }
.line .stepper { grid-column: 2 / 4; justify-self: start; margin-top: 6px; }

.empty { padding: 32px 0; color: var(--ink-soft); text-align: center; }

/* ---------- Formulaire ---------- */

.link {
  margin: 8px 0 16px; padding: 10px 0; border: 0; background: none;
  color: var(--orange-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--orange-line); border-radius: 14px; background: var(--white);
  font-size: 1rem; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--orange-deep); outline: none; box-shadow: 0 0 0 3px var(--orange-line); }
.field input:user-invalid, .field textarea:user-invalid, .field input[aria-invalid="true"] { border-color: #b3261e; }
.hint { margin-top: 6px; color: var(--ink-soft); font-size: .9rem; }

.form-error {
  padding: 12px 14px; border-radius: 12px;
  background: #fde8e6; color: #8c1d18; font-weight: 500;
}

/* ---------- Confirmation ---------- */

.done { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 40px; gap: 10px; }
.done-icon { font-size: 3.4rem; line-height: 1; }
.done h3 { font: 800 1.7rem var(--display); letter-spacing: -0.02em; }
.done p { max-width: 32ch; }
.done-ref { margin-top: 8px; padding: 10px 16px; border-radius: 12px; background: var(--orange-tint); }

/* ---------- Message temporaire ---------- */

.toast {
  position: fixed; z-index: 20; left: 50%; bottom: 88px; transform: translateX(-50%);
  width: calc(100% - 2 * var(--gutter)); max-width: 460px;
  padding: 12px 16px; border-radius: 14px;
  background: var(--white); border: 2px solid var(--orange-deep); font-weight: 500;
  box-shadow: 0 8px 24px rgba(43, 23, 8, .2);
}
.toast:empty { display: none; }

/* ---------- Mobile : le panier devient une feuille depuis le bas ---------- */

@media (max-width: 640px) {
  .sheet { inset: auto 0 0 0; width: 100vw; height: auto; max-height: 92dvh; margin: 0; border-radius: 24px 24px 0 0; }
  .sheet[open] { animation-name: slide-up; }
  .cart-btn { padding: 0 14px; }
}

@keyframes slide-up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sheet[open] { animation: none; }
}


/* ---------- Adresse : suggestions ---------- */

.combo { position: relative; }
.suggestions {
  position: absolute; z-index: 3; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 240px; overflow-y: auto;
  border: 2px solid var(--orange-deep); border-radius: 14px; background: var(--white);
  box-shadow: 0 8px 24px rgba(43, 23, 8, .18);
}
.suggestions[hidden] { display: none; }
.suggestions li { padding: 12px 14px; border-bottom: 1px solid var(--orange-line); cursor: pointer; }
.suggestions li:last-child { border-bottom: 0; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--orange-tint); }
.suggestions .a-main { display: block; font-weight: 600; }
.suggestions small { display: block; color: var(--ink-soft); }

.addr-status { margin-top: 6px; min-height: 1.4em; font-size: .92rem; font-weight: 600; }
.addr-status.ok { color: #1d6b3a; }
.addr-status.warn { color: #8c1d18; }
.optional { color: var(--ink-soft); font-weight: 400; }

/* ---------- Réception : modes, jours, créneaux ---------- */

fieldset.choice { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
fieldset.choice[hidden] { display: none; }
fieldset.choice legend { margin-bottom: 6px; padding: 0; font-weight: 600; }

/* Radios stylés : l'input natif reste là (clavier, lecteurs d'écran), seul son habillage change. */
.card, .pick { position: relative; display: block; cursor: pointer; }
.card input, .pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.cards { display: grid; gap: 8px; }
.card-body {
  display: block; padding: 12px 14px;
  border: 2px solid var(--orange-line); border-radius: 14px; background: var(--white);
}
.card-body strong { display: block; }
.card-body small { display: block; color: var(--ink-soft); font-size: .9rem; }
.card input:checked + .card-body { border-color: var(--orange-deep); background: var(--orange-tint); }
.card input:focus-visible + .card-body, .pick input:focus-visible + span { outline: 3px solid var(--orange-deep); outline-offset: 2px; }

.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick span {
  display: block; min-height: 44px; padding: 8px 18px;
  border: 2px solid var(--orange-line); border-radius: 999px; background: var(--white);
  font-weight: 600; text-align: center; line-height: 1.2;
}
.pick span small { display: block; color: var(--ink-soft); font-weight: 400; font-size: .85rem; }
.pick input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.pick input:checked + span small { color: var(--orange-line); }

.recap { margin: 0 0 8px; color: var(--ink-soft); font-size: .95rem; }
.recap div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.recap div[hidden] { display: none; }
.recap dt, .recap dd { margin: 0; }
.recap dd { text-align: right; }

.note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--orange-tint); font-size: .92rem; }
.note[hidden] { display: none; }
