/* =========================================================
   Pizzeria B52 — commande en ligne (panier, options, tunnel)
   ========================================================= */
:root { --ok: #2f7d3b; --warn: #c25a12; --err: #b3261e; }

[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.no-scroll { overflow: hidden; }

/* ---------- Carte : cartes cliquables ---------- */
.dish__btn { all: unset; display: flex; flex-direction: column; cursor: pointer; border-radius: var(--r-img); }
.dish__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.dish__btn[disabled] { cursor: not-allowed; }
.dish__plus {
  position: absolute; right: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--yellow); color: var(--ink); display: grid; place-items: center;
  font: 400 30px/1 var(--font-body); transition: transform .35s var(--ease), background-color .25s;
}
.dish__btn:hover .dish__plus { transform: rotate(90deg) scale(1.08); background: var(--cream); }
.dish--off .dish__plus { display: none; }

/* Boissons en liste */
.drinks__list { list-style: none; margin: 0 auto; padding: 0; max-width: 1000px; columns: 2; column-gap: 48px; }
.drink { break-inside: avoid; border-bottom: 1px solid rgba(35,33,28,.25); opacity: 0; animation: dishIn .5s var(--ease) forwards; animation-delay: calc(var(--i) * 20ms); }
.drink button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 4px; cursor: pointer; }
.drink button:focus-visible { outline: 2px solid var(--ink); }
.drink__nom { flex: 1; font-size: 17px; }
.drink__nom small { display: block; font-size: 13px; color: var(--ink-soft); }
.drink__prix { font-weight: 700; white-space: nowrap; }
.drink__plus { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-size: 20px; transition: background-color .2s, transform .3s var(--ease); flex: none; }
.drink button:hover .drink__plus { background: var(--yellow); border-color: var(--yellow); transform: rotate(90deg); }
.drink--off { opacity: .45 !important; }
.drink--off button { cursor: not-allowed; }

/* Bandeau d'état */
.etat-commandes { max-width: 820px; margin: 0 auto 36px; padding: 18px 22px; border: 1px solid var(--ink); border-radius: var(--r-btn); background: var(--peach); text-align: center; line-height: 1.45; }
.etat-commandes--demo { background: var(--yellow); }

/* Compteur & bouton flottant */
.compteur { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: var(--yellow); font: 700 12px/22px var(--font-badge); text-align: center; }
.nav .pill--solid .compteur { background: var(--ink); color: var(--yellow); }
.pulse { animation: pulseCpt .5s var(--ease); }
@keyframes pulseCpt { 40% { transform: scale(1.45); } }
.panier-flottant {
  position: fixed; right: 24px; bottom: 24px; z-index: 55;
  display: flex; align-items: center; gap: 12px; padding: 12px 22px 12px 12px;
  border-radius: var(--r-pill); border: 1px solid var(--ink); background: var(--yellow); color: var(--ink);
  font: 700 15px/1 var(--font-body); cursor: pointer;
  animation: fadeUp .4s var(--ease);
  transition: transform .25s var(--ease);
}
.panier-flottant:hover { transform: translateY(-3px); }
.panier-flottant__nb { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; }
.panier-flottant[hidden] { display: none; }

/* ---------- Boutons divers ---------- */
.icone-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink); background: var(--cream); cursor: pointer; font-size: 16px; display: grid; place-items: center; flex: none; }
.icone-btn:hover { background: var(--ink); color: var(--cream); }
.btn { cursor: pointer; }
.btn--large { width: 100%; padding: 20px; font-size: 16px; }
.btn.is-disabled, .btn:disabled { opacity: .45; pointer-events: none; }
.alerte { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r-btn); background: #fbe3d4; color: #7a2e0c; font-size: 14px; line-height: 1.4; }
.alerte--erreur { background: #f9dedb; color: var(--err); }
.alerte ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Stepper ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--ink); border-radius: var(--r-pill); }
.stepper button { width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; font-size: 20px; border-radius: 50%; }
.stepper button:hover { background: var(--peach); }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; }
.stepper--petit button { width: 36px; height: 36px; font-size: 16px; }

/* ---------- Modal produit ---------- */
.modal { padding: 0; border: 1px solid var(--ink); border-radius: var(--r-img); background: var(--cream); color: var(--ink); width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; }
.modal::backdrop { background: rgba(35,33,28,.6); backdrop-filter: blur(3px); }
.modal[open] { animation: modalIn .35s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.modal__inner { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); margin: 0; position: relative; }
.modal__fermer { position: absolute; top: 14px; right: 14px; z-index: 2; }
.modal__img { aspect-ratio: 16 / 9; overflow: hidden; flex: none; }
.modal__img img { width: 100%; height: 100%; object-fit: cover; }
.modal__contenu { padding: 24px 30px 10px; overflow-y: auto; }
.modal__titre { font: 400 42px/1 var(--font-display); letter-spacing: -0.02em; padding-right: 40px; }
.modal__desc { margin: 10px 0 4px; color: var(--ink-soft); }
.modal__prix-base { margin: 0 0 18px; font-weight: 700; }
.modal__pied { display: flex; gap: 12px; align-items: center; padding: 16px 30px 22px; border-top: 1px solid rgba(35,33,28,.25); background: var(--cream); }
.modal__ajouter { flex: 1; padding: 16px 20px; }

.options { border: 0; padding: 0; margin: 0 0 18px; }
.options legend { font: 600 13px/1 var(--font-badge); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.options legend small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.option { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(35,33,28,.15); cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__case { width: 24px; height: 24px; border: 1px solid var(--ink); border-radius: 6px; display: grid; place-items: center; flex: none; transition: background-color .2s; }
.option input:checked + .option__case { background: var(--ink); }
.option input:checked + .option__case::after { content: "✓"; color: var(--yellow); font-size: 15px; }
.option input:focus-visible + .option__case { outline: 2px solid var(--ink); outline-offset: 2px; }
.option__nom { flex: 1; }
.option__prix { font-weight: 500; white-space: nowrap; }

/* ---------- Champs de formulaire ---------- */
.champ { display: block; margin-bottom: 18px; }
.champ__label { display: block; font: 600 13px/1 var(--font-badge); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.champ__label small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-soft); margin-left: 4px; }
.champ input, .champ select, .champ textarea {
  width: 100%; padding: 15px 16px; border: 1px solid var(--ink); border-radius: var(--r-btn);
  background: #fffaf6; color: var(--ink); font: 400 16px/1.3 var(--font-body);
}
.champ input:focus, .champ select:focus { outline: 2px solid var(--yellow-deep); outline-offset: 0; }
.champ--erreur input { border-color: var(--err); background: #fff3f1; }
.champ__aide { display: block; font-size: 13px; margin-top: 6px; color: var(--ink-soft); }
.champ--erreur .champ__aide { color: var(--err); }

/* ---------- Tiroir ---------- */
.tiroir-fond { position: fixed; inset: 0; z-index: 70; background: rgba(35,33,28,.55); opacity: 0; transition: opacity .35s; }
.tiroir-fond.is-open { opacity: 1; }
.tiroir {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(460px, 100%);
  background: var(--cream); border-left: 1px solid var(--ink);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .4s var(--ease); visibility: hidden;
}
.tiroir.is-open { transform: none; visibility: visible; }
.tiroir__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--ink); }
.tiroir__head h2 { font: 400 34px/1 var(--font-display); }
.tiroir__corps { flex: 1; overflow-y: auto; padding: 6px 24px; }
.tiroir__pied { padding: 18px 24px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink); }
.tiroir__pied:empty { display: none; }

.panier-vide { text-align: center; padding: 60px 10px; }
.panier-vide__titre { font: 400 30px/1.1 var(--font-display); margin: 0 0 8px; }

.lignes { list-style: none; margin: 0; padding: 0; }
.ligne { padding: 18px 0; border-bottom: 1px solid rgba(35,33,28,.2); animation: fadeUp .3s var(--ease); }
.ligne__haut { display: flex; justify-content: space-between; gap: 14px; }
.ligne__nom { margin: 0; font: 400 22px/1.1 var(--font-display); }
.ligne__nom small { font: 500 12px/1 var(--font-badge); color: var(--ink-soft); margin-left: 4px; }
.ligne__opts { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.ligne__alerte { margin: 6px 0 0; font-size: 14px; color: var(--err); }
.ligne--off .ligne__nom { text-decoration: line-through; }
.ligne__prix { margin: 0; font-weight: 700; white-space: nowrap; }
.ligne__bas { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.ligne__remarque { flex: 1; min-width: 0; padding: 9px 12px; border: 1px dashed rgba(35,33,28,.5); border-radius: var(--r-btn); background: transparent; font: 400 14px/1.2 var(--font-body); color: var(--ink); }
.ligne__remarque:focus { border-style: solid; outline: none; background: #fffaf6; }

.totaux p { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 17px; }
.totaux .totaux__note { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.totaux__total { font-size: 22px !important; padding-top: 10px; border-top: 1px solid var(--ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 90; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--cream); padding: 14px 22px; border-radius: var(--r-pill);
  font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease);
  max-width: calc(100% - 32px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .drinks__list { columns: 1; }
  .panier-flottant { display: none !important; }
  .mobile-bar button { border-radius: var(--r-btn); text-align: center; padding: 15px; font: 700 15px/1 var(--font-body); text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--yellow); background: var(--yellow); cursor: pointer; }
  .modal { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r-img) var(--r-img) 0 0; border-bottom: 0; }
  .modal__inner { max-height: 92dvh; }
  .modal[open] { animation: sheetIn .35s var(--ease); }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  .modal__contenu { padding: 20px 16px 6px; }
  .modal__pied { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .modal__titre { font-size: 34px; }
  .tiroir__head, .tiroir__corps, .tiroir__pied { padding-left: 16px; padding-right: 16px; }
  .toast { bottom: 90px; }
}

/* =========================================================
   Page commander.html
   ========================================================= */
.page-commande { background: var(--cream); }
.cmd-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter); background: var(--ink); color: var(--cream); --logo-word: var(--white); border-bottom: 1px solid var(--yellow); }
.cmd-nav .logo { width: 72px; }
.cmd-nav a.retour { color: var(--cream); text-decoration: none; font-size: 15px; }
.cmd-nav a.retour:hover { text-decoration: underline; }

.cmd { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(24px, 4vw, 60px); max-width: 1200px; margin: 0 auto; padding: 48px var(--gutter) 120px; align-items: start; }
.cmd__titre { font: 400 clamp(46px, 6vw, 80px)/.95 var(--font-display); letter-spacing: -0.025em; margin-bottom: 36px; }
.bloc { border-top: 1px solid var(--ink); padding: 28px 0 10px; }
.bloc__titre { display: flex; align-items: baseline; gap: 12px; font: 400 32px/1 var(--font-display); margin-bottom: 20px; }
.bloc__num { font: 600 13px/1 var(--font-badge); letter-spacing: .1em; }

/* Choix en tuiles */
.tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.tuile { position: relative; display: block; cursor: pointer; }
.tuile input { position: absolute; opacity: 0; pointer-events: none; }
.tuile__corps { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; border: 1px solid var(--ink); border-radius: var(--r-btn); background: #fffaf6; transition: background-color .2s, transform .2s var(--ease); }
.tuile__corps strong { font: 400 24px/1 var(--font-display); }
.tuile__corps small { font-size: 14px; color: var(--ink-soft); }
.tuile:hover .tuile__corps { transform: translateY(-2px); }
.tuile input:checked + .tuile__corps { background: var(--yellow); }
.tuile input:checked + .tuile__corps small { color: var(--ink); }
.tuile input:focus-visible + .tuile__corps { outline: 2px solid var(--ink); outline-offset: 2px; }
.tuile input:disabled + .tuile__corps { opacity: .45; cursor: not-allowed; }
.tuiles--3 { grid-template-columns: repeat(3, 1fr); }

/* Adresse */
.combo { position: relative; }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; margin: 4px 0 0; padding: 6px; list-style: none; background: var(--cream); border: 1px solid var(--ink); border-radius: var(--r-btn); max-height: 300px; overflow-y: auto; }
.suggestions li { padding: 12px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--peach); }
.suggestions li small { color: var(--ink-soft); white-space: nowrap; }
.suggestions li.hors-zone small { color: var(--err); }
.zone-statut { display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; font-size: 15px; }
.zone-statut--ok { color: var(--ok); }
.zone-statut--ko { color: var(--err); }

/* Créneaux */
.creneaux { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.creneau { position: relative; }
.creneau input { position: absolute; opacity: 0; pointer-events: none; }
.creneau span { display: inline-block; padding: 11px 16px; border: 1px solid var(--ink); border-radius: var(--r-pill); cursor: pointer; font-weight: 500; transition: background-color .2s; }
.creneau input:checked + span { background: var(--ink); color: var(--cream); }
.creneau input:focus-visible + span { outline: 2px solid var(--yellow-deep); outline-offset: 2px; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.consentement { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0 24px; cursor: pointer; line-height: 1.45; }
.consentement input { width: 24px; height: 24px; flex: none; accent-color: var(--ink); margin-top: 1px; }

/* Récap */
.recap { position: sticky; top: 24px; border: 1px solid var(--ink); border-radius: var(--r-img); background: var(--peach); padding: 26px; }
.recap h2 { font: 400 32px/1 var(--font-display); margin-bottom: 14px; }
.recap ul { list-style: none; margin: 0 0 16px; padding: 0; }
.recap li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(35,33,28,.2); font-size: 15px; }
.recap li small { display: block; color: var(--ink-soft); font-size: 13px; }
.recap .totaux p { font-size: 16px; }
.recap__modifier { display: inline-block; margin-bottom: 18px; font-size: 14px; }
.securite { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }

/* Écran confirmation / simulation */
.ecran { max-width: 640px; margin: 0 auto; padding: 64px var(--gutter) 120px; text-align: center; }
.ecran__ticket { display: inline-block; margin: 10px 0 24px; padding: 18px 28px; border: 1px solid var(--ink); border-radius: var(--r-img); background: var(--yellow); }
.ecran__ticket small { display: block; font: 600 12px/1 var(--font-badge); letter-spacing: .12em; text-transform: uppercase; }
.ecran__ticket strong { font: 400 84px/1 var(--font-display); letter-spacing: -0.02em; }
.ecran h1 { font: 400 clamp(42px, 6vw, 64px)/1 var(--font-display); letter-spacing: -0.02em; margin-bottom: 14px; }
.ecran p { font-size: 17px; }
.ecran .btn { margin: 8px 4px; }
.lien-suivi { display: block; word-break: break-all; padding: 14px; border: 1px dashed var(--ink); border-radius: var(--r-btn); margin: 16px 0; font-size: 14px; }

.simu { position: fixed; inset: 0; z-index: 100; background: #f3f4f6; color: #1f2937; overflow-y: auto; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.simu__bandeau { background: #b45309; color: #fff; text-align: center; padding: 10px 16px; font-weight: 600; font-size: 14px; }
.simu__carte { max-width: 440px; margin: 40px auto; background: #fff; border-radius: 12px; padding: 28px; border: 1px solid #e5e7eb; }
.simu__carte h2 { font-family: inherit; font-size: 15px; font-weight: 500; color: #6b7280; margin: 0 0 4px; }
.simu__montant { font-size: 34px; font-weight: 700; margin: 0 0 18px; }
.simu__info { font-size: 14px; line-height: 1.5; background: #fef3c7; border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; color: #78350f; }
.simu__btn { display: block; width: 100%; padding: 15px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; font: 600 15px/1 system-ui, sans-serif; cursor: pointer; }
.simu__btn--ok { background: #1f2937; color: #fff; border-color: #1f2937; }
.simu__btn:hover { filter: brightness(.95); }

@media (max-width: 960px) {
  .cmd { grid-template-columns: 1fr; padding-bottom: 60px; }
  .recap { position: static; order: -1; }
}
@media (max-width: 640px) {
  .cmd { padding: 28px 16px 60px; }
  .tuiles--3 { grid-template-columns: 1fr; }
  .grille-2 { grid-template-columns: 1fr; }
  .tuile__corps strong { font-size: 21px; }
}
