/**
 * NAVBAR MOBILE CSS - Styles spécifiques mobile
 * Chargé uniquement sur mobile pour optimiser PageSpeed
 * Media query: (max-width: 768px)
 * 
 * IMPORTANT: Ce fichier est chargé avec media="(max-width: 768px)"
 * donc les styles ne s'appliquent QUE sur mobile
 */

/* ============================================
   MENU CATÉGORIES MOBILE
   ============================================ */

/* Menu catégories en overlay mobile */
#categoriesDropdownMenu {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
    border-radius: 0 !important;
    margin-top: 0 !important;
    z-index: 10001 !important;
    overflow-y: auto !important;
}

/* En mobile, afficher catégories en liste simple avec développement */
#categoriesDropdownMenu > div {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
}

#categoriesDropdownMenu .categories-main-list {
    border-right: none !important;
    border-bottom: 2px solid rgba(255,255,255,0.2) !important;
    padding-right: 0 !important;
    padding-bottom: 15px !important;
    max-height: none !important;
}

#categoriesDropdownMenu .categories-sub-list {
    display: none !important; /* Masquer colonne droite en mobile */
}

/* Sous-catégories affichées sous chaque catégorie au clic */
.category-sub-items {
    display: none;
    padding: 10px 0 10px 20px;
    background: rgba(255,255,255,0.05);
    margin-top: 5px;
    border-radius: 8px;
}

.category-sub-items.expanded {
    display: block;
}

.category-sub-item {
    padding: 10px 16px;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.category-sub-item:hover {
    background: rgba(255,255,255,0.1);
}

/* Changer chevron en mobile */
.category-main-item.has-children {
    cursor: pointer;
}

.category-main-item.has-children .fa-chevron-right {
    transition: transform 0.3s;
}

.category-main-item.has-children.expanded .fa-chevron-right {
    transform: rotate(90deg);
}

/* ============================================
   RETIRER TOUS LES INDICATEURS VISUELS MOBILE
   (Triangle, lignes, bordures actives sous les icônes)
   ============================================ */
.mobile-nav-icon,
.mobile-nav-icon.active,
.mobile-nav-icon.selected,
#mobileCategoriesBtn,
#mobileCategoriesBtn.active,
#mobileCategoriesBtn.selected,
#mobileSearchBtn,
#mobileSearchBtn.active,
#mobileSearchBtn.selected {
    border-bottom: none !important;
    border-top: none !important;
    position: relative !important;
}

.mobile-nav-icon::after,
.mobile-nav-icon::before,
.mobile-nav-icon.active::after,
.mobile-nav-icon.active::before,
.mobile-nav-icon.selected::after,
.mobile-nav-icon.selected::before,
#mobileCategoriesBtn::after,
#mobileCategoriesBtn::before,
#mobileCategoriesBtn.active::after,
#mobileCategoriesBtn.active::before,
#mobileCategoriesBtn.selected::after,
#mobileCategoriesBtn.selected::before,
#mobileSearchBtn::after,
#mobileSearchBtn::before,
#mobileSearchBtn.active::after,
#mobileSearchBtn.active::before,
#mobileSearchBtn.selected::after,
#mobileSearchBtn.selected::before,
.mobile-nav-icons::after,
.mobile-nav-icons::before,
header::after,
header::before,
.navbar-container::after,
.navbar-container::before {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    content: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
    width: 0 !important;
    height: 0 !important;
    border: none !important;
    background: none !important;
}

/* S'assurer qu'aucun élément ne bloque les clics sur les icônes mobile */
.mobile-nav-icon,
#mobileCategoriesBtn,
#mobileSearchBtn {
    pointer-events: auto !important;
    z-index: 1002 !important;
    position: relative !important;
}

/* Retirer les éléments enfants qui pourraient être des indicateurs */
.mobile-nav-icon *,
.mobile-nav-icons * {
    pointer-events: auto !important;
}


/* S'assurer qu'aucun élément ne bloque les clics */
.mobile-nav-icon,
#mobileCategoriesBtn,
#mobileSearchBtn {
    pointer-events: auto !important;
    z-index: 1002 !important;
    position: relative !important;
}

/* ============================================
   MASQUER TOUS LES BADGES EN MOBILE (RENFORCÉ - DÉFINITIF)
   Les badges sont également désactivés en JavaScript pour éviter les appels API inutiles
   ============================================ */
.cart-badge,
.wishlist-badge,
.tracking-badge,
.notification-badge,
.profileBadge,
#profileBadge,
span.cart-badge,
span.wishlist-badge,
span.tracking-badge,
span.notification-badge,
span.profileBadge,
.badge,
[class*="badge"],
[class*="Badge"],
[data-badge],
.navbar-action-icon .badge,
.navbar-action-icon span[class*="badge"],
.navbar-action-icon .notification-badge,
.navbar-action-icon .cart-badge,
.navbar-action-icon .wishlist-badge,
.navbar-action-icon .tracking-badge,
header .badge,
header [class*="badge"],
header [class*="Badge"],
.navbar-container .badge,
.navbar-container [class*="badge"],
.navbar-actions .badge,
.navbar-actions [class*="badge"],
.mobile-nav-icon .badge,
.mobile-nav-icon [class*="badge"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Masquer badges dans tous les contextes mobile */
@media (max-width: 768px) {
    header .badge,
    header [class*="badge"],
    .navbar-container .badge,
    .navbar-container [class*="badge"],
    .navbar-actions .badge,
    .navbar-actions [class*="badge"],
    .mobile-nav-icon .badge,
    .mobile-nav-icon [class*="badge"],
    .navbar-action-icon::after,
    .navbar-action-icon::before {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        content: none !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }
    
    /* Forcer pointer-events: none sur tous les badges en mobile */
    .badge,
    [class*="badge"],
    [class*="Badge"],
    [id*="Badge"],
    [id*="badge"] {
        pointer-events: none !important;
        z-index: -1 !important;
    }
}

/* ============================================
   BARRE DE RECHERCHE MOBILE
   ============================================ */
#mobileNavbarSearchWrapper {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    right: 0 !important;
    width: calc(100vw - 24px) !important;
    max-width: 400px !important;
    z-index: 10001 !important;
    background: transparent !important;
}

#mobileNavbarSearchInput {
    width: 100% !important;
    padding: 12px 16px 12px 40px !important;
    border: 2px solid rgba(255,255,255,0.2) !important;
    border-radius: 12px 12px 0 0 !important;
    font-size: 0.9rem !important;
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(10px) !important;
    color: white !important;
    z-index: 10001 !important;
    outline: none !important;
    transition: all 0.3s !important;
    box-sizing: border-box !important;
}

#mobileNavbarSearchInput:focus {
    border: 2px solid rgba(255,255,255,0.4) !important;
    background: rgba(255,255,255,0.15) !important;
}

#mobileNavbarSearchInput::placeholder {
    color: rgba(255,255,255,0.6) !important;
    opacity: 1 !important;
}

#mobile-search-suggestions {
    position: absolute !important;
    top: calc(100% - 1px) !important;
    left: 0 !important;
    right: 0 !important;
    background: #5a6b8a !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    z-index: 10002 !important;
    overflow: hidden !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    border-top: 1px solid rgba(255,255,255,0.2) !important;
}

#mobile-search-history-section {
    display: none;
}

#mobile-search-history-section:not([style*="display: none"]) {
    display: block !important;
}

#mobile-search-history-list {
    padding: 8px 0 !important;
}

#mobile-search-suggestions-list {
    padding: 8px 0 !important;
    display: none;
}

#mobile-search-suggestions-list:not([style*="display: none"]) {
    display: block !important;
}

#mobile-search-popular {
    padding: 12px 16px !important;
    background: rgba(255,255,255,0.1) !important;
    border-top: 1px solid rgba(255,255,255,0.2) !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#mobile-search-popular-list {
    padding: 8px 0 !important;
}

.search-popular-item {
    padding: 10px 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: background 0.2s !important;
}

.search-popular-item:active {
    background: rgba(255,255,255,0.15) !important;
}
