/* La Méthode Luxe : la page de commande (js/commande.js) et l'état de la page merci.
   Variables de css/style.css. Sur téléphone, la commande prend tout l'écran. */

/* ---------- la commande, au-dessus du site (z-index > nav 60, barre 55, toast 70) ---------- */
.cmd { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.cmd[hidden] { display: none !important; }
.cmd-fond { position: absolute; inset: 0; background: rgba(27, 34, 30, .74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.cmd-boite {
  position: relative; width: min(600px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain;
  background: var(--craie); color: var(--encre); border-radius: var(--r-card);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.cmd.cmd-visible .cmd-fond, .cmd.cmd-visible .cmd-boite { opacity: 1; transform: none; }
body.cmd-ouverte { overflow: hidden; }

.cmd-fermer {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%;
  background: rgba(27, 34, 30, .06); color: var(--encre); cursor: pointer; transition: background .15s;
}
.cmd-fermer:hover { background: rgba(27, 34, 30, .12); }
.cmd-fermer svg { width: 22px; height: 22px; }

.cmd-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 28px 70px 22px 30px; border-bottom: 1px solid var(--ligne); }
.cmd-eyebrow { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--vert); }
.cmd-titre { margin-top: 8px; font-size: 26px; line-height: 1.1; }
.cmd-sous { margin-top: 6px; font-size: 14px; color: var(--mute); max-width: 40ch; }
.cmd-prix { flex: none; text-align: right; }
.cmd-prix b { display: block; font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1; letter-spacing: -.02em; }
.cmd-prix small { display: block; margin-top: 4px; font-size: 12px; color: var(--mute); max-width: 14ch; margin-left: auto; }

.cmd-corps { padding: 22px 30px 8px; }
/* Stripe pose son iframe ici. Avant qu'il arrive, un fond neutre garde la place. */
.cmd-checkout { min-height: 120px; }
.cmd-checkout-attente { min-height: 320px; border-radius: 14px; background: repeating-linear-gradient(-45deg, transparent 0 22px, rgba(27, 34, 30, .035) 22px 24px); }
.cmd-message { margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: var(--blanc); border: 1px solid var(--ligne); font-size: 15px; line-height: 1.5; }
.cmd-message[hidden] { display: none !important; }
.cmd-message p { margin: 0; }
.cmd-message-attente { color: var(--mute); }
.cmd-message-attente p::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--vert); animation: cmd-pulse 1s ease-in-out infinite alternate; }
@keyframes cmd-pulse { from { opacity: .35; } to { opacity: 1; } }
.cmd-message-erreur { background: rgba(212, 179, 106, .16); border-color: rgba(212, 179, 106, .6); }
.cmd-message-erreur p:first-child { font-weight: 600; }
.cmd-message-aide { margin-top: 6px !important; font-size: 14px; color: var(--texte); }
.cmd-message-aide a { color: var(--vert-2); font-weight: 600; }
.cmd-reessayer { margin-top: 12px; }

.cmd-rassure { display: flex; align-items: center; gap: 8px; padding: 12px 30px 24px; font-size: 13px; color: var(--mute); }
.cmd-rassure svg { width: 18px; height: 18px; color: var(--vert); flex: none; }

/* ---------- la page merci : l'état de la commande ---------- */
.merci-etat { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--blanc); border: 1px solid var(--ligne); font-size: 15px; line-height: 1.5; color: var(--texte); }
.merci-etat[hidden] { display: none !important; }
.merci-etat-attente::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--vert); animation: cmd-pulse 1s ease-in-out infinite alternate; }
.merci-etat-erreur, .merci-etat-patience { background: rgba(212, 179, 106, .16); border-color: rgba(212, 179, 106, .6); }
.merci-etat a { color: var(--vert-2); font-weight: 600; }
.page .btns[hidden] { display: none !important; }

/* ---------- téléphone : plein écran ---------- */
@media (max-width: 700px) {
  .cmd { padding: 0; place-items: stretch; }
  .cmd-boite { width: 100%; height: 100%; max-height: none; border-radius: 0; box-shadow: none; transform: translateY(24px); }
  .cmd-tete { flex-direction: column; gap: 12px; padding: 24px 66px 18px 20px; }
  .cmd-prix { text-align: left; }
  .cmd-prix b { font-size: 34px; }
  .cmd-prix small { margin-left: 0; max-width: none; }
  .cmd-corps { padding: 18px 16px 8px; }
  .cmd-rassure { padding: 10px 16px calc(22px + env(safe-area-inset-bottom)); }
  .cmd-fermer { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cmd-fond, .cmd-boite, .cmd-fermer { transition: none; }
  .cmd-message-attente p::before, .merci-etat-attente::before { animation: none; }
}
