/* =========================================================================
   Voiture — fiche détaillée
   -------------------------------------------------------------------------
   Chargée par views/reservation/locationsCarDetails.php, servie telle quelle
   aux deux écrans : la vue étant écrite ici et non héritée du thème, une seule
   feuille responsive suffit — pas de doublon « -mobile » à tenir à jour.

   Même vocabulaire que la liste (css/voitures.css) : mêmes couleurs, mêmes
   pastilles de caractéristiques, même carte.
   ========================================================================= */

:root {
  --vf-blue:  var(--yb-blue, #0d65c9);
  --vf-navy:  var(--yb-navy, #0d233e);
  --vf-cyan:  var(--yb-cyan, #29abe2);
  --vf-ink:   #1f2937;
  --vf-body:  #4b5563;
  --vf-muted: #9ca3af;
  --vf-line:  #e5e7eb;
  --vf-page:  #f2f5fa;
}

.vf-page { background: var(--vf-page); padding: 0 0 48px; }
/* Sous la mise en page « application », le corps porte déjà son fond. */
.yb-app .vf-page { padding-bottom: 12px; }

.vf-conteneur { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Fil d'Ariane et titre ----------------------------------------- */

.vf-entete { padding: 18px 0 16px; }
.vf-retour {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--vf-blue) !important;
}
.vf-titre-ligne {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-top: 10px;
}
.vf-page h1.vf-titre {
  margin: 0; color: var(--vf-ink);
  font-size: 32px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15;
}
.vf-lieu { margin: 5px 0 0; font-size: 14px; color: var(--vf-body); }
.vf-lieu i { color: var(--vf-blue); margin-right: 5px; }
/* Doublon avec .vf-reserv__prix (le panneau de reservation) une fois celui-ci sticky et visible en meme temps a l'ecran, ce qui n'arrive qu'a partir de 992px (voir .vf-reserv { position: static } en dessous) : masque sur ordinateur, reactive en dessous ou le panneau descend hors vue. */
.vf-prix-entete { display: none; text-align: right; }
.vf-prix-entete strong { display: block; font-size: 30px; font-weight: 800; color: var(--vf-blue); line-height: 1.1; }
.vf-prix-entete span { font-size: 12.5px; color: var(--vf-muted); font-weight: 600; }

/* ---------- Galerie -------------------------------------------------------- */

/* Une grande image et, à côté, la pile des vignettes. Sans photo secondaire,
   la grande occupe toute la largeur : pas de colonne vide. */
/* Dans la colonne de gauche de .vf-corps depuis peu (voir locationsCarDetails.php) : elle n'est plus separee de .vf-bloc par le margin-top de .vf-corps, qui ne s'applique qu'une fois, en haut de la grille entiere. */
.vf-galerie { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 20px; }

/* ---------- Visite 360° --------------------------------------------------- */

.vf-360 {
  position: relative; overflow: hidden; margin-bottom: 20px;
  border-radius: 18px; background: #e7edf7; aspect-ratio: 16 / 10; max-height: 440px;
  cursor: grab; user-select: none; outline: none;
}
.vf-360:active { cursor: grabbing; }
.vf-360 img { width: 100%; height: 100%; object-fit: contain; background: #e7edf7; display: block; pointer-events: none; }
.vf-360__aide {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(9,15,28,.62); color: #fff; font-size: 12.5px; font-weight: 600;
  pointer-events: none; transition: opacity .3s ease;
}
/* La consigne ne sert qu'au premier contact : elle s'efface une fois que la
   voiture a tourné, pour ne pas rester en travers de la vue. */
.vf-360.is-parcouru .vf-360__aide { opacity: 0; }
.vf-360__compteur {
  position: absolute; top: 14px; right: 14px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(9,15,28,.55); color: #fff; font-size: 12px; font-weight: 700;
}
.vf-galerie--seule { grid-template-columns: 1fr; }
.vf-galerie__grande {
  position: relative; border-radius: 18px; overflow: hidden;
  background: #e7edf7; aspect-ratio: 16 / 10;
  /* Plafond de hauteur : sans photo secondaire, la grande occupe toute la
     largeur, et le seul rapport de forme lui donnait 750px de haut — elle
     repoussait la fiche et le formulaire sous la ligne de flottaison. */
}
/* Le lien doit occuper tout le cadre : laissé en ligne, il rendait à l'image sa
   hauteur naturelle et laissait une bande vide sous la photo. */
.vf-galerie__grande > a { display: block; width: 100%; height: 100%; }
.vf-galerie__grande img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vf-galerie__vide {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2f9, #dde6f5);
  color: #b7c7e0; font-size: 96px;
}
.vf-galerie__cote { display: grid; grid-auto-rows: 1fr; gap: 12px; }
.vf-vignette {
  display: block; border-radius: 14px; overflow: hidden; background: #e7edf7;
  position: relative;
}
.vf-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Compteur sur la dernière vignette quand la galerie en cache d'autres. */
.vf-vignette__reste {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(9,15,28,.55); color: #fff; font-size: 20px; font-weight: 800;
}
.vf-gabarit {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  padding: 5px 13px; border-radius: 999px;
  background: rgba(255,255,255,.94); color: var(--vf-navy);
  font-size: 12px; font-weight: 700;
}

/* ---------- Deux colonnes -------------------------------------------------- */

.vf-corps { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 26px; margin-top: 26px; }

.vf-bloc {
  background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: 0 2px 10px rgba(13,35,62,.08);
  margin-bottom: 20px;
}
.vf-page .vf-bloc__titre {
  margin: 0 0 16px; font-size: 18px; font-weight: 700; color: var(--vf-ink);
}

/* Caractéristiques en tuiles : plus lisibles qu'une liste à puces, et le
   pictogramme donne le sens avant même la lecture. */
.vf-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vf-spec {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 12px; background: #f4f6fa;
}
.vf-spec i { flex: 0 0 auto; font-size: 21px; color: var(--vf-blue); }
.vf-spec span { min-width: 0; font-size: 13px; font-weight: 600; color: var(--vf-ink); }
.vf-specs--vide {
  padding: 14px; border-radius: 12px; background: #fff7ed;
  color: #b45309; font-size: 13.5px; font-weight: 600;
}

.vf-texte { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--vf-body); }
.vf-texte + .vf-texte { margin-top: 10px; }

/* ---------- Carte de réservation ------------------------------------------ */

.vf-reserv { align-self: start; position: sticky; top: 20px; margin: 0; }
/* Le formulaire n'est pas la carte elle-meme : sans ce reset, un
   margin par defaut du navigateur sur <form> aurait pu ouvrir un vide
   entre le haut de .vf-reserv et le bandeau bleu (.vf-reserv__tete). */
/* margin seulement : padding:0 ici ecrasait silencieusement le padding de .vf-reserv__corps plus bas (.vf-reserv > form a une specificite plus elevee — classe + element — qui l'emporte sur la simple classe .vf-reserv__corps, quel que soit l'ordre des regles). C'est ce qui rendait tous les ajustements de rembourrage precedents invisibles : les champs collaient aux bords depuis le debut. */
.vf-reserv > form { margin: 0; }
.vf-reserv__tete {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--vf-navy), var(--vf-blue));
  color: #fff; border-radius: 18px 18px 0 0;
}
.vf-page .vf-reserv__tete h2 { margin: 0 0 3px; color: #fff; font-size: 17px; font-weight: 700; }
.vf-reserv__prix { margin: 0; font-size: 13px; color: rgba(255,255,255,.85); }
.vf-reserv__prix strong { font-size: 22px; font-weight: 800; color: #fff; }
.vf-reserv__corps {
  padding: 32px 28px 28px; background: #fff;
  border-radius: 0 0 18px 18px; box-shadow: 0 2px 10px rgba(13,35,62,.08);
}

/* Bascule Louer/Acheter : deux <form> distincts (voir locationsCarDetails.php
   pour le pourquoi — un <form> ne peut pas en contenir un autre), une seule
   visible a la fois, pilotee par [data-mode] sur .vf-reserv. Double classe
   (.vf-reserv__corps.vf-reserv__vue--achat) pour battre la regle de base
   .vf-reserv__corps quel que soit l'ordre des regles dans ce fichier. */
.vf-mode { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.16); }
.vf-mode__btn {
  padding: 8px 18px; border: 0; border-radius: 999px; background: transparent;
  color: rgba(255,255,255,.85); font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.vf-mode__btn.is-on { background: #fff; color: var(--vf-navy); }

.vf-reserv__vue--achat { display: none; }
[data-mode="achat"] .vf-reserv__vue--location { display: none; }
[data-mode="achat"] .vf-reserv__tete .vf-reserv__vue--achat { display: block; }
[data-mode="achat"] form.vf-reserv__corps.vf-reserv__vue--achat { display: block; }

.vf-champ { margin-bottom: 18px; }
.vf-page .vf-champ > label {
  display: block; margin: 0 0 6px;
  font-size: 12.5px; font-weight: 600; color: var(--vf-body);
}
/* Le champ porte son pictogramme en absolu ; la réserve de place est faite par
   le rembourrage des contrôles. */
.vf-champ__boite { position: relative; }
.vf-champ__ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  z-index: 2; pointer-events: none; font-size: 16px; color: var(--vf-muted);
}
/* Rembourrage augmenté : le texte et l'icône touchaient presque les bords de
   la boîte (38px/12px ne laissaient qu'un mince filet d'air). */
.vf-page .vf-champ input[type=text],
.vf-page .vf-champ input[type=tel],
.vf-page .vf-champ .form-control {
  width: 100%; height: 50px; box-sizing: border-box;
  background: #f7f8fa; border: 1px solid #eceef2; border-radius: 11px;
  padding: 0 18px 0 46px; font-size: 14px; color: var(--vf-ink);
  box-shadow: none;
}
.vf-page .vf-champ input:focus,
.vf-page .vf-champ .form-control:focus {
  outline: none; background: #fff;
  border-color: var(--vf-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}

/* Select2 et le sélecteur de date-heure viennent de widgets tiers : on les
   ramène à l'apparence des autres champs sans toucher à leur mécanique. Même
   rembourrage que les champs texte ci-dessus, pour un rendu identique. */
.vf-champ .select2-container { width: 100% !important; display: block; background: #f7f8fa; border-radius: 11px; }
.vf-champ .select2-container--default .select2-selection--single {
  height: 50px !important; box-sizing: border-box;
  background: #f7f8fa !important; border: 1px solid #eceef2 !important; border-radius: 11px !important;
  display: flex !important; align-items: center; padding: 0 !important;
}
.vf-champ .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: 46px !important; padding-right: 38px !important;
  line-height: 1.3 !important; color: var(--vf-ink) !important;
}
.vf-champ .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important; top: 0 !important; right: 14px !important;
}
.vf-champ .input-group { width: 100%; }
.vf-champ .input-group .form-control { border-radius: 11px !important; }
/* Les boutons calendrier/effacer du widget Krajee : masqués, la saisie se fait
   au clic dans le champ. */
.vf-champ .input-group-addon,
.vf-champ .kv-date-calendar,
.vf-champ .kv-date-remove { display: none !important; }

.vf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border: 0; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--vf-navy), var(--vf-blue)); color: #fff !important;
}
.vf-btn:hover { filter: brightness(1.08); }
.vf-note {
  margin: 12px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--vf-muted); text-align: center;
}
.vf-note i { margin-right: 4px; }

/* ---------- Largeurs intermédiaires --------------------------------------- */

@media (max-width: 991.98px) {
  .vf-corps { grid-template-columns: minmax(0, 1fr); }
  .vf-reserv { position: static; }
  .vf-prix-entete { display: block; }
  .vf-page h1.vf-titre { font-size: 26px; }
  .vf-specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .vf-conteneur { padding: 0 14px; }
  .vf-entete { padding: 14px 0 12px; }
  .vf-page h1.vf-titre { font-size: 22px; }
  .vf-prix-entete { text-align: left; }
  .vf-prix-entete strong { font-size: 24px; }
  /* La pile de vignettes passe sous la grande image, en rangée défilante. */
  .vf-galerie { grid-template-columns: 1fr; gap: 10px; }
  .vf-galerie__grande { border-radius: 14px; aspect-ratio: 4 / 3; }
  .vf-galerie__cote {
    display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  }
  .vf-galerie__cote::-webkit-scrollbar { display: none; }
  .vf-vignette { flex: 0 0 96px; height: 72px; }
  .vf-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vf-bloc { padding: 16px; border-radius: 14px; margin-bottom: 14px; }
  .vf-reserv__tete, .vf-reserv__corps { border-radius: 14px 14px 0 0; }
  .vf-reserv__corps { border-radius: 0 0 14px 14px; }
}
/* Une seule colonne réservée aux écrans vraiment étroits : à 390px, deux
   tuiles tiennent sans serrer. */
@media (max-width: 359.98px) {
  .vf-specs { grid-template-columns: minmax(0, 1fr); }
}
