/* ============================================================
   louelafête — Section « Réserver » (maquette Claude Design, oct. 2026)
   Sélecteur « J'ai ma date / Pas encore », deux blocs empilés,
   cartes avec compteur, volet de fiche, barre récap.
   Chargée après les autres feuilles : elle a le dernier mot sur la section.
   Le calendrier garde son style grand format via .reserver__date
   (apple-theme.css).
   ============================================================ */

.resa {
  max-width: var(--max-width, 1140px);
  margin: 0 auto;
}

/* ── Sélecteur de mode ── */
.resa__modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  max-width: 440px;
  padding: 4px;
  margin-bottom: 24px;
  background: #e8e6ef;
  border-radius: 9999px;
}
.resa__mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--texte-doux);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.3px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.resa__mode svg { width: 16px; height: 16px; flex: none; }
.resa__mode:hover { color: var(--texte); }
.resa__mode.is-actif { background: var(--primaire); color: #fff; }
.resa__mode:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }

/* ── Les deux blocs : l'ordre suit le mode ── */
.resa__etapes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.resa__etape--date     { order: 1; }
.resa__etape--materiel { order: 2; }
.resa__etapes--materiel .resa__etape--date     { order: 2; }
.resa__etapes--materiel .resa__etape--materiel { order: 1; }

.resa__etape {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 18px;
  padding: 28px;
  scroll-margin-top: 90px;
}
.resa__etape-tete {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.resa__num {
  width: 30px;
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--primaire);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.resa__etape-titre {
  flex: 1;
  margin: 0;
  font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
}
.resa__libres { font-size: 15px; color: var(--texte-doux); }
.resa__libres a { color: var(--primaire); font-weight: 600; }

/* ── Bloc date ── */
.resa__date-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
  gap: 32px 40px;
  align-items: start;
}
/* La carte blanche de .reserver__date est déjà dans le bloc : on l'aplatit */
.reserver .resa__cal {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.resa__date-cote {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 4px;
}
.resa__date-texte {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.374px;
  color: var(--texte-doux);
  text-wrap: pretty;
}
.resa__date-texte a { color: var(--primaire); }
.resa__date-msg { margin: 0; font-size: 15px; color: var(--texte); }
.resa__date-msg:empty { display: none; }
.resa__date-choisie {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--fond-clair);
  border-radius: 12px;
}
.resa__date-choisie[hidden] { display: none; }
.resa__date-choisie-lbl {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--texte-doux);
}
.resa__date-choisie-val { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.reserver .resa__plusieurs { margin: 0; font-size: 15px; font-weight: 600; }

/* « Pas encore » : jour libre pour le pack, pas pour les ajouts */
.reserver .flatpickr-day.resa-jour--partiel { position: relative; }
.reserver .flatpickr-day.resa-jour--partiel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Groupes de cartes ── */
.resa__groupe + .resa__groupe { margin-top: 40px; }
.resa__intertitre {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 20px;
}
.resa__intertitre span {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--texte-doux);
  white-space: nowrap;
}
.resa__intertitre::after { content: ""; flex: 1; height: 1px; background: #e0e0e0; }
.resa__grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Carte ── */
.carte-resa {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 18px;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s cubic-bezier(.2,.7,.2,1), opacity .2s;
}
.carte-resa:hover { transform: translateY(-3px); }
.carte-resa--choisie,
.carte-resa--active { box-shadow: 0 0 0 4px #dcd9f5, 0 0 0 1px var(--primaire); }
.carte-resa--indispo { opacity: .65; }
.carte-resa--indispo .carte-resa__photo { filter: grayscale(.6); }

/* Le bouton qui ouvre la fiche couvre toute la carte ; pastille et
   compteur passent au-dessus. */
.carte-resa__ouvrir {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: inherit;
}
.carte-resa__ouvrir:focus-visible { outline: 3px solid var(--primaire); outline-offset: -3px; }

.carte-resa__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--fond-sombre);
}
.carte-resa__photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.carte-resa__detail {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9999px;
  background: rgba(35,33,53,.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.24px;
  text-decoration: none;
}
.carte-resa__detail svg { width: 14px; height: 14px; }
.carte-resa__detail:hover { background: rgba(35,33,53,.88); color: #fff; }
.carte-resa__badge {
  position: absolute;
  top: 14px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--fond-sombre);
  font-size: 13px;
  font-weight: 700;
}
.carte-resa__badge svg { width: 12px; height: 12px; }

.carte-resa__corps {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 20px 20px;
}
.carte-resa__chip {
  padding: 5px 12px;
  border-radius: 9999px;
  background: #edecfa;
  color: var(--primaire);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.2px;
}
.carte-resa__chip--piece { background: #f0eee9; color: var(--texte-doux); }
.carte-resa__nom {
  font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.15;
}
.carte-resa__pied {
  align-self: stretch;
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.carte-resa__prix { white-space: nowrap; font-size: 17px; color: var(--texte-doux); }
.carte-resa__prix strong {
  font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.8px;
  color: var(--primaire);
}
.carte-resa__complet {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
  color: #c24545;
}
.carte-resa__autres {
  border: 0;
  padding: 0;
  background: none;
  color: var(--primaire);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Compteur − / + ── */
.compteur {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}
.compteur__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primaire);
  border-radius: 50%;
  background: #fff;
  color: var(--primaire);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s, opacity .12s;
}
.compteur__btn:hover:not(:disabled) { background: var(--primaire); color: #fff; }
.compteur__btn:disabled { opacity: .3; cursor: not-allowed; }
.compteur__btn:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
.compteur__val { min-width: 14px; text-align: center; font-size: 16px; font-weight: 700; }

/* ── Barre récap ── */
.resa__recap {
  position: sticky;
  bottom: 16px;
  z-index: 50;
  margin-top: 24px;
  background: var(--fond-sombre);
  color: var(--texte-clair);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(35,33,53,.28);
  overflow: hidden;
}
.resa__recap[hidden] { display: none; }
.resa__recap-barre {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  padding: 18px 24px;
  flex-wrap: wrap;
}
.resa__recap-infos {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.resa__recap-resume { font-size: 16px; color: var(--texte-clair); }
.resa__recap-totaux { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.resa__recap-total {
  font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: var(--primaire-vif);
}
.resa__recap-caution { font-size: 15px; color: var(--texte-clair-2); }
.resa__recap-alerte { font-size: 14px; color: var(--accent); }
.resa__recap-alerte[hidden] { display: none; }
.resa__recap-bascule {
  border: 0;
  padding: 8px 4px;
  background: none;
  color: var(--primaire-vif);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.resa__recap-bascule:hover { color: #fff; }
.resa__recap-cta { min-height: 52px; padding-left: 32px; padding-right: 32px; font-size: 17px; }
.resa__recap-detail {
  list-style: none;
  margin: 0;
  padding: 14px 24px 4px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.resa__recap-detail[hidden] { display: none; }
.resa__recap-ligne {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}
.resa__recap-ligne + .resa__recap-ligne { border-top: 1px solid rgba(255,255,255,.08); }
.resa__recap-nom { flex: 1; font-weight: 600; }
.resa__recap-nom small { font-weight: 400; color: var(--texte-clair-2); }
.resa__recap-prix { color: var(--texte-clair-2); }
.resa__recap .compteur__btn { background: transparent; border-color: var(--primaire-vif); color: var(--primaire-vif); }
.resa__recap .compteur__btn:hover:not(:disabled) { background: var(--primaire-vif); color: var(--fond-sombre); }

/* ── Volet de la fiche ── */
.resa-volet {
  position: fixed;
  inset: 0;
  z-index: 600;
}
.resa-volet[hidden] { display: none; }
.resa-volet__fond {
  position: absolute;
  inset: 0;
  background: rgba(35,33,53,.5);
  animation: resa-fondu .2s ease;
}
.resa-volet__panneau {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  box-shadow: -12px 0 40px rgba(35,33,53,.2);
  animation: resa-glisse .28s cubic-bezier(.2,.7,.2,1);
}
.resa-volet .reserver__fiche {
  border: 0;
  border-radius: 0;
  min-height: 100%;
}
@keyframes resa-fondu { from { opacity: 0; } }
@keyframes resa-glisse { from { transform: translateX(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .carte-resa, .carte-resa:hover { transition: none; transform: none; }
  .resa-volet__fond, .resa-volet__panneau { animation: none; }
}

/* ── Tablette ── */
@media (max-width: 900px) {
  .resa__etape { padding: 22px 18px; }
  .resa__date-grille { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Téléphone ── */
@media (max-width: 640px) {
  .resa__mode { font-size: 15px; }
  .resa__etape { padding: 20px 14px; border-radius: 16px; }
  .resa__etape-titre { font-size: 20px; }
  .resa__libres { flex-basis: 100%; font-size: 14px; }

  /* Les cartes défilent sur une ligne, au doigt (comme avant) */
  .resa__grille {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -14px;
    padding: 4px 14px 8px;
    scrollbar-width: none;
  }
  .resa__grille::-webkit-scrollbar { display: none; }
  .resa__grille > .carte-resa { flex: 0 0 78%; scroll-snap-align: start; }
  .carte-resa:hover { transform: none; }
  .resa__groupe + .resa__groupe { margin-top: 28px; }
  .carte-resa__nom { font-size: 20px; }
  .carte-resa__prix strong { font-size: 26px; }
  .compteur__btn { width: 40px; height: 40px; }

  /* La barre mobile du bas est déjà collée : le récap reste dans la page */
  .resa__recap { position: static; border-radius: 18px; }
  .resa__recap-barre { padding: 16px; gap: 12px; }
  .resa__recap-cta { width: 100%; }
  .resa__recap-detail { padding: 10px 16px 4px; }

  /* Le volet monte du bas */
  .resa-volet__panneau {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 90vh;
    border-radius: 18px 18px 0 0;
    animation-name: resa-monte;
  }
  @keyframes resa-monte { from { transform: translateY(40px); opacity: 0; } }
}

/* « Voir tous les appareils / Voir moins » sous la grille à la pièce */
.resa__groupe .reserver__voir-plus {
  display: block;
  width: 100%;
  margin-top: 14px;
}
