/* ===== ULTIMATE OVERRIDE - CORRECTIONS FORCÉES DESKTOP/TABLETTE ===== */
/* Ce fichier DOIT être chargé EN DERNIER pour écraser tous les autres */

/* 1. SIDEBAR TOUJOURS VISIBLE SUR DESKTOP (>1024px) */
@media screen and (min-width: 1025px) {
    .dashboard-sidebar {
        left: 0 !important;
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
        position: fixed !important;
    }
    
    .dashboard-main {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
    }
}

/* 2. ICÔNES PANIER ET SEARCH - FOND VERT SUR DESKTOP/TABLETTE */
@media screen and (min-width: 769px) {
    /* Bouton panier - Fond vert, icône blanche */
    .header-cart .cart-icon-btn,
    .cart-icon-btn {
        background-color: #2d4a3e !important;
        background: #2d4a3e !important;
        color: #ffffff !important;
        border: none !important;
    }
    
    .header-cart .cart-icon-btn:hover,
    .cart-icon-btn:hover {
        background-color: #1f3329 !important;
        background: #1f3329 !important;
        color: #ffffff !important;
        transform: scale(1.1) !important;
    }
    
    /* Icône panier en blanc */
    .header-cart .cart-icon-btn svg,
    .cart-icon-btn svg,
    .header-cart .cart-icon-btn [data-feather],
    .cart-icon-btn [data-feather] {
        stroke: #ffffff !important;
        color: #ffffff !important;
    }
    
    /* Bouton search - Fond vert, icône blanche */
    .search-bar button {
        background-color: #2d4a3e !important;
        background: #2d4a3e !important;
        position: absolute !important;
        right: 4px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    
    .search-bar button:hover {
        background-color: #1f3329 !important;
        background: #1f3329 !important;
        /* PAS de scale sur le hover pour éviter le décalage */
        transform: translateY(-50%) !important;
    }
    
    /* Icône search en blanc */
    .search-bar button svg,
    .search-bar button [data-feather] {
        stroke: #ffffff !important;
        color: #ffffff !important;
    }
}

/* 3. SIDEBAR VISIBLE SUR TABLETTE AUSSI (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Sur tablette, sidebar cachée par défaut mais fonctionnelle */
    .dashboard-sidebar {
        left: -280px !important;
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
        position: fixed !important;
        transition: left 0.3s ease !important;
    }
    
    .dashboard-sidebar.open {
        left: 0 !important;
    }
    
    .dashboard-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Afficher le burger sur tablette */
    .mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
    }
}

/* 4. CACHER LE BOUTON SEARCH MOBILE SUR DESKTOP/TABLETTE */
@media screen and (min-width: 769px) {
    .mobile-search-btn {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Afficher la vraie search bar */
    .header-right .search-bar {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* 5. PROTECTION ABSOLUE DU MOBILE - NE RIEN CHANGER < 768px */
@media screen and (max-width: 768px) {
    /* Sidebar cachée sur mobile */
    .dashboard-sidebar {
        left: -280px !important;
        transform: translateX(0) !important;
    }
    
    .dashboard-sidebar.open {
        left: 0 !important;
    }
    
    /* Menu burger visible */
    .mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
    }
    
    /* Main sans marge */
    .dashboard-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Les styles mobiles restent EXACTEMENT comme avant */
    /* NE PAS TOUCHER AUX COULEURS DU HEADER MOBILE */
}

/* 6. FIX SPÉCIFIQUE POUR LE HEADER DESKTOP - OVERRIDE ABSOLUTE-FINAL-HEADER.CSS */
@media screen and (min-width: 1025px) {
    /* Réinitialiser le header desktop */
    .dashboard-header {
        background: #ffffff !important;
        border-bottom: 1px solid #e0e0e0 !important;
    }
    
    /* Titre en noir sur desktop */
    #page-title {
        color: #333333 !important;
        position: static !important;
        transform: none !important;
        text-align: left !important;
    }
    
    /* Container right aligné à droite */
    .header-right {
        justify-content: flex-end !important;
    }
}

/* 7. FORCER LA PRIORITÉ MAXIMALE */
.dashboard-sidebar,
.dashboard-main,
.header-cart .cart-icon-btn,
.search-bar button {
    /* Empty rule to increase specificity */
}

/* DEBUG - pour vérifier que le fichier est chargé */
body::after {
    content: "ULTIMATE-OVERRIDE-LOADED" !important;
    display: none !important;
}
