/* ============================================
   🎯 HEADER STICKY MODERNE - GRAPHISCANN V5 FINAL
   Fichier: header-sticky-modern.css
   ⚠️ DOIT ÉCRASER TOUTES LES RÈGLES DE MAIN.CSS
   ============================================ */

/* ==========================================
   💻 VERSION DESKTOP (> 992px)
   ========================================== */

/* Padding-top pour compenser le header fixe */
body {
    padding-top: 157px !important;
}

/* ===== ZONE LOGO (Premier niveau) ===== */
body #logo {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 90px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12) !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    float: none !important;
}

body #logo::before {
    content: '' !important;
    display: block !important;
    width: 50% !important;
}

/* Texte "Livraison partout en France" */
body #logo > div:first-child {
    position: absolute !important;
    top: 6px !important;
    left: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.8em !important;
    color: #555 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body #logo > div:first-child img {
    width: 24px !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

/* Logo Graphiscann */
body #logo > a {
    position: absolute !important;
    left: 20px !important;
    bottom: 8px !important;
    display: block !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body img#lelogo {
    width: 346px !important;
    height: 61px !important;
    display: block !important;
}

/* Coordonnées + Recherche à DROITE */
body #logo #coordonnees {
    position: absolute !important;
    top: 10px !important;
    right: 40px !important;
    width: 280px !important;
    max-width: 280px !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    z-index: 1001 !important;
    float: none !important;
}

body #logo #coordonnees p {
    text-align: right !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.78em !important;
    line-height: 1.25 !important;
    color: #555 !important;
    font-weight: 500 !important;
    display: block !important;
}

body #logo #coordonnees p br {
    display: inline !important;
}

body #logo #coordonnees #champrecherche {
    width: 100% !important;
    border: 1px solid #ccc !important;
    padding: 6px 32px 6px 10px !important;
    font-size: 0.88em !important;
    color: #333 !important;
    background: #fff !important;
    border-radius: 16px !important;
    transition: all 0.3s ease !important;
    line-height: 1.2 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    background-image: url(images/icons/search.png) !important;
    background-size: 16px !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
}

body #logo #coordonnees #champrecherche:hover {
    border-color: #999 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12) !important;
}

body #logo #coordonnees #champrecherche:focus {
    outline: 2px solid #dd0333 !important;
    border-color: #dd0333 !important;
    background-color: #fffef8 !important;
    box-shadow: 0 3px 10px rgba(221, 3, 51, 0.2) !important;
}

body #logo #coordonnees #champrecherche::placeholder {
    color: #999 !important;
    opacity: 1 !important;
    font-style: italic;
}

body #logo #coordonnees #resultatrecherche {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 5px !important;
    z-index: 1002 !important;
}

body #logo #coordonnees #resultatrecherche #interieurrecherche {
    background: #fff !important;
    padding: 12px 15px !important;
    border: 2px solid #dd0333 !important;
    border-radius: 10px !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    animation: slideDown 0.3s ease-out !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body #logo #coordonnees #resultatrecherche #interieurrecherche a {
    display: block !important;
    padding: 10px 12px !important;
    color: #333 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #eee !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    border-radius: 5px !important;
    margin-bottom: 3px !important;
}

body #logo #coordonnees #resultatrecherche #interieurrecherche a:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

body #logo #coordonnees #resultatrecherche #interieurrecherche a:hover {
    background: #f8f9fa !important;
    color: #dd0333 !important;
    padding-left: 18px !important;
    transform: translateX(3px) !important;
}

body #logo #coordonnees #resultatrecherche #interieurrecherche a::before {
    content: '→' !important;
    margin-right: 8px !important;
    color: #dd0333 !important;
    font-weight: bold !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

body #logo #coordonnees #resultatrecherche #interieurrecherche a:hover::before {
    opacity: 1 !important;
}

/* ===== ZONE MENU (Deuxième niveau) ===== */
body #header {
    position: fixed !important;
    top: 90px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 67px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    z-index: 999 !important;
    display: block !important;
    box-shadow: none !important;
}

body #menuprincipal {
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
}

.menufenetre {
    position: fixed !important;
    top: 157px !important;
    left: 2% !important;
    width: 96% !important;
    background-color: #f7f7f7 !important;
    z-index: 998 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18) !important;
    border-radius: 0 0 15px 15px !important;
}

body #conteneurprincipal {
    margin-top: 0 !important;
    padding-top: 30px !important;
}

footer {
    position: relative !important;
    margin-top: 0 !important;
}

/* ==========================================
   📱 RESPONSIVE MOBILE (≤ 992px) - CRITIQUE
   ========================================== */
@media (max-width: 992px) {
    /* RÉINITIALISER le padding-top du body */
    body {
        padding-top: 0 !important;
        position: relative !important;
    }
    
    /* HEADER FIXE MOBILE - FORCE AU-DESSUS DE TOUT */
    body #logo {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        padding: 12px 65px 12px 12px !important;
        text-align: center !important;
        display: block !important;
        background: #ffffff !important;
        z-index: 999999 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        float: none !important;
        margin: 0 !important;
    }
    
    body #logo::before {
        display: none !important;
    }
    
    body #logo > div:first-child {
        display: none !important;
    }
    
    body #logo > a {
        position: static !important;
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        bottom: auto !important;
        z-index: 999999 !important;
        float: none !important;
    }
    
    body img#lelogo {
        max-width: 260px !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    body #logo #coordonnees {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        text-align: center !important;
        padding: 10px 0 15px 0 !important;
        margin: 0 !important;
        display: block !important;
        z-index: 999999 !important;
        float: none !important;
    }
    
    body #logo #coordonnees p {
        display: none !important;
    }
    
    body #logo #coordonnees #champrecherche {
        width: calc(100% - 30px) !important;
        max-width: 400px !important;
        margin: 0 auto !important;
        display: block !important;
        font-size: 16px !important;
        z-index: 999999 !important;
    }
    
    body #logo #coordonnees #resultatrecherche {
        width: calc(100% - 30px) !important;
        max-width: 400px !important;
        margin: 5px auto 0 auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        z-index: 999999 !important;
    }
    
    body #header {
        position: relative !important;
        top: auto !important;
        height: auto !important;
        margin-top: 0 !important;
        box-shadow: none !important;
        z-index: 1 !important;
    }
    
    #responsive_menu_button {
        display: block !important;
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 1000000 !important;
        width: 45px !important;
        height: 45px !important;
        cursor: pointer !important;
        background: rgba(255, 255, 255, 1) !important;
        border-radius: 5px !important;
        padding: 5px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
        pointer-events: auto !important;
    }
    
    #responsive_menu_button img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* ============================================
       🍔 MENU HAMBURGER - FIX DÉFINITIF
       ============================================ */
    
    /* Menu fermé par défaut */
    body #menuprincipal {
        position: fixed !important;
        display: none !important;
        top: 75px !important;
        right: 10px !important;
        width: 280px !important;
        max-width: calc(100% - 20px) !important;
        z-index: 999998 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
        background-color: rgba(155, 174, 177, 1) !important;
        border-radius: 8px !important;
        padding: 10px !important;
        margin: 0 !important;
        pointer-events: auto !important;
    }
    
    /* Menu ouvert - SURCHARGE TOUT */
    body #menuprincipal.menu-ouvert {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* S'assurer que les items sont cliquables */
    body #menuprincipal.menu-ouvert * {
        pointer-events: auto !important;
    }
    
    .menufenetre {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        margin-top: 10px !important;
        z-index: 999997 !important;
    }
    
    /* CONTENU - FORCÉ EN DESSOUS DU HEADER */
    body #conteneurprincipal {
        margin-top: 150px !important;
        padding-top: 20px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    body #conteneurprincipal * {
        position: relative !important;
        z-index: auto !important;
    }
    
    body #conteneurprincipal #blocdroit {
        position: relative !important;
        z-index: auto !important;
    }
}

/* ==========================================
   📱 TRÈS PETIT MOBILE (≤ 580px)
   ========================================== */
@media (max-width: 580px) {
    body #logo {
        padding: 10px 60px 10px 10px !important;
    }
    
    body img#lelogo {
        max-width: 220px !important;
    }
    
    body #logo #coordonnees {
        padding: 8px 0 12px 0 !important;
    }
    
    #responsive_menu_button {
        top: 12px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
    }
    
    #menuprincipal {
        top: 65px !important;
        width: 200px !important;
    }
    
    body #conteneurprincipal {
        margin-top: 135px !important;
    }
}

/* ==========================================
   🎨 ANIMATIONS
   ========================================== */

body #logo,
body #header {
    animation: slideDownHeader 0.3s ease-out !important;
}

@keyframes slideDownHeader {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.menufenetre {
    transition: all 0.3s ease !important;
}

/* ==========================================
   🔧 HIÉRARCHIE Z-INDEX - CRITIQUE
   ========================================== */

/* Desktop */
@media (min-width: 993px) {
    body #logo {
        z-index: 1000 !important;
    }
    
    body #header {
        z-index: 999 !important;
    }
    
    body #logo #coordonnees {
        z-index: 1001 !important;
    }
    
    body #logo #coordonnees #resultatrecherche {
        z-index: 1002 !important;
    }
    
    .menufenetre {
        z-index: 998 !important;
    }
}

/* Mobile - Z-index MAXIMUMS */
@media (max-width: 992px) {
    body #logo,
    body #logo *,
    body #logo > a,
    body img#lelogo,
    body #logo #coordonnees,
    body #logo #coordonnees *,
    body #logo #coordonnees #champrecherche,
    body #logo #coordonnees #resultatrecherche,
    body #logo #coordonnees #resultatrecherche * {
        z-index: 999999 !important;
    }
    
    #responsive_menu_button {
        z-index: 1000000 !important;
    }
    
    #menuprincipal,
    #menuprincipal * {
        z-index: 999998 !important;
    }
    
    .menufenetre,
    .menufenetre * {
        z-index: 999997 !important;
    }
    
    body #header,
    body #header * {
        z-index: 1 !important;
    }
    
    body #conteneurprincipal,
    body #conteneurprincipal *,
    body #conteneurprincipal div,
    body #conteneurprincipal section,
    body #conteneurprincipal article {
        z-index: 1 !important;
    }
}

/* Contenu principal toujours SOUS le header */
body #conteneurprincipal {
    position: relative !important;
    z-index: 1 !important;
}

/* Alerte RGPD au-dessus de tout */
#alerte_rgpd {
    z-index: 999999 !important;
}

/* ==========================================
   ✅ FIN DU FICHIER
   ========================================== */