/* =============================
   FICHIER : mobile-header.css
   DESCRIPTION : Styles spécifiques pour l'en-tête en version mobile
   ============================= */

/* =============================
   BREAKPOINTS RESPONSIFS POUR ENTETE.PHP
   ============================= */



/* Styles tablettes supprimés - utilisation des styles mobiles pour tous les écrans < 1024px */

/* Styles tablettes supprimés - utilisation des styles mobiles pour tous les écrans < 1024px */



/* Styles mobiles pour les écrans en dessous de 1024px */
@media (max-width: 1023px) {
    
    /* Masquer complètement l'affichage desktop */
    .desktop-only,
    .desktop-nav-container,
    .menu-mega {
        display: none !important;
    }
    
    /* Afficher les éléments mobiles */
    .mobile-only {
        display: block !important;
    }
    
    /* Hide the entire secondary mobile navigation and its header line by default */
    .navigation-secondaire.mobile-only,
    .navigation-secondaire-mobile,
    .navigation-secondaire.mobile-only .menu-header-line {
        display: none !important;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        width: auto !important;
        overflow: visible !important;
        visibility: hidden !important;
    }

    /* Show the secondary mobile navigation and its header line when the menu is open */
    body.menu-mobile-ouvert .navigation-secondaire.mobile-only,
    body.menu-mobile-ouvert .navigation-secondaire-mobile,
    body.menu-mobile-ouvert .navigation-secondaire.mobile-only .menu-header-line {
        display: block !important;
        width: auto !important;
        height: auto !important;
        position: relative;
        z-index: 1001;
        visibility: visible !important;
        overflow: visible !important;
    }
    
    /* Styles de la première ligne de navigation */
    .navigation-principale {
        display: flex;
        justify-content: space-between; /* Répartir les éléments sur toute la largeur */
        align-items: center;
        padding: 6px 5px; 
        /* gap: 4px; */ /* Supprimer le gap global */
        flex-wrap: nowrap; /* Forcer une seule ligne */
        width: 100% !important; /* Forcer la pleine largeur pour surcharger le style en ligne */
        background: #ffffff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    /* Styles pour le conteneur du hamburger */
    .hamburger {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.2s;
        flex-shrink: 0;
        position: relative;
        margin: 0; 
        margin-right: 2px; /* Marge droite hamburger réduite */
    }
    
    .hamburger:hover {
        background-color: rgba(0, 123, 255, 0.1);
    }
    
    /* Styles du logo */
    .logo {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        flex-shrink: 0; 
        margin: 0; 
        margin-left: -20px; /* Marge droite logo réduite */
    }
    
    .logo-img {
        height: 26px;
        width: 26px;
        border-radius: 50%;
        object-fit: cover;
        border: 1px solid #f0f0f0;
    }
    
    /* Styles de la barre de recherche */
    .barre-recherche {
        flex: 1 1 auto; /* Prend l'espace, peut rétrécir */
        /* max-width: 45%; */ 
        min-width: 40px; 
        height: 36px;
        display: flex;
        position: relative;
        margin: 0; 
        margin-right: 2px; /* Marge droite barre de recherche réduite */
        transition: max-width 0.3s ease;
    }
    
    .barre-recherche.expanded {
        max-width: 70%;
        z-index: 100;
    }
    
    .barre-recherche input {
        width: 100%;
        height: 36px;
        padding: 0 36px 0 10px;
        border-radius: 18px;
        border: 1px solid #e0e0e0;
        font-size: 14px;
    }
    
    .barre-recherche button {
        position: absolute;
        right: 0;
        top: 0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #007bff;
        position: relative;
    }
    
    /* Styles du menu utilisateur (Correction: cibler .um-menu) */
    .um-menu { 
        display: flex; /* Toujours afficher en mode mobile/tablette */
        justify-content: flex-start; /* Aligner à gauche */
        flex-shrink: 0; 
        margin-left: 4px; /* Marge à gauche pour décaler légèrement */
    }
    
    /* Correction: cibler .um-liste */
    .um-liste { 
        display: flex;
        align-items: center;
        gap: 2px; /* Espacement réduit */
        padding: 0;
        margin: 0;
    }
    
    .liste-menu-utilisateur li { /* Garder pour la structure si besoin */
        margin: 0;
        padding: 0;
        position: relative;
    }
    
    /* Style pour les boutons (Correction: cibler .um-liste button) */
    .um-liste button { 
        min-width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: transparent;
        transition: background-color 0.2s ease;
        border: none;
        color: #007bff;
        position: relative;
        touch-action: manipulation;
    }
    
    .um-liste button:hover { 
        background-color: rgba(0, 123, 255, 0.1);
    }
    
    .um-liste i { 
        font-size: 1rem;
        margin: 0;
    }
}

/* Styles pour les très petits écrans mobiles */
@media (max-width: 480px) {
    .navigation-principale {
        padding: 4px 8px;
        /* gap: 3px; */ /* Supprimer gap pour un contrôle plus fin par marges */
    }
    
    .hamburger {
        width: 32px;
        height: 32px;
        margin-right: 1px; /* Marge réduite */
    }
    
    .logo {
        margin-right: 1px; /* Marge réduite */
    }

    .logo-img {
        height: 22px;
        width: 22px;
    }
    
    .barre-recherche {
        height: 32px;
        max-width: 35%; /* Augmenter un peu pour éviter compression excessive */
        min-width: 30px;
        margin-right: 1px; /* Marge réduite */
    }
    
    .barre-recherche input {
        height: 32px;
        font-size: 12px;
        padding: 0 32px 0 8px;
    }
    
    .barre-recherche button {
        width: 32px;
        height: 32px;
    }

    /* Styles du menu utilisateur pour très petits écrans */
    .um-menu {
        margin-left: 2px; /* Marge à gauche encore plus réduite */
    }
    
    .um-liste { 
        gap: 1px; /* Espacement minimal */
    }
    
    .um-liste button { 
        min-width: 32px;
        height: 32px;
    }
    
    .um-liste i { 
        font-size: 0.9rem;
    }
}
