/* =========================================================
   LP campagne 1126 – ajouts conversion (custom.css)
   ========================================================= */

/* ---------- 1. Sélecteur de modèles ---------- */
/* Toutes tailles : le wrapper doit occuper toute la largeur
   (sinon, sur desktop, il se réduit à la largeur des cartes et elles se collent) */
.lp-vehicles {
  width: 100%;
}

/* Mobile : 2 véhicules par ligne */
/* Le wrapper .lp-vehicles regroupe les 2 blocs .lp-buttonimg-con existants.
   En mobile, les blocs "disparaissent" (display:contents) et toutes les cartes
   se rangent dans une seule grille de 2 colonnes, alignée à gauche.
   Le desktop n'est pas modifié. */
@media screen and (max-width: 479px) {
  .lp-vehicles {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    margin-bottom: 10px;
  }
  .lp-vehicles .lp-buttonimg-con {
    display: contents;
  }
  .lp-vehicles .lp-button-img {
    width: calc(50% - 6px);
    height: auto;
    margin: 0;
    padding: 8px;
  }
  .lp-vehicles .lp-button-visual {
    width: 100%;
    height: auto;
    margin-top: 2px;
  }
  .lp-vehicles .lp-button-t1 {
    font-size: 14px;
    line-height: 17px;
    margin-top: 6px;
  }
}

/* Espace au-dessus des cartes quand on y scrolle */
#choix-modele {
  scroll-margin-top: 20px;
}

/* ---------- 2. Flèche courbe qui se dessine (commune desktop + mobile) ---------- */
.lp-arrow {
  display: block;
  color: #FC001F; /* couleur du trait */
  overflow: visible;
}
.lp-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;   /* les paths ont pathLength="1" */
  stroke-dashoffset: 1;  /* invisible au départ */
}
/* Le trait se dessine, puis la pointe, pause, fondu, et ça recommence */
.lp-arrow .lp-arrow-body {
  animation: lpDrawBody 3s ease-in-out infinite;
}
.lp-arrow .lp-arrow-head {
  animation: lpDrawHead 3s ease-out infinite;
}
@keyframes lpDrawBody {
  0%   { stroke-dashoffset: 1; opacity: 1; }
  35%  { stroke-dashoffset: 0; opacity: 1; }
  85%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes lpDrawHead {
  0%, 33% { stroke-dashoffset: 1; opacity: 1; }
  45%     { stroke-dashoffset: 0; opacity: 1; }
  85%     { stroke-dashoffset: 0; opacity: 1; }
  100%    { stroke-dashoffset: 0; opacity: 0; }
}

/* Desktop : flèche sous le titre, qui pointe vers les modèles */
.lp-scroll-hint {
  display: block;
  width: 64px;
  margin: 6px auto 0;
}
.lp-scroll-hint .lp-arrow {
  width: 100%;
  height: auto;
}

/* ---------- 3. Mobile : bouton fixe "Je choisis mon modèle" ---------- */
.lp-sticky-cta {
  display: none; /* caché hors mobile */
}

@media screen and (max-width: 479px) {
  /* En mobile, la flèche sous le titre est remplacée par celle du bouton fixe */
  .lp-scroll-hint {
    display: none;
  }

  .lp-sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    padding: 46px 16px calc(14px + env(safe-area-inset-bottom));
    /* léger dégradé pour détacher le bouton du contenu */
    background: linear-gradient(to bottom, rgba(246, 247, 247, 0) 0%, rgba(246, 247, 247, .95) 45%);
    pointer-events: none; /* seul le bouton est cliquable */
    /* état initial : caché, le JS ajoute .is-visible au chargement */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .45s ease, transform .45s ease;
  }
  .lp-sticky-cta.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .lp-sticky-cta:not(.is-visible) .lp-sticky-cta-btn {
    pointer-events: none;
  }
  .lp-sticky-cta.is-gone {
    display: none;
  }

  /* Flèche posée au-dessus du bouton, qui descend vers lui */
  .lp-sticky-cta .lp-arrow {
    position: absolute;
    left: 14%;
    top: 2px;
    width: 50px;
    height: auto;
  }

  .lp-sticky-cta-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border: 0;
    border-radius: 999px;
    background: #FC001F;
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(252, 0, 31, .35);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .lp-sticky-cta-btn:active {
    transform: scale(.98);
  }
  .lp-sticky-cta-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Accessibilité : pas d'animation si l'utilisateur l'a désactivée */
@media (prefers-reduced-motion: reduce) {
  .lp-arrow path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .lp-sticky-cta {
    transition: none;
  }
}