/* ══════════════════════════════════════════════════════════════════════
   Étape de commande (CGV, décision 2 du 2026-10-17) — assets/js/commande.js
   Un bon de commande : récapitulatif, ligne de coupe, case jamais pré-cochée,
   bouton « Commande avec obligation de paiement ». Site sombre uniquement.
   ══════════════════════════════════════════════════════════════════════ */
.cm {
  --cm-bg:    #111118;
  --cm-raise: #17171F;
  --cm-line:  rgba(237, 233, 254, .10);
  --cm-text:  #ECECF4;
  --cm-mut:   #A1A1AA;
  --cm-v6:    #7C3AED;
  --cm-v7:    #6D28D9;
  --cm-v4:    #A78BFA;
  --cm-v1:    #EDE9FE;
  --cm-err:   #FCA5A5;
  --cm-mono:  'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --cm-out:   cubic-bezier(.16, 1, .3, 1);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--cm-line);
  border-radius: 16px;
  background: var(--cm-bg);
  color: var(--cm-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(124, 58, 237, .12);
  overflow: auto;
  overscroll-behavior: contain;
}
.cm::backdrop { background: rgba(5, 5, 10, .72); }
.cm[open] { animation: cm-in .22s var(--cm-out) both; }
@keyframes cm-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cm-card { display: grid; gap: 0; margin: 0; }
.cm-top { position: relative; padding: 1.25rem 3.25rem .9rem 1.35rem; }
.cm-k { margin: 0 0 .45rem; font-family: var(--cm-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cm-v4); }
.cm-top h2 { margin: 0; font-family: var(--font-title, 'Bricolage Grotesque', system-ui, sans-serif); font-weight: 700; font-stretch: 90%; font-size: 1.3rem; line-height: 1.2; color: var(--cm-text); text-wrap: balance; }
.cm-x { position: absolute; top: .85rem; right: .85rem; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--cm-mut); cursor: pointer; transition: color .15s, background-color .15s; }
.cm-x:hover { color: var(--cm-text); background: rgba(237, 233, 254, .06); }
.cm-x svg { width: 18px; height: 18px; }

.cm-lines { margin: 0; padding: .2rem 1.35rem .9rem; display: grid; gap: .1rem; }
.cm-lines > div { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--cm-line); }
.cm-lines > div:first-child { border-top: 0; }
.cm-lines dt { font-family: var(--cm-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cm-mut); padding-top: .2rem; }
.cm-lines dd { margin: 0; font-size: .88rem; line-height: 1.55; color: var(--cm-text); }
.cm-lines dd small { display: block; font-size: .76rem; color: var(--cm-mut); margin-top: .1rem; }
.cm-price { font-family: var(--font-title, 'Bricolage Grotesque', system-ui, sans-serif); font-weight: 700; font-stretch: 88%; font-size: 1.6rem; line-height: 1.05; color: var(--cm-v1); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* Ligne de coupe du bon : pointillés et encoches */
.cm-cut { position: relative; height: 1px; margin: 0 1.35rem; background: repeating-linear-gradient(90deg, rgba(237, 233, 254, .28) 0 6px, transparent 6px 12px); }

.cm-act { display: grid; gap: .8rem; padding: 1.05rem 1.35rem 1.25rem; background: var(--cm-raise); }
.cm-ok { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: .7rem; align-items: start; padding: .75rem .8rem; border: 1px solid var(--cm-line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.cm-ok:hover { border-color: rgba(167, 139, 250, .45); }
.cm-ok input { width: 20px; height: 20px; margin: .1rem 0 0; accent-color: var(--cm-v6); cursor: pointer; }
.cm-ok input:focus-visible { outline: 2px solid var(--cm-v4); outline-offset: 2px; }
.cm-ok span { font-size: .88rem; line-height: 1.5; color: var(--cm-text); }
.cm-ok:has(input:checked) { border-color: rgba(167, 139, 250, .55); background: rgba(124, 58, 237, .10); }
.cm-ok.is-invalid { border-color: var(--cm-err); }
.cm-err { margin: -.3rem 0 0; font-size: .8rem; line-height: 1.45; color: var(--cm-err); }
.cm-err[hidden] { display: none; }

.cm-pay { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1rem; border: 0; border-radius: 10px; background: var(--cm-v6); color: #fff; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; transition: background-color .15s, transform .15s var(--cm-out); }
.cm-pay:hover { background: var(--cm-v7); }
.cm-pay:active { transform: translateY(1px); }
.cm-pay:focus-visible, .cm-cancel:focus-visible, .cm-x:focus-visible, .cm-legal a:focus-visible { outline: 2px solid var(--cm-v4); outline-offset: 2px; }
.cm-pay[aria-busy="true"] { cursor: progress; opacity: .8; }
.cm-pay svg { width: 16px; height: 16px; flex: none; }

.cm-legal { margin: 0; font-size: .76rem; line-height: 1.55; color: var(--cm-mut); }
.cm-legal a { color: var(--cm-v4); text-underline-offset: 3px; }
.cm .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cm-cancel { justify-self: center; min-height: 40px; padding: .4rem .9rem; border: 0; border-radius: 8px; background: transparent; color: var(--cm-mut); font: inherit; font-size: .85rem; cursor: pointer; transition: color .15s; }
.cm-cancel:hover { color: var(--cm-text); }

@media (max-width: 560px) {
  .cm { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .cm-lines > div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cm[open] { animation: none; }
  .cm-pay, .cm-ok, .cm-x, .cm-cancel { transition: none; }
}
