/* Site public d'une friterie (F6b). Theme clair, une couleur d'accent, polices systeme.
   Mobile d'abord (lisible des 320 px). Identite visuelle fine : a decider (voir le rapport). */
:root {
  --fond: #fbf8f2;
  --carte: #ffffff;
  --texte: #1f1d1a;
  --discret: #5b564e;
  --trait: #cfc8bb;
  --accent: #a8321a;      /* contraste 7,1:1 sur blanc */
  --accent-texte: #ffffff;
  --danger: #8f1d1d;
  --alerte-fond: #fdecea;
  --info-fond: #fff4d6;
  --focus: #0b57d0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
  padding-bottom: 5rem;
}

.saut { position: absolute; left: -999px; top: 0; background: var(--carte); padding: .75rem 1rem; z-index: 10; }
.saut:focus { left: 0; }

.entete { background: var(--accent); color: var(--accent-texte); padding: .9rem 1rem; }
.nom-commerce { margin: 0; font-size: 1.25rem; font-weight: 700; }

main { max-width: 40rem; margin: 0 auto; padding: 1rem; }
main:focus { outline: none; }

.titre-vue { font-size: 1.5rem; margin: .5rem 0 1rem; }
.titre-vue:focus { outline: none; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; color: var(--discret); }

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

[hidden] { display: none !important; }

.aide, .facultatif { color: var(--discret); font-size: .9rem; margin: .25rem 0; }
.donnees { font-size: .9rem; background: var(--carte); border: 1px solid var(--trait); border-radius: .5rem; padding: .6rem .75rem; }

.bandeau { background: var(--info-fond); border: 2px solid #b58900; border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.alerte { background: var(--alerte-fond); border: 2px solid var(--danger); color: var(--danger); border-radius: .5rem; padding: .75rem 1rem; font-weight: 600; }
.alerte::before { content: "Erreur : "; }
.erreur-champ { color: var(--danger); font-weight: 600; margin: .25rem 0; min-height: 0; }
.erreur-champ:empty { display: none; }

/* La carte */
.categories { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem 0 .75rem; position: sticky; top: 0; background: var(--fond); z-index: 2; }
.categories button { flex: 0 0 auto; padding: 0 .9rem; border: 1px solid var(--trait); border-radius: 2rem; color: var(--texte); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.article { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: var(--carte); border: 1px solid var(--trait); border-radius: .5rem; padding: .6rem .75rem; margin: .5rem 0; }
.article-texte { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.article-nom { font-weight: 600; margin: 0; }
.prix { color: var(--discret); margin: 0; }
.epuise { display: inline-block; margin-top: .25rem; padding: .1rem .5rem; border: 2px solid var(--discret); border-radius: .25rem; font-weight: 700; font-size: .85rem; }
.article.est-epuise .article-nom { text-decoration: line-through; color: var(--discret); }

button { font: inherit; min-height: 44px; min-width: 44px; padding: .5rem 1rem; border-radius: .5rem; border: 2px solid var(--accent); background: var(--carte); color: var(--accent); cursor: pointer; }
button.principal { background: var(--accent); color: var(--accent-texte); font-weight: 700; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.secondaire { border-color: var(--trait); color: var(--texte); }
button:disabled { opacity: .55; cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }

/* Panier */
.lignes { list-style: none; margin: 0; padding: 0; }
.ligne { background: var(--carte); border: 1px solid var(--trait); border-radius: .5rem; padding: .6rem .75rem; margin: .5rem 0; }
.ligne-detail { color: var(--discret); font-size: .9rem; margin: .1rem 0; }
.ligne-bas { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .4rem; }
.quantite { display: inline-flex; align-items: center; gap: .25rem; }
.quantite output { min-width: 2rem; text-align: center; font-weight: 700; }

.total { display: flex; justify-content: space-between; font-size: 1.15rem; margin: 1rem 0 .25rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.actions button { flex: 1 1 10rem; }

/* Formulaires */
fieldset { border: 1px solid var(--trait); border-radius: .5rem; background: var(--carte); margin: 0 0 1rem; padding: .5rem .75rem .75rem; }
legend { font-weight: 700; padding: 0 .25rem; }
.champ { margin: 0 0 1rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type="text"], input[type="tel"], select { width: 100%; min-height: 44px; font: inherit; padding: .5rem .6rem; border: 2px solid var(--trait); border-radius: .5rem; background: var(--carte); color: var(--texte); }
input[aria-invalid="true"] { border-color: var(--danger); }
.choix { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .25rem 0; font-weight: 400; margin: 0; }
.choix input { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; accent-color: var(--accent); }
.choix .surcout { margin-left: auto; color: var(--discret); white-space: nowrap; }
.choix.est-epuise { color: var(--discret); }

/* Suivi */
.etat { background: var(--carte); border: 2px solid var(--accent); border-radius: .75rem; padding: 1rem; text-align: center; }
.etat-titre { font-size: 1.3rem; font-weight: 700; margin: 0 0 .5rem; }
.numero { font-size: 3.5rem; font-weight: 800; margin: .25rem 0; line-height: 1; }
.numero::before { content: "N° "; font-size: 1.2rem; font-weight: 600; }

/* Barre du panier */
.barre { position: fixed; left: 0; right: 0; bottom: 0; padding: .6rem 1rem; background: var(--fond); border-top: 1px solid var(--trait); z-index: 3; }
.barre button { width: 100%; max-width: 38rem; display: block; margin: 0 auto; }

/* Configurateur */
dialog { width: min(34rem, calc(100% - 1rem)); max-height: calc(100% - 1rem); border: 2px solid var(--accent); border-radius: .75rem; padding: 1rem; background: var(--carte); color: var(--texte); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog h2 { margin-top: 0; }
dialog h2:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
