/* ═══════════════════════════════════════════════════════════════
   Rénovation Énergie — Site Bundle v7
   Architecture Énergétique Premium (2026)
   
   @import modulaires → bundle optimisé
   ═══════════════════════════════════════════════════════════════ */

@import url('tokens.css');
@import url('base.css');
@import url('components.css');
@import url('layout.css');
@import url('pages.css');
@import url('animations.css');

@media (max-width: 480px) { .back-top { bottom: 80px; } }

/* ═══ RESPONSIVE OVERRIDES ═══ */
@media (max-width: 768px) {
  :root {
    --gutter: 16px;
    --gutter-lg: 24px;
    --header-height: 60px;
  }
  .container { padding: 0 var(--sp-4); }
  .section { padding: var(--sp-10) 0; }
  .section-lg { padding: var(--sp-16) 0; }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  .hero h1 { font-size: var(--text-3xl); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-xl { min-height: 56px; padding: var(--sp-4) var(--sp-8); font-size: var(--text-lg); }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .dpe-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .funnel-steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .floating-bar-text { font-size: 11px; }
  .floating-bar-inner .btn-outline { display: none; }
  /* Inline grids fallback — force single column on mobile */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1.3fr 1fr"],
  [style*="grid-template-columns: 1.3fr 1fr"],
  [style*="grid-template-columns:1.2fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .hero-actions { flex-direction: column; gap: 8px; }
}
@media (max-width: 480px) {
  :root { --gutter: 12px; }
  .hero { padding: var(--sp-8) 0 var(--sp-6); }
  .hero h1 { font-size: var(--text-2xl); }
  .hero-stats { flex-direction: column; gap: var(--sp-4); }
  .hero-stat { text-align: center; }
  .btn-xl { min-height: 52px; padding: var(--sp-3) var(--sp-6); font-size: var(--text-base); }
  .modal { margin: var(--sp-2); max-height: 95vh; border-radius: var(--radius-lg); }
  .newsletter-form { flex-direction: column; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ LEGACY COMPAT (old class names → new tokens) ═══ */
.hero-accent { color: var(--copper-light); }
.marquee-wrap { overflow: hidden; white-space: nowrap; }
.back-top {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  width: 48px; height: 48px; border-radius: var(--radius-full);
  background: var(--forest); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
  transform: translateY(16px); transition: all var(--transition);
  z-index: var(--z-sticky); cursor: pointer;
}
.back-top.visible { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--copper); transform: translateY(-2px); }
.phone-float {
  position: fixed; bottom: var(--sp-6); left: var(--sp-6);
  width: 48px; height: 48px; border-radius: var(--radius-full);
  background: var(--sage); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); z-index: var(--z-sticky); cursor: pointer;
  animation: bounce 1.4s ease-in-out 1;
}
.exit-popup {
  position: fixed; inset: 0; background: rgba(16,35,29,0.6);
  backdrop-filter: blur(4px); z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center; padding: var(--sp-4);
}
.exit-popup.active { display: flex; }
.exit-popup-card {
  background: var(--bg-elevated); border-radius: var(--radius-xl);
  padding: var(--sp-8); max-width: 480px; width: 100%; text-align: center;
  box-shadow: var(--shadow-2xl); animation: scaleIn 0.3s var(--ease-spring);
}
.modal-close { position: relative; }
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated); border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--gutter); z-index: var(--z-overlay);
  box-shadow: var(--shadow-xl); transform: translateY(100%); transition: transform var(--transition-slow);
}
.cookie-banner.visible { transform: translateY(0); }
.social-notif {
  position: fixed; bottom: var(--sp-20); left: var(--sp-6);
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-xl);
  z-index: var(--z-sticky); animation: fadeInLeft 0.5s var(--ease-spring);
  max-width: 280px; display: none;
}
@media (max-width: 480px) { .social-notif { display: none !important; } }
.breadcrumb-sep { color: var(--text-muted); margin: 0 var(--sp-2); }
.lazy-bg { background-size: cover; background-position: center; transition: opacity var(--transition-slow); }

@media print {
  .site-nav, .site-footer, .chat-widget, .floating-bar, .back-top, .phone-float,
  .exit-popup, .urgency-bar, .skip-link, .cookie-banner, .social-notif,
  .abandonment-banner, .newsletter-popup, .recrut-popup, .dpe-popup,
  .chat-float, .promo-bar { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: underline !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 11px; color: #666; }
  a[href^="javascript"]::after, a[href^="#"]::after { content: "" !important; }
  .hero, .page-header, .hero-accueil { background: none !important; color: #000 !important; }
  * { animation: none !important; transition: none !important; }
  img { max-width: 100% !important; }
  .site-header { position: static !important; box-shadow: none !important; }
}
