/* components.css — briques réutilisables, préfixées par leur rôle */

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e-2);
  padding: var(--e-3) var(--e-6);
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: var(--r-pilule);
  background: var(--c-noir);
  color: var(--c-blanc);
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: var(--t-md);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover { transform: translateY(-2px); color: var(--c-blanc); }
.btn .point { color: var(--accent); }

.btn--orange { background: var(--accent); color: var(--c-noir); }
.btn--orange:hover { background: var(--c-orange-fonce); color: var(--c-noir); }
.btn--orange .point { color: var(--c-noir); }

.btn--blanc { background: var(--c-blanc); color: var(--c-noir); }
.btn--blanc:hover { background: var(--c-gris-2); color: var(--c-noir); }

.btn--fantome {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
}
.btn--fantome:hover { background: var(--c-noir); color: var(--c-blanc); border-color: var(--c-noir); }

.btn--large { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Titre de section ---------- */

.titre-section { text-align: center; margin-bottom: var(--e-7); }
.titre-section h2 { text-transform: uppercase; }
.titre-section p { color: var(--texte-doux); max-width: 62ch; margin-inline: auto; }
.section--sombre .titre-section p,
.section--sombre .pied__coord { color: var(--c-gris-3); }

.trait-orange {
  display: block;
  width: 64px; height: 4px;
  background: var(--accent);
  border-radius: var(--r-pilule);
  margin: var(--e-4) auto 0;
}
.trait-orange--gauche { margin-inline: 0; }

/* ---------- Carte véhicule ---------- */

.grille-vehicules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--e-5);
}

.carte-vehicule {
  display: flex;
  flex-direction: column;
  background: var(--c-blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.carte-vehicule:hover {
  transform: translateY(-4px);
  box-shadow: var(--ombre-2);
  border-color: var(--c-gris-4);
}

/* Les photos de la flotte sont en portrait (2:3 à 4:5) : le cadre suit le format
   de la source, sinon le véhicule se retrouve tranché. */
.carte-vehicule__media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--c-noir);
  overflow: hidden;
}
.carte-vehicule__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transition: transform 400ms cubic-bezier(.4, 0, .2, 1);
}
.carte-vehicule:hover .carte-vehicule__media img { transform: scale(1.04); }

.carte-vehicule__prix {
  position: absolute;
  right: var(--e-3);
  bottom: var(--e-3);
  background: var(--accent);
  color: var(--c-noir);
  padding: var(--e-2) var(--e-4);
  border-radius: var(--r-pilule);
  font-family: var(--police-titre);
  font-weight: var(--gras-titre);
  font-size: var(--t-sm);
  line-height: 1.3;
}
.carte-vehicule__prix small { font-weight: 500; font-size: .78em; }

.carte-vehicule__corps {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--e-5);
  gap: var(--e-4);
}

.etiquettes { display: flex; flex-wrap: wrap; gap: var(--e-2); }
.etiquette {
  font-size: var(--t-xs);
  font-weight: var(--gras-moyen);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--texte-doux);
  background: var(--c-gris-2);
  padding: 3px var(--e-3);
  border-radius: var(--r-pilule);
}

.carte-vehicule__nom {
  font-size: var(--t-lg);
  margin: 0;
}
.carte-vehicule__nom a { text-decoration: none; }
.carte-vehicule__nom a::after { content: ""; position: absolute; inset: 0; }
.carte-vehicule { position: relative; }

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2) var(--e-4);
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--texte-doux);
  font-size: var(--t-sm);
}
.specs li { display: flex; align-items: center; gap: 6px; margin: 0; }
.specs svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: 0 0 auto; }



/* ---------- Barre de filtres ---------- */

.filtres {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--e-4);
  align-items: end;
  background: var(--c-blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  padding: var(--e-5);
  box-shadow: var(--ombre-1);
}
.champ { display: flex; flex-direction: column; gap: var(--e-2); }
.champ > label {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: var(--t-sm);
}
.champ select, .champ input, .champ textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--e-3) var(--e-4);
  border: 1px solid var(--bordure);
  border-radius: var(--r-md);
  background: var(--c-blanc);
  transition: border-color var(--transition);
}
.champ select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317171A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px; cursor: pointer; }
.champ textarea { min-height: 140px; resize: vertical; }
.champ select:hover, .champ input:hover, .champ textarea:hover { border-color: var(--c-gris-4); }

.filtres__resultat {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--e-4);
  flex-wrap: wrap;
  color: var(--texte-doux);
  font-size: var(--t-sm);
}
.lien-raz {
  background: none;
  border: 0;
  padding: 0;
  color: var(--texte-doux);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  cursor: pointer;
}
.lien-raz:hover { color: var(--accent); }

@media (max-width: 900px) { .filtres { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .filtres { grid-template-columns: 1fr; } }

/* ---------- État vide ---------- */

.etat-vide {
  text-align: center;
  padding: var(--e-8) var(--e-5);
  border: 1px dashed var(--c-gris-4);
  border-radius: var(--r-lg);
  color: var(--texte-doux);
}
.etat-vide h3 { color: var(--texte); }

/* ---------- Avis ---------- */

.rail {
  display: flex;
  gap: var(--e-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--e-4);
  scrollbar-width: thin;
  scrollbar-color: var(--c-gris-4) transparent;
}
.rail > * {
  scroll-snap-align: start;
  flex: 0 0 clamp(260px, 78vw, 340px);
}

.carte-avis {
  background: var(--c-blanc);
  color: var(--texte);
  border-radius: var(--r-lg);
  padding: var(--e-6);
  display: flex;
  flex-direction: column;
  gap: var(--e-4);
  box-shadow: var(--ombre-1);
}
.carte-avis__etoiles { color: var(--accent); letter-spacing: 2px; font-size: var(--t-md); }
.carte-avis__texte { flex: 1; color: var(--texte-doux); }
.carte-avis__nom { font-family: var(--police-titre); font-weight: var(--gras-titre); }

/* ---------- Accordéon FAQ ---------- */

.faq { border-top: 1px solid var(--bordure); }
.faq details { border-bottom: 1px solid var(--bordure); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-4);
  padding: var(--e-5) 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: var(--t-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 14px; height: 14px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-3px);
  transition: transform var(--transition);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq__reponse { padding-bottom: var(--e-5); color: var(--texte-doux); }
.faq__reponse ul { padding-left: 1.1em; }

/* ---------- Bandeau de page ---------- */

.bandeau {
  background: var(--c-noir);
  color: var(--texte-inverse);
  padding-block: var(--e-8);
  text-align: center;
}
.bandeau h1 { margin-bottom: var(--e-3); }
.bandeau p { color: var(--c-gris-3); max-width: 70ch; margin-inline: auto; }

.fil-ariane {
  font-size: var(--t-sm);
  color: var(--c-gris-4);
  margin-bottom: var(--e-4);
}
.fil-ariane ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--e-2); padding: 0; margin: 0; justify-content: center; }
.fil-ariane li { margin: 0; }
.fil-ariane li + li::before { content: "›"; margin-right: var(--e-2); }
.fil-ariane a { text-decoration: none; }

/* ---------- Message de confirmation ---------- */

.message {
  display: flex;
  align-items: flex-start;
  gap: var(--e-3);
  padding: var(--e-4) var(--e-5);
  border-radius: var(--r-md);
  border-left: 4px solid var(--c-vert);
  background: #EFF7F1;
  color: #14532D;
}
.message--erreur { border-left-color: var(--c-rouge); background: #FDF1EF; color: #7A1508; }
.message[hidden] { display: none; }

/* ---------- Apparition au scroll ---------- */

/* Sans la classe .js (JS absent ou en échec), le contenu reste visible :
   une animation ne doit jamais pouvoir effacer une section. */
.js .apparait {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.js .apparait.est-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .apparait { opacity: 1; transform: none; }
}
@media print {
  .js .apparait { opacity: 1; transform: none; }
}

/* ---------- Étiquette de prix (motif des grands loueurs) ---------- */

.pastille {
  display: inline-block;
  margin: 0 0 var(--e-5);
  padding: var(--e-3) var(--e-5);
  background: var(--c-blanc);
  color: var(--c-noir);
  transform: skewX(-10deg);
  box-shadow: var(--ombre-2);
  text-align: left;
}
.pastille > span { display: block; transform: skewX(10deg); }
.pastille__surtitre {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-gris-5);
}
.pastille__valeur {
  font-family: var(--police-titre);
  font-weight: var(--gras-titre);
  font-size: var(--t-2xl);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--c-noir);          /* explicite : ne jamais dépendre du parent */
}
.pastille__unite {
  font-size: var(--t-xs);
  font-weight: var(--gras-moyen);
  color: var(--c-gris-5);
}
.pastille--sombre { background: var(--c-noir); color: var(--c-blanc); }
.pastille--sombre .pastille__surtitre,
.pastille--sombre .pastille__unite { color: var(--c-gris-4); }
.pastille--sombre .pastille__valeur { color: var(--accent); }

/* ---------- Ruban de remise ---------- */

.ruban-remise {
  display: inline-block;
  padding: 2px var(--e-3);
  background: var(--accent);
  color: var(--c-noir);
  border-radius: var(--r-sm);
  font-family: var(--police-titre);
  font-weight: var(--gras-titre);
  font-size: var(--t-sm);
  letter-spacing: -0.01em;
}
.carte-vehicule .ruban-remise {
  position: absolute;
  top: var(--e-3);
  left: var(--e-3);
  z-index: 1;
  box-shadow: var(--ombre-1);
}

/* ---------- Cartes d'offre ---------- */

.grille-offres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--e-5);
  margin-top: var(--e-5);
}

.offre {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--e-3);
  padding: var(--e-6) var(--e-5);
  background: var(--c-noir);
  color: var(--c-blanc);
  border-radius: var(--r-lg);
}
.offre h3 { text-transform: uppercase; font-size: var(--t-md); margin: 0; }
.offre p:not(.pastille) { color: var(--c-gris-3); font-size: var(--t-sm); flex: 1; margin: 0; }
.offre .btn { margin-top: var(--e-3); white-space: nowrap; }
.offre .btn--fantome:hover { background: var(--c-blanc); color: var(--c-noir); border-color: var(--c-blanc); }

.offre--vedette {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--accent);
  color: var(--c-noir);
}
.offre--vedette .offre__contenu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--e-4);
  padding: var(--e-8) var(--e-7);
}
.offre--vedette h3 { font-size: var(--t-2xl); }
.offre--vedette p:not(.pastille) { color: rgba(23, 23, 26, .82); font-size: var(--t-md); flex: 0; }
.offre--vedette .offre__media { aspect-ratio: 3 / 4; background: #0E0E10; }
.offre--vedette .offre__media picture { display: block; height: 100%; }
.offre--vedette .offre__media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 800px) {
  .offre--vedette { grid-template-columns: 1fr; }
  .offre--vedette .offre__contenu { padding: var(--e-6) var(--e-5); order: 1; }
  .offre--vedette .offre__media { max-height: 60vh; }
}

.ico-wa { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }

/* ---------- Bande de contact (bas de chaque page) ---------- */

.bande-contact {
  background: var(--c-noir);
  color: var(--c-blanc);
  padding-block: var(--e-7);
  border-top: 4px solid var(--accent);
}
.bande-contact .enveloppe {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-6);
  flex-wrap: wrap;
}
.bande-contact h2 { text-transform: uppercase; font-size: var(--t-xl); margin: 0 0 var(--e-2); }
.bande-contact p { color: var(--c-gris-3); margin: 0; max-width: 58ch; }
.bande-contact__actions { display: flex; gap: var(--e-3); flex-wrap: wrap; }
.bande-contact .btn--fantome:hover { background: var(--c-blanc); color: var(--c-noir); border-color: var(--c-blanc); }

/* Pied de tuile : un seul bouton, qui ouvre la conversation. */
.carte-vehicule__cta { margin-top: auto; position: relative; z-index: 1; }
.avis-limite svg { width: 16px; height: 16px; fill: none; stroke: var(--c-vert); stroke-width: 2.4; flex: 0 0 auto; }

/* Le point de marque est collé au mot : il ne doit pas hériter du gap du bouton. */
.btn .point { margin-left: calc(-1 * var(--e-2)); }

/* ---------- Bande de photos pleine largeur ---------- */

.showroom { padding-bottom: 0; }

.bande-photos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  margin-top: var(--e-6);
}

.tuile-showroom {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0E0E10;
  text-decoration: none;
}
.tuile-showroom img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.4, 0, .2, 1), filter 400ms ease;
  filter: saturate(.92) brightness(.86);
}
.tuile-showroom:hover img,
.tuile-showroom:focus-visible img { transform: scale(1.06); filter: none; }

.tuile-showroom__nom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--e-6) var(--e-4) var(--e-3);
  background: linear-gradient(180deg, transparent, rgba(23, 23, 26, .92));
  color: var(--c-blanc);
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.25;
  transform: translateY(6px);
  opacity: .88;
  transition: transform var(--transition), opacity var(--transition);
}
.tuile-showroom:hover .tuile-showroom__nom,
.tuile-showroom:focus-visible .tuile-showroom__nom { transform: none; opacity: 1; }

@media (max-width: 900px) {
  .bande-photos {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2px;
  }
  .tuile-showroom { flex: 0 0 62vw; scroll-snap-align: start; }
}

/* ---------- Carte « humaine » : un visage, puis le message ---------- */

.carte-humaine {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-noir);
  color: var(--c-blanc);
}
.carte-humaine__media { aspect-ratio: 16 / 10; background: #0E0E10; }
.carte-humaine__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
.carte-humaine__corps {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--e-4);
  padding: var(--e-6) var(--e-5);
  flex: 1;
}
.carte-humaine h3 { text-transform: uppercase; font-size: var(--t-lg); margin: 0; }
.carte-humaine p { color: var(--c-gris-3); font-size: var(--t-sm); margin: 0; flex: 1; }
.carte-humaine .btn--fantome:hover { background: var(--c-blanc); color: var(--c-noir); border-color: var(--c-blanc); }

/* ---------- Avis avec un visage ---------- */

.avis-humain {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: var(--e-8);
  align-items: center;
}
/* Sans ceci, l'élément de grille prend la largeur de son contenu (le rail)
   et la page déborde à l'horizontale sur mobile. */
.avis-humain > * { min-width: 0; }
.avis-humain h2 { text-transform: uppercase; }
.avis-humain__portrait { margin: 0; }
.avis-humain__portrait picture { display: block; border-radius: var(--r-lg); overflow: hidden; }
.avis-humain__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.avis-humain__portrait figcaption {
  margin-top: var(--e-4);
  padding-left: var(--e-4);
  border-left: 3px solid var(--accent);
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: var(--t-sm);
  color: var(--c-gris-3);
}
.rail--serre { margin-top: var(--e-5); }
.rail--serre > * { flex: 0 0 clamp(240px, 74vw, 300px); }

@media (max-width: 900px) {
  .avis-humain { grid-template-columns: 1fr; gap: var(--e-6); }
}
