/* ===================================================================
   NAVIGATION HARMONISÉE 2025 - SXO Compliant & Multi-niveaux
   Date: 2025-10-23
   Version: 2.0
   Comportement: Dropdowns multi-niveaux (1, 2 ou 3 niveaux selon facettes)
   =================================================================== */

/* ==================== NAV ITEMS ==================== */
.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-item-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* ==================== NAV LINKS & BUTTONS ==================== */
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 100%;
    text-decoration: none;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.nav-link:hover {
    color: #0066cc;
    background: rgba(0, 102, 204, 0.05);
}

.nav-link .fa-angle-down {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.nav-item-dropdown.active .nav-link .fa-angle-down {
    transform: rotate(180deg);
}

/* ==================== DROPDOWN MENU ==================== */
.nav-dropdown {
    display: flex !important; /* AJOUTÉ: force flexbox layout */
    flex-direction: column !important; /* AJOUTÉ: empile les enfants verticalement */
    position: fixed; /* CHANGÉ: fixed au lieu d'absolute pour sortir du flux */
    top: auto; /* Sera calculé par JS */
    left: auto; /* Sera calculé par JS */
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999; /* Augmenté pour être au-dessus de tout */
    max-height: 80vh;
    overflow-y: auto;
}

.nav-item-dropdown.active .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==================== DROPDOWN ITEMS ==================== */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-dropdown-item:hover {
    background: #f3f4f6;
    color: #0066cc;
}

.nav-dropdown-item i {
    width: 20px;
    text-align: center;
    color: #0066cc;
    font-size: 1rem;
}

/* ==================== DROPDOWN DIVIDER ==================== */
.nav-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 12px;
}

/* ==================== "TOUT VOIR" LINK ==================== */
.nav-dropdown-all {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 20px !important;
    color: #0066cc !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: #eff6ff !important;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.nav-dropdown-all:hover {
    background: #dbeafe !important;
    color: #1e40af !important;
}

.nav-dropdown-all i {
    color: inherit;
}

/* ==================== BRANDS DROPDOWN (LOGOS) ==================== */
.nav-dropdown-brands {
    min-width: 320px;
}

.brand-dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
}

.brand-dropdown-item:hover {
    background: #f3f4f6;
}

.brand-logo-small {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-dropdown-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .nav-link {
        padding: 0 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 991px) {
    .nav-link {
        padding: 0 12px;
    }
}

/* ==================== MULTI-LEVEL DROPDOWNS ==================== */

/* Category Level 2 - Header/Group */
.nav-dropdown-category {
    display: block;
    padding: 10px 20px 6px;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 4px;
    cursor: default;
}

.nav-dropdown-category:first-child {
    margin-top: 0;
}

.nav-dropdown-category:not(:first-child) {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

/* Category Level 2 - Clickable (when has items directly) */
.nav-dropdown-category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-dropdown-category-link:hover {
    background: #f3f4f6;
    color: #0066cc;
}

.nav-dropdown-category-link i {
    width: 20px;
    text-align: center;
    color: #0066cc;
    font-size: 1rem;
}

/* Category Level 3 - Sub-items (indented) */
.nav-dropdown-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 40px; /* Indentation 40px */
    color: #374151;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-dropdown-subitem:hover {
    background: #f3f4f6;
    color: #0066cc;
    padding-left: 42px; /* Slight shift on hover */
}

.nav-dropdown-subitem i {
    width: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
}

.nav-dropdown-subitem:hover i {
    color: #0066cc;
}

/* Count badge (number of items) */
.nav-dropdown-count {
    margin-left: auto;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
}

.nav-dropdown-item:hover .nav-dropdown-count,
.nav-dropdown-category-link:hover .nav-dropdown-count,
.nav-dropdown-subitem:hover .nav-dropdown-count {
    background: #0066cc;
    color: white;
}

/* Dropdown wider for multi-level */
.nav-dropdown-multilevel {
    min-width: 320px;
    max-width: 400px;
}

/* ==================== LEVEL 3 CATEGORY HEADERS (non-clickable) ==================== */
.nav-dropdown-subheader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 6px 30px; /* Indentation 30px */
    color: #1f2937;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f9fafb;
    border-left: 3px solid #e5e7eb;
    margin-top: 4px;
    cursor: default;
}

.nav-dropdown-subheader i {
    width: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

/* "Voir toutes..." link at end of each category group */
.nav-dropdown-view-all-level3 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 55px; /* Same indentation as level 4 items */
    color: #0066cc;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 10px;
}

.nav-dropdown-view-all-level3:hover {
    background: #eff6ff;
    color: #1e40af;
    padding-left: 57px;
}

.nav-dropdown-view-all-level3 i {
    color: #0066cc;
    font-size: 0.75rem;
}

/* Level 4 - Individual items (solutions) - Most indented */
.nav-dropdown-item-level4 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 55px; /* Indentation 55px (30 + 25) */
    color: #6b7280;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.nav-dropdown-item-level4:hover {
    background: #f3f4f6;
    color: #0066cc;
    padding-left: 57px; /* Slight shift on hover */
}

.nav-dropdown-item-level4 i {
    width: 14px;
    text-align: center;
    color: #d1d5db;
    font-size: 0.7rem;
}

.nav-dropdown-item-level4:hover i {
    color: #0066cc;
}

/* ===================================================================
   ACCORDÉON PROGRESSIF - v1.2 (2025-10-24)
   Headers niveau 2 et 3 clickables avec icônes toggle
   =================================================================== */

/* Icône toggle accordéon */
.nav-accordion-toggle {
    margin-right: 8px;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: #6b7280;
}

/* État fermé : chevron-right */
.accordion-closed .nav-accordion-toggle {
    transform: rotate(0deg);
}

/* État ouvert : chevron-down */
.accordion-open .nav-accordion-toggle {
    transform: rotate(90deg);
}

/* Headers niveau 2 clickables */
.nav-dropdown-category {
    cursor: pointer !important;
    user-select: none;
    transition: background 0.2s ease;
}

.nav-dropdown-category:hover {
    background: #f3f4f6;
}

.nav-dropdown-category:active {
    background: #e5e7eb;
}

/* Headers niveau 3 clickables */
.nav-dropdown-subheader {
    cursor: pointer !important;
    user-select: none;
    transition: background 0.2s ease;
}

.nav-dropdown-subheader:hover {
    background: #ffffff;
}

.nav-dropdown-subheader:active {
    background: #f9fafb;
}
