/* ===================================
   AFRICAN LOOP CONSULTING - MODERN HEADER
   Inspired by the provided design
   Version 2.1 - Mobile Fix
   =================================== */

/* Header Base */
.corporate-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ajustement du body pour éviter que le contenu soit caché sous le header fixe */
body {
    padding-top: 90px;
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Éliminer tout débordement horizontal */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 2rem;
    height: 90px;
    gap: 3rem;
    width: 100%;
    box-sizing: border-box;
}

/* Logo Section */
.logo-section {
    flex: 0 0 auto;
}

.logo-link {
    display: block;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    height: 60px;
    width: auto;
}

/* Main Navigation */
.main-nav {
    flex: 0 1 auto;
    display: flex;
    justify-content: flex-start;
    margin: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 3rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    text-decoration: none;
    color: #2c2c2c;
    font-weight: 400;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
}

.nav-link:hover {
    color: #000000;
}

.nav-link.active {
    color: #8B4513;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #8B4513;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: #2c2c2c;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dropdown-link:hover {
    background: #f8f9fa;
    color: #000000;
}

/* Language Switcher */
.lang-section {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.lang-switcher {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #8B4513;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    background: #6d3410;
}

.lang-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.chevron-icon {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.lang-switcher:hover .chevron-icon {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.lang-switcher:hover .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #2c2c2c;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lang-dropdown-link:hover {
    background: #f8f9fa;
    color: #000000;
}

.lang-dropdown-link.active {
    background: #8B4513;
    color: #ffffff;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
}

/* Mobile Controls Container */
.mobile-controls {
    display: none;
}

/* Desktop/Mobile visibility classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #2c2c2c;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu-content {
    padding: 1.5rem 2rem 2rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    text-decoration: none;
    color: #2c2c2c;
    font-weight: 400;
    font-size: 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-link .nav-icon {
    width: 18px;
    height: 18px;
}

.mobile-link:hover,
.mobile-link.active {
    color: #8B4513;
    font-weight: 500;
}

/* Underline animation for mobile links (match nav-link behavior) */
.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #8B4513;
    transition: width 0.3s ease;
}

.mobile-link:hover::after,
.mobile-link.active::after {
    width: 100%;
}

.mobile-dropdown {
    border-bottom: 1px solid #f5f5f5;
}

.mobile-submenu {
    padding-left: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.mobile-sublink {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    color: #666666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mobile-sublink:hover {
    color: #000000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-list {
        gap: 2rem;
    }
    
    .nav-link {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    /* Forcer la disparition complète des éléments desktop */
    .header-container > .main-nav,
    .header-container > .lang-section,
    .header-container > .mobile-menu-btn {
        display: none !important;
        visibility: hidden !important;
    }
    
    .corporate-header {
        height: 65px;
        min-height: 65px;
    }
    
    .header-container {
        flex-direction: row;
        padding: 0.5rem;
        height: 65px;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
        max-width: 100vw;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .logo-section {
        flex: 0 0 auto;
        text-align: left;
    }
    
    .logo {
        height: 45px;
    }
    
    /* Container pour les boutons à droite */
    .mobile-controls {
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        flex: 0 0 auto;
    }
    
    .mobile-controls .mobile-menu-btn {
        display: flex !important;
        width: 24px;
        height: 24px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .mobile-controls .mobile-menu-btn span {
        width: 14px;
        height: 1.5px;
    }
    
    .mobile-controls .lang-toggle {
        padding: 0.3rem 0.6rem;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 0.3rem;
        flex-shrink: 0;
        min-width: 50px;
        justify-content: center;
    }
    
    .mobile-menu {
        top: 65px;
    }
    
    /* Ajustement du padding-top pour mobile */
    body {
        padding-top: 65px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.4rem;
        gap: 0.5rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .mobile-controls {
        gap: 0.5rem;
    }
    
    .mobile-controls .mobile-menu-btn {
        width: 22px;
        height: 22px;
    }
    
    .mobile-controls .mobile-menu-btn span {
        width: 12px;
        height: 1.5px;
    }
    
    .mobile-controls .lang-toggle {
        padding: 0.25rem 0.5rem;
        font-size: 11px;
        min-width: 45px;
    }
}

/* Pour les très petits écrans (Samsung S21 FE et similaires) */
@media (max-width: 390px) {
    .header-container {
        padding: 0.3rem;
        gap: 0.3rem;
    }
    
    .logo {
        height: 38px;
    }
    
    .mobile-controls {
        gap: 0.4rem;
    }
    
    .mobile-controls .mobile-menu-btn {
        width: 20px;
        height: 20px;
    }
    
    .mobile-controls .mobile-menu-btn span {
        width: 10px;
        height: 1px;
    }
    
    .mobile-controls .lang-toggle {
        padding: 0.2rem 0.4rem;
        font-size: 10px;
        min-width: 40px;
    }
}