/* =========================
   AutoDetail — Base (global)
   Tout ce qui est commun au site (reset, typo, sections, boutons)
   Les réglages rapides (hauteurs, couleurs…) sont dans tokens.css
========================= */

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Un footer d'actions fixe est affiché en bas : on laisse la place */
  padding-bottom: var(--action-footer-h);
}

img,svg{ display:block; max-width:100%; }

a{ color: inherit; }

.container{
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Page offset (utile si un jour header en fixed).
   Sticky ne l'exige pas, mais ça évite que le hero colle trop en haut. */
main{ padding-top: 0; }

/* -------------------------
   HERO (unique, clean, premium)
------------------------- */
.hero{
  position: relative;
  min-height: var(--hero-min-h);
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--header-h) + 56px) 0 72px;
  background-repeat: no-repeat;

  /* Emboss / relief + profondeur */
    /* Emboss / relief + profondeur */
  background-image:
    radial-gradient(120% 120% at 50% 35%, rgba(120,160,255,.10), rgba(0,0,0,.88) 70%),
    linear-gradient(to bottom, rgba(0,0,0,.26), rgba(0,0,0,.70)),

    /* highlight (haut-gauche) */
    radial-gradient(60% 70% at 45% 35%, rgba(255,255,255,.18), transparent 62%),

    /* LOGO (une seule fois) */
    var(--hero-logo),

    /* shadow (bas-droite) */
    radial-gradient(70% 90% at 55% 65%, rgba(0,0,0,.06), transparent 58%);

  background-size:
    cover,
    cover,
    cover,
    var(--hero-logo-size),
    cover;
    
  background-position:
    center,
    center,
    center,
    calc(50% - var(--hero-3d)) calc(50% - var(--hero-3d)),
    center;
}
.home .hero{
  --hero-3d: 0px;
}

/* Home : réglage mobile hero (fine tuning propre) */
@media (max-width: 720px){

  /* un peu plus d'air en haut, sans changer le desktop */
  .home .hero{
    padding: calc(var(--header-h) + 12px) 0 56px;
  }

  /* on remonte tout le bloc (titre+texte+bouton) */
  .home .hero__inner{
    transform: translateY(-50px);
  }

  /* on éloigne le bouton en bas (CTA plus bas) */
  .home .hero p{
    margin-bottom: 425px;
  }
 }

/* grain subtil */
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.hero__inner{ max-width: 1100px; }
.hero__inner{ width: 100%; }

.hero h1{
  font-size: var(--h1);
  line-height: 1.02;
  margin: 0 0 16px;
  font-weight: 520;
  letter-spacing: .01em;
  text-shadow: 0 12px 40px rgba(0,0,0,.65);
}

@media (max-width: 720px) {
  .hero h1 {
    font-size: var(--h1-mobile);
    margin: 0 0 14px;
    text-align: center;
  }
}

.hero p{
  /* Un peu plus d'espace avant le CTA (bouton plus bas) */
  margin: 0 auto 36px;
  max-width: 62ch;
  font-size: var(--lead);
  color: rgba(255,255,255,.80);
  text-shadow: 0 10px 30px rgba(0,0,0,.60);
}

/* Sur les autres pages : hero neutre (pas de logo, pas de 3D) */
body:not(.home) .hero{
  /* Les pages internes n'ont pas besoin d'un hero "90vh" : on évite les grands vides */
  min-height: auto;
  /* Même rythme que Contact: plus compact, moins de scroll */
  padding: 40px 0 24px;
  background-image:
    radial-gradient(120% 120% at 50% 55%, rgba(0,0,0,.10), rgba(0,0,0,.88) 70%),
    linear-gradient(to bottom, rgba(0,0,0,.32), rgba(0,0,0,.92)) !important;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* -------------------------
   Sections
------------------------- */
.section{
  padding: var(--section-pad) 0;
}

@media (max-width: 720px){
  .section{ padding: var(--section-pad-mobile) 0; }
}

.section--dark{
  background: rgba(255,255,255,.02);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.h2{
  font-size: var(--h2);
  font-weight: 300;
  margin: 0 0 18px;
  letter-spacing: .01em;
  text-align:center;
}

.lead{
  color: var(--muted);
  text-align:center;
  max-width: 70ch;
  margin: 0 auto 48px;
}

/* Cards grid */
.grid{
  display:grid;
  gap: 24px;
}
@media (min-width: 900px){
  .grid--3{ grid-template-columns: repeat(2, 1fr); }
}
.card{
  padding: 28px 22px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
}
.card h3{
  margin: 0 0 10px;
  font-size: var(--h3);
  font-weight: 500;
  letter-spacing: .01em;
}
.card p{
  margin: 0;
  color: var(--muted);
  font-size: var(--body);
}

/* Services : titres centrés + texte un peu plus petit (B) */
.page-services .card h3{
  text-align: center;
  font-size: 22px;
}
.page-services .card{
  /* Liseret un poil plus visible pour mieux séparer les services */
  border-color: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.page-services .card p{
  text-align: center;
  font-size: 15px;
}
.page-services .card p + p{ margin-top: 6px; }

/* Services : liseret plus lisible (séparation des rubriques) */
.page-services .card{
  border-color: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

/* Réalisations : cartes avec image + label (C) */
.work-grid{ gap: 18px; }
.work-card{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.work-card__img{
  height: 180px;
  width: 100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.05) contrast(1.02);
}
.work-card__overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.72));
}
.work-card__label{
  position:absolute;
  left: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}
@media (min-width: 760px){
  .work-card__img{ height: 220px; }
}

/* -------------------------
   Buttons
------------------------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: rgba(255,255,255,.92);
  text-decoration:none;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-size: 12px;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.92); /* blanc */
  color: #000;                       /* texte noir */
  border-color: rgba(255,255,255,.92);
}


/* -------------------------
   Footer
------------------------- */
.site-footer{
  padding: 28px 0 calc(28px + var(--action-footer-h));
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: var(--small);
}
.footer__inner{
  display:flex;
  flex-wrap:wrap;
  gap: 16px;
  align-items:center;
  justify-content: space-between;
}

/* Action footer (C + H) */
.action-footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--action-footer-h);
  z-index: 9999;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;

  align-items: center;
  padding: 10px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--header-blur));
  border-top: 1px solid rgba(255,255,255,.10);
  transition: background 180ms ease;
}
.action-footer.is-scrolled{ background: var(--glass-bg-scrolled); }

.af-item{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px 10px;
  border-radius: 14px;
  text-decoration:none;

  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);

  /* Fix: certaines icônes disparaissaient selon le rendu.
     On force la couleur au niveau du lien, les SVG utilisent currentColor. */
  color: rgba(175, 215, 255, .98);
}

.af-item:hover{ background: rgba(255,255,255,.08); }

/* Icônes seules (mobile-first) + glow discret */
.af-item svg{
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  opacity: .98;
  filter: drop-shadow(0 0 10px rgba(120, 180, 255, .65));
}

/* On cache le texte (icône-only) */
.af-item span{ display:none; }
.map{
  width: min(900px, 92%);
  margin: 32px auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}

.map iframe{
  width: 100%;
  height: 300px;
  border: 0;
  display:block;
}

@media (max-width: 720px){
  .map{
    width: 92%;
    margin: 20px auto;
  }
  .map iframe{
    height: 240px;
  }
}

/* ===== Page Contact : ajustements spacing ===== */

.page-contact .hero{
  min-height: auto !important;
  padding: 120px 24px 40px !important;
}

.page-contact main{
  padding-top: 16px;
  padding-bottom: 48px;
}

.page-contact h1{
  margin-bottom: 8px;
}

.page-contact .section-subtitle{
  margin-bottom: 14px;
}

.page-contact form{
  margin-top: 12px;
}

/* Si "Formulaire" est un titre H2 */
.page-contact h2{
  margin-top: 22px;
  margin-bottom: 10px;
}

/* Pour éviter que le contenu passe sous le header fixe
   (désormais géré par main + hotfix header plus bas)
   => on NE met plus de padding-top sur body ici. */

/* Devis : textarea compacte → s’agrandit au focus (mobile) */
@media (max-width: 720px){

  /* Devis : si tu utilises une grid inline, on force 1 colonne */
  #devis-form > div{
    grid-template-columns: 1fr !important;
  }

  #devis-form textarea{
    min-height: 48px;
    max-height: 260px;
    resize: vertical;
    overflow-y: auto;
    transition: min-height 180ms ease;
  }

  #devis-form textarea:focus{
    min-height: 180px;
  }
}


@media (max-width: 720px){
  /* Mobile : on garde la densité (Contact-like) sur les pages internes
     et un hero home maîtrisé. */
  .home .hero{
    padding: calc(var(--header-h) + 18px) 0 52px;
  }
  .hero h1{
    font-size: var(--h1-mobile);
    line-height: 1.06;
    letter-spacing: 0;
  }
  .hero p{
    max-width: 38ch;
    padding: 0 10px;
  }
}

/* Lightbox / Carousel (Réalisations) */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
}
.lightbox.is-open{ display: grid; }

.lightbox__panel{
  width: min(980px, 96vw);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.lightbox__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,.88);
  font-size: 13px;
}

.lightbox__counter{
  opacity: .85;
}

.lightbox__stage{
  position: relative;
  display: grid;
  place-items: center;
}

.lightbox__img{
  max-width: 96vw;
  max-height: 78vh;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}

.lightbox__close,
.lightbox__nav{
  appearance:none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: 10px 12px;
}

.lightbox__close{ padding: 10px 12px; }

.lightbox__nav{
  display: none;
}

.lightbox__nav--prev{ left: 10px; }
.lightbox__nav--next{ right: 10px; }

.lightbox__nav:hover,
.lightbox__close:hover{ background: rgba(255,255,255,.10); }

@media (max-width: 720px){
  .lightbox{ padding: 14px; }
  .lightbox__nav{ width: 42px; height: 42px; }
}
.lightbox__img{
  width: min(920px, 96vw);
  max-height: 84vh;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
}
.lightbox__close{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  display: grid;
  place-items: center;
  cursor: pointer;
}
/* =========================
   HOTFIX HEADER (stabilité)
   - Empêche le header de "foutre le camp" au scroll
   - Garantit le burger visible au-dessus de tout
   - Corrige les titres sous le header
========================= */

/* 1) Header toujours au-dessus */
#site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20000;
  transform: translateZ(0); /* évite certains glitches mobile */
}

/* 2) Confort latéral : évite burger collé au bord (écrans arrondis) */
#site-header .container{
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

/* 3) Offset global du contenu : les titres ne passent plus sous le header */
main{
  padding-top: var(--header-h);
}

/* 4) Mobile : même logique, plus safe */
@media (max-width: 720px){
  main{
    padding-top: var(--header-h);
  }
}
@media (max-width: 720px){

  /* Services */
  body.page-services .hero p{
    max-width: none;
  }

  /* Devis */
  main.container > h1{
    text-align: center;
    padding: 0 16px;
  }
  main.container > h1 + p{
    padding: 0 16px;
  }
  #devis-form{
    padding: 0 16px;
  }
  #devis-form .btn{
    display: flex;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  /* Contact */
  body.page-contact .hero{
    text-align: center;
  }
  body.page-contact .hero p{
    max-width: none;
    white-space: nowrap;
    padding: 0 16px;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
  }
  body.page-contact .section h2{
    margin-top: 8px;
  }
}

/* ===== FIX FINAL CE SOIR — DEVIS (mobile) ===== */
@media (max-width: 720px){

  /* Le titre devis est TOUJOURS le premier h1 du main */
  main.container > h1{
    margin-top: calc(var(--header-h, 64px) + 16px) !important;
  }
}

@media (max-width: 720px) {

  /* Contact – hero mobile : alignement propre sous le header */
  body.page-contact .hero {
    min-height: auto;
    display: block;
    padding-top: 96px;   /* espace sous le header */
    padding-bottom: 24px;
  }

  body.page-contact .hero__inner {
    display: block;
    text-align: center;
  }
}
@media (max-width: 720px) {

  /* Contact – recentrer le conteneur du hero */
  body.page-contact .hero__inner {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    text-align: center;
  }

}

