/* ============================================================
   RÉSERVATION — Visites à domicile (Que de la Gueule)
   S'appuie sur les variables et la base de globalQDLG.css
   (--rouge, --or, --texte, --texte-2, --bord, --fond, --blanc,
    --r-md, --r-lg, polices Inter / Lora).
   ============================================================ */

/* ============ LAYOUT ============ */
.reservation-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) 2rem clamp(3rem, 5vw, 4rem);
}
.reservation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  align-items: start;
}
.reservation-form {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  box-shadow: 0 1px 2px rgba(26, 26, 24, .04), 0 12px 32px rgba(26, 26, 24, .05);
}

/* ============ ÉTAPES ============ */
.form-step { padding: 1.75rem 0; border-top: 1px solid var(--bord); }
.form-step:first-child { padding-top: 0; border-top: 0; }
.step-heading { display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1.25rem; }
.step-number {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--rouge); color: #fff;
  font-size: .9rem; font-weight: 700; line-height: 1;
}
.step-heading h3 { font-family: 'Lora', serif; color: var(--rouge); font-size: 1.22rem; line-height: 1.2; margin-bottom: .25rem; }
.step-heading p { color: var(--texte-2); font-size: .9rem; line-height: 1.5; }

/* ============ CHAMPS ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field label, .choice-title {
  font-size: .85rem; font-weight: 600; color: var(--texte);
}
.field label .req, .choice-title .req { color: var(--rouge); }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--bord);
  border-radius: var(--r-md);
  background: var(--fond);
  color: var(--texte); font: inherit;
  padding: .72rem .85rem; min-height: 46px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input::placeholder, .field textarea::placeholder { color: #a8a39c; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0; border-color: var(--rouge);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(122, 16, 16, .12);
}
.field select {
  appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a1010' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center;
}
.field-hint { grid-column: 1 / -1; font-size: .78rem; color: var(--texte-2); font-style: italic; }

/* choix segmenté (nouveau client) */
.choice-field { grid-column: 1 / -1; display: grid; gap: .5rem; }
.choice-title { margin: 0; }
.seg { display: inline-flex; background: var(--fond); border: 1px solid var(--bord); border-radius: 999px; padding: 4px; gap: 4px; width: fit-content; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 72px; min-height: 38px; padding: 0 1.1rem;
  border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--texte-2);
  transition: background .18s, color .18s;
}
.seg input:checked + span { background: var(--rouge); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--or); outline-offset: 2px; }

/* ============ PASSAGES À PRÉVOIR ============ */
.schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.schedule-status {
  font-size: .85rem; color: var(--texte-2);
  background: var(--rouge-lt); border-radius: 999px;
  padding: .4rem .85rem; display: inline-flex; align-items: center; gap: .4rem;
}
.schedule-tools { display: flex; gap: .5rem; }
.schedule-tools[hidden] { display: none; }
.mini-btn {
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  color: var(--rouge); background: #fff; border: 1px solid var(--bord);
  border-radius: 999px; padding: .42rem .85rem;
  transition: background .18s, border-color .18s;
}
.mini-btn:hover { background: var(--rouge-lt); border-color: var(--rouge); }

.schedule-legend {
  display: flex;
  align-items: center;
  gap: .5rem .8rem;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: .7rem;
  padding: .75rem .85rem;
  border: 1px solid var(--bord);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--texte-2);
  font-size: .82rem;
}
.legend-title {
  margin: 0;
  color: var(--rouge);
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}
.legend-items {
  display: flex;
  align-items: center;
  gap: .5rem .8rem;
  flex-wrap: wrap;
}
.legend-items span {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
  line-height: 1.35;
  white-space: nowrap;
}
/* Pastilles d'exemple : plus petites que les vraies cases pour ne pas inviter au clic */
.legend-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 26px; padding: 0 .7rem;
  border: 1px solid var(--bord); border-radius: 999px;
  font-size: .74rem; font-weight: 600; line-height: 1; cursor: default;
}
.legend-pill--checked { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.legend-pill--empty { background: var(--fond); color: var(--texte-2); }

/* Grille alignée : 1 colonne jour + 3 colonnes passages */
.schedule-grid { --cols: minmax(140px, 1.5fr) repeat(3, minmax(0, 1fr)); display: grid; gap: .5rem; }
.schedule-grid[hidden] { display: none; }

.sg-head { display: grid; grid-template-columns: var(--cols); gap: .4rem; align-items: center; padding: 0 .85rem; }
.sg-corner { display: flex; align-items: center; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); }
/* En-têtes = actions sur toute la colonne : volontairement plus petits et carrés que les pastilles */
.col-toggle {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  align-self: center; min-height: 46px; padding: .3rem .45rem; cursor: pointer;
  border: 1px solid var(--bord); border-radius: 5px;
  background: #fff; color: var(--texte-2);
  font: inherit; font-size: .68rem; font-weight: 600; line-height: 1.12; text-align: center; white-space: normal;
  transition: background .18s, color .18s, border-color .18s;
}
.col-toggle svg { width: 12px; height: 12px; flex-shrink: 0; }
.col-toggle:hover { border-color: var(--rouge); color: var(--rouge); }
.col-toggle.on { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.col-toggle.on:hover { color: #fff; }
.col-toggle:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

.schedule-days { display: grid; gap: .5rem; }
.day-row {
  display: grid; grid-template-columns: var(--cols);
  align-items: center; gap: .4rem;
  padding: .55rem .85rem;
  border: 1px solid var(--bord); border-radius: var(--r-md);
  background: #fff;
  transition: border-color .18s;
}
.day-row:hover { border-color: #d8d0c8; }
.day-row.is-weekend { background: #f1ece5; }            /* week-end : fond légèrement plus sombre */
.day-row.is-holiday { border-left: 3px solid var(--or); } /* jour férié (tarif majoré) */
.day-info { display: grid; gap: .15rem; min-width: 0; }
.day-name { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.day-badges { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.day-tag { font-size: .7rem; color: var(--or); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.day-holiday {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: #fff; background: var(--or); padding: .1rem .4rem; border-radius: 4px;
}
.schedule-hint { margin: .1rem 0 .15rem; font-size: .76rem; color: var(--texte-2); }
.schedule-hint[hidden] { display: none; }
.hint-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; vertical-align: -1px; margin-right: .2rem; }
.hint-swatch.fr { background: var(--or); }

.slot {
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 40px; padding: 0 .6rem;
  border: 1px solid var(--bord); border-radius: 999px;
  background: var(--fond); color: var(--texte-2);
  font-size: .82rem; font-weight: 600; white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.slot svg { width: 15px; height: 15px; }
/* Le nom est porté visuellement par l'en-tête de colonne, mais reste lu
   par les lecteurs d'écran (masquage sr-only, pas display:none). */
.slot .slot-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
.slot:hover { border-color: var(--rouge); }
.slot.on { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.slot:has(input:focus-visible) { outline: 2px solid var(--or); outline-offset: 2px; }

/* ============ RÉSUMÉ ============ */
.summary-card {
  position: sticky; top: 80px;
  background: var(--blanc);
  border: 1px solid var(--bord); border-radius: var(--r-lg);
  padding: clamp(1.25rem, 2vw, 1.6rem);
  box-shadow: 0 1px 2px rgba(26, 26, 24, .04), 0 12px 32px rgba(26, 26, 24, .05);
}
.summary-head { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: 1rem; }
.summary-head h3 { font-family: 'Lora', serif; color: var(--rouge); font-size: 1.15rem; margin-bottom: .2rem; }
.summary-head p { color: var(--texte-2); font-size: .88rem; line-height: 1.45; }

.summary-stats { display: flex; gap: .5rem; margin-bottom: 1.1rem; }
.stat {
  flex: 1; text-align: center;
  background: var(--rouge-lt); border-radius: var(--r-md);
  padding: .7rem .5rem;
}
.stat b { display: block; font-size: 1.35rem; color: var(--rouge); font-family: 'Lora', serif; line-height: 1; }
.stat span { font-size: .76rem; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }

.summary-toggle {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--fond); border: 1px solid var(--bord); border-radius: var(--r-md);
  padding: .7rem .85rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--texte);
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .8rem;
}
.summary-toggle svg { transition: transform .2s; }
.summary-toggle.open svg { transform: rotate(180deg); }

.summary-output {
  width: 100%; min-height: 13rem; resize: vertical;
  border: 1px solid var(--bord); border-radius: var(--r-md);
  background: var(--fond); color: var(--texte);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .8rem; line-height: 1.5;
  padding: .85rem; margin-bottom: 1rem;
}
.summary-output[hidden] { display: none; }

.btn-mail {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; min-height: 50px;
  background: var(--rouge); color: #fff; text-decoration: none;
  border-radius: var(--r-md); font-weight: 700; font-size: .95rem;
  box-shadow: 0 8px 20px rgba(122, 16, 16, .22);
  transition: background .18s, transform .18s, box-shadow .18s;
}
.btn-mail:hover { background: var(--rouge-dk); transform: translateY(-1px); }
.btn-mail:focus-visible { outline: 3px solid rgba(200, 146, 42, .45); outline-offset: 3px; }

.summary-note {
  margin-top: 1rem; padding: .8rem .9rem;
  border-left: 3px solid var(--or); border-radius: var(--r-md);
  background: var(--rouge-lt); color: var(--texte-2);
  font-size: .85rem; line-height: 1.5;
}

/* Secours sans logiciel de mail : copier le message + adresse en clair */
.btn-copy {
  width: 100%; min-height: 44px; margin-top: .6rem;
}
.send-alt { text-align: center; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1040px) {
  .reservation-layout { grid-template-columns: 1fr; max-width: 700px; margin: 0 auto; }
  .summary-card { position: static; }
}
@media (max-width: 620px) {
  .reservation-hero { padding-inline: 1rem; }
  .reservation-form, .summary-card { padding: 1.1rem; }
  .form-grid { grid-template-columns: 1fr; }
  /* Les colonnes s'empilent : l'en-tête devient une barre de 3 boutons
     "cocher/décocher toute la colonne", au lieu de disparaître. */
  .sg-head { display: flex; gap: .4rem; padding: 0; margin-bottom: .35rem; }
  .sg-corner { display: none; }
  .col-toggle {
    flex: 1; min-width: 0;
    white-space: normal; text-align: center; line-height: 1.15;
    min-height: 48px;
  }
  .day-row { grid-template-columns: 1fr; gap: .5rem; }
  .slot { justify-content: flex-start; padding-left: .9rem; }
  .slot .slot-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
}

/* ============ TOGGLE DE MODE (nouvelle demande / modification) ============ */
.mode-switch {
  display: flex; gap: .4rem; width: fit-content; margin: 0 auto 1rem;
  background: var(--blanc); border: 1px solid var(--bord);
  border-radius: 999px; padding: 5px;
  box-shadow: 0 1px 2px rgba(26, 26, 24, .04), 0 8px 22px rgba(26, 26, 24, .05);
}
.mode-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 0; cursor: pointer; font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--texte-2); background: transparent;
  padding: .62rem 1.1rem; border-radius: 999px;
  transition: background .18s, color .18s;
}
.mode-btn svg { width: 17px; height: 17px; }
.mode-btn.is-active { background: var(--rouge); color: #fff; }
.mode-btn:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

.mode-note {
  max-width: 760px; margin: -.2rem auto 1.5rem;
  background: var(--rouge-lt); border-left: 3px solid var(--or);
  border-radius: var(--r-md); padding: .8rem 1rem;
  color: var(--texte-2); font-size: .9rem; line-height: 1.5;
}
.mode-note[hidden] { display: none; }
.mode-note strong { color: var(--rouge); }

/* ============ BOUTON FLOTTANT : revenir à la période ============ */
/* Couleur or (comme les jours fériés) pour se distinguer des pastilles rouges. */
.scroll-dates {
  position: fixed; right: 1.25rem; bottom: 5rem; z-index: 60;
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--or); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 700;
  padding: .72rem 1.05rem; border-radius: 999px;
  box-shadow: 0 10px 26px rgba(200, 146, 42, .4);
  transition: background .18s, transform .18s, box-shadow .18s;
}
.scroll-dates[hidden] { display: none; }
.scroll-dates:hover { background: #b3801f; transform: translateY(-1px); }
.scroll-dates:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }

@media (max-width: 620px) {
  .mode-switch { width: 100%; }
  .mode-btn { flex: 1; padding-inline: .5rem; font-size: .86rem; }
  .scroll-dates { right: .85rem; bottom: 5.25rem; font-size: .82rem; padding: .62rem .85rem; }
}
