/* ===== STICKY FOOTER RESET STRICT - NETTOYEUR DE CONFLITS ===== */
/* Ce fichier force le positionnement correct du footer en écrasant tous les conflits */
/* DOIT ÊTRE CHARGÉ EN PREMIER (avant tous les autres CSS) */

/* === RESET STRICT BASE === */
html {
  height: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  
  /* STRUCTURE FLEXBOX FORCÉE */
  display: flex !important;
  flex-direction: column !important;
  
  /* CORRECTION OVERFLOW - Permettre le scroll naturel */
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

/* === CONTENEUR PRINCIPAL === */
main,
#main-content,
.main-container {
  /* FORCE LE MAIN À S'ÉTIRER */
  flex: 1 0 auto !important;
  
  /* Assure que le contenu peut déborder si nécessaire */
  min-height: 0 !important;
  
  /* Position relative pour le z-index */
  position: relative !important;
  z-index: 1 !important;
}

/* === HEADER === */
header,
.nb-header,
.wb-nav {
  /* NE DOIT PAS S'ÉCRASER */
  flex-shrink: 0 !important;
  
  /* Position relative pour le z-index */
  position: relative !important;
  z-index: 1000 !important;
}

/* === FOOTER === */
footer,
.wb-footer {
  /* NE DOIT JAMAIS S'ÉCRASER */
  flex-shrink: 0 !important;
  
  /* Hauteur naturelle */
  flex-basis: auto !important;
  
  /* Position relative pour le z-index */
  position: relative !important;
  z-index: 1 !important;
  
  /* Pas de margin négatif */
  margin-top: 0 !important;
}

/* === CANVAS 3D === */
#canvas-bg,
#hero-canvas {
  /* TOUJOURS EN ARRIÈRE-PLAN */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* === SECTIONS === */
section,
.wb-section,
.wb-hero {
  /* Ne pas forcer de hauteur fixe */
  height: auto !important;
  
  /* Position relative pour le z-index */
  position: relative !important;
  z-index: 1 !important;
}

/* === CORRECTION SPÉCIFIQUE HERO === */
.wb-hero {
  /* Hauteur minimale mais pas fixe */
  min-height: auto !important;
  height: auto !important;
}

/* === MOBILE CORRECTIONS === */
@media (max-width: 768px) {
  html {
    overflow-x: hidden !important;
  }
  
  body {
    /* Pas de padding-bottom sur body en mobile */
    padding-bottom: 0 !important;
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  .wb-footer {
    /* Padding pour la nav-bar en bas */
    padding-bottom: calc(var(--wb-space-xl, 2rem) + 64px) !important;
    margin-bottom: 0 !important;
  }
  
  .wb-hero {
    /* Ajustement pour la nav-bar mobile */
    min-height: auto !important;
    padding-top: 0 !important;
  }
  
  #canvas-bg,
  #hero-canvas {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
  }
}

/* === DÉSACTIVATION DES RÈGLES CONFLICTUELLES === */

/* Empêcher les conteneurs de forcer une hauteur 100% */
.container,
.wrapper,
#app,
#root {
  height: auto !important;
  min-height: 0 !important;
}

/* Empêcher les overflow: hidden sur les parents du footer */
body > *:not(#canvas-bg):not(#hero-canvas) {
  overflow: visible !important;
}

/* === DEBUG MODE (à commenter en production) === */
/*
body {
  outline: 3px solid red !important;
}

main {
  outline: 3px solid blue !important;
}

.wb-footer {
  outline: 3px solid green !important;
}
*/
