/* Le panneau de réservation : un tiroir à droite sur grand écran, une feuille
   qui monte du bas sur mobile. Présent sur toutes les pages (base.html). */

.reservation-voile { position: fixed; inset: 0; background: rgba(22, 19, 17, 0.55); z-index: 200; opacity: 0; transition: opacity 350ms var(--sortie); }
.reservation-voile:not([hidden]) { opacity: 1; }
.reservation {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-height: 92svh;
    z-index: 201;
    background: var(--creme);
    color: var(--encre);
    border-top: 3px solid var(--encre);
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    transform: translateY(100%);
    transition: transform 450ms var(--sortie);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
}
.reservation[hidden] { display: none; }
.reservation.ouverte { transform: translateY(0); }
body.reservation-ouverte { overflow: hidden; }
.reservation-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px var(--marge) 8px; }
.reservation-tete .surtitre { margin-bottom: 4px; }
.reservation-titre { font-weight: 900; font-stretch: 115%; text-transform: uppercase; letter-spacing: -0.03em; font-size: clamp(28px, 5vw, 40px); line-height: 0.95; }
.reservation-titre em { color: var(--cuivre); text-transform: none; font-size: 1.15em; }
.reservation-fermer { width: 42px; height: 42px; border: 2px solid var(--encre); background: transparent; font-size: 22px; cursor: pointer; flex: none; transition: background 200ms, color 200ms; }
.reservation-fermer:hover { background: var(--encre); color: var(--creme); }
.reservation-ticket { margin: 0 var(--marge); padding: 10px 14px; background: var(--nuit); color: var(--creme); font-size: 13px; font-weight: 600; min-height: 40px; display: flex; align-items: center; gap: 8px; box-shadow: 4px 4px 0 var(--cuivre); }
.reservation-ticket:empty { display: none; }
.reservation-ticket b { color: var(--cuivre-clair); font-family: var(--serif); font-size: 20px; font-weight: 600; }
.reservation-corps { overflow-y: auto; padding: 18px var(--marge) 8px; display: grid; gap: 22px; align-content: start; }
.etape-reservation { display: grid; gap: 14px; }
.etape-reservation[hidden] { display: none; }
.etape-titre { display: flex; align-items: center; gap: 10px; font-weight: 800; font-stretch: 110%; text-transform: uppercase; font-size: 14px; letter-spacing: 0.06em; }
.etape-titre span { width: 26px; height: 26px; display: grid; place-items: center; background: var(--encre); color: var(--creme); font-size: 12px; }
.reservation-note { font-size: 13px; color: var(--gris); min-height: 1em; }
.reservation-note:empty { display: none; }

/* couverts */
.couverts { display: inline-flex; align-items: center; border: 2px solid var(--encre); background: var(--blanc); }
.couverts-bouton { width: 52px; height: 52px; border: 0; background: transparent; font-size: 24px; font-weight: 700; cursor: pointer; transition: background 200ms, color 200ms; }
.couverts-bouton:hover { background: var(--encre); color: var(--creme); }
.couverts-bouton[disabled] { opacity: 0.3; pointer-events: none; }
.couverts-valeur { min-width: 80px; text-align: center; font-family: var(--serif); font-size: 36px; font-weight: 700; color: var(--cuivre); }

/* calendrier */
.calendrier { display: grid; gap: 8px; max-width: 420px; }
.calendrier-tete { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-stretch: 110%; text-transform: uppercase; letter-spacing: 0.06em; font-size: 14px; }
.calendrier-nav { width: 38px; height: 38px; border: 2px solid var(--encre); background: transparent; cursor: pointer; font-size: 16px; }
.calendrier-nav:hover { background: var(--encre); color: var(--creme); }
.calendrier-nav[disabled] { opacity: 0.3; pointer-events: none; }
.calendrier-jours, .calendrier-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendrier-jours span { text-align: center; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--gris); }
.calendrier-jour { position: relative; aspect-ratio: 1; border: 2px solid var(--ligne); background: var(--blanc); font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; cursor: pointer; display: grid; place-items: center; transition: background 200ms, color 200ms, border-color 200ms, transform 150ms; }
.calendrier-jour::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 6px; height: 6px; transform: translateX(-50%); background: var(--olive); border-radius: 50%; }
.calendrier-jour.presque::after { background: #d9962a; }
.calendrier-jour.complet { color: var(--gris); text-decoration: line-through; cursor: not-allowed; }
.calendrier-jour.complet::after { background: var(--cuivre); }
.calendrier-jour.ferme, .calendrier-jour.passe, .calendrier-jour.hors_horizon, .calendrier-jour.vide { color: var(--gris); opacity: 0.45; cursor: not-allowed; background: transparent; border-color: transparent; }
.calendrier-jour.ferme::after, .calendrier-jour.passe::after, .calendrier-jour.hors_horizon::after, .calendrier-jour.vide::after { display: none; }
.calendrier-jour.chargement { opacity: 0.5; }
.calendrier-jour:not(.complet):not(.ferme):not(.passe):not(.hors_horizon):not(.vide):hover { border-color: var(--encre); transform: translateY(-1px); }
.calendrier-jour.aujourd-hui { border-color: var(--encre); }
.calendrier-jour[aria-pressed="true"] { background: var(--cuivre); color: #fff; border-color: var(--cuivre); box-shadow: 3px 3px 0 var(--encre); }
.calendrier-jour[aria-pressed="true"]::after { background: #fff; }
.calendrier-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--gris); }
.calendrier-legende span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--olive); }
.calendrier-legende .legende-presque::before { background: #d9962a; }
.calendrier-legende .legende-complet::before { background: var(--cuivre); }

/* services et créneaux */
.services-creneaux { display: grid; gap: 18px; }
.service-bloc { display: grid; gap: 8px; }
.service-bloc h4 { font-weight: 800; font-stretch: 110%; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; display: flex; justify-content: space-between; gap: 10px; }
.service-bloc h4 small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--gris); }
.creneaux { display: flex; flex-wrap: wrap; gap: 6px; }
.creneau { font: inherit; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 9px 12px; border: 2px solid var(--encre); background: var(--blanc); cursor: pointer; position: relative; transition: background 200ms, color 200ms, box-shadow 200ms; }
.creneau:hover { box-shadow: 3px 3px 0 var(--cuivre); }
.creneau[aria-pressed="true"] { background: var(--cuivre); color: #fff; border-color: var(--cuivre); box-shadow: 3px 3px 0 var(--encre); }
.creneau.presque::after { content: "!"; position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; display: grid; place-items: center; background: #d9962a; color: #fff; font-size: 11px; border-radius: 50%; }
.creneau[disabled] { color: var(--gris); border-color: var(--ligne); background: transparent; text-decoration: line-through; cursor: not-allowed; box-shadow: none; }
.creneaux-vide { font-size: 14px; color: var(--gris); }

/* formulaire */
.formulaire-reservation { grid-template-columns: 1fr 1fr; gap: 12px; }
.formulaire-reservation .champ-large { grid-column: 1 / -1; }
.formulaire-reservation .champ input, .formulaire-reservation .champ select, .formulaire-reservation .champ textarea { padding: 11px 12px; font-size: 15px; }
.formulaire-reservation .champ textarea { min-height: 76px; }
.erreur-formulaire { grid-column: 1 / -1; background: #f3cfc9; color: #7a2418; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.erreur-formulaire[hidden] { display: none; }

/* merci */
.reservation-merci { text-align: center; padding: 20px 0; gap: 10px; }
.reservation-merci-titre { font-size: clamp(40px, 8vw, 64px); color: var(--cuivre); line-height: 1; }
.reservation-merci p { font-size: 16px; }

/* pied */
.reservation-pied { padding: 12px var(--marge) calc(14px + env(safe-area-inset-bottom)); border-top: 2px solid var(--encre); background: var(--creme); display: grid; gap: 10px; }
.reservation-politique { font-size: 11px; color: var(--gris); line-height: 1.4; }
.reservation-actions { display: flex; gap: 10px; justify-content: flex-end; }
.reservation-actions .bouton { flex: 1; }
.reservation-actions .bouton[hidden] { display: none; }

@media (min-width: 760px) {
    .reservation { left: auto; top: 0; bottom: 0; width: min(520px, 100%); max-height: none; border-top: 0; border-left: 3px solid var(--encre); transform: translateX(100%); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.35); }
    .reservation.ouverte { transform: translateX(0); }
    .reservation-tete { padding-top: 26px; }
    .reservation-actions .bouton { flex: none; }
    .reservation-actions .bouton-plein { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .reservation, .reservation-voile { transition: none; } }
