/**
 * Sun Travel — Moteur & tunnel de réservation (charte v7)
 *
 * Personnalise les composants Synelio à la charte Sun Travel v7.
 * - #hero-search : moteur embarqué en home, look maquette (mint/glass, 2 lignes)
 * - tunnel (loading / recap / booking) : recoloré marine → mint
 * Les styles de base viennent de @tws-synelio/css/synelio.css.
 */

/* palette dérivée (fallbacks si v7-design-system.css absent) */
:root {
  --v7-navy: var(--navy, #0E2A6D);
  --v7-mint: var(--primary-mint, #7ECFB3);
  --v7-slate: var(--slate, #26344A);
  /* SYN-1007 : la fin du dégradé (#7ECFB3) ne donnait que 1,78:1 sous le texte blanc du bloc
     récapitulatif — dates, passagers, cabine devenaient quasi illisibles à droite. Aucune teinte
     mint claire ne peut porter du blanc à 4,5:1 ; la fin est assombrie à #2E7D62 (4,51:1).
     C'est le seul changement de ce lot qui modifie l'aspect de la charte. */
  --v7-flight-gradient: linear-gradient(135deg, rgba(14, 42, 109, .95) 0%, rgba(46, 125, 98, .95) 100%);
}

/* ============================================================
   MOTEUR EMBARQUÉ — #hero-search (home v7)
   ============================================================ */
#hero-search .v7-sqa { padding: 0; }
#hero-search .v7-sqa-errors:empty { display: none; }
#hero-search .v7-sqa-errors { margin-bottom: 10px; }

/* — Ligne 1 : pills type / cabine / passagers — */
#hero-search .v7-sqa-row1 {
  display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
#hero-search .v7-pill {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid #ddd; border-radius: 24px;
  padding: 6px 16px; font-size: 14px; font-weight: 600; color: var(--v7-slate);
  position: relative;
}
#hero-search .v7-pill-select { padding-right: 34px; }
#hero-search .v7-pill-input {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: none; outline: none;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--v7-slate);
  cursor: pointer; padding: 2px 0;
}
#hero-search .v7-pill-caret {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #999; pointer-events: none;
}
#hero-search .v7-passengers-icon { font-size: 16px; color: var(--v7-slate); }

/* Passagers — rendu maquette : chip « Passagers » + chip compteurs, popup +/- conservé */
#hero-search .v7-passengers-group { position: relative; display: flex; gap: 12px; flex-wrap: wrap; }
#hero-search .v7-pill.v7-pax-label,
#hero-search .v7-pill.v7-pax-counts {
  font-family: inherit; cursor: pointer; background: #fff;
  border: 1.5px solid #ddd; border-radius: 24px; color: var(--v7-slate);
}
#hero-search .v7-pill.v7-pax-label { gap: 8px; }
#hero-search .v7-pill.v7-pax-label i { font-size: 16px; }
#hero-search .v7-pill.v7-pax-counts { gap: 14px; padding: 6px 16px; }
#hero-search .v7-pax-cat { display: inline-flex; align-items: center; gap: 6px; }
#hero-search .v7-pax-lbl { font-size: 13px; font-weight: 600; color: #888; }
#hero-search .v7-pax-lbl small { font-weight: 400; }
#hero-search .v7-pax-n {
  font-size: 15px; font-weight: 700; color: var(--v7-slate);
  min-width: 14px; text-align: center;
}
#hero-search #passengers.dropdown-menu.show { display: block; }

/* — Ligne 2 : barre blanche origine / destination / dates / bouton — */
#hero-search .v7-sqa-bar {
  display: flex; align-items: stretch;
  background: #fff; border: 1.5px solid #e0e0e0; border-radius: 14px;
}
#hero-search .v7-cell {
  flex: 1; padding: 12px 20px; border-right: 1px solid #eee;
  position: relative; min-width: 0;
}
#hero-search .v7-cell:first-child { border-top-left-radius: 14px; border-bottom-left-radius: 14px; }

/* Dates — 2 cellules riches (maquette), pickers easepick conservés en overlay transparent */
#hero-search .v7-dates-group { position: relative; display: flex; flex: 1.9; min-width: 0; }
#hero-search .v7-cell-date { flex: 1; }
#hero-search .v7-date-body { min-height: 38px; }
#hero-search .v7-date-main { display: flex; align-items: baseline; gap: 4px; }
#hero-search .v7-date-num { font-size: 24px; font-weight: 800; color: var(--v7-slate); line-height: 1; }
#hero-search .v7-date-my { font-size: 12px; font-weight: 600; color: #888; line-height: 1.2; }
#hero-search .v7-date-weekday { font-size: 11px; font-weight: 600; color: var(--primary-mint-dark, #5bb895); margin-top: 2px; }
#hero-search .v7-date-placeholder { font-size: 15px; font-weight: 600; color: #bbb; padding-top: 6px; }
#hero-search .v7-dates-overlay { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 3; border: none; background: transparent; width: 100%; }
#hero-search .v7-dates-overlay-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; background: transparent; }
/* L'overlay aller simple est un DIV (pas un input) dans lequel easepick insère
   le calendrier. Avec opacity:0 sur le DIV, le calendrier hérite de l'opacité
   et devient INVISIBLE (calendrier aller simple « qui ne s'affiche pas » —
   l'aller-retour marche car son input returnDates est frère, pas enfant). On
   rend donc le DIV opaque ; c'est l'input interne (.v7-dates-overlay-input,
   opacity:0 ci-dessus) qui reste transparent. Spécificité #id+élément+classe
   pour battre la règle .v7-dates-overlay ci-dessus. */
#hero-search div.v7-dates-overlay { opacity: 1; }
#hero-search .v7-dates-group:has(.is-invalid) { outline: 2px solid #dc3545; outline-offset: -2px; border-radius: 8px; }
/* N'afficher que le feedback du champ réellement invalide (SYN-1388). Deux règles
   révélaient les DEUX messages superposés (champ date illisible en aller simple) :
   l'ancienne `:has(.is-invalid) .invalid-feedback`, ET surtout la règle native de
   Bootstrap `.is-invalid ~ .invalid-feedback` — l'input returnDates invalide est
   frère direct des deux feedbacks. On neutralise donc le défaut dans le groupe
   (spécificité #id > la règle Bootstrap en 2 classes), puis on rallume chaque
   feedback pour SON champ : returnDates ↔ returnDatesFeedback, input date simple
   ↔ dateFeedback. */
#hero-search .v7-dates-group .invalid-feedback { display: none; }
#hero-search .v7-dates-group:has([data-tws-air--sqa-target="returnDates"].is-invalid) [data-tws-air--sqa-target="returnDatesFeedback"] { display: block; }
#hero-search .v7-dates-group:has(.v7-dates-overlay-input.is-invalid) [data-tws-air--sqa-target="dateFeedback"] { display: block; }
#hero-search .v7-cell-l {
  font-size: 12px; font-weight: 600; color: #999;
  letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase;
}
#hero-search .v7-cell-input {
  border: none; outline: none; width: 100%;
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--v7-slate);
  background: transparent; padding: 0;
}
#hero-search .v7-cell-input::placeholder { color: #bbb; font-weight: 400; }

/* Drapeau pays à gauche des champs origine / destination (--flag-url posé sur .v7-cell) */
#hero-search input[id$="originInput"],
#hero-search input[id$="destinationInput"] {
  background-image: var(--flag-url, none);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 22px 16px;
}
#hero-search .v7-cell[style*="--flag-url"] .v7-cell-input { padding-left: 30px; }

/* Résultats d'autocomplétion : au-dessus de la barre */
#hero-search .synelio-autocomplete-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
  max-height: 320px; overflow-y: auto;
}

/* Bouton RECHERCHER (marine, pleine hauteur) */
#hero-search .v7-sqa-submit {
  flex: 0 0 auto; background: var(--v7-slate); color: #fff; border: none;
  padding: 0 32px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-top-right-radius: 12px; border-bottom-right-radius: 12px;
  transition: background .25s ease;
}
#hero-search .v7-sqa-submit i { font-size: 20px; }
#hero-search .v7-sqa-submit span { font-size: 12px; font-weight: 700; letter-spacing: 1px; }
#hero-search .v7-sqa-submit:hover { background: #1a2535; }

/* Dropdown passagers */
#hero-search #passengers.dropdown-menu {
  border: none !important; border-radius: 1rem !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0 !important; overflow: hidden; min-width: 300px;
}
#hero-search #passengers .p-3 { padding: 1.25rem !important; }
#hero-search #passengers h6 {
  font-weight: 700; color: var(--v7-navy);
  font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em;
}
#hero-search #passengers small { color: #999; }
#hero-search #passengers .btn-primary.btn-sm.rounded-circle { transition: transform 0.2s ease; }
#hero-search #passengers .btn-primary.btn-sm.rounded-circle:hover { transform: scale(1.1); }

/* Responsive moteur */
@media (max-width: 767px) {
  #hero-search .v7-sqa-bar { flex-wrap: wrap; border-radius: 14px; }
  #hero-search .v7-cell { flex: 1 1 100%; border-right: none; border-bottom: 1px solid #eee; }
  /* Le groupe de dates enveloppe deux .v7-cell : sans cette règle il garde son
     flex:1.9 et se réduit à 0, ce qui faisait déborder la page de ~100 px. */
  #hero-search .v7-dates-group { flex: 1 1 100%; }
  #hero-search .v7-sqa-submit {
    flex: 1 1 100%; flex-direction: row; padding: 14px;
    border-radius: 0 0 12px 12px;
  }
  #hero-search .v7-passengers-input { min-width: 120px; }

  /* Zones tactiles : le <select> ne mesurait que 25 px et l'input de ville 24 px
     à l'intérieur d'une pastille de 37 px, donc la moitié de la pastille ne
     déclenchait rien au doigt.
     Les pastilles passagers sont des <button> : l'élément entier est déjà la
     cible, on leur garde un padding vertical pour que le libellé sur deux
     lignes ne colle pas à la bordure. Les pastilles <select>, elles, doivent
     céder leur padding au contrôle, sinon les 16 px de gauche et les 34 px du
     chevron restent inertes — 52 px sur 136, chevron compris. */
  #hero-search .v7-pill.v7-pax-label,
  #hero-search .v7-pill.v7-pax-counts {
    min-height: 44px; padding-top: 4px; padding-bottom: 4px;
  }
  #hero-search .v7-pill.v7-pill-select {
    min-height: 44px; padding: 0;
  }
  #hero-search .v7-pill-select .v7-pill-input {
    align-self: stretch; width: 100%; padding: 0 34px 0 16px;
  }
  #hero-search .v7-cell { padding-top: 6px; padding-bottom: 6px; }
  #hero-search .v7-cell-input { min-height: 44px; }
}

/* ============================================================
   ÉTAT DE CHARGEMENT (recherche en cours)
   ============================================================ */
.synelio-air-main .synelio-flight-search-loading {
  position: relative;
  min-height: 58vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(14, 42, 109, .92) 0%, rgba(126, 207, 179, .85) 100%),
              url("../img/v7/hero-sky-R3OMgOw.webp");
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  padding: 56px 20px;
}
.synelio-air-main .synelio-flight-search-loading .container { margin: 0; }
.synelio-air-main .synelio-flight-search-loading h1 {
  color: #fff;
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 20px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}
.synelio-air-main .synelio-flight-search-loading h2 {
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px; font-weight: 600;
  opacity: .95; margin-top: 16px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .2);
}
.synelio-air-main .synelio-flight-search-loading .synelio-journey p {
  font-size: 18px; font-weight: 600; margin: 4px 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .2);
}
.synelio-air-main .synelio-flight-search-loading .synelio-journey p i { color: var(--v7-mint); }
.synelio-air-main .synelio-flight-search-loading .synelio-spinner {
  width: 52px; height: 52px; margin: 30px auto 0;
  border: 4px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  /* keyframe propre (rotation pure) : celui du bundle contient translateX(-50%)
     et décalerait le spinner vers la gauche. */
  animation: v7-spin 1s linear infinite;
}
@keyframes v7-spin { to { transform: rotate(360deg); } }

/* ============================================================
   BARRE DE RÉCAP (résultats)
   ============================================================ */
#synelio-flight-sqa-recap {
  background: var(--v7-flight-gradient); padding: 1rem 0; color: white;
}
#synelio-flight-sqa-recap .container { display: flex; align-items: center; justify-content: space-between; }
#synelio-flight-sqa-recap .synelio-recap-segment strong { color: white; }
#synelio-flight-sqa-recap .synelio-recap-arrow { color: rgba(255, 255, 255, 0.8); }
#synelio-flight-sqa-recap .synelio-recap-date { color: rgba(255, 255, 255, 0.9); }
#synelio-flight-sqa-recap .synelio-recap-info { color: white; }
#synelio-flight-sqa-recap .synelio-recap-pax,
#synelio-flight-sqa-recap .synelio-recap-cabin { background: rgba(255, 255, 255, 0.2); }
#synelio-flight-sqa-recap .btn {
  margin-left: 1rem; font-size: 0.85rem; padding: 0.25rem 0.75rem;
  background: white; color: var(--v7-navy); border-color: white;
}
#synelio-flight-sqa-recap .btn:hover { background: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.9); }

/* Sur téléphone, la mise en page du bandeau (bouton rond à droite) est dans
   suntravel-correctifs-moteur.css depuis SUN-1 : l'ancienne règle qui passait le
   .container en colonne et le bouton en pleine largeur l'écrasait (sélecteur
   d'identifiant, plus fort que les classes de cette feuille). */
@media (max-width: 991px) {
  #synelio-flight-sqa-recap .btn { margin-left: 0; }
}

/* ============================================================
   PAGES DU TUNNEL BOOKING
   ============================================================ */
.synelio-air-booking .synelio-sqa-recap { background: var(--v7-flight-gradient); color: white; }
.synelio-air-booking .synelio-sqa-recap .synelio-recap-segment strong { color: white; }
.synelio-air-booking .synelio-sqa-recap .btn { background: white; color: var(--bs-primary); border-color: white; }
.synelio-air-booking .synelio-sqa-recap .btn:hover { background: rgba(255, 255, 255, 0.9); }
.synelio-air-booking .btn-primary {
  background: var(--v7-navy); border: none;
  padding: 0.6rem 1.5rem; font-weight: 600; border-radius: 0.5rem; transition: all 0.2s ease;
}
.synelio-air-booking .btn-primary:hover {
  background: #0a2058; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 42, 109, 0.3);
}
.synelio-air-booking .form-control:focus,
.synelio-air-booking .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(126, 207, 179, 0.25);
}

/* ============================================================
   BADGE TYPE DE TARIF (utilisateurs agence)
   ============================================================ */
.synelio-fare-type {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 2px 6px; border-radius: 3px; margin-bottom: 4px; text-transform: uppercase;
}
.synelio-fare-type--published { background: #e8f5e9; color: #2e7d32; }
.synelio-fare-type--negotiated { background: #fff3e0; color: #e65100; }
.synelio-fare-type--corporate { background: #e3f2fd; color: #1565c0; }
.synelio-fare-type--gds { background: #f3e5f5; color: #7b1fa2; }
.synelio-fare-type--ndc { background: #fce4ec; color: #c2185b; }

/* SYN-1007 — calendrier de recherche (easepick).
   Le calendrier rend dans un shadow DOM et charge son CSS depuis un CDN : aucune règle
   de cette feuille ni de celle du bundle n'atteint ses éléments. Seules les propriétés
   personnalisées traversent la frontière, en les posant sur l'hôte.
   `--color-fg-muted` colore les en-têtes de colonne (lun., mar., …), à 2,68:1 par défaut.
   Il est distinct de `--color-fg-locked` (lock-plugin), qui colore les jours indisponibles :
   les foncer ensemble ferait passer un jour non réservable pour un jour ouvert. */
.easepick-wrapper {
  --color-fg-muted: #757575;
  /* Dates choisies : le blanc sur le périwinkle par défaut d'easepick (#6b82ff) ne donne
     que 3,35:1 — ce sont pourtant les deux dates que le client vient de sélectionner.
     On reprend le navy de la charte, qui monte à 11,66:1. */
  --color-fg-primary: #0E2A6D;
}

/* ============================================================
   SUN-8 — RECHERCHE DU JOUR SANS VOL (liste des résultats)
   Bandeau au dégradé du récapitulatif, deux boutons de contact.
   Présentation validée le 18/11/2026 (option B de la maquette).
   ============================================================ */
.st-lastmin {
  max-width: 880px; margin: 40px auto 56px; padding: 34px 36px;
  background: var(--v7-flight-gradient); border-radius: 16px; color: #fff;
  box-shadow: 0 16px 40px rgba(14, 42, 109, .18);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
/* Sans vol, « 0 résultats » et les filtres n'ont rien à filtrer. */
#synelio-flight-offers:has(.st-lastmin) [data-tws-air--sqa-offers-target="filters"] { display: none; }
.st-lastmin .st-lm-head { display: flex; gap: 20px; align-items: flex-start; }
.st-lastmin .st-lm-badge {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: var(--v7-mint);
}
.st-lastmin h2 { color: #fff; font-size: 22px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 8px; }
.st-lastmin p { color: rgba(255, 255, 255, .9); font-size: 15.5px; line-height: 1.6; margin: 0; }
.st-lastmin .st-lm-contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.st-lastmin .st-lm-contact {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 12px;
  text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  transition: transform .25s cubic-bezier(.2, 0, .4, 1), box-shadow .25s cubic-bezier(.2, 0, .4, 1);
}
.st-lastmin .st-lm-contact:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, .16); }
.st-lastmin .st-lm-contact:focus-visible { outline: 3px solid var(--v7-mint); outline-offset: 2px; }
.st-lastmin .st-lm-ico {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
}
.st-lastmin .st-lm-contact small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.st-lastmin .st-lm-contact strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.st-lastmin .st-lm-go { margin-left: auto; font-size: 18px; opacity: .6; }
.st-lastmin .st-lm-call { background: #fff; color: var(--v7-navy); }
.st-lastmin .st-lm-call small { color: #6B7280; }
.st-lastmin .st-lm-call .st-lm-ico { background: rgba(14, 42, 109, .08); color: var(--v7-navy); }
.st-lastmin .st-lm-wa { background: var(--wa, #25D366); color: #fff; }
.st-lastmin .st-lm-wa small { color: rgba(255, 255, 255, .85); }
.st-lastmin .st-lm-wa .st-lm-ico { background: rgba(255, 255, 255, .2); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .st-lastmin .st-lm-contact { transition: none; }
  .st-lastmin .st-lm-contact:hover { transform: none; }
}

@media (max-width: 767px) {
  /* Marge basse : le bouton WhatsApp flottant ne doit pas couvrir le second bouton. */
  .st-lastmin { margin: 0 0 104px; padding: 22px 18px; }
  .st-lastmin .st-lm-head { display: grid; grid-template-columns: 44px 1fr; gap: 6px 14px; }
  .st-lastmin .st-lm-text { display: contents; }
  .st-lastmin h2 { align-self: center; font-size: 19px; margin: 0; }
  .st-lastmin p { grid-column: 1 / -1; margin-top: 8px; font-size: 15px; }
  .st-lastmin .st-lm-badge { width: 44px; height: 44px; font-size: 22px; }
  .st-lastmin .st-lm-contacts { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .st-lastmin .st-lm-contact { padding: 12px 14px; min-height: 64px; }
  .st-lastmin .st-lm-contact strong { font-size: 18px; }
}
