/* Carats Limousine — page Réservation (à charger après site.css)
   Toutes les classes ci-dessous sont pilotées par reservation.js : ne pas les renommer. */

/* Thème du composant d'autocomplétion Google Places (New) : ces variables
   sont déclarées au niveau :root (et pas seulement sur le composant lui-même)
   car Google affiche parfois la liste de suggestions dans un panneau attaché
   ailleurs dans la page ; les variables CSS héritées depuis :root s'appliquent
   alors aussi à ce panneau, ce qui évite un texte sombre sur fond sombre. */
:root {
  --gmpx-color-surface: var(--nuit);
  --gmpx-color-on-surface: var(--ivoire);
  --gmpx-color-on-surface-variant: #C7C9CD;
  --gmpx-color-primary: var(--champagne-vif);
  --gmpx-color-outline: var(--trait);
  --gmpx-font-family: var(--sans);
  --gmpx-font-size-base: 15px;
}

.is-hidden { display: none !important; }

/* ---------- Mode mariage : la page passe en version claire ---------- */
body.wedding-reservation-mode {
  --nuit: #F4F1EB;
  --asphalte: #FFFFFF;
  --trait: #DCD6CB;
  --ivoire: #141517;
  --brume: #5E6166;
  --champagne: #9A7B45;
  --champagne-vif: #7F6436;
  --header-bg: rgba(244, 241, 235, .94);
  --menu-bg: rgba(244, 241, 235, .98);
  color-scheme: light;
}
body.wedding-reservation-mode .site-header:not(.is-solid),
body.wedding-reservation-mode .reservation-hero {
  --ivoire: #F4F1EB;
  --brume: #D5D6D8;
  --champagne: #DCC7A0;
  --nuit: #0E0F11;
}
body.wedding-reservation-mode input[type="date"],
body.wedding-reservation-mode input[type="time"] { color-scheme: light; }

/* ---------- En-tête de page ---------- */
.reservation-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(380px, 52vh, 520px);
  display: flex; align-items: flex-end;
  padding: 130px var(--gutter) clamp(36px, 6vh, 64px);
  background-color: #0E0F11;
  background-image: linear-gradient(rgba(14,15,17,.55), rgba(14,15,17,.55)), url("img/mercedes-1536.webp");
  background-size: cover; background-position: center;
  color: var(--ivoire);
}
.reservation-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(14,15,17,.85), rgba(14,15,17,0));
}
.reservation-title { position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 0 auto; animation: rise 1s .1s var(--ease) both; }
.reservation-title > span { display: inline-block; font-size: 15px; color: var(--champagne); margin-bottom: 12px; }
.reservation-title h1 { font-family: var(--serif); font-size: clamp(38px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.02em; max-width: 16ch; color: var(--ivoire); }
.reservation-title p { margin-top: 16px; max-width: 52ch; font-size: 18px; color: rgba(236,232,225,.86); }
body.wedding-reservation-mode .reservation-title p { color: rgba(244,241,235,.9); }
.journey-context { display: none; margin-top: 14px; font-size: 14px; color: var(--brume); }
.journey-context.show { display: block; }
.mobile-hero-capacity { display: none; }

/* ---------- Mise en page ---------- */
.reservation-section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) var(--gutter) clamp(64px, 8vw, 110px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(28px, 4vw, 64px); align-items: start;
}
.reservation-form { display: grid; gap: 18px; min-width: 0; }
.reservation-side { position: sticky; top: 96px; display: grid; gap: 16px; min-width: 0; }

/* ---------- Choix du service ---------- */
.service-choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--asphalte); border: 1px solid var(--trait); border-radius: 999px; padding: 4px;
}
.service-choice:has(.service-btn.is-hidden) { grid-template-columns: 1fr; }
.service-btn {
  border: 0; background: none; cursor: pointer; border-radius: 999px; min-height: 46px;
  font: 500 15px/1 var(--sans); color: var(--brume);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.service-btn:hover { color: var(--ivoire); }
.service-btn.active { background: var(--ivoire); color: var(--nuit); }

/* ---------- Panneaux de formulaire ---------- */
.booking-panel {
  display: none;
  background: var(--asphalte); border: 1px solid var(--trait); border-radius: 18px;
  padding: clamp(20px, 3vw, 32px);
}
.booking-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.booking-panel h3 { grid-column: 1 / -1; font-family: var(--serif); font-size: clamp(26px, 2.4vw, 32px); line-height: 1.1; }
.booking-panel > label, .client-form label { display: grid; gap: 7px; align-content: start; min-width: 0; }
.booking-panel > label > span:first-child, .booking-panel .airport-fields label > span:first-child,
.client-form label > span:first-child { font-size: 13px; color: var(--brume); }
.label-line { display: block; }

/* Champs sur toute la largeur */
.booking-panel > .request-type-field,
#weddingDepartureField, #weddingTownhallField,
#departureDetailsField, #arrivalDetailsField,
.booking-panel > label:has(#transferDeparture),
.booking-panel > label:has(#transferDestination),
.booking-panel > label:has(#transferVehicle),
.booking-panel > label:has(#hourlyVehicle),
.booking-panel > label:has(#hourlyPickup),
.airport-fields, .event-price-note, .sncf-note, .vehicle-capacity, .wedding-decoration, .vehicle-preview-inline { grid-column: 1 / -1; }

.booking-panel input, .booking-panel select, .booking-panel textarea,
.client-form input, .client-form textarea { background: var(--nuit); }

select {
  width: 100%; min-height: 48px;
  appearance: none; -webkit-appearance: none;
  background: var(--nuit) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239C9FA4' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 14px center / 11px;
  border: 1px solid var(--trait); border-radius: 10px;
  color: var(--ivoire); font: 15px var(--sans);
  padding: 0 36px 0 14px; text-overflow: ellipsis; cursor: pointer;
}
select:focus-visible { outline: none; border-color: var(--champagne); box-shadow: 0 0 0 3px rgba(201,178,138,.22); }
select option { background: var(--asphalte); color: var(--ivoire); }

.request-source { display: block; font-size: 13px; color: var(--champagne); }

.airport-fields { display: grid; grid-template-columns: 1fr; max-width: 320px; gap: 16px; padding: 16px; border-radius: 12px; border: 1px dashed var(--trait); }
.airport-fields label { display: grid; gap: 7px; }

.event-price-note, .sncf-note { font-size: 13px; color: var(--brume); line-height: 1.5; }
.duration-note { display: block; font-size: 12.5px; color: var(--brume); }

.vehicle-capacity { display: none; gap: 18px; font-size: 14px; color: var(--brume); }
.vehicle-capacity.show { display: flex; }
.vehicle-capacity span:first-child { color: var(--ivoire); font-weight: 600; }

.vehicle-preselected { border-color: var(--champagne) !important; }

.wedding-decoration {
  display: flex !important; align-items: center; gap: 14px; cursor: pointer;
  padding: 16px; border: 1px solid var(--trait); border-radius: 12px;
}
.wedding-decoration.is-hidden { display: none !important; }
.wedding-decoration input { width: 20px; height: 20px; accent-color: var(--champagne); flex: none; }
.wedding-decoration strong { display: block; font-weight: 500; }
.wedding-decoration small { color: var(--brume); font-size: 13.5px; }

/* Champ rempli : discret repère de validation */
input.field-valid, select.field-valid { border-color: rgba(123, 197, 154, .55); }
input.field-valid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237BC59A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 14px; padding-right: 40px;
}
input[type="date"].field-valid, input[type="time"].field-valid { background-image: none; padding-right: 14px; }

/* ---------- Commentaire ---------- */
.comment-details { border: 1px solid var(--trait); border-radius: 12px; background: var(--asphalte); }
.comment-details summary { list-style: none; cursor: pointer; padding: 14px 16px; font-size: 15px; color: var(--ivoire); min-height: 44px; }
.comment-details summary::-webkit-details-marker { display: none; }
.comment-details[open] summary { color: var(--champagne); }
.comment-details label { display: block; padding: 0 16px 16px; }

/* ---------- Bouton estimation ---------- */
.estimate-button {
  width: 100%; min-height: 54px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ivoire); color: var(--nuit); font: 500 16px/1 var(--sans);
  transition: background .25s var(--ease);
}
.estimate-button:hover { background: var(--champagne-vif); }

/* ---------- Colonne de droite : véhicule et prix ---------- */
.vehicle-preview { position: relative; text-align: center; padding: 8px 0 4px; }
.vehicle-preview > span { display: block; font-size: 13px; color: var(--brume); }
.vehicle-preview h3 { margin: 6px 0 12px; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.vehicle-preview-media { position: relative; width: 100%; aspect-ratio: 3 / 2; margin: 0 auto; overflow: hidden; border-radius: 14px; }
.vehicle-preview img, .vehicle-preview .vehicle-preview-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0;
}
.vehicle-preview > img#vehiclePreviewImage { position: static; aspect-ratio: 3 / 2; border-radius: 14px; }
.vehicle-preview-img { transition: opacity 1s cubic-bezier(.45,0,.2,1); }
.vehicle-preview-img-front { opacity: 1; z-index: 1; }
.vehicle-preview-img-back { opacity: 0; z-index: 2; pointer-events: none; }
.vehicle-preview.is-crossfading .vehicle-preview-img-front { opacity: 0; }
.vehicle-preview.is-crossfading .vehicle-preview-img-back { opacity: 1; }
body.wedding-reservation-mode .vehicle-preview-media { background: #fff; }
body.wedding-reservation-mode .vehicle-preview img { object-fit: contain; }

.price-box {
  background: var(--asphalte); border: 1px solid var(--trait); border-radius: 18px;
  padding: clamp(22px, 3vw, 30px);
  animation: rise .6s var(--ease) both;
}
.price-box > span { font-size: 13px; color: var(--brume); }
.price-box h2 { margin: 6px 0 10px; font-family: var(--serif); font-size: clamp(40px, 4vw, 54px); line-height: 1; font-variant-numeric: lining-nums; }
.price-box p { font-size: 14px; color: var(--brume); margin-bottom: 20px; }
.price-box button {
  width: 100%; min-height: 52px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ivoire); color: var(--nuit); font: 500 16px/1 var(--sans);
  transition: background .25s var(--ease), opacity .25s;
}
.price-box button:hover:not(:disabled) { background: var(--champagne-vif); }
.price-box button:disabled { opacity: .4; cursor: not-allowed; }
.price-box a { display: block; margin-top: 14px; text-align: center; font-size: 14px; color: var(--champagne); }

/* ---------- Coordonnées ---------- */
.client-section { display: none; padding: 0 var(--gutter) clamp(64px, 8vw, 110px); }
.client-section.show { display: block; animation: rise .6s var(--ease) both; }
.client-form {
  max-width: var(--max); margin: 0 auto;
  background: var(--asphalte); border: 1px solid var(--trait); border-radius: 18px;
  padding: clamp(22px, 4vw, 48px);
  display: grid; gap: 18px;
}
.client-form > span { font-size: 15px; color: var(--champagne); }
.client-form h2 { font-family: var(--serif); font-size: clamp(30px, 3vw, 44px); line-height: 1.05; margin-top: -8px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid .comment-details { grid-column: 1 / -1; background: var(--nuit); }
.request-notice { border-left: 2px solid var(--champagne); padding: 4px 0 4px 16px; }
.request-notice strong { display: block; font-weight: 500; }
.request-notice p { margin-top: 4px; color: var(--brume); font-size: 14.5px; max-width: 70ch; }
#requestButton {
  justify-self: start; min-height: 54px; padding: 0 32px; border: 0; border-radius: 999px; cursor: pointer;
  background: #1F8F5F; color: #fff; font: 500 16px/1 var(--sans);
  transition: background .25s var(--ease), opacity .25s;
}
#requestButton:hover:not(:disabled) { background: #22a06b; }
#requestButton:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Mode mariage : masquer les champs de transfert ---------- */
body.wedding-reservation-mode label:has(#transferDeparture),
body.wedding-reservation-mode label:has(#transferDestination),
body.wedding-reservation-mode #departureDetailsField,
body.wedding-reservation-mode #arrivalDetailsField,
body.wedding-reservation-mode #departureAirportFields,
body.wedding-reservation-mode #arrivalAirportFields,
body.wedding-reservation-mode .sncf-note { display: none !important; }
body.wedding-reservation-mode .wedding-field { display: grid !important; }
body.wedding-reservation-mode .reservation-title h1 { color: #F4F1EB; }

/* ---------- Tablette et mobile ---------- */
@media (max-width: 960px) {
  .reservation-section { grid-template-columns: 1fr; }
  .reservation-side { position: static; }
  .reservation-side .vehicle-preview:not(.vehicle-preview-inline) { max-width: 520px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .booking-panel.active { grid-template-columns: 1fr; }
  .airport-fields { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  #requestButton { width: 100%; }

  /* Aperçu du véhicule inséré dans le formulaire (reservation.js) */
  .vehicle-preview.vehicle-preview-inline { padding: 0; }
  .vehicle-preview.vehicle-preview-inline h3 { font-size: 22px; }
  .vehicle-preview.vehicle-preview-from-fleet { display: none !important; }

  /* Photo du véhicule en fondu dans l'en-tête (réservation depuis la flotte) */
  .reservation-hero.vehicle-mobile-hero { min-height: 480px; background-image: none !important; }
  .reservation-hero.vehicle-mobile-hero::before,
  .reservation-hero.vehicle-mobile-hero .hero-next {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-size: cover; background-position: center;
    transition: opacity 1.1s cubic-bezier(.45,0,.2,1);
  }
  .reservation-hero.vehicle-mobile-hero::before { background-image: var(--mobile-reservation-hero); }
  .reservation-hero.vehicle-mobile-hero.hero-image-crossfading::before { opacity: 0; }
  .reservation-hero.vehicle-mobile-hero::after {
    inset: 0; height: auto; z-index: -2;
    background-image: var(--mobile-reservation-hero-next); background-size: cover; background-position: center;
  }
}

@media (max-width: 560px) {
  .reservation-hero { min-height: 400px; padding-top: 112px; }
  .reservation-title p { font-size: 16px; }
}

/* Champ d'autocomplétion d'adresse Google Places (New) : composant web
   (gmp-place-autocomplete) qui remplace visuellement le champ texte
   d'origine une fois Google Maps chargé. Les variables --gmpx-* sont
   celles exposées par Google pour thémer le composant et sa liste de
   suggestions dans le style du site. */
.carats-place-autocomplete {
  display: block;
  width: 100%;
  border: 1px solid var(--trait);
  border-radius: 10px;
  background: var(--nuit);
}

