/* ============================================================================
   SEINE & MIAM — Couche MOBILE-FIRST (refonte 26/07/2026)
   Repense chaque écran pour le pouce. TOUT est sous @media(max-width:640px) :
   la version PC n'est jamais touchée, elle garde exactement son CSS d'origine.
   Chargée après le <style> inline des pages, donc gagne en cascade sur mobile.
   Un seul breakpoint principal (640px) + un cran petit-écran (380px).
   Règles : touch >= 48px, CTA en bas et pleine largeur, empilement vertical,
   typo fluide, respect des safe-areas iPhone, zéro déco qui chevauche le texte.
   ============================================================================ */

@media (max-width: 640px) {

  /* ---- Socle ---- */
  :root { --m-gap: 16px; --m-pad: 18px; }
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 1.02rem; line-height: 1.6; }
  .wrap {
    padding-left: max(var(--m-pad), env(safe-area-inset-left));
    padding-right: max(var(--m-pad), env(safe-area-inset-right));
  }
  /* Titres fluides : jamais de mot coupé, jamais de débordement */
  .disp { line-height: 1.05; }
  h1.disp, .hero h1, .mast h1 { font-size: clamp(2.1rem, 11vw, 3rem); }
  h2.disp, section h2 { font-size: clamp(1.7rem, 8vw, 2.3rem); }
  p { overflow-wrap: break-word; }

  /* ---- Zones tactiles : tout ce qui se tape fait au moins 48px ---- */
  .nav .links a.txt, .fcol a, .fbar .legal a, .hpill, .pill, .vlink {
    min-height: 44px; display: flex; align-items: center;
  }

  /* ---- Boutons : hauteur généreuse, pleine largeur dans les blocs CTA ---- */
  .btn {
    min-height: 52px; font-size: 1.02rem; border-radius: 15px;
    padding-top: 14px; padding-bottom: 14px;
  }
  .cta-row, .cta-dual, .hero-cta, .mast-cta { display: flex; flex-direction: column; gap: 12px; }
  .cta-row .btn, .cta-dual .btn, .hero-cta .btn, .mast-cta .btn { width: 100%; }

  /* ---- Nav : menu déroulant net, pleine largeur, gros liens ---- */
  header.nav .row { height: 62px; }
  header.nav .links {
    top: calc(100% + 10px); left: 12px; right: 12px; min-width: 0;
    border-radius: 20px; padding: 12px; gap: 4px;
    box-shadow: 0 18px 40px -20px rgba(43,28,18,.5), 6px 8px 0 rgba(43,28,18,.14);
  }
  header.nav .links a.txt {
    font-size: 1.05rem; padding: 13px 12px; border-radius: 12px; min-height: 50px;
    color: var(--ink); font-weight: 700;
  }
  header.nav .links a.txt:active { background: var(--cream); }
  header.nav .links .btn { min-height: 52px; margin-top: 6px; }
  .brand b { font-size: .98rem; }

  /* ---- Hero : aligné à gauche (net, lisible), CTA en pile pleine largeur ---- */
  .mast, .hero { padding-top: 20px; }
  .mast .wrap, .hero .wrap { display: block; }
  .herologo, .mastlogo { width: min(58vw, 210px); height: auto; }
  .mast .lead, .hero p.clarif, .hero .pitch { font-size: 1.05rem; }
  .mastcta { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
  .mastcta .btn { width: 100%; }
  /* La carte 3D interactive du 77 : lourde (relief + drag) et inutile au doigt sur petit écran.
     On la retire du hero mobile pour un rendu net et rapide. Elle reste intacte sur PC. */
  .mast .map3d { display: none; }
  /* Hero du club/app (centré à l'origine) : on garde le centrage, il rend bien */
  .hero .wrap { text-align: center; }
  .hero .wrap > * { margin-inline: auto; }
  .hero p { max-width: 34ch; }
  .apphint { text-align: center; }

  /* ---- Cartes de tests : une vraie carte pleine largeur, façon app food ---- */
  .testrow { grid-template-columns: 1fr !important; gap: 16px; }
  .tcard { flex-direction: row; align-items: stretch; }
  .tcard .ph { aspect-ratio: 1/1; width: 40%; min-width: 128px; border-bottom: 0; border-right: 2.5px solid var(--ink); }
  .tcard .b { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 14px 15px; }
  .tcard h3 { font-size: 1.12rem; }
  .tcard p { font-size: .88rem; margin-top: 5px; }
  .tcard .ph .n { right: 6px; bottom: 6px; }
  /* petit écran : la carte repasse en pile verticale (photo pleine largeur) */
  @media (max-width: 380px) {
    .tcard { flex-direction: column; }
    .tcard .ph { width: 100%; aspect-ratio: 16/10; border-right: 0; border-bottom: 2.5px solid var(--ink); }
  }

  /* ---- Filtres cuisine : pastilles tapables, alignées ---- */
  .tchip { padding-top: 11px; padding-bottom: 11px; min-height: 44px; display: inline-flex; align-items: center; }
  .tfilters, .pills { gap: 9px; }

  /* ---- Section "trouve ton coin" (villes) ---- */
  .vlist, .villes { gap: 9px; }

  /* ---- Bandeau app (téléphone 3D) : empilé, centré ---- */
  .appband .in { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 24px; padding: 26px 20px; }
  .appband .feats span { justify-content: flex-start; text-align: left; }
  .appband .stores { justify-content: center; width: 100%; }
  .appband .stores .store { flex: 1 1 45%; }

  /* ---- Blocs CTA fermés (final / clubteaser / appfinal) : padding réduit ---- */
  .final, .clubteaser, .appfinal { padding-left: 20px; padding-right: 20px; }

  /* ---- Footer : empilé, aéré, liens tapables (déjà en place, on renforce) ---- */
  footer { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); }
  .fgrid { grid-template-columns: 1fr; gap: 26px; }
  .fbrand { text-align: center; }
  .fbrand .flogo img { margin-inline: auto; }
  .fbrand p { margin-inline: auto; }
  .fstores { justify-content: center; }

  /* ---- Marquees : on garde la bande défilante, juste un peu plus fine ---- */
  .marq .inner { font-size: 1.1rem; }
}
