/* Shortcode [gite_reservation] — couleurs reprises du prototype de barre de recherche.
   Police heritee du theme (Divi) ; tout est scope sous .gite-booking pour ne rien casser autour. */

.gite-booking {
  --gb-brand: #313a1c;
  --gb-brand-hover: #232a13;
  --gb-brand-tint: #eef0e6;
  --gb-ink: #1c2321;
  --gb-muted: #6b7672;
  --gb-line: #dfe3e0;
  --gb-surface: #ffffff;
  --gb-danger: #b3261e;
  --gb-warning-bg: #fff4e5;
  --gb-radius: 14px;
  color: var(--gb-ink);
  max-width: 1120px;
  margin: 0 auto;
  line-height: 1.5;
  /* La mise en page (colonne recap ou bandeau) depend de la largeur du bloc, pas de l'ecran :
     la page peut etre pleine largeur ou avec une barre laterale Divi. */
  container: gb / inline-size;
  --gb-sticky-top: 150px; /* sous le header fixe de Divi */
}
.gite-booking *, .gite-booking *::before, .gite-booking *::after { box-sizing: border-box; }

/* ----- Progression ----- */
.gite-booking .gb-progress {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  counter-reset: none;
}
.gite-booking .gb-progress li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 13px;
  color: var(--gb-muted);
  text-align: center;
  position: relative;
}
.gite-booking .gb-progress li::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--gb-line);
}
.gite-booking .gb-progress li:last-child::after { display: none; }
.gite-booking .gb-progress-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--gb-line);
  background: var(--gb-surface);
  font-weight: 600;
}
.gite-booking .gb-progress li.is-current { color: var(--gb-ink); font-weight: 600; }
.gite-booking .gb-progress li.is-current .gb-progress-num { border-color: var(--gb-brand); color: var(--gb-brand); }
.gite-booking .gb-progress li.is-done .gb-progress-num { background: var(--gb-brand); border-color: var(--gb-brand); color: #fff; }
.gite-booking .gb-progress li.is-done::after { background: var(--gb-brand); }
@media (max-width: 600px) {
  .gite-booking .gb-progress-label { display: none; }
  .gite-booking .gb-progress li.is-current .gb-progress-label { display: block; position: absolute; top: 36px; white-space: nowrap; }
  .gite-booking .gb-progress { margin-bottom: 36px; }
}

/* ----- Mise en page : etapes + colonne recapitulatif ----- */
.gite-booking .gb-layout { display: flex; flex-direction: column-reverse; gap: 16px; }
.gite-booking .gb-aside {
  background: var(--gb-surface);
  border-radius: var(--gb-radius);
  border: 1px solid var(--gb-line);
  box-shadow: 0 4px 16px rgba(20, 40, 35, .06);
  overflow: hidden;
}
.gite-booking .gb-aside-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  background: var(--gb-brand-tint);
  color: var(--gb-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gite-booking .gb-aside-title { font-weight: 700; font-size: 16px; flex: 1 0 auto; }
.gite-booking .gb-aside-short { font-size: 14px; color: var(--gb-muted); order: 3; flex-basis: 100%; }
.gite-booking .gb-aside-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--gb-brand);
  border-bottom: 2px solid var(--gb-brand);
  transform: rotate(45deg);
  transition: transform .2s;
  margin-top: -4px;
}
.gite-booking .gb-aside:not(.is-collapsed) .gb-aside-chevron { transform: rotate(-135deg); margin-top: 4px; }
.gite-booking .gb-aside.is-collapsed .gb-aside-body { display: none; }
.gite-booking .gb-aside-body { padding: 4px 18px 16px; }
.gite-booking .gb-aside-block { padding: 12px 0; border-bottom: 1px solid var(--gb-line); }
.gite-booking .gb-aside-block:last-child { border-bottom: 0; }
.gite-booking .gb-aside-block p { margin: 0 0 2px; padding: 0; font-size: 14px; }
.gite-booking .gb-aside-label {
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gb-muted);
  margin-bottom: 4px !important;
}
.gite-booking .gb-aside-price { background: #fafbfa; margin: 0 -18px -16px; padding: 12px 18px 16px; }

/* ----- Acceptation des CGV ----- */
.gite-booking .gb-cgv-block { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--gb-line); border-radius: 12px; }
.gite-booking .gb-cgv-block .gb-subtitle { margin-top: 0; }
.gite-booking .gb-cgv-status { margin: 0 0 12px; padding: 0; }
.gite-booking .gb-cgv-status.is-accepted { color: var(--gb-brand); font-weight: 600; }

/* Fenetre des CGV : ajoutee a <body>, donc hors de .gite-booking (couleurs en dur). */
.gb-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(20, 40, 35, .3);
  color: #1c2321;
  display: flex;
  flex-direction: column;
}
.gb-modal:not([open]) { display: none; }
.gb-modal::backdrop { background: rgba(20, 30, 27, .55); }
.gb-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid #dfe3e0; }
.gb-modal-header h2 { margin: 0; padding: 0; font-size: 20px; line-height: 1.3; }
.gb-modal-close { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: #6b7672; padding: 4px 8px; }
.gb-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 15px; line-height: 1.6; min-height: 0; }
.gb-modal-body:focus { outline: none; }
.gb-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid #dfe3e0; background: #fafbfa; }
.gb-modal-hint { margin: 0; padding: 0; font-size: 14px; color: #6b7672; }
.gb-modal .gb-btn { padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; border: 0; background: #313a1c; color: #fff; }
.gb-modal .gb-btn:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 600px) {
  .gb-modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .gb-modal-footer .gb-btn { flex: 1 1 100%; }
}

/* ----- Detail du prix ----- */
.gite-booking .gb-price-lines { list-style: none; margin: 0 0 8px; padding: 0; }
.gite-booking .gb-price-lines li,
.gite-booking .gb-price-total,
.gite-booking .gb-price-deposit,
.gite-booking .gb-price-balance { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 3px 0; font-size: 14px; line-height: 1.35; }
.gite-booking .gb-price-lines li span:last-child,
.gite-booking .gb-price p span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.gite-booking .gb-price-total { border-top: 1px solid var(--gb-line); padding-top: 8px !important; font-weight: 700; font-size: 16px !important; }
.gite-booking .gb-price-deposit { color: var(--gb-brand); font-weight: 600; }
.gite-booking .gb-price-balance { color: var(--gb-muted); }
.gite-booking .gb-price-error { color: var(--gb-danger); font-weight: 500; }
.gite-booking .gb-aside-price.is-loading .gb-price { opacity: .5; transition: opacity .15s; }

/* Bloc assez large : colonne a droite, collante et toujours depliee (apres les regles ci-dessus, qu'il surcharge). */
@container gb (min-width: 820px) {
  .gite-booking .gb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
  }
  .gite-booking .gb-aside {
    position: sticky;
    top: var(--gb-sticky-top);
    /* Jamais plus haute que l'ecran : sinon le total resterait hors de vue. */
    max-height: calc(100vh - var(--gb-sticky-top) - 16px);
    overflow-y: auto;
  }
  /* Colonne toujours depliee : l'en-tete n'est plus un bouton. */
  .gite-booking .gb-aside-toggle { pointer-events: none; }
  .gite-booking .gb-aside-short, .gite-booking .gb-aside-chevron { display: none; }
  .gite-booking .gb-aside.is-collapsed .gb-aside-body { display: block; }
}

/* ----- Panneau ----- */
.gite-booking .gb-panel {
  background: var(--gb-surface);
  border-radius: var(--gb-radius);
  box-shadow: 0 10px 30px rgba(20, 40, 35, .10), 0 2px 6px rgba(20, 40, 35, .05);
  padding: 28px;
}
@media (max-width: 600px) { .gite-booking .gb-panel { padding: 20px 16px; } }

.gite-booking .gb-title { margin: 0 0 16px; font-size: 24px; line-height: 1.25; color: var(--gb-ink); padding: 0; }
.gite-booking .gb-subtitle { margin: 24px 0 10px; font-size: 18px; padding: 0; }
.gite-booking .gb-recap { margin: -8px 0 16px; color: var(--gb-muted); padding: 0; }
.gite-booking .gb-help.is-warning { color: var(--gb-danger); font-weight: 500; }
.gite-booking .gb-help, .gite-booking .gb-muted { color: var(--gb-muted); font-size: 14px; margin: 6px 0 0; padding: 0; }

.gite-booking .gb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 24px;
}
.gite-booking .gb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gite-booking .gb-field label, .gite-booking .gb-label { font-weight: 600; font-size: 14px; }
.gite-booking .gb-field > .gb-btn { align-self: flex-start; }

.gite-booking .gb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gb-line);
  border-radius: 10px;
  background: var(--gb-surface);
  color: var(--gb-ink);
  font: inherit;
  font-size: 16px; /* evite le zoom automatique sur iOS */
}
.gite-booking .gb-input:focus { outline: 2px solid var(--gb-brand); outline-offset: 1px; border-color: var(--gb-brand); }
.gite-booking .gb-input[aria-invalid="true"] { border-color: var(--gb-danger); background: #fdf3f2; }
.gite-booking .gb-input-small { width: auto; min-width: 120px; }
.gite-booking textarea.gb-input { resize: vertical; }

.gite-booking .gb-fieldset {
  border: 1px solid var(--gb-line);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin: 20px 0 0;
}
.gite-booking .gb-fieldset legend { font-weight: 600; padding: 0 6px; }

/* ----- Stepper ----- */
.gite-booking .gb-stepper { display: inline-flex; align-items: center; gap: 12px; }
.gite-booking .gb-stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gb-line);
  background: var(--gb-surface);
  color: var(--gb-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.gite-booking .gb-stepper-btn:hover:not(:disabled) { border-color: var(--gb-brand); background: var(--gb-brand-tint); }
.gite-booking .gb-stepper-btn:disabled { opacity: .35; cursor: not-allowed; }
.gite-booking .gb-stepper-value { min-width: 24px; text-align: center; font-weight: 600; font-size: 17px; }

/* ----- Options, cases a cocher ----- */
.gite-booking .gb-options { display: grid; gap: 10px; }
.gite-booking .gb-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gite-booking .gb-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 0; cursor: pointer; }
.gite-booking .gb-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gb-brand); flex-shrink: 0; }

/* ----- Enfants ----- */
.gite-booking .gb-children { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gite-booking .gb-children li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0; }
.gite-booking .gb-children label { font-weight: 400; min-width: 70px; }

/* ----- Boutons ----- */
.gite-booking .gb-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap-reverse;
  margin-top: 28px;
}
.gite-booking .gb-actions > :only-child { margin-left: auto; }
.gite-booking .gb-btn {
  padding: 12px 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
}
.gite-booking .gb-btn-primary { background: var(--gb-brand); color: #fff; }
.gite-booking .gb-btn-primary:hover:not(:disabled) { background: var(--gb-brand-hover); }
.gite-booking .gb-btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.gite-booking .gb-btn-ghost { background: transparent; color: var(--gb-brand); border-color: var(--gb-line); }
.gite-booking .gb-btn-ghost:hover:not(:disabled) { border-color: var(--gb-brand); background: var(--gb-brand-tint); }
.gite-booking .gb-btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.gite-booking .gb-btn.is-loading { opacity: .7; cursor: progress; }
.gite-booking .gb-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gb-brand);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  justify-self: start;
  text-align: left; /* un bouton centre son texte par defaut, visible sur deux lignes */
}
@media (max-width: 600px) { .gite-booking .gb-actions .gb-btn { flex: 1 1 100%; } }

/* ----- Recapitulatif (etape 4) ----- */
.gite-booking .gb-summary { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--gb-line); }
.gite-booking .gb-summary-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gb-line);
}
.gite-booking .gb-summary dt { font-weight: 600; }
.gite-booking .gb-summary dd { margin: 0; }
@media (max-width: 600px) { .gite-booking .gb-summary-row { grid-template-columns: 1fr; gap: 2px; } }


/* ----- Messages ----- */
.gite-booking .gb-message {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fdf3f2;
  border-left: 4px solid var(--gb-danger);
  color: var(--gb-ink);
}
.gite-booking .gb-timer {
  margin: 0 0 16px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gb-brand-tint);
  font-size: 14px;
}
.gite-booking .gb-timer.is-urgent { background: var(--gb-warning-bg); }
.gite-booking .gb-notice { padding: 14px 16px; border-radius: 10px; background: var(--gb-warning-bg); margin: 16px 0 0; }
.gite-booking [hidden] { display: none !important; }

/* Champ piege anti-robots : hors ecran, jamais visible. */
.gite-booking .gb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
