:root{
  --bg:#f8f9fb;
  --card:#fff;
  --accent:#0b63d6;
  --accent-rgb:11,99,214;
  --muted:#666;
  --text:var(--font-color);
  --background:249,250,245;
  --font-color:#282828;
  --background-dark:40,40,40;
  --font-color-dark:#f9faf5;
}
*{box-sizing:border-box}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial; background-color:rgb(var(--background)); color:var(--font-color); margin:0}
.container.header-grid{max-width:1000px;margin:0 auto;padding:0px}
.container{max-width:1000px;margin:0 auto;padding:1rem}
main.container{padding-top:2rem}
.site-header{border-bottom:1px solid #e6e9ef}
.site-header .brand{display:flex;align-items:center;justify-content:center}
.brand-logo{width:auto;height:8rem;min-height:40px;min-width:40px;object-fit:contain}
.site-header a{color:inherit;text-decoration:none}

/* Masque visuel pour éviter un halo dû à l'anti-aliasing / matte d'export */
.brand-logo{
  display:block;
  background:#fff; /* force un fond blanc derrière le logo (masque le halo) */
  border-radius:6px; /* optionnel : coins arrondis */
  box-sizing:content-box;
}

.header-grid{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:1rem}

/* S'assurer que l'alignement vertical est correct en version desktop */
@media(min-width: 701px) {
  .header-grid {
    padding-top: 0 !important;
  }

  .nav-left ul, .nav-right ul {
    align-items: center;
  }

  .site-header .brand {
    margin-bottom: 0;
  }

  .nav-left, .nav-right {
    margin-bottom: 0;
  }
}
.nav-left ul,.nav-right ul{list-style:none;margin:0;padding:0;display:flex;gap:1rem;justify-content:flex-start}
.nav-right{justify-self:end}
#en_route{font-weight:bold;font-style:italic;font-size:1.8rem}
.nav-left a,.nav-right a{color:var(--font-color);text-decoration:none;padding:.25rem .5rem;border-radius:6px;font-size:1.3rem;font-weight:500}
.nav-left a:hover,.nav-right a:hover{background:rgba(11,99,214,0.08);color:var(--accent)}

/* Sélecteur de langue avec drapeaux */
.language-selector { margin-left: 0.5rem; }

.language-flags {
  display: flex;
  gap: 8px;
  align-items: center;
}

.flag-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.flag-link:hover {
  opacity: 1;
  background: rgba(var(--accent-rgb), 0.1);
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.flag-link.active {
  opacity: 1;
  background: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 2px solid rgba(var(--accent-rgb), 0.3);
}

.flag {
  width: 20px;
  height: 14px;
  display: inline-block;
  object-fit: cover;
  border-radius: 2px;
  transition: transform 0.2s ease;
  border: 1px solid rgba(0,0,0,0.1);
}

.flag-link:hover .flag {
  transform: scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(var(--accent-rgb), 0.3);
}

.flag-link.active .flag {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.4);
  transform: scale(1.05);
}

.flag-text {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 4px;
  color: var(--text);
}

/* Version mobile compacte en haut à droite */
.mobile-top {
  display: none;
}

.mobile-flags-compact {
  display: flex;
  gap: 3px;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 4px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mobile-flags-compact .flag-link {
  padding: 2px 3px;
  border-radius: 3px;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.mobile-flags-compact .flag-link:hover {
  opacity: 1;
  transform: scale(1.1);
}

.mobile-flags-compact .flag-link.active {
  opacity: 1;
  background: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 1px 2px rgba(var(--accent-rgb), 0.3);
}

.mobile-flags-compact .flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.1);
}

.mobile-flags-compact .flag-link:hover .flag {
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(var(--accent-rgb), 0.3);
}

.mobile-flags-compact .flag-link.active .flag {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(var(--accent-rgb), 0.4);
  transform: scale(1.05);
}

/* Footer simplifié */
.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Responsive: Desktop/Mobile */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media(max-width:700px){
  .header-grid{
    grid-template-columns:1fr;
    grid-template-rows:auto auto auto;
    row-gap:0;
    text-align:center;
    grid-template-areas:
      "brand"
      "nav-left" 
      "nav-right";
    padding-top: 45px;
  }
  .site-header .brand{grid-area:brand;margin-bottom:0.75rem}
  .nav-left{grid-area:nav-left;justify-self:center;margin-bottom:0.75rem}
  .nav-right{grid-area:nav-right;justify-self:center}
  .nav-left ul,.nav-right ul{justify-content:center;flex-direction:column;align-items:center;gap:0.75rem}
}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem}

/* Variante pour forcer 2 colonnes (utilisée sur pages ventes / déjà vendu) */
.grid.grid-2{grid-template-columns:repeat(2,1fr)}

@media(min-width:700px){
    .card{padding:.5rem;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:hidden}
}
.card{position:relative}
.card img{width:100%;height:220px;object-fit:contain;display:block}
.card .card-overlay{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:center;padding:0.75rem;pointer-events:none}
.card .overlay-inner{background:linear-gradient(180deg,rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 60%);color:#fff;padding:.5rem;border-radius:6px;width:100%;transform:translateY(50%);opacity:0;transition:all .22s ease;pointer-events:auto}
.card:hover .overlay-inner{transform:translateY(0);opacity:1}
.card h2{font-size:1rem;margin:.25rem 0}
.card .meta{color:#fff;font-size:.95rem}
.overlay-title{font-size:1rem;font-weight:600;margin-bottom:.25rem}
.overlay-year{font-size:.9rem;margin-bottom:.1rem}
.overlay-price, .overlay-main-keyword{font-weight:600;font-size:1rem}
.car-top{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:center}
.car-media img{width:100%;height:360px;object-fit:cover;border-radius:6px;display:block;cursor:pointer;}
.car-detail img{width:100%;height:auto;border-radius:6px}

@media(max-width:700px){
  .grid.grid-2{grid-template-columns:1fr}
  .card{padding:.5rem;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:hidden}
}

/* Informations détaillées de la voiture */
.car-details{margin:1rem 0}
.car-details-table{
  width:50%;
  border-collapse:collapse;
  margin:1rem 0;
  margin-top: 0px;
  table-layout:fixed;
  float:left;
}
.car-details-table td{
  border:none;
  padding:0.25rem 0.5rem;
  font-size:1rem;
  color:var(--font-color);
  vertical-align:top;
  text-align:left;
  width:50%;
}
.car-details-table td:last-child{
  padding-right:0;
}
.car-details-table td:first-child{
  padding-left:0;
  text-align: right;
}
.car-year-cell{
  font-weight:500;
}
.car-km-cell{
  color:#666;
}
.car-price-cell{
  font-weight:600;
  color:#2c5d31;
}
.car-info-content{
  margin-left:0;
  padding-left:0;
  clear:both;
  margin-top:1rem;
}
.clearfix{
  clear:both;
}
.car-brand-model,.car-year-km,.car-price-keyword,.car-keyword{
  font-size:1rem;
  margin:.25rem 0;
  color:var(--font-color);
}
.car-keyword{
  font-weight: bold;
  border-radius:4px;
  font-size:0.9rem;
}
.car-description{
  margin:1rem 0;
  line-height:1.5;
  color:var(--font-color);
  font-style:italic;
}
.car-features{
  margin-top:1.5rem;
}
.car-features strong{
  color:var(--font-color);
  font-size:.95rem;
}
.features{list-style:disc;margin-left:1rem;margin-top:.5rem}

/* Section "Voir plus" */
.voir-plus-section{
  margin-top:1.5rem;
}
.voir-plus-btn{
  background:transparent;
  color:var(--muted);
  border:1px solid var(--font-color);
  padding:.3rem .5rem;
  border-radius:6px;
  cursor:pointer;
  font-size:1.5rem;
  transition:all .2s ease;
}
.voir-plus-btn:hover{
  background:#a19f92;
  color:white;
  border-color:#a19f92;
}
.description-longue-section{
  margin:2rem 0;
}
.description-longue-section p{
  line-height:1.6;
  color:var(--font-color);
  text-align:justify;
  max-width:800px;
  margin:0 auto;
}

/* Image header en pleine largeur dans la description */
.car-header-image{
  margin:1.5rem 0;
  width:100%;
}
.header-image-full{
  width:100%;
  height:400px;
  object-fit:cover;
  border-radius:8px;
  display:block;
}

.btn{display:inline-block;padding:.4rem .6rem;background:var(--accent);color:#fff;border-radius:6px;text-decoration:none}

.back-section{
  margin-bottom:0.2rem;
  margin-top:0.2rem;
}
.btn-back{
  background:transparent;
  color:var(--muted);
  border:1px solid #e6e9ef;
  padding:.3rem .5rem;
  font-size:.9rem;
  transition:all .2s ease;
}
.btn-back:hover{
  background:rgba(11,99,214,0.06);
  color:var(--accent);
  border-color:rgba(11,99,214,0.2);
}

.site-footer{padding:1rem 0;margin-top:2rem;color:var(--muted);font-size:.9rem}
.site-footer .container{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1rem}
.site-footer a{color:var(--muted);text-decoration:none}
.site-footer a:hover{color:var(--accent);text-decoration:underline}

@media(max-width:700px){
  .site-footer .container{justify-content:center;text-align:center}
  .hide-mobile{display:none}
}

@media(max-width:700px){
  .car-top{
    grid-template-columns:1fr;
    grid-template-rows:auto auto;
  }
  .car-detail{grid-template-columns:1fr}
  .card img{height:160px}
  .car-media img{height:200px}
}

.gallery-thumb{width:120px;height:80px;object-fit:contain;border-radius:6px;border:2px solid transparent;cursor:pointer;transition:transform 0.2s ease, box-shadow 0.2s ease;background:#f4f6f9}
.gallery-thumb.selected{border-color:var(--accent);box-shadow:0 2px 6px rgba(11,99,214,0.18)}
.gallery-thumb:hover{transform:scale(1.05);box-shadow:0 4px 8px rgba(0,0,0,0.15)}

/* lightbox */
.lightbox{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,0.75);z-index:1200}
.lightbox[aria-hidden="false"]{display:flex}
.lightbox .lightbox-body{max-width:90vw;max-height:90vh;display:flex;align-items:center;justify-content:center}
.lightbox img{max-width:100%;max-height:100%;border-radius:6px}
.lightbox-close,.lightbox-prev,.lightbox-next{position:fixed;background:transparent;color:#fff;border:0;font-size:2rem;padding:.5rem;cursor:pointer}
.lightbox-close{top:1rem;right:1rem}
.lightbox-prev{left:1rem;top:50%;transform:translateY(-50%)}
.lightbox-next{right:1rem;top:50%;transform:translateY(-50%)}
body.no-scroll{overflow:hidden}

/* Styles pour pages avec images hero (accueil + autres) */
.home-page .site-header,
.hero-page .site-header{
  position:absolute;
  top:0;
  left:0;
  right:0;
  z-index:10;
  /*background:rgba(var(--background),0.7);*/
  border-bottom:1px solid rgba(230,233,239,0.6);
}

@Media(min-width:700px){
    .home-page .site-header,
    .hero-page .site-header{
      background:rgba(var(--background),0.7);
    }
}

.home-page main,
.hero-page main{
  padding-top:0;
}

/* Correction pour mobile sur pages avec hero */
@media(max-width:700px){
  .home-page .site-header,
  .hero-page .site-header{
    position:static !important;
    /*background:rgb(var(--background)) !important;*/
    /*border-bottom:1px solid #e6e9ef !important;*/
    z-index:auto !important;
  }
  
  .home-page .hero-image,
  .hero-page .hero-image{
    margin-top:-1rem;
  }
  
  .home-page main,
  .hero-page main{
    padding-top:1rem;
  }
  
  /* Image header responsive sur mobile */
  .header-image-full{
    height:250px;
  }
}

/* Image d'en-tête hero - commune à toutes les pages */
.hero-image{
  width:100vw;
  position:relative;
  left:50%;
  right:50%;
  margin-left:-50vw;
  margin-right:-50vw;
  margin-bottom:2rem;
  margin-top:0; /* Toutes les images commencent en haut */
}
.hero-img{
  width:100%;
  height:auto;
  object-fit:contain;
  display:block;
  background:var(--bg);
}

/* Section de présentation */
.presentation{margin:2rem 0}
.presentation-content{max-width:800px;margin:0 auto;text-align:center}
.presentation-content h2{color:var(--font-color);margin-bottom:1.5rem;font-size:1.8rem}
.presentation-content p{line-height:1.6;margin-bottom:1rem;color:var(--font-color);font-size:1.05rem}

/* Section des services */
.services{margin:2rem 0}
.services-content{max-width:800px;margin:0 auto;text-align:left}
.services-content p{line-height:1.7;margin-bottom:1.5rem;color:var(--font-color);font-size:1.05rem;text-align:justify}

/* Sections de présentation par langue */
.presentation-fr,
.presentation-en {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.presentation-fr h2,
.presentation-en h2 {
  color: var(--font-color);
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  font-size: 1.6rem;
  text-align: center;
}

.presentation-fr h2:first-child,
.presentation-en h2:first-child {
  margin-top: 0;
}

.presentation-fr p,
.presentation-en p {
  line-height: 1.7;
  margin-bottom: 1.2rem;
  color: var(--font-color);
  font-size: 1.05rem;
  text-align: justify;
}

.presentation-fr ul,
.presentation-en ul {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.presentation-fr li,
.presentation-en li {
  line-height: 1.6;
  margin-bottom: 0.5rem;
  color: var(--font-color);
  font-size: 1.05rem;
}

/* Page des mentions légales */
.legal-content{max-width:800px;margin:0 auto}
.legal-content h1{color:var(--font-color);margin-bottom:2rem;font-size:2rem;text-align:center}
.legal-content h2{color:var(--font-color);margin-top:2rem;margin-bottom:1rem;font-size:1.4rem;border-bottom:1px solid #e6e9ef;padding-bottom:.5rem}
.legal-content p{line-height:1.6;margin-bottom:1rem;color:var(--font-color)}
.legal-content strong{color:var(--font-color)}

/* Flèche de défilement pour les pages hero */
.scroll-down-arrow {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  color: var(--accent);
  transition: all 0.3s ease;
  animation: bounce 2s infinite;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-down-arrow:hover {
  background: var(--accent);
  color: white;
  transform: translateX(-50%) scale(1.1);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@media (max-width: 700px) {
  .scroll-down-arrow {
    bottom: 20px;
    width: 45px;
    height: 45px;
  }
}

/* séparateur de section : ligne avec texte centré */
.section-divider{display:flex;align-items:center;gap:1rem;margin:2rem 0;color:var(--muted)}
.section-divider:before,.section-divider:after{content:'';flex:1;height:1px;background:var(--muted)}
.section-divider span{padding:.25rem .75rem;background:var(--bg);border-radius:999px;font-weight:600}

/* Formulaire de contact */
.contact-page{max-width:800px;margin:0 auto;padding:1rem}
.contact-content{margin-top:2rem}
.contact-info{margin-bottom:2rem;text-align:center}
.contact-info h3{color:var(--font-color);margin-bottom:1rem;font-size:1.5rem}
.contact-info p{color:#666;font-size:1.1rem;line-height:1.6}
p.contact-phone-info{font-size:1.2rem;color:#777;margin-top:0.25rem;display:flex;align-items:center;justify-content:center;gap:0.5rem}
img.contact-phone-icon{height: 1.5em;vertical-align:middle}
img.contact-whatsapp-icon{height: 2.5em;vertical-align:middle}
img.contact-whatsapp-icon-mobile{height: 4em;vertical-align:middle}
.contact-form{background:rgb(var(--background));padding:2rem;border-radius:8px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}
.form-group{display:flex;flex-direction:column}
.form-group label{font-weight:600;margin-bottom:0.5rem;color:#333}
.form-group input,.form-group textarea{padding:0.75rem;border:1px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color 0.2s}
.form-group input:focus,.form-group textarea:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 2px rgba(0,123,255,0.25)}
.required{color:#dc3545;font-size:0.9rem}
.contact-submit{background:#007bff;color:white;padding:0.75rem 1.5rem;border:none;border-radius:4px;font-size:1rem;font-weight:600;cursor:pointer;transition:background-color 0.2s;margin-top:1rem}
.contact-submit:hover{background:#0056b3}
.alert{padding:1rem;border-radius:4px;margin:1rem 0;font-weight:500}
.alert-success{background:#d4edda;color:#155724;border:1px solid #c3e6cb}
.alert-error{background:#f8d7da;color:#721c24;border:1px solid #f5c6cb}

/* Media queries pour le sélecteur de langue */
@media(max-width: 700px) {
  /* Masquer le sélecteur de langue du header desktop en mobile */
  .language-selector.desktop-only {
    display: none !important;
  }
  
  /* Afficher le sélecteur compact en haut à droite en mobile */
  .mobile-top {
    display: block !important;
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 100;
  }
  
  /* S'assurer que le header a une position relative */
  .site-header {
    position: relative;
  }
  
  /* Ajuster le header grid pour laisser place aux drapeaux */
  .header-grid {
    padding-top: 35px;
  }
  
  /* Tableau car-details responsive */
  .car-details-table{
    width:100%;
    float:none;
    margin-bottom:1rem;
  }
  .car-details-table td{
    padding:0.2rem 0.3rem;
    font-size:0.95rem;
  }
  .car-keyword{
    font-size:0.8rem;
  }
  .car-info-content{
    margin-left:0;
    padding-left:0;
  }
  
  /* Formulaire de contact responsive */
  .contact-page{padding:0.5rem}
  .contact-form{padding:1rem}
  .form-row{grid-template-columns:1fr;gap:0.5rem}
  .contact-submit{width:100%}
  
  /* Formulaire de contact - une seule colonne en mobile */
  .contact-form .form-row {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .contact-form .form-group {
    width: 100%;
  }

  /* Footer simplifié */
  .footer-content {
    justify-content: center;
    text-align: center;
  }

  /* Affichage conditionnel des éléments téléphone en mobile */
  p.contact-phone-web {
    display: none !important;
  }

  p.contact-phone-mobile {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  p.contact-phone-mobile img.contact-phone-icon {
    margin-bottom: 0.25rem;
  }

  p.contact-phone-mobile span {
    text-align: center;
    margin-bottom: 0.25rem;
  }

  p.contact-phone-mobile strong {
    text-align: center;
    font-size: 1.1em;
  }

  /* Formulaire de contact responsive - nouvelle section */
  .contact-form .form-row {
    grid-template-columns: 1fr !important;
  }

  .contact-content {
    padding: 1rem;
  }

  /* Section divider sans couleur de fond en mobile */
  .section-divider span,
   filter-toggle-section,
    filter-toggle-btn {
    background: transparent !important;
  }
}

/* ========================================
   FORMULAIRE DE CONTACT ET RECAPTCHA
======================================== */

/* Page de contact */
.contact-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.contact-content {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.contact-info {
  margin-bottom: 2rem;
  text-align: center;
}

.contact-info h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.contact-info p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.contact-phone-info {
  background: rgb(var(--background));
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Affichage conditionnel des éléments téléphone selon la version */
p.contact-phone-web {
  display: block;
}

p.contact-phone-mobile {
  display: none;
}

/* Formulaire de contact */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.required {
  color: #dc3545;
  font-weight: normal;
  font-size: 0.85rem;
}

/* Bouton de soumission */
.contact-submit {
  background: var(--accent);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  align-self: flex-start;
}

.contact-submit:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
  transform: translateY(-1px);
}

.contact-submit:active {
  transform: translateY(0);
}

/* Messages d'alerte */
.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-success {
  background: #d1edff;
  color: #0066cc;
  border: 1px solid #b3d9ff;
}

.alert-error {
  background: #ffe6e6;
  color: #cc0000;
  border: 1px solid #ffb3b3;
}

/* ========================================
   STYLES RECAPTCHA V2
======================================== */

.recaptcha-container {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Widget reCAPTCHA */
.g-recaptcha {
  margin-bottom: 0.5rem;
}

/* Erreurs reCAPTCHA */
.recaptcha-error {
  color: #dc3545;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 4px;
  display: block;
}

/* Responsive reCAPTCHA */
@media (max-width: 480px) {
  /* Transform standard reCAPTCHA pour mobile */
  .g-recaptcha {
    transform: scale(0.77);
    transform-origin: 0 0;
    margin-right: -56px; /* Compenser la réduction d'échelle */
  }
  
  .recaptcha-container {
    overflow: hidden; /* Éviter le débordement horizontal */
  }
}

/* Styles pour le filtrage par marque */
.filter-toggle-section {
  margin: 1rem 0;
  text-align: center;
}

.filter-toggle-btn {
  /*background: var(--card);*/
  border: 2px solid #e6e9ef;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--text);
}

.filter-toggle-btn:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.filter-toggle-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-toggle-btn .filter-arrow {
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.filter-toggle-btn.active .filter-arrow {
  transform: rotate(180deg);
}

.filter-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.filter-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-label {
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.brand-select, .brand-search {
  padding: 0.75rem 1rem;
  border: 2px solid #e6e9ef;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  transition: all 0.2s ease;
  min-width: 200px;
}

.brand-select:focus, .brand-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.brand-search::placeholder {
  color: var(--muted);
}

.clear-filters-btn {
  padding: 0.75rem 1rem;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.clear-filters-btn:hover {
  background: #e55555;
  transform: translateY(-1px);
}

.filter-stats {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.filter-stats span {
  color: var(--accent);
  font-weight: 600;
}

/* Animation pour les voitures filtrées */
.car-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.car-item[style*="display: none"] {
  opacity: 0;
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .brand-select, .brand-search {
    min-width: auto;
    width: 100%;
  }
  
  .filter-section {
    margin: 1rem 0;
    padding: 1rem;
  }
  
  .filter-toggle-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* ========================================
   MODE SOMBRE / DARK MODE
======================================== */

/* Bouton de basculement du mode sombre */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 1rem;
}

.theme-toggle-btn {
  position: relative;
  width: 50px;
  height: 24px;
  background: #e6e9ef;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.theme-toggle-btn::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-toggle-btn.active {
  background: var(--accent);
}

.theme-toggle-btn.active::before {
  transform: translateX(26px);
}

.theme-icon {
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.theme-toggle:hover .theme-icon {
  opacity: 1;
}

/* Mode sombre activé */
body.dark-mode {
  --background: var(--background-dark);
  --font-color: var(--font-color-dark);
  --text: var(--font-color-dark);
  --card: #2a2a2a;
  --bg: #1a1a1a;
  --muted: #9ca3af;
}

body.dark-mode .site-header {
  background: rgb(var(--background-dark));
  border-bottom-color: #404040;
}

body.dark-mode .card {
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

body.dark-mode .brand-logo {
  background: #2a2a2a;
}

body.dark-mode .filter-section,
body.dark-mode .contact-content {
  background: var(--card);
  border-color: #404040;
}

body.dark-mode .brand-select,
body.dark-mode .brand-search,
body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
  background: #2a2a2a;
  border-color: #404040;
  color: var(--font-color-dark);
}

body.dark-mode .filter-toggle-btn {
  background: var(--card);
  border-color: #404040;
  color: var(--font-color-dark);
}

/* Mobile - Version compacte du bouton mode sombre */
.mobile-theme-toggle {
  display: none;
  position: absolute;
  top: 10px;
  left: 15px;
  z-index: 100;
}

.mobile-theme-toggle .theme-toggle-btn {
  width: 40px;
  height: 20px;
  border-radius: 10px;
}

.mobile-theme-toggle .theme-toggle-btn::before {
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
}

.mobile-theme-toggle .theme-toggle-btn.active::before {
  transform: translateX(20px);
}

.mobile-theme-toggle .theme-icon {
  display: none;
}

/* Responsive */
@media(max-width: 700px) {
  .theme-toggle.desktop-only {
    display: none !important;
  }

  .mobile-theme-toggle {
    display: block !important;
  }

  /* Réajuster le padding pour faire place aux deux boutons */
  .header-grid {
    padding-top: 45px;
  }

  /* Image de fond mobile */
  body {
    background-image: url('/images/background-mobile.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
  }
  
  /* Assurer que le contenu reste visible par-dessus l'image de fond */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--background), 0.90);
    z-index: -1;
    pointer-events: none;
  }
  
  /* S'assurer que les éléments principaux ont un z-index approprié */
  .site-header,
  main.container,
  .site-footer {
    position: relative;
    z-index: 1;
  }
}

body {
    background-image: url('/images/background-mobile.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
  }

  /* Assurer que le contenu reste visible par-dessus l'image de fond */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--background), 0.90);
    z-index: -1;
    pointer-events: none;
  }

  /* S'assurer que les éléments principaux ont un z-index approprié */
  .site-header,
  main.container,
  .site-footer {
    position: relative;
    z-index: 1;
  }

/* Informations techniques de la voiture */
.car-technical-info {
  background: rgba(0,0,0,0.05);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.tech-info-item {
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.tech-info-item:last-child {
  border-bottom: none;
}

.tech-info-item strong {
  color: var(--font-color);
  font-weight: 500;
  flex: 1;
}

.tech-info-item .price-info strong {
  color: #2c5d31;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Version mobile */
@media (max-width: 700px) {
  .tech-info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .car-technical-info {
    font-size: 0.9rem;
    display:grid;
    grid-template-columns: 1fr 1fr;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ========================================
   STYLES POUR LA PAGE DES ACTUALITÉS
======================================== */

.news-page {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.news-empty {
  text-align: center;
  padding: 3rem;
  color: #666;
  font-style: italic;
}

.news-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.news-article {
  margin-bottom: 2rem;
}

.news-content {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  align-items: start;
}

.news-image {
  width: 250px;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-text {
  flex: 1;
}

.news-header {
  margin-bottom: 1rem;
}

.news-title {
  font-size: 1.5rem;
  color: #333;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.news-date {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
  font-style: italic;
}

.news-body {
  line-height: 1.6;
}

.news-excerpt, .news-full p {
  color: #444;
  margin: 0 0 1rem 0;
}

.news-toggle-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.news-toggle-btn:hover {
  background: #0056b3;
}

.news-full-content {
  margin-top: 1rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.news-full-text {
  line-height: 1.7;
  color: #333;
}

.news-full-text p {
  margin: 0;
  text-align: justify;
}

.news-separator {
  border: none;
  height: 1px;
  background-color: var(--muted);
  margin: 2rem 0;
}

/* Styles pour le comportement de clic */
.news-article:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.news-read-more {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: inline-block;
}

.news-article:hover .news-read-more {
  text-decoration: underline;
}

/* Responsive pour les actualités */
@media (max-width: 768px) {
  .news-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .news-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .news-title {
    font-size: 1.25rem;
  }

  .news-page {
    padding: 0 0.5rem;
  }
}

/* ========================================
   STYLES POUR LE DÉTAIL D'UNE ACTUALITÉ
======================================== */

.news-detail-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.news-detail-header {
  text-align: center;
  margin-bottom: 3rem;
}

.news-detail-title {
  font-size: 2rem;
  color: var(--font-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.news-detail-date {
  color: var(--muted);
  font-size: 1.1rem;
  font-style: italic;
}

.news-detail-content {
  margin-bottom: 3rem;
}

.news-paragraph {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.news-paragraph:not(:last-child) {
  border-bottom: 1px solid #e6e9ef;
}

.news-paragraph.media-left {
  grid-template-areas: "media text";
}

.news-paragraph.media-right {
  grid-template-areas: "text media";
}

.news-paragraph.media-left .paragraph-media {
  grid-area: media;
}

.news-paragraph.media-left .paragraph-text {
  grid-area: text;
}

.news-paragraph.media-right .paragraph-media {
  grid-area: media;
}

.news-paragraph.media-right .paragraph-text {
  grid-area: text;
}

.paragraph-image, .paragraph-video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.paragraph-image {
  object-fit: cover;
  max-height: 300px;
}

.paragraph-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--font-color);
  text-align: justify;
}

.news-detail-footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid #e6e9ef;
}

.btn-back {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--accent);
  color: white;
}

/* Responsive pour le détail des actualités */
@media (max-width: 768px) {
  .news-paragraph {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "media"
      "text" !important;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .news-detail-title {
    font-size: 1.5rem;
  }

  .paragraph-text p {
    font-size: 1rem;
    text-align: justify;
  }

  .paragraph-image {
    max-height: 200px;
  }
}

