:root{
  --bg:#f8f9fb;
  --card:#fff;
  --accent:#0b63d6;
  --accent-rgb:11,99,214;
  --muted:#666;
  --text:#222;
}
*{box-sizing:border-box}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial; background:var(--bg); color:#222; 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{background:#fff; 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}
.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}
.nav-left a,.nav-right a{color:var(--muted);text-decoration:none;padding:.25rem .5rem;border-radius:6px}
.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 {
  font-size: 1.2rem;
  display: inline-block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
  transition: transform 0.2s ease;
}

.flag-link:hover .flag {
  transform: scale(1.1);
}

.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 {
  font-size: 0.85rem;
}

/* 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";
  }
  .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(max-width:700px){
  .grid.grid-2{grid-template-columns:1fr}
}
.card{background:var(--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:cover;background:#f4f6f9;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:start}
.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}

/* 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:#444;
  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:#444;
}
.car-keyword{
  font-weight: bold;
  border-radius:4px;
  font-size:0.9rem;
}
.car-description{
  margin:1rem 0;
  line-height:1.5;
  color:#444;
  font-style:italic;
}
.car-features{
  margin-top:1.5rem;
}
.car-features strong{
  color:#222;
  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 #e6e9ef;
  padding:.3rem .5rem;
  border-radius:6px;
  cursor:pointer;
  font-size:.9rem;
  transition:all .2s ease;
}
.voir-plus-btn:hover{
  background:rgba(11,99,214,0.06);
  color:var(--accent);
  border-color:rgba(11,99,214,0.2);
}
.description-longue-section{
  margin:2rem 0;
}
.description-longue-section p{
  line-height:1.6;
  color:#444;
  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:cover;border-radius:6px;border:2px solid transparent}
.gallery-thumb.selected{border-color:var(--accent);box-shadow:0 2px 6px rgba(11,99,214,0.18)}

/* 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(255,255,255,0.7);
  border-bottom:1px solid rgba(230,233,239,0.6);
}

.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:#fff !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:#222;margin-bottom:1.5rem;font-size:1.8rem}
.presentation-content p{line-height:1.6;margin-bottom:1rem;color:#444;font-size:1.05rem}

/* Page des mentions légales */
.legal-content{max-width:800px;margin:0 auto}
.legal-content h1{color:#222;margin-bottom:2rem;font-size:2rem;text-align:center}
.legal-content h2{color:#222;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:#444}
.legal-content strong{color:#222}

/* 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:#222;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:0.85rem;color:#777;margin-top:0.25rem}
.contact-form{background:#f8f9fa;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%}
  
  /* Footer simplifié */
  .footer-content {
    justify-content: center;
    text-align: center;
  }
}

/* ========================================
   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: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--accent);
}

/* 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 */
  }
}
