/*
 * mobile.css — ia-entrepreneur.fr
 * Optimisations responsive mobile, chargé après les styles inline de chaque page.
 * Breakpoints : 900px (tablettes étroites), 768px (mobile), 480px (petits mobiles)
 */

/* ════════════════════════════════════════════
   STICKY CTA BAR — caché par défaut (desktop)
   ════════════════════════════════════════════ */
.mobile-sticky-cta { display: none; }

/* ════════════════════════════════════════════
   900px — tablettes étroites
   On cache la nav et on montre le hamburger
   dès 900px pour éviter le débordement (8 items).
   Le hero-layout collapse aussi pour cohérence.
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
  nav { display: none !important; }
  .hamburger { display: flex !important; margin-left: auto !important; }

  /* Hero homepage 2-col → 1-col quand nav hamburger */
  .hero-layout {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* ── Menu ouvert : couvre tout le fond, scroll verrouillé ── */
  body:has(.mobile-menu.open) {
    overflow: hidden !important;
  }
  .mobile-menu.open {
    position: fixed !important;
    top: 68px;
    left: 0;
    right: 0;
    /* height (pas bottom:0) : le header a un backdrop-filter, ce qui en fait
       le containing block de ce fixed enfant. bottom:0 se résoudrait alors
       par rapport à la hauteur du header (~69px) et non du viewport, et le
       menu se réduirait à une bande vide. calc(100vh - 68px) est immunisé
       contre ce piège car les unités vh restent relatives au viewport réel. */
    height: calc(100vh - 68px) !important;
    z-index: 99 !important;
    overflow-y: auto !important;
    background: rgba(255,255,255,0.98) !important;
    box-shadow: 0 8px 32px rgba(10,15,44,0.10);
  }
}

/* ════════════════════════════════════════════
   768px — mobile
   ════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ════════════════════════════════════════════
     STICKY CTA BAR — visible uniquement mobile
     ════════════════════════════════════════════ */
  .mobile-sticky-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: #10B981;
    box-shadow: 0 -3px 20px rgba(16,185,129,0.30);
    border-top: 1px solid rgba(255,255,255,0.18);
    align-items: stretch;
  }
  .mobile-sticky-cta-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 14px;
    color: #fff;
    font-family: 'Inter','Plus Jakarta Sans',sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    letter-spacing: -0.01em;
  }
  .mobile-sticky-cta-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.12);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
  }

  /* Espace pour la barre sticky */
  body { padding-bottom: 58px !important; }

  /* ════════════════════════════════════════════
     HERO SECTIONS — réduction des paddings
     ════════════════════════════════════════════ */
  .page-hero,
  .hero-apropos {
    padding-top: 36px !important;
    padding-bottom: 28px !important;
  }
  .hero-badge {
    font-size: 0.71rem !important;
    padding: 5px 11px !important;
    margin-bottom: 12px !important;
    white-space: normal !important;
  }

  /* Bannière financement — évite le débordement */
  .financement-banner {
    white-space: normal !important;
    font-size: 0.74rem !important;
    padding: 7px 12px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    line-height: 1.5 !important;
  }

  /* ════════════════════════════════════════════
     HERO TABS (formations-entreprises)
     ════════════════════════════════════════════ */
  .hero-tabs {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .hero-tab {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 14px 16px !important;
    font-size: 0.88rem !important;
  }

  /* ════════════════════════════════════════════
     GROUPES DE CTA HERO — full-width
     ════════════════════════════════════════════ */
  .hero-ctas {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .hero-ctas .btn,
  .hero-ctas a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* ════════════════════════════════════════════
     iOS ZOOM FIX — inputs min 16px
     ════════════════════════════════════════════ */
  .form-group input,
  .form-group select,
  .form-group textarea,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px !important;
  }

  /* ════════════════════════════════════════════
     BLOCS CTA FINAUX
     ════════════════════════════════════════════ */
  .cta-inner {
    padding: 32px 20px !important;
    border-radius: 16px !important;
  }
  .cta-inner h2 {
    font-size: clamp(1.2rem, 6vw, 1.5rem) !important;
    line-height: 1.3 !important;
    margin-bottom: 10px !important;
  }
  .cta-inner p {
    font-size: 0.88rem !important;
  }
  .cta-inner .btn,
  .cta-inner a.btn,
  .cta-inner > a[href] {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  .cta-note {
    font-size: 0.68rem !important;
    margin-top: 10px !important;
  }

  /* ════════════════════════════════════════════
     ESPACEMENTS SECTIONS COMMUNES
     ════════════════════════════════════════════ */
  .niveaux-section,
  .resultats-section,
  .calendar-section,
  .waiting-section,
  .financement-section,
  .entreprises-section,
  .faq-section,
  .cta-section,
  .timeline-section,
  .concerne-section,
  .offre-section {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  /* ════════════════════════════════════════════
     FAQ
     ════════════════════════════════════════════ */
  details summary {
    font-size: 0.86rem !important;
    padding: 14px 16px !important;
    gap: 10px !important;
    line-height: 1.4 !important;
  }
  .faq-answer {
    padding: 0 16px 14px !important;
    font-size: 0.84rem !important;
  }

  /* ════════════════════════════════════════════
     CARTES PROGRAMME
     ════════════════════════════════════════════ */
  .niveau-card {
    padding: 22px 18px !important;
    gap: 12px !important;
  }
  .niveau-price {
    font-size: 1.3rem !important;
  }
  .niveau-details {
    gap: 4px !important;
  }
  .niveau-detail {
    font-size: 0.7rem !important;
  }

  /* ════════════════════════════════════════════
     SECTION HEADER (label + titre + sous-titre)
     ════════════════════════════════════════════ */
  .section-title {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
    line-height: 1.25 !important;
  }
  .section-sub {
    font-size: 0.88rem !important;
  }

  /* ════════════════════════════════════════════
     BOUTON RETOUR EN HAUT
     ════════════════════════════════════════════ */
  #back-top {
    bottom: 70px !important;
    right: 14px !important;
    z-index: 499 !important;
  }

  /* ════════════════════════════════════════════
     ENCARTS MAILLAGE (border-left vert)
     ════════════════════════════════════════════ */
  [style*="border-left:4px solid #10B981"][style*="display:flex"],
  [style*="border-left:4px solid var(--accent)"][style*="display:flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  [style*="border-left:4px solid #10B981"] a[style*="background:#10B981"],
  [style*="border-left:4px solid var(--accent)"] a[style*="background:#10B981"],
  [style*="border-left:4px solid var(--accent)"] a[style*="background:var(--primary)"] {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* ════════════════════════════════════════════
     WAITING / DEVIS FORMS (intérieur)
     ════════════════════════════════════════════ */
  .waiting-inner,
  .devis-form {
    padding: 24px 18px !important;
  }

  /* ════════════════════════════════════════════
     BLOG — article hero hauteur
     ════════════════════════════════════════════ */
  .article-hero {
    height: 260px !important;
  }
  .article-hero-content {
    padding: 20px 18px !important;
  }

  /* ════════════════════════════════════════════
     BLOG — boutons footer article (stack vertical)
     ════════════════════════════════════════════ */
  .btn-accent {
    margin-left: 0 !important;
  }
  .article-footer-cta {
    padding: 28px 20px !important;
  }
  .article-footer-cta .btn-cta {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    margin: 0 0 10px !important;
  }

  /* ════════════════════════════════════════════
     IMAGES — sécurité globale
     ════════════════════════════════════════════ */
  img {
    max-width: 100% !important;
    height: auto;
  }

  /* ════════════════════════════════════════════
     SIMULATEUR — grilles choix en 1 colonne
     (.col2 couvre 461-767px phones non capturés
     par le breakpoint interne à 460px)
     ════════════════════════════════════════════ */
  .sim-page .col2,
  .sim-page .cta-pair,
  .sim-page .ef-grid {
    grid-template-columns: 1fr !important;
  }

  /* ════════════════════════════════════════════
     TABLEAUX — cellules compactes sur mobile
     ════════════════════════════════════════════ */
  table th,
  table td {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
  }

  /* ════════════════════════════════════════════
     FOOTER — touch targets 44px minimum
     ════════════════════════════════════════════ */
  .footer-links a {
    padding: 10px 8px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

}

/* ════════════════════════════════════════════
   480px — petits mobiles
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .mobile-sticky-cta-link {
    font-size: 0.86rem;
    padding: 14px 10px;
  }
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .cta-inner {
    padding: 26px 14px !important;
  }
  .page-hero {
    padding-top: 28px !important;
    padding-bottom: 20px !important;
  }
  .niveau-card {
    padding: 18px 14px !important;
  }

  /* Article hero compact sur petits écrans */
  .article-hero {
    height: 200px !important;
  }

  /* Grids en 1 colonne */
  .financement-grid,
  .pricing-grid {
    grid-template-columns: 1fr !important;
  }

  /* Titre article adapté */
  .article-title {
    font-size: 1.4rem !important;
  }

  /* Footer links pleine largeur sur très petits écrans */
  .footer-links {
    flex-direction: column !important;
    gap: 0 !important;
  }
  .footer-links a {
    width: 100% !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(10,15,44,0.06) !important;
  }
}
