/* Panier et formulaire de commande (module commun : accueil + page produit).
   Classes préfixées cm- pour ne jamais entrer en conflit avec la page hôte.
   Utilise les couleurs de la page (--teal, --mint, --line…). */

/* barre du panier */
.cm-bar{position:fixed;left:50%;bottom:0;z-index:50;width:min(560px,100% - 24px);margin-bottom:calc(14px + env(safe-area-inset-bottom,0px));background:#06393C;color:#fff;border-radius:999px;padding:8px 8px 8px 22px;display:flex;align-items:center;gap:12px;transform:translateX(-50%);display:none;box-shadow:0 24px 50px -16px rgba(6,57,60,.7);font-family:Outfit,system-ui,sans-serif}
.cm-bar.show{display:flex}
.cm-bar .cm-sum{flex:1;line-height:1.2;min-width:0}
.cm-bar .cm-sum b{font-size:19px;font-weight:700;white-space:nowrap}
.cm-bar .cm-sum small{display:block;color:#9FD3CF;font-size:13.5px}
.cm-bar button{border:0;border-radius:999px;background:#1DAA57;color:#fff;font:600 16px Outfit,system-ui,sans-serif;padding:14px 22px;cursor:pointer;white-space:nowrap;box-shadow:0 14px 30px -14px rgba(29,170,87,.8)}
.cm-bar button:active{filter:brightness(.9)}

/* feuille de commande */
.cm-sheet{border:0;padding:0;border-radius:28px;width:min(520px,100% - 24px);max-height:92vh;max-height:92dvh;overflow:auto;overscroll-behavior:contain;background:var(--bg,#fff);color:var(--ink,#0E2A2C);font-family:Outfit,system-ui,sans-serif}
.cm-sheet::backdrop{background:rgba(3,30,32,.55);backdrop-filter:blur(3px)}
@keyframes cmIn{from{opacity:0;transform:translateY(30px) scale(.97)}}
@keyframes cmUp{from{transform:translateY(100%)}}
.cm-form{padding:18px 20px 0}
.cm-grip{display:none;width:44px;height:5px;border-radius:9px;background:var(--line);margin:-6px auto 10px}
.cm-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.cm-head h2{margin:0;font-size:23px;font-weight:700;letter-spacing:-.02em}
.cm-x{width:38px;height:38px;border-radius:50%;border:0;background:var(--mint);color:var(--teal);font-size:22px;line-height:1;cursor:pointer;flex:none}

.cm-lines{margin-top:6px;max-height:156px;overflow:auto}
.cm-line{display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--line)}
.cm-line .n{flex:1;min-width:0;font-weight:500;font-size:15.5px;line-height:1.25}
.cm-line .p{font-weight:600;font-size:14.5px;white-space:nowrap;min-width:64px;text-align:right}
.cm-qty{display:flex;align-items:center;gap:6px}
.cm-qty button{width:30px;height:30px;border-radius:50%;border:0;background:var(--mint);color:var(--teal);font-size:17px;cursor:pointer;line-height:1}
.cm-qty b{min-width:14px;text-align:center}
.cm-more{background:none;border:0;padding:8px 0 0;color:var(--teal);font:600 14.5px Outfit,system-ui,sans-serif;cursor:pointer}

.cm-row{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:8px;margin-top:12px}
.cm-f{display:block;min-width:0;margin-top:10px}
.cm-row .cm-f{margin-top:0}
.cm-t{display:block;font-size:13.5px;font-weight:600;color:var(--ink);margin:0 2px 4px}
.cm-in{display:block;width:100%;height:46px;padding:0 14px;border-radius:14px;border:1.5px solid var(--line);background:var(--surface,#fff);color:var(--ink);font:400 16px Outfit,system-ui,sans-serif}
.cm-in:focus,.cm-tel:focus-within{outline:none;border-color:var(--turq)}
.cm-tel{display:flex;align-items:center;height:46px;border-radius:14px;border:1.5px solid var(--line);background:var(--surface,#fff);overflow:hidden}
.cm-tel em{font-style:normal;color:var(--muted);font-weight:500;padding:0 0 0 10px;font-size:14.5px}
.cm-tel input{flex:1;min-width:0;height:100%;border:0;background:transparent;padding:0 10px 0 6px;color:var(--ink);font:400 16px Outfit,system-ui,sans-serif}
.cm-tel input:focus{outline:none}
.cm-msg{display:none;color:var(--chili,#E0482F);font-size:13px;font-weight:500;margin:4px 2px 0}
.cm-f.err .cm-in,.cm-f.err .cm-tel{border-color:var(--chili,#E0482F)}
.cm-f.err .cm-msg{display:block}
.cm-where[hidden]{display:none}
/* quartier : bouton + tuiles */
.cm-zbtn{display:flex;align-items:center;gap:10px;text-align:left;cursor:pointer;color:var(--muted)}
.cm-zbtn .v{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;white-space:nowrap;overflow:hidden}
.cm-zbtn.set{color:var(--ink);border-color:var(--teal);background:var(--mint)}
.cm-zbtn .v b{font-weight:600;overflow:hidden;text-overflow:ellipsis}
.cm-zbtn .v em{font-style:normal;font-weight:700;color:var(--teal);font-size:15px;flex:none}
.cm-zchev{flex:none;width:9px;height:9px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:translateY(-2px) rotate(45deg)}
.cm-zf.open .cm-zchev{transform:translateY(2px) rotate(-135deg)}
.cm-zf.open .cm-zbtn{border-color:var(--turq)}
.cm-zlist{margin-top:8px;padding:8px;border-radius:18px;background:var(--surface,#fff);box-shadow:0 0 0 1.5px var(--line),0 18px 36px -22px rgba(6,57,60,.45)}
.cm-zsearch{height:42px;margin-bottom:8px;font-size:15.5px}
.cm-zgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:min(46dvh,330px);overflow:auto;overscroll-behavior:contain}
.cm-zopt{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0;padding:11px 12px;border:0;border-radius:14px;background:var(--mint);color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.cm-zopt[hidden]{display:none}
.cm-zopt b{font-size:15px;font-weight:600;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cm-zopt small{font-size:12.5px;color:var(--muted);font-weight:500}
.cm-zopt:active{filter:brightness(.95)}
.cm-zopt[aria-selected="true"]{background:var(--teal);color:#fff}
.cm-zopt[aria-selected="true"] small{color:rgba(255,255,255,.85)}
.cm-zopt:focus-visible{outline:3px solid var(--gold,#F2A93B);outline-offset:1px}
.cm-znone{margin:8px 4px 2px}

.cm-label{display:block;font-size:13.5px;font-weight:600;margin:12px 2px 6px}
.cm-chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -20px;padding:2px 20px 4px;scroll-snap-type:x proximity}
.cm-chips::-webkit-scrollbar{display:none}
.cm-chips label{position:relative;flex:none;scroll-snap-align:start;cursor:pointer}
.cm-chips input,.cm-pay input{position:absolute;opacity:0;pointer-events:none}
.cm-chips span{display:block;padding:9px 14px;border-radius:999px;background:var(--mint);font-weight:600;font-size:14.5px;white-space:nowrap;}
.cm-chips input:checked+span{background:var(--teal);color:var(--on-teal,#fff)}
.cm-hint{font-size:12.5px;color:var(--muted);margin:4px 2px 0}

.cm-pay{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cm-pay label{position:relative;cursor:pointer;min-width:0}
.cm-pay span{display:block;height:100%;padding:10px 10px;border-radius:16px;border:1.5px solid var(--line);background:var(--surface,#fff);text-align:center;line-height:1.2;}
.cm-pay span b{display:block;font-size:14.5px;font-weight:600}
.cm-pay span small{display:block;font-size:12.5px;color:var(--muted);margin-top:2px}
.cm-pay input:checked+span{border-color:var(--teal);background:var(--mint);box-shadow:inset 0 0 0 1px var(--teal)}
.cm-chips input:focus-visible+span,.cm-pay input:focus-visible+span{outline:3px solid var(--gold,#F2A93B);outline-offset:2px}
.cm-pay.single{grid-template-columns:1fr}

.cm-sum2{display:flex;justify-content:space-between;gap:10px;margin-top:12px;font-size:14px;color:var(--muted)}
.cm-sum2 b{color:var(--ink);font-weight:600}
.cm-err{margin:10px 0 0;padding:10px 12px;border-radius:12px;background:color-mix(in srgb,var(--chili,#E0482F) 12%,var(--surface,#fff));color:var(--chili,#E0482F);font-weight:500;font-size:14.5px}
.cm-err a{color:inherit;font-weight:700}
.cm-foot{position:sticky;bottom:0;z-index:2;margin:12px -20px 0;padding:10px 20px calc(14px + env(safe-area-inset-bottom,0px));background:var(--bg,#fff);box-shadow:0 -1px 0 var(--line)}
.cm-go{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:54px;border:0;border-radius:999px;background:#1DAA57;color:#fff;font:600 17px Outfit,system-ui,sans-serif;cursor:pointer;box-shadow:0 14px 30px -14px rgba(29,170,87,.8)}
.cm-go:hover{background:#168E48}
.cm-go:active{filter:brightness(.9)}
.cm-go[disabled]{opacity:.7;cursor:progress}

@media (max-width:600px){
  .cm-sheet{width:100%;max-width:100%;margin:auto 0 0;border-radius:24px 24px 0 0;max-height:96dvh}
  .cm-form{padding:14px 16px 0}
  .cm-grip{display:block}
  .cm-chips{margin:0 -16px;padding:2px 16px 4px}
  .cm-foot{margin-inline:-16px;padding-inline:16px}
  .cm-bar{padding-left:18px}
  .cm-bar button{padding:13px 18px;font-size:15.5px}
}
@media (max-width:340px){.cm-row{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){.cm-sheet[open],.cm-bar{animation:none;transition:none}}
