/* =========================================================
   AutoBac66 — Responsive
   Points de rupture : 1200 / 1000 / 900 (menu) / 640 / 400
   ========================================================= */

/* ---------- Laptop ---------- */
@media (max-width: 1200px) {
  .nav { gap: var(--space-5); }
  .nav__list { gap: var(--space-5); }
  .split { grid-template-columns: 1fr 1fr; }
  .split__media { min-height: 320px; }
}

/* ---------- Tablette large ---------- */
@media (max-width: 1000px) {

  .steps { grid-template-columns: repeat(2, 1fr); row-gap: var(--space-6); }
  .steps::before { display: none; }

  .contact__grid { grid-template-columns: 1fr; }

  .footer__grid { grid-template-columns: repeat(3, 1fr); row-gap: var(--space-6); }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---------- Prise en charge ---------- */
@media (max-width: 1000px) {
  .coverage__layout { grid-template-columns: 1fr; }
  .coverage__text { min-height: 0; }
}

/* sur petit écran, les repères restent sur le véhicule, sans libellé */
@media (max-width: 700px) {
  .hotspot__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .hotspot__dot { width: 16px; height: 16px; }
  .coverage.is-zoomed .hotspot:not(.is-active) { opacity: 0.35; }
}

/* ---------- Menu mobile ---------- */
@media (max-width: 900px) {
  .burger { display: block; }

  .header__mobile { display: flex; }
  .nav__cta { justify-self: stretch; }

  .nav {
    display: flex;
    position: fixed;
    top: calc(100% + var(--space-2));
    left: 0;
    width: 100%;
    max-height: calc(100dvh - var(--header-h) - var(--space-5));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-3) var(--space-5) var(--space-5);
    background: rgba(18, 21, 24, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    z-index: var(--z-menu);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; font-size: var(--fs-sm); }
  .nav__list a {
    display: block;
    padding: var(--space-4) 0;
    color: var(--text-on-dark);
    border-bottom: 1px solid var(--line-dark);
  }
  .nav__list a::after { display: none; }
  .nav__list a.is-active { color: var(--color-accent); }

  .nav__cta { margin-top: var(--space-5); width: 100%; min-height: 52px; }

  body.is-menu-open { overflow: hidden; }
}

/* ---------- Tablette / mobile large ---------- */
@media (max-width: 900px) {
  .hero { min-height: 0; padding-top: calc(var(--header-h) + var(--space-8)); padding-bottom: var(--space-8); }
  .hero::after { background: linear-gradient(180deg, rgba(8, 9, 10, 0.72), rgba(8, 9, 10, 0.92)); }
  .hero__title { max-width: none; }

  .split { grid-template-columns: 1fr; }
  .split__media { min-height: 260px; }
  .split__media--right { order: 4; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  :root { --header-h: 66px; --header-h-scrolled: 66px; }

  p { max-width: none; }

  .logo__img,
  .header.is-scrolled .logo__img { width: 152px; height: 48px; }

  .hero { padding-top: calc(var(--header-h) + var(--space-7)); }
  .hero__title { font-size: clamp(2rem, 9.5vw, 2.7rem); }
  .hero__lead { max-width: none; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; min-height: 54px; }

  .hero__scroll { display: none; }
  .footer__bottom { align-items: flex-start; }

  .split__panel { padding: var(--space-7) var(--gutter); }

  .steps { grid-template-columns: 1fr; gap: var(--space-5); }
  .step { display: grid; grid-template-columns: 54px 1fr; gap: var(--space-4); text-align: left; }
  .step__icon { margin: 0; grid-row: span 2; }
  .step__title { align-self: end; }
  .step p { margin-inline: 0; max-width: none; }

  .cta__inner { flex-direction: column; align-items: stretch; }
  .cta__actions { width: 100%; flex-direction: column; }
  .cta__actions .btn { width: 100%; min-height: 54px; }

  .info__row { grid-template-columns: 1fr; gap: var(--space-1); }
  .info dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }

  .form__row { grid-template-columns: 1fr; }
  .form { padding: var(--space-5) var(--space-4); }

  .footer { padding-top: var(--space-7); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---------- Passe finale ---------- */
@media (max-width: 1200px) {
  .nav__list { gap: clamp(0.85rem, 1.6vw, 1.5rem); }
  .nav__list a { letter-spacing: 0.08em; }
  .coverage__layout { grid-template-columns: 1.4fr 1fr; }
}

@media (max-width: 1000px) {
  .finder__grid { grid-template-columns: 1fr; }
  .garage__grid {
    grid-template-columns: 1fr;
    grid-template-areas: "hero" "text" "side" "values";
  }
  .garage__side { margin-top: 0; }
  .garage__side img { height: 220px; }
}

@media (max-width: 900px) {
  /* barre d'actions rapides */
  .quickbar { display: flex; }
  body { padding-bottom: 58px; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 640px) {
  .marquee__item { font-size: var(--fs-xs); }
  .hero__meta { flex-wrap: wrap; }

  .steps::after { display: none; }
  .step { text-align: left; }

  .reviews__head { flex-direction: column; align-items: flex-start; }
  .review { padding: var(--space-4); }

  .modal__dialog { margin-top: 4vh; max-height: 88vh; }
  .footer__logo { width: 176px; height: 56px; }
}

/* ---------- Petits mobiles ---------- */
@media (max-width: 400px) {
  :root { --gutter: 1.15rem; }
  .btn { padding: 0 var(--space-4); letter-spacing: 0.06em; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Capsule & confort mobile (passe finale) ---------- */
@media (max-width: 900px) {
  :root { --header-h: 88px; --header-h-scrolled: 82px; }
  .header { padding: var(--space-2) var(--gutter); }
  .header__inner { height: 62px; padding-inline: var(--space-3) var(--space-3); gap: var(--space-3); }
  .header.is-scrolled .header__inner { height: 58px; }
  .logo__img, .header.is-scrolled .logo__img { width: 132px; height: 40px; }

  body { padding-bottom: 84px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  .coverage__layout { grid-template-columns: 1fr; gap: var(--space-5); }
  .carviz { margin-inline: calc(var(--gutter) * -0.5); }
  .carviz__frame {
    -webkit-mask-image: radial-gradient(90% 86% at 50% 50%, #000 66%, transparent 100%);
    mask-image: radial-gradient(90% 86% at 50% 50%, #000 66%, transparent 100%);
  }
  .coverage__panel { margin-top: 0; }
}

@media (max-width: 640px) {
  :root { --section-y: 3.5rem; --section-y-sm: 2.75rem; }

  .hero { min-height: 0; padding-top: calc(var(--header-h) + var(--space-6)); padding-bottom: var(--space-7); }
  .hero__title { font-size: clamp(1.9rem, 8.6vw, 2.5rem); }
  .hero__lead { font-size: var(--fs-base); }
  .hero__actions { margin-top: var(--space-5); }

  /* orientation : grille compacte, pas 7 gros boutons empilés */
  .chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .chip { min-height: 46px; padding: var(--space-2) var(--space-3); font-size: var(--fs-xs); text-align: center; }
  .finder__advice { min-height: 0; font-size: var(--fs-sm); }
  .finder__result { margin-top: var(--space-4); padding-top: var(--space-4); }
  .finder__cta { width: 100%; }

  /* contact : une seule colonne confortable */
  .contact__grid { gap: var(--space-6); }
  .contact__cta-actions .btn { width: 100%; }
  .form { padding: var(--space-4); }
  .form__row { gap: var(--space-3); }
  .field__input { min-height: 48px; }

  /* avis */
  .reviews__controls { width: 100%; justify-content: space-between; }
  .reviews::before { display: none; }

  /* modales quasi plein écran mais aérées */
  .modal__dialog {
    width: calc(100% - 1.5rem);
    margin-top: 3vh;
    max-height: 90dvh;
    padding: var(--space-6) var(--space-4) var(--space-5);
    border-radius: 16px;
  }
  .modal__close { top: var(--space-2); right: var(--space-2); }

  /* footer vertical */
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .footer__col { gap: var(--space-3); }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
}

@media (max-width: 380px) {
  .chips { grid-template-columns: 1fr 1fr; }
  .quickbar__item { font-size: 0.66rem; }
  .logo__img, .header.is-scrolled .logo__img { width: 118px; height: 36px; }
}

/* ---------- Passe WOW : mobile ---------- */
@media (max-width: 900px) {
  .coverage__layout { padding: var(--space-4); border-radius: var(--radius-xl); }
  .carviz__frame { border-radius: var(--radius-lg); }
  .garage__hero { border-radius: var(--radius-lg); }
  .garage__hero figcaption { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .review { flex-basis: calc(100% - var(--space-6)); }
}

@media (max-width: 640px) {
  .review {
    flex-basis: 86%;
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-md);
  }
  .review::before { font-size: 3.6rem; }
  .coverage__layout { padding: var(--space-3); }
  .coverage__panel { border-radius: var(--radius-md); padding: var(--space-5) var(--space-4); }
  .carviz__frame { border-radius: var(--radius-md); }
  .garage__hero, .garage__side { border-radius: var(--radius-md); }
  .garage__hero figcaption { border-radius: 0 0 var(--radius-md) var(--radius-md); }
  .form { border-radius: var(--radius-lg); }
  .modal__dialog { border-radius: var(--radius-lg); }
  .step { padding: var(--space-4) var(--space-3); }
}

/* ---------- Correctifs mobiles : header, hero, processus ---------- */
@media (max-width: 900px) {
  /* header : logo à gauche, burger tout à droite */
  .header__inner { grid-template-columns: auto 1fr; padding-inline: var(--space-4); }
  .header__mobile { justify-self: end; gap: 0; }
  .burger { margin-right: 0; }
  .burger__bar { height: 1.5px; width: 20px; left: 12px; }
}

@media (max-width: 640px) {
  /* hero : bloc de réassurance centré sous les CTA */
  .hero__inner { text-align: left; }
  .hero__meta {
    justify-content: center;
    text-align: center;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-4);
    font-size: 0.72rem;
  }
  .hero__actions { gap: var(--space-2); }
  .hero__actions .btn { min-height: 52px; border-radius: var(--radius-sm); }
  .hero__lead { margin-top: var(--space-3); }

  /* processus : timeline verticale lisible */
  .process .section__title { font-size: clamp(1.5rem, 6.4vw, 1.9rem); }
  .steps { display: block; margin-top: var(--space-6); }
  .steps::before, .steps::after { display: none; }
  .step {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: var(--space-4);
    row-gap: 0;
    align-items: start;
    padding: 0 0 var(--space-6) 0;
  }
  .step:last-child { padding-bottom: 0; }
  .step:hover { background: none; }
  .step::before {
    content: "";
    position: absolute;
    left: 23px;
    top: 52px;
    bottom: 8px;
    width: 1px;
    background: var(--line-light);
  }
  .step:last-child::before { display: none; }
  .step::after {
    content: "";
    position: absolute;
    left: 23px;
    top: 52px;
    width: 1px;
    height: 0;
    background: var(--color-accent);
    transition: height 480ms var(--ease-out);
  }
  .step.is-done::after { height: calc(100% - 60px); }
  .step__icon { width: 46px; height: 46px; }
  .step__body { padding-top: 2px; }
  .step p { max-width: none; font-size: 0.95rem; line-height: 1.6; }
  .step__title { font-size: 1.02rem; }
}

@media (prefers-reduced-motion: reduce) {
  .step::after { transition: none; }
}
