/* Fix Final Tablette - Corrections spécifiques pour tablette */

/* =============================================== */
/* FIX POUR LA SIDEBAR SUR TABLETTE */
/* =============================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    
    /* Force la sidebar à fonctionner correctement */
    .dashboard-sidebar {
        position: fixed !important;
        top: 60px !important;
        left: -280px !important;
        width: 280px !important;
        height: calc(100vh - 60px) !important;
        background: white !important;
        z-index: 9998 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-shadow: 2px 0 20px rgba(0,0,0,0.15) !important;
        overflow-y: auto !important;
    }
    
    /* Sidebar ouverte */
    .dashboard-sidebar.open {
        left: 0 !important;
    }
    
    /* Forcer la visibilité du contenu de la sidebar */
    .dashboard-sidebar * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Sections de la sidebar */
    .sidebar-header {
        padding: 20px !important;
        border-bottom: 1px solid #eee !important;
        background: white !important;
    }
    
    .sidebar-header .logo {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        color: #2c5530 !important;
    }
    
    .sidebar-header .logo-text {
        font-size: 20px !important;
        font-weight: 600 !important;
        color: #2c5530 !important;
    }
    
    .sidebar-nav {
        padding: 10px 0 !important;
    }
    
    .sidebar-nav .nav-item {
        display: flex !important;
        align-items: center !important;
        padding: 12px 20px !important;
        color: #333 !important;
        text-decoration: none !important;
        transition: background 0.2s !important;
    }
    
    .sidebar-nav .nav-item:hover {
        background: #f5f5f5 !important;
    }
    
    .sidebar-nav .nav-item.active {
        background: #e8f5e9 !important;
        color: #2c5530 !important;
        font-weight: 600 !important;
    }
    
    /* User section */
    .user-section {
        padding: 20px !important;
        border-top: 1px solid #eee !important;
        margin-top: auto !important;
        background: white !important;
    }
    
    /* Overlay actif */
    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* =============================================== */
/* FIX POUR LES ICÔNES DU HEADER */
/* =============================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    
    /* Container header droit - éviter le chevauchement */
    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Search bar avec le bon z-index */
    .header-right .search-bar {
        display: flex !important;
        align-items: center !important;
        background: #f8f9fa !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 50px !important;
        padding: 0 !important;
        width: 200px !important;
        height: 36px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Input qui ne déborde pas */
    .search-bar input {
        width: calc(100% - 40px) !important;
        padding: 8px 12px !important;
        padding-right: 5px !important;
        border: none !important;
        background: transparent !important;
        font-size: 14px !important;
    }
    
    /* Bouton search bien positionné */
    .search-bar button {
        position: absolute !important;
        right: 2px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 32px !important;
        height: 32px !important;
        background: white !important;
        border: none !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        z-index: 2 !important;
        transition: all 0.2s !important;
    }
    
    .search-bar button:hover {
        background: #f0f0f0 !important;
        transform: translateY(-50%) scale(1.05) !important;
    }
    
    /* Cart button avec la même apparence */
    .header-cart {
        display: flex !important;
        z-index: 10 !important;
        position: relative !important;
    }
    
    .header-cart .cart-icon-btn {
        width: 36px !important;
        height: 36px !important;
        background: #f8f9fa !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        position: relative !important;
        transition: all 0.2s !important;
    }
    
    .header-cart .cart-icon-btn:hover {
        background: #f0f0f0 !important;
        transform: scale(1.05) !important;
        border-color: #ccc !important;
    }
    
    /* Icônes SVG avec la même couleur */
    .search-bar button svg,
    .header-cart .cart-icon-btn svg {
        width: 18px !important;
        height: 18px !important;
        stroke: #495057 !important;
        fill: none !important;
        stroke-width: 2 !important;
    }
    
    /* Badge du panier bien positionné */
    .header-cart .cart-count {
        position: absolute !important;
        top: -4px !important;
        right: -4px !important;
        background: #ff4444 !important;
        color: white !important;
        font-size: 10px !important;
        min-width: 16px !important;
        height: 16px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: bold !important;
        padding: 0 3px !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        z-index: 3 !important;
    }
}

/* =============================================== */
/* DESKTOP - Harmonisation totale */
/* =============================================== */

@media (min-width: 1025px) {
    
    /* Container header droit */
    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        justify-content: flex-end !important;
    }
    
    /* Boutons identiques */
    .search-bar button,
    .header-cart .cart-icon-btn {
        width: 40px !important;
        height: 40px !important;
        background: #f8f9fa !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .search-bar button:hover,
    .header-cart .cart-icon-btn:hover {
        background: #e9ecef !important;
        transform: scale(1.05) !important;
        border-color: #ccc !important;
    }
    
    /* Icônes avec la même couleur */
    .search-bar button svg,
    .header-cart .cart-icon-btn svg {
        width: 20px !important;
        height: 20px !important;
        stroke: #495057 !important;
        fill: none !important;
        stroke-width: 2 !important;
    }
}