/* Demande de commande des fêtes : sélecteurs sous les fiches, barre « Ma demande », volet de finalisation.
   S'appuie sur les couleurs de pages.css (--bg, --surface, --ink, --ink-soft, --line, --accent, --on-accent). */
:root { --cmd-card: #faf6ee; --cmd-accent-soft: rgba(178,58,46,.1); --cmd-ok: #2f6b3a; --cmd-voile: rgba(28,24,19,.5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cmd-card: #26201a; --cmd-accent-soft: rgba(205,161,77,.14); --cmd-ok: #8fc79a; --cmd-voile: rgba(0,0,0,.6); } }
:root[data-theme="dark"] { --cmd-card: #26201a; --cmd-accent-soft: rgba(205,161,77,.14); --cmd-ok: #8fc79a; --cmd-voile: rgba(0,0,0,.6); }

[hidden] { display: none !important; }
html.cmd-actif body { padding-bottom: 96px; }
html.cmd-bloque { overflow: hidden; }

/* Fiches */
.prod { position: relative; border: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.prod.cmd-choisi { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cmd-badge { position: absolute; top: 10px; left: 10px; z-index: 1; font-family: var(--display); font-weight: 700; font-size: 13px; background: var(--accent); color: var(--on-accent); padding: 4px 10px; border-radius: 999px; }
.prod .prix { margin-bottom: 6px; }
.cmd-tag { display: inline-block; align-self: flex-start; margin: 0 0 8px; font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 3px 10px; }
.cmd-tag-option { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-weight: 600; }
.cmd-choix { padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.cmd-choix button, .cmd-volet button { font-family: var(--display); cursor: pointer; }
.cmd-ajouter { font-weight: 700; font-size: 16px; letter-spacing: .02em; border: 2px solid var(--accent); color: var(--accent); background: transparent; border-radius: 999px; padding: 12px; }
.cmd-ajouter:hover { background: var(--cmd-accent-soft); }
.cmd-choix .cmd-question { margin: 0; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--accent); }
.cmd-retirer { justify-self: center; border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; text-decoration: underline; padding: 2px 6px; }
.cmd-seg { display: grid; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--bg); }
.cmd-seg button { min-width: 0; border: 0; background: transparent; color: var(--ink-soft); font-weight: 600; font-size: 13px; padding: 7px 4px; border-radius: 999px; }
.cmd-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.cmd-unites { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--display); font-size: 13px; }
.cmd-unites span { color: var(--ink-soft); font-weight: 600; }
.cmd-unites button { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.cmd-unites button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cmd-pas { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.cmd-pas > button { height: 42px; border: 0; background: transparent; color: var(--ink); font-size: 22px; }
.cmd-pas > button:hover { background: var(--cmd-accent-soft); }
.cmd-pas output { text-align: center; font-family: var(--display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.cmd-saisie { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--display); font-weight: 700; }
.cmd-saisie input { width: 76px; text-align: center; font: inherit; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--cmd-card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; }
.cmd-saisie span { color: var(--ink-soft); font-size: 14px; }
.cmd-note { margin: -2px 0 0 !important; text-align: center; font-family: var(--display); font-size: 12.5px !important; color: var(--ink-soft); }
.cmd-prec { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.cmd-choix :focus-visible, .cmd-volet :focus-visible, .cmd-barre :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Barre fixe */
.cmd-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--ink); color: var(--bg); padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); transform: translateY(110%); transition: transform .3s ease; }
.cmd-barre.cmd-vue { transform: none; }
.cmd-barre-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cmd-barre p { margin: 0; font-family: var(--display); font-weight: 600; font-size: 15px; min-width: 0; }
.cmd-barre p span { display: block; font-weight: 400; font-size: 13px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-barre button { flex: none; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 13px 18px; cursor: pointer; }

/* Volet */
.cmd-voile { position: fixed; inset: 0; z-index: 30; background: var(--cmd-voile); display: flex; justify-content: flex-end; }
.cmd-volet { width: min(580px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); color: var(--ink); padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) 20px; }
.cmd-form { display: grid; gap: 22px; }
.cmd-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cmd-tete h2, .cmd-merci h2 { margin: 0; font-size: 24px; }
.cmd-fermer { flex: none; white-space: nowrap; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.cmd-recap { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmd-recap li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--cmd-card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.cmd-recap img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.cmd-recap b { font-family: var(--display); font-size: 15px; display: block; line-height: 1.2; }
.cmd-recap span { font-size: 14px; color: var(--ink-soft); }
.cmd-recap em { display: block; font-style: normal; font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--accent); }
.cmd-recap .cmd-q { font-family: var(--display); font-weight: 700; color: var(--accent); white-space: nowrap; }
.cmd-bloc { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.cmd-bloc legend { font-family: var(--display); font-weight: 700; font-size: 17px; padding: 0; margin-bottom: 10px; }
.cmd-volet abbr { color: var(--accent); text-decoration: none; }
.cmd-cal { background: var(--cmd-card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cmd-cal-tete { font-family: var(--display); font-weight: 700; margin-bottom: 8px; }
.cmd-cal-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cmd-js { font-family: var(--display); font-size: 12px; font-weight: 600; color: var(--ink-soft); padding-bottom: 4px; }
.cmd-cal-grille button { position: relative; aspect-ratio: 1; max-width: 100%; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.cmd-cal-grille button:hover:not(:disabled) { border-color: var(--accent); }
.cmd-cal-grille button:disabled { color: var(--ink-soft); opacity: .35; cursor: default; text-decoration: line-through; }
.cmd-cal-grille button.cmd-fete::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.cmd-cal-grille button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.cmd-cal-grille button[aria-pressed="true"]::after { background: var(--on-accent); }
.cmd-cal-legende { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.cmd-cal-legende i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: middle; }
.cmd-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.cmd-boutons input { position: absolute; opacity: 0; pointer-events: none; }
.cmd-boutons label { font-family: var(--display); font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer; background: var(--cmd-card); }
.cmd-boutons input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cmd-boutons input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmd-boutons input:disabled + label { opacity: .4; cursor: default; text-decoration: line-through; }
.cmd-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .cmd-deux { grid-template-columns: 1fr; } }
.cmd-champ { display: grid; gap: 4px; }
.cmd-champ label { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.cmd-champ input, .cmd-champ textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--cmd-card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cmd-champ input[aria-invalid="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cmd-err { margin: 2px 0 0; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--accent); }
.cmd-err a { color: inherit; }
.cmd-petit { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.cmd-acompte { border: 1px solid var(--accent); background: var(--cmd-accent-soft); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.45; }
.cmd-acompte b { font-family: var(--display); display: block; margin-bottom: 4px; }
.cmd-acompte ul { margin: 6px 0 0; padding-left: 18px; }
.cmd-engage { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; background: var(--surface); padding: 12px; border-radius: 12px; cursor: pointer; }
.cmd-engage input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.cmd-piege { position: absolute; left: -9999px; }
.cmd-envoyer { font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 16px; }
.cmd-envoyer:disabled { opacity: .75; cursor: wait; }
.cmd-roue { display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cmd-tourne .8s linear infinite; }
@keyframes cmd-tourne { to { transform: rotate(360deg); } }
.cmd-attente { text-align: center; }
.cmd-merci { text-align: center; display: grid; gap: 12px; padding-top: 40px; outline: none; }
.cmd-merci h2 { color: var(--cmd-ok); }
.cmd-merci p { margin: 0; }
.cmd-merci .cmd-fermer { justify-self: center; }
.cmd-rond { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--cmd-ok); color: var(--bg); font-size: 32px; }
@media (prefers-reduced-motion: reduce) { .cmd-barre, .prod { transition: none; } }

/* Gigot / épaule : prix de la qualité choisie surligné */
.prod .prix .cmd-px { transition: color .15s, opacity .15s; }
.prod.cmd-px-choisi .prix .cmd-px { font-weight: 600; font-size: 14px; color: var(--ink-soft); opacity: .7; }
.prod.cmd-px-choisi .prix .cmd-px.cmd-px-on { font-weight: 800; font-size: 18px; color: var(--accent); opacity: 1; background: var(--cmd-accent-soft); border-radius: 6px; padding: 1px 6px; }
.prod .prix .cmd-px-sep { color: var(--ink-soft); font-weight: 600; }

/* Poids d'un entier (foie gras, saumon) : bien visible */
.cmd-poids { margin: 0 !important; padding: 10px 12px; border-radius: 10px; background: var(--cmd-accent-soft); border: 1.5px solid var(--accent); color: var(--ink); font-family: var(--display); font-size: 15px !important; line-height: 1.35 !important; text-align: center; }
.cmd-poids b { color: var(--accent); font-weight: 800; }
.cmd-q small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); text-align: right; }

/* Saucisses cocktail : un compteur par parfum */
.cmd-parfums { display: grid; gap: 8px; }
.cmd-parfum { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 12px; border: 1px solid var(--line); }
.cmd-parfum > span { font-family: var(--display); font-weight: 700; font-size: 16px; }
.cmd-parfum-on { border-color: var(--accent); background: var(--cmd-accent-soft); }
.cmd-parfum-on > span { color: var(--accent); }
