/* ======================================================================
   VERSION MOBILE (iPhone 17 : 402 px de large)
   Objectif : moins de défilement. Les listes de cartes deviennent des
   carrousels qu'on fait glisser du doigt, les blocs secondaires sont resserrés.
   Chargé en dernier, uniquement sous 640 px : l'ordinateur ne change pas.
   ====================================================================== */
@media (max-width:640px){

  /* ---------- rythme général ---------- */
  .wrap,.wrap-wide{padding-left:max(18px,env(safe-area-inset-left,0px))!important;padding-right:max(18px,env(safe-area-inset-right,0px))!important}
  .sec,.calls,.funded{padding:52px 0!important}
  .sec-head{margin-bottom:22px!important;gap:12px!important}
  .sec h2,.calls h2,.funded h2,.faq-side h2{font-size:29px!important;line-height:1.1!important}
  .sec h2::after,.calls h2::after,.funded h2::after{margin-top:16px!important;width:48px!important}
  .eyebrow{margin-bottom:12px!important;font-size:11px!important;letter-spacing:.26em!important}
  .sec-head .lead{font-size:15px!important;line-height:1.55!important}

  /* ---------- vidéo : plus de bandeau « Défiler » ---------- */
  .scroll-hint{display:none!important}
  .vid-sound{transform:scale(.88);transform-origin:right bottom}

  /* ---------- héros : texte posé sur la photo au lieu d'en dessous ---------- */
  .hero3{min-height:0!important;display:block!important}
  .h3-photo{position:absolute!important;inset:0!important;width:100%!important;height:100%!important}
  .h3-photo img{object-position:22% 18%!important}
  .h3-photo::after{background:linear-gradient(0deg,#070C16 0%,rgba(7,12,22,.92) 42%,rgba(7,12,22,.35) 72%,rgba(7,12,22,.15) 100%)!important}
  .h3-in{padding-top:190px!important;padding-bottom:30px!important}
  .hero3 h1{font-size:36px!important;margin-top:12px!important}
  .hero3 p{font-size:15.5px!important;margin-top:14px!important}
  .h3-cta{margin-top:20px!important}
  .h3-cta .btn{width:100%;justify-content:center}

  /* ---------- 4 atouts : grille 2 × 2, titres seuls ---------- */
  .h3-feats-in{display:grid!important;grid-template-columns:1fr 1fr!important;gap:0!important;padding-top:0!important;padding-bottom:0!important}
  .h3-feat{padding:14px 10px!important;gap:10px!important;align-items:center!important;border:0!important}
  .h3-feat:nth-child(odd){border-right:1px solid var(--c-edge)!important}
  .h3-feat:nth-child(n+3){border-top:1px solid var(--c-edge)!important}
  .h3-feat .h3-ico{width:34px!important;height:34px!important;flex:0 0 34px}
  .h3-feat .h3-ico svg{width:17px!important;height:17px!important}
  .h3-feat b{font-size:13px!important;line-height:1.25!important}
  .h3-feat div>span{display:none!important}

  /* ---------- carrousels à faire glisser ---------- */
  .m-rail{display:flex!important;grid-template-columns:none!important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none;gap:12px!important;margin-left:-18px!important;margin-right:-18px!important;padding:14px 18px 6px!important;scroll-padding:0 18px}
  .m-rail::-webkit-scrollbar{display:none}
  /* une carte occupe presque tout l'écran, on devine seulement le bord de la suivante */
  .m-rail{gap:10px!important}
  .m-rail>*{flex:0 0 calc(100vw - 62px)!important;max-width:calc(100vw - 62px)!important;min-width:0;scroll-snap-align:start;scroll-snap-stop:always;margin:0!important}
  .m-rail>.reveal{transform:none!important}
  .m-nav{display:flex;align-items:center;justify-content:space-between;margin:12px 0 0}
  .m-dots{display:flex;gap:7px}
  .m-hint{display:inline-flex;align-items:center;gap:8px;font-size:11px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--brass-bright)}
  .m-hint svg{width:18px;height:18px;animation:mhint 1.6s ease-in-out infinite}
  .m-nav.done .m-hint{opacity:.45}
  @keyframes mhint{0%,100%{transform:translateX(0)}50%{transform:translateX(5px)}}
  .m-dots i{width:6px;height:6px;border-radius:99px;background:rgba(150,190,240,.28);transition:width .3s,background .3s}
  .m-dots i.on{width:20px;background:var(--brass)}
  .m-swipe{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:4px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#7F8EA3}

  /* salles : vignettes plus petites, deux visibles et demie */
  .rooms5 .salle{aspect-ratio:1/1.02!important}
  .rooms5 .salle img{height:100%!important}
  .rooms5 .salle b{font-size:22px!important}

  /* ---------- journée type : frise verticale compacte, sans photos ---------- */
  .sub-head{margin-top:34px!important}
  .sub-head h3{font-size:21px!important}
  .sub-head p{display:none}
  .day5{display:grid!important;grid-auto-flow:row!important;grid-template-columns:1fr!important;grid-auto-columns:auto!important;overflow:visible!important;gap:0!important;margin-top:14px!important;padding:0!important}
  .day5::before{left:21px!important;right:auto!important;top:22px!important;bottom:22px!important;width:1px!important;height:auto!important;background:linear-gradient(180deg,rgba(102,186,255,.6),rgba(102,186,255,.15))!important}
  .day5 li{display:grid!important;grid-template-columns:44px 1fr;column-gap:14px;align-items:center!important;text-align:left!important;padding:7px 0}
  .day5 li img{display:none!important}
  .day5 .d-ico,.day5 li img+.d-ico{grid-row:1/3;margin:0!important;width:42px!important;height:42px!important}
  .day5 time{grid-column:2;font-size:11.5px!important}
  .day5 b{grid-column:2;font-size:17px!important;margin:1px 0 0!important}
  .day5 p{grid-column:2;font-size:12.5px!important;max-width:none!important;line-height:1.4!important}

  /* ---------- venir au centre : bloc resserré ---------- */
  .come{padding:16px!important;gap:12px!important;margin-top:28px!important;grid-template-columns:1fr!important}
  .come-l{gap:12px!important}
  .come-door{width:40px!important;height:40px!important;border-radius:10px!important;animation:none!important}
  .come-door svg{width:20px!important;height:20px!important}
  .come .k{font-size:10.5px!important}
  .come h3{font-size:16.5px!important;max-width:none!important;margin-top:2px!important}
  .come-ways{gap:6px!important;grid-template-columns:1fr!important}
  .way{padding:0 0 0 12px!important;border:0!important;border-left:2px solid rgba(214,180,110,.45)!important;border-radius:0!important;background:none!important}
  .way b{display:inline!important;font-size:13.5px!important}
  .way b::after{content:" · "}
  .way span{font-size:13px!important;line-height:1.4!important}
  .come-call{justify-self:stretch!important;width:100%;justify-content:center;padding:9px 14px!important;gap:8px!important;border-radius:10px!important}
  .come-call .cc-ico{width:auto!important;height:auto!important;background:none!important}
  .come-call .cc-ico svg{width:16px!important;height:16px!important}
  .come-call small{display:none!important}
  .come-call b{font-size:15px!important;font-weight:700!important}
  .come-call b::before{content:"Réserver · ";font-weight:600}

  /* ---------- parcours en 3 étapes ---------- */
  .path3{margin-bottom:8px!important}
  .path3 b{font-size:13px!important}
  .path3 small{font-size:10.5px!important}
  .step-block{margin-top:34px!important}
  .step-head{margin-bottom:0!important}
  .step-head h3{font-size:22px!important}
  .step-head>p{display:none!important}

  /* cartes d'offres dans les carrousels */
  .m-rail .offer{padding:22px 20px!important}
  .m-rail .offer h3{font-size:22px!important}
  .m-rail .bigprice{font-size:34px!important}
  .m-rail .offer ul{margin:14px 0 18px!important}
  .m-rail .offer li{font-size:13.5px!important;padding:5px 0!important}
  .m-rail .btns{display:grid!important;gap:8px!important}
  .m-rail .btns .btn{width:100%;justify-content:center}
  .trio.m-rail .ig{order:-1}
  .trio.m-rail .seal{top:-10px!important;right:12px!important;transform:scale(.85)}
  .trio.m-rail .ig .tagline,.trio.m-rail .ig h3{padding-right:58px}
  .trio.m-rail{padding-top:22px!important}
  .access{margin-top:18px!important;padding:14px!important;font-size:13px!important;gap:12px!important}
  .access .ico{display:none!important}

  /* ---------- trader financé ---------- */
  .funded .sec-head .lead{display:none!important}
  .fund{padding:0!important}
  .fund-l{padding:22px 20px!important}
  .fund-l h4{font-size:21px!important}
  .fund-l p{font-size:14px!important}
  .fund-l .btn{width:100%;justify-content:center;white-space:normal;text-align:center}
  .fund-r{padding:16px 20px 20px!important;gap:10px!important}
  .fund-step b{font-size:14px!important}
  .fund-step span:not(.n){font-size:12.5px!important}

  /* ---------- services ---------- */
  .m-rail .call{padding:22px 20px!important}
  .m-rail .call .q{font-size:15px!important}
  .m-rail .call li{font-size:13.5px!important}
  .calls3.m-rail{padding-top:22px!important}

  /* ---------- témoignages : masqués tant qu'ils sont vides ---------- */
  #temoignages:not(:has(.quote:not(.is-empty))){display:none!important}

  /* ---------- équipe : lignes compactes ---------- */
  .team{gap:12px!important}
  .member{display:grid!important;grid-template-columns:84px 1fr;gap:14px;align-items:center;padding:12px!important;border:1px solid var(--c-edge);border-radius:12px;background:rgba(14,22,36,.55)}
  .member img{width:84px!important;height:96px!important;aspect-ratio:auto!important;border-radius:8px!important;object-fit:cover}
  .member span{font-size:10.5px!important;letter-spacing:.14em!important}
  .member h3{font-size:19px!important;margin:3px 0 4px!important}
  .member p{font-size:13px!important;line-height:1.45!important;margin:0!important}

  /* ---------- FAQ ---------- */
  .faq-side .lead{display:none}
  .faq details{border-radius:10px!important}
  .faq summary{font-size:15.5px!important;padding:14px 16px!important}
  .faq .ans{font-size:14px!important;padding:0 16px 14px!important}
  .faq{display:grid;gap:8px}

  /* ---------- appel final et pied de page ---------- */
  .final-card{padding:34px 20px!important}
  .final-card h2{font-size:27px!important}
  .final-act{display:grid!important;gap:10px!important}
  .final-act .btn{width:100%;justify-content:center}
  footer{padding:36px 0 110px!important}
  .foot-grid{gap:22px!important}
  .foot-partners p{display:none}
  .risk{font-size:11.5px!important;line-height:1.5!important}

  /* ---------- bouton SOS : n'apparaît qu'après le héros, au-dessus de la barre d'appel ---------- */
  .sos{right:max(14px,env(safe-area-inset-right,0px))!important;opacity:0;pointer-events:none;transform:translateY(12px);transition:opacity .35s,transform .35s,bottom .3s}
  body.past-hero .sos{opacity:1;pointer-events:auto;transform:none}
  .sos-btn{width:48px!important;height:48px!important}
}
