/* ================================================================
   ERdigIA — RESPONSIVE v2.0
   ================================================================ */

/* ── HEADER ── */
@media (max-width: 900px) {
  #er-hamburger { display: flex !important; }
  #er-header nav { display: none !important; }
  #er-cta-btn { display: none !important; }
}

/* ── UTILITAIRES RESPONSIVE ── */
@media (max-width: 900px) {
  .er-footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .er-footer-inner { padding: 48px 24px 32px !important; }
}
@media (max-width: 580px) {
  .er-footer-grid { grid-template-columns: 1fr !important; }
}

/* ── BODY CLASSES ajoutées par responsive.js ── */

/* Tablet */
body.er-tablet section,
body.er-mobile section {
  padding-left: 0;
  padding-right: 0;
}

/* Mobile : toutes les grilles passent en 1 colonne */
body.er-mobile [style*="display:grid"] {
  grid-template-columns: 1fr !important;
  gap: 16px !important;
}

/* Mobile : exceptions pour garder 2 colonnes sur certains petits éléments */
body.er-mobile .er-footer-grid { grid-template-columns: 1fr !important; }
body.er-mobile .sim-option-group { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
body.er-mobile .erform-choices { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }

/* Tablet : grilles 3-4 colonnes → 2 */
body.er-tablet [style*="grid-template-columns:repeat(3,1fr)"],
body.er-tablet [style*="grid-template-columns:repeat(4,1fr)"] {
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
}
body.er-tablet [style*="grid-template-columns:repeat(3, 1fr)"],
body.er-tablet [style*="grid-template-columns:repeat(4, 1fr)"] {
  grid-template-columns: 1fr 1fr !important;
}

/* Mobile : toutes les grilles repeat → 1 colonne */
body.er-mobile [style*="grid-template-columns:repeat(2,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(3,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(4,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(2, 1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(3, 1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(4, 1fr)"],
body.er-mobile [style*="grid-template-columns:1fr 1fr"],
body.er-mobile [style*="grid-template-columns:1.1fr 0.9fr"],
body.er-mobile [style*="grid-template-columns:360px 1fr"],
body.er-mobile [style*="grid-template-columns:2fr 1fr"] {
  grid-template-columns: 1fr !important;
  gap: 20px !important;
}

/* Mobile : padding containers */
body.er-mobile [style*="padding:0 48px"],
body.er-mobile [style*="padding: 0 48px"] {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Tablet : padding containers */
body.er-tablet [style*="padding:0 48px"],
body.er-tablet [style*="padding: 0 48px"] {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* Mobile : sections padding */
body.er-mobile section[style*="padding:90px"],
body.er-mobile section[style*="padding:100px"],
body.er-mobile section[style*="padding:110px"],
body.er-mobile section[style*="padding:120px"] {
  padding-top: 52px !important;
  padding-bottom: 52px !important;
}

/* Mobile : hero padding */
body.er-mobile section[style*="padding:90px 0 70px"],
body.er-mobile section[style*="padding:100px 0 80px"] {
  padding-top: 44px !important;
  padding-bottom: 36px !important;
}

/* Mobile : cacher badges flottants hero */
body.er-mobile [style*="bottom:60px;left:-20px"],
body.er-mobile [style*="top:70px;right:-20px"],
body.er-mobile [style*="bottom:-12px;right:-12px"],
body.er-mobile [style*="top:-12px;left:-12px"] {
  display: none !important;
}

/* Mobile : titres h1 */
body.er-mobile h1 { font-size: clamp(1.9rem, 8vw, 1rem) !important; }
body.er-mobile h2 { font-size: clamp(1.5rem, 6vw, 2rem) !important; }

/* Mobile : Simulateurs options → 2 colonnes */
body.er-mobile [style*="grid-template-columns:repeat(auto-fill,minmax(175px,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(auto-fill,minmax(160px,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(auto-fill,minmax(150px,1fr)"] {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

/* Mobile : Simulateurs "Ce qui est inclus" → 1 colonne */
body.er-mobile [style*="grid-template-columns:repeat(auto-fill,minmax(260px,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(auto-fill,minmax(280px,1fr)"],
body.er-mobile [style*="grid-template-columns:repeat(auto-fill,minmax(340px,1fr)"] {
  grid-template-columns: 1fr !important;
}

/* Mobile : formulaires 2 colonnes → 1 */
body.er-mobile [style*="grid-template-columns:1fr 1fr;gap:14"],
body.er-mobile [style*="grid-template-columns:1fr 1fr;gap:14px"] {
  grid-template-columns: 1fr !important;
}

/* Mobile : simulateur bloc padding */
body.er-mobile [style*="padding:44px"] {
  padding: 22px 16px !important;
}

/* Mobile : CTAs flex → colonne */
body.er-mobile [style*="display:flex;gap:14px;flex-wrap:wrap"],
body.er-mobile [style*="display:flex;gap:16px;flex-wrap:wrap"] {
  flex-direction: column !important;
  align-items: stretch !important;
}
body.er-mobile [style*="justify-content:center;flex-wrap:wrap"] {
  flex-wrap: wrap !important;
}

/* Mobile : tarifs 3 colonnes → 1 */
body.er-mobile .er-pricing-grid,
body.er-tablet .er-pricing-grid { grid-template-columns: 1fr !important; }

/* Tablet : tarifs 3 colonnes → 1 (cartes assez larges) */
body.er-tablet [style*="grid-template-columns:repeat(3,1fr)"][style*="gap:20px"] {
  grid-template-columns: 1fr !important;
}

/* Mobile : page processus 4 colonnes → 2×2 */
body.er-mobile [style*="grid-template-columns:repeat(4,1fr)"][style*="gap:0"] {
  grid-template-columns: 1fr 1fr !important;
  gap: 24px !important;
}
/* Cacher ligne connectrice processus sur mobile */
body.er-mobile [style*="position:absolute;top:44px;left:12%"] {
  display: none !important;
}

/* Mobile : technologies 4 colonnes → 2 */
body.er-mobile [style*="grid-template-columns:repeat(4,1fr);gap:16px"] {
  grid-template-columns: 1fr 1fr !important;
}

/* ── TEXTE OVERFLOW ── */
body.er-mobile * {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Tarifs section ── */
@media (max-width: 640px) {
  body { font-size: 14px; }
}

/* ── HAMBURGER FALLBACK CSS (sans JS) ── */
@media (max-width: 900px) {
  #er-hamburger {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 42px !important;
    height: 42px !important;
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(0,212,255,.2) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }
  #er-header nav { display: none !important; }
  #er-cta-btn { display: none !important; }
}
@media (min-width: 901px) {
  #er-hamburger { display: none !important; }
  #er-header nav { display: flex !important; }
  #er-cta-btn { display: inline-flex !important; }
  #er-mobile-menu { display: none !important; }
}
