/* Suivi de commande (C4), notifications (P2), installation (P1) et page « Le resto ». */

.track-meta { padding-top: max(56px, env(safe-area-inset-top)); font-size: 0.875rem; color: var(--ink-on-navy-2); }
.track-title { font-size: 2.1rem; line-height: 1.05; margin-top: 6px; }
.track-title:focus { outline: none; }
.stamp {
    display: inline-block; margin-top: 12px; padding: 4px 12px; border: 2.5px solid currentColor; border-radius: 6px;
    font-family: var(--font-cond); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.06em; text-transform: uppercase; transform: rotate(-4deg);
    color: var(--cream);
}
.stamp-ready { background: var(--cream); border-color: var(--cream); color: var(--navy); }
.stamp-preparing { color: var(--caramel-bright); }
.stamp-cancelled, .stamp-no_show, .stamp-expired { color: #e8a37f; }
.stamp-pending { color: var(--cream-muted); }
@media (prefers-reduced-motion: no-preference) {
    .stamp.is-new { animation: stamp-in 420ms var(--ease) both; }
    @keyframes stamp-in { from { transform: rotate(-4deg) scale(1.8); opacity: 0; } }
}
.track-blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
.track-blocks > .ticket { margin-bottom: 9px; }

/* Code reçu par SMS ouvert sur le suivi : pas de pastille d'étape à gauche (C3 décale les cases de 40 px), et le libellé
   « Commander avec obligation de paiement · 16,50 € » passe à la ligne plutôt que de déborder sur un téléphone. */
.track-blocks .code-boxes, .track-blocks .code-error, .track-blocks .code-help { margin-left: 0; }
.track-blocks .step-body .btn { white-space: normal; text-align: center; line-height: 1.25; }

/* Carte du code de retrait : photo du comptoir, code en grand */
.code-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--rule-dark); }
.code-card-photo { width: 100%; height: 150px; object-fit: cover; object-position: center 60%; }
.code-card-body { padding: 16px; background: var(--navy-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code-card-text { font-size: 0.875rem; color: var(--ink-on-navy-2); }
.code-value { font-family: var(--font-cond); font-size: 3.5rem; font-weight: 700; letter-spacing: 0.1em; line-height: 1; color: var(--caramel-bright); }

/* Annulation : règle et heure limite, puis confirmation explicite */
.cancel-zone { display: grid; gap: 10px; justify-items: start; padding: 14px; border-radius: var(--r-card); border: 1px solid var(--rule-dark); }
.cancel-zone.is-confirming { border-color: rgba(176, 89, 43, 0.6); background: rgba(176, 89, 43, 0.1); }
.cancel-question { font-weight: 700; }
.cancel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cancel-zone .notice-action { color: var(--cream-muted); }
.withdrawal-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.other-orders { display: grid; justify-items: start; gap: 2px; }

/* Notifications : deux interrupteurs (rangées entières cliquables, 64px) */
.push-card { padding: 4px 14px; border-radius: var(--r-card); border: 1px solid var(--rule-dark); }
.push-card[hidden] { display: none; }
.push-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 0 2px; font-family: var(--font); font-size: 1rem; font-weight: 700; }
.push-card-head .ic { color: var(--caramel-bright); }
.switch-row {
    width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule-dark);
    background: none; color: var(--cream); text-align: left;
}
.switch-row:last-child { border-bottom: 0; }
.switch-text { flex: 1; display: grid; gap: 2px; }
.switch-title { font-weight: 600; font-size: 0.97rem; }
.switch-sub { font-size: 0.8125rem; color: var(--ink-on-navy-2); }
.switch-track { width: 52px; height: 32px; border-radius: var(--pill); background: var(--rule-dark); position: relative; flex: none; transition: background-color 200ms var(--ease); }
.switch-track::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: transform 200ms var(--ease); }
.switch-row[aria-checked="true"] .switch-track { background: var(--caramel); }
.switch-row[aria-checked="true"] .switch-track::after { transform: translateX(20px); background: var(--navy); }
.switch-row[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.push-card .hint, .push-card .btn { margin: 8px 0 12px; }

/* Feuilles basses claires sur fond assombri : guide d'installation iPhone (P1), fenêtre des notifications */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(8, 10, 13, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.app-sheet {
    width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
    background: var(--paper); color: var(--ink); border-radius: 20px 20px 0 0; padding: 10px 18px calc(18px + var(--safe-bottom));
}
.app-sheet:focus { outline: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--rule-light); margin: 0 auto 14px; }
.install-head { display: flex; gap: 14px; align-items: center; }
.install-icon { width: 64px; height: 64px; border-radius: 15px; background: var(--cream); border: 1px solid var(--rule-light); display: grid; place-items: center; overflow: hidden; flex: none; }
.install-icon img { display: block; width: 100%; height: 100%; }
.install-head h2 { font-size: 1.55rem; }
.install-head p { font-size: 0.875rem; color: var(--ink-2); margin-top: 4px; }
.install-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.install-steps li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule-light); font-size: 0.97rem; line-height: 1.35; }
.install-steps li:last-child { border-bottom: 0; }
.install-steps .n { width: 28px; height: 28px; border-radius: var(--pill); background: var(--navy); color: var(--cream); display: grid; place-items: center; font-weight: 700; font-size: 0.875rem; flex: none; }
.install-steps .ic { display: inline; vertical-align: -4px; }
.app-sheet .btn-later { width: 100%; min-height: 48px; margin-top: 6px; border-radius: 10px; border: 1px solid var(--rule-light); background: var(--cream-2); color: var(--ink); font-weight: 600; }
.app-sheet .btn-later:hover { background: var(--cream-3); }
.app-sheet .btn-later[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.app-sheet .note { margin-top: 10px; font-size: 0.8125rem; color: var(--ink-2); text-align: center; }
.app-sheet a { color: var(--caramel-deep); }
.app-sheet :focus-visible { outline-color: var(--terracotta); }
/* Fenêtre des notifications : case des annonces (rangée entière cliquable, 48px au moins), message, boutons */
.push-sheet .install-icon .ic { color: var(--caramel-deep); }
.prompt-body { display: grid; margin-top: 12px; }
.prompt-body .btn-primary { margin-top: 12px; }
.prompt-body .note { margin-top: 8px; text-align: left; }
.sheet-check { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; min-height: 48px; padding: 12px 0; border-top: 1px solid var(--rule-light); border-bottom: 1px solid var(--rule-light); cursor: pointer; }
.sheet-check input { grid-row: span 2; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); }
.sheet-check-title { font-weight: 600; font-size: 0.97rem; }
.sheet-check-sub { font-size: 0.8125rem; color: var(--ink-2); }
/* Zone annoncée toujours présente (jamais masquée) : vide, elle ne prend pas de place. */
.sheet-message { font-size: 0.9375rem; line-height: 1.4; color: var(--terracotta-ink); }
.sheet-message:not(:empty) { margin-top: 10px; }

/* Le resto */
.resto-card { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-card); background: var(--navy-2); border: 1px solid var(--rule-dark); }
.resto-card h2 { font-size: 1.35rem; }
.resto-line { display: flex; gap: 10px; align-items: flex-start; color: var(--cream-muted); }
.resto-line .ic { color: var(--caramel-bright); margin-top: 2px; }
.resto-line a { display: inline-flex; align-items: center; min-height: 44px; margin-top: -11px; margin-bottom: -11px; font-weight: 600; }
.install-box { display: grid; justify-items: start; margin-top: 4px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.875rem; }
.legal-links a { color: var(--cream-muted); min-height: 44px; display: inline-flex; align-items: center; }
/* Descente du skieur (blocks/ski-run.mjs) : piste, sapins et refuge ; la fenêtre s'allume et la cheminée fume quand c'est prêt. */
.ski-run { margin-top: 18px; padding: 12px 12px 10px; border: 1px solid var(--rule-dark); border-radius: var(--r-card); background: var(--navy-2); }
.sk-scene svg { display: block; width: 100%; height: auto; overflow: visible; }
.sk-mount { fill: var(--navy-3); }
.sk-cap { fill: var(--cream); opacity: 0.5; }
.sk-snow { fill: var(--cream); opacity: 0.07; }
.sk-tree { fill: var(--navy); }
.sk-piste { fill: none; stroke: var(--cream); stroke-opacity: 0.22; stroke-width: 7; stroke-linecap: round; }
.sk-trail { fill: none; stroke: var(--caramel-bright); stroke-width: 3; stroke-linecap: round; }
.sk-start { stroke: var(--cream-muted); stroke-width: 1.2; }
.sk-flag { fill: var(--terracotta); }
.sk-chalet { fill: var(--caramel-deep); }
.sk-chimney { fill: var(--caramel-deep); }
.sk-roof { fill: var(--terracotta); }
.sk-window { fill: var(--navy); transition: fill 600ms var(--ease); }
.ski-run.is-ready .sk-window { fill: var(--caramel-bright); }
.sk-smoke { fill: var(--cream); opacity: 0; }
.sk-ski { fill: none; stroke: var(--cream); stroke-width: 1.6; stroke-linecap: round; }
.sk-pole { stroke: var(--cream-muted); stroke-width: 1; stroke-linecap: round; }
.sk-legs { fill: none; stroke: var(--cream-muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sk-body { stroke: var(--caramel-bright); stroke-width: 3.4; stroke-linecap: round; }
.sk-scarf { stroke: var(--terracotta); stroke-width: 1.4; stroke-linecap: round; }
.sk-head { fill: var(--cream); }
.sk-spray circle { fill: var(--cream); opacity: 0.5; }
.ski-run.is-ready .sk-spray { display: none; }
@media (prefers-reduced-motion: no-preference) {
    .ski-run:not(.is-ready) .sk-bob { animation: sk-bob 900ms ease-in-out infinite alternate; }
    .ski-run:not(.is-ready) .sk-spray circle { animation: sk-spray 800ms ease-out infinite; }
    .ski-run:not(.is-ready) .sk-spray circle:nth-child(2) { animation-delay: 160ms; }
    .ski-run:not(.is-ready) .sk-spray circle:nth-child(3) { animation-delay: 320ms; }
    .ski-run.is-ready .sk-smoke { animation: sk-smoke 2.6s ease-out infinite; }
    .ski-run.is-ready .sk-smoke-2 { animation-delay: 1.3s; }
    @keyframes sk-bob { to { transform: translateY(-1px); } }
    @keyframes sk-spray { from { opacity: 0.7; } to { opacity: 0; transform: translate(-5px, -2px); } }
    @keyframes sk-smoke { 30% { opacity: 0.45; } to { opacity: 0; transform: translateY(-12px); } }
}
.ski-run.is-ready .sk-smoke { opacity: 0.35; }
.sk-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-family: var(--font-cond); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-on-navy-2); }
.sk-steps li { display: flex; align-items: center; gap: 6px; }
.sk-steps li:nth-child(2) { justify-content: center; }
.sk-steps li:nth-child(3) { justify-content: flex-end; }
.sk-steps li::before { content: ''; flex: none; width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 50%; }
.sk-steps .is-done { color: var(--cream-muted); }
.sk-steps .is-done::before, .sk-steps .is-current::before { background: currentColor; }
.sk-steps .is-current { color: var(--caramel-bright); }
/* « Ma commande » (views/ma-commande.mjs, blocks/order-card.mjs) : commandes en cours en cartes (temps restant en grand,
   code au comptoir, avancement), puis l'historique en lignes. Toute la carte ouvre le suivi (lien étendu). */
.orders-title { font-size: 2.1rem; line-height: 1.05; margin-top: 18px; }
.orders-section { display: grid; gap: 12px; margin-top: 22px; }
.orders-heading { font-family: var(--font-cond); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-on-navy-2); }
.orders-where { margin-top: -4px; font-size: 0.875rem; color: var(--ink-on-navy-2); }
.orders-call { display: inline-flex; align-items: center; min-height: 44px; margin: -11px 0 -11px 10px; font-weight: 600; color: var(--caramel-bright); }
.oc { position: relative; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--rule-dark); border-radius: 16px; background: var(--navy-2); }
.oc-soon, .oc-ready { border-color: var(--caramel); }
.oc-ready { background: linear-gradient(180deg, rgba(204, 160, 119, 0.16), var(--navy-2) 70%); }
.oc-head { display: flex; align-items: center; gap: 10px; }
.oc-when { font-family: var(--font-cond); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; }
.oc-status, .oh-status {
    margin-left: auto; padding: 2px 9px; border: 1.5px solid currentColor; border-radius: 6px; white-space: nowrap;
    font-family: var(--font-cond); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.oc-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.oc-timer, .oc-code { display: grid; gap: 2px; }
.oc-code { justify-items: end; text-align: right; }
.oc-label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-on-navy-2); }
.oc-value { font-family: var(--font-cond); font-size: 3.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--cream); }
.oc-soon .oc-value { color: var(--caramel-bright); }
.oc-ready .oc-value { color: var(--cream); }
.oc-note { min-height: 1.25em; font-size: 0.875rem; color: var(--ink-on-navy-2); }
.oc-code-value { font-family: var(--font-cond); font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: 0.12em; color: var(--caramel-bright); }
.oc-progress { width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; background: var(--navy-3); appearance: none; }
.oc-progress::-webkit-progress-bar { background: var(--navy-3); border-radius: 999px; }
.oc-progress::-webkit-progress-value { background: var(--caramel-bright); border-radius: 999px; transition: width 800ms var(--ease); }
.oc-progress::-moz-progress-bar { background: var(--caramel-bright); border-radius: 999px; }
.oc-progress[hidden] { display: none; }
.oc-items { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--cream-muted); }
.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--rule-dark); }
.oc-amount { font-weight: 600; }
.oc-link { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; font-weight: 600; color: var(--caramel-bright); text-decoration: none; white-space: nowrap; }
.oc-link::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }
.oc-link:focus-visible { outline: none; }
.oc-link:focus-visible::after { outline: 2px solid var(--caramel-bright); outline-offset: 2px; }
.orders-history { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--rule-dark); border-radius: 14px; overflow: hidden; }
.orders-history li + li { border-top: 1px solid var(--rule-dark); }
.oh-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; color: var(--cream); text-decoration: none; background: var(--navy-2); }
.oh-row:hover { background: var(--navy-3); }
.oh-main { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.oh-title { font-weight: 700; }
.oh-items { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.875rem; color: var(--ink-on-navy-2); }
.oh-status { margin-left: 0; font-size: 0.75rem; }
.oh-total { min-width: 4.5rem; text-align: right; font-weight: 600; }
.orders-again { margin-top: 26px; }
@media (max-width: 380px) {
    .oc-value { font-size: 2.75rem; }
    .oc-code-value { font-size: 2.2rem; }
    .oh-items { display: none; }
}
