/* Styles améliorés pour le header principal */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.98), rgba(250, 250, 252, 0.98));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 98px; /* Hauteur fixe pour uniformité */
}
.menu-open .main-header {
    height: 100% !important;
    padding-top: 0px;
}
.menu-open .logo img{
    display: none;
}
.menu-open .container{
    width: 100% !important;
}


.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.logo {
    padding: 5px 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 60px; /* Hauteur fixe pour le logo */
    display: flex;
    align-items: center;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo img {
    max-height: 60px;
    height: auto;
    width: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
}

.main-nav {
    margin-left: auto;
    height: 100%;
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    height: 100%;
    align-items: center;
}

.main-nav .nav-item {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 10px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* Hauteur fixe pour les éléments de navigation */
}

.main-nav .nav-item::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #8B0000;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.main-nav .nav-item:hover {
    color: #8B0000;
    background-color: rgba(139, 0, 0, 0.05);
    transform: translateY(-2px);
}

.main-nav .nav-item:hover::after {
    width: 40%;
    opacity: 1;
}

.main-nav .nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, #8B0000, #a30000);
    box-shadow: 0 4px 10px rgba(139, 0, 0, 0.2);
}

.main-nav .nav-item.active::after {
    display: none;
}

.partner-nav-item {
    margin-left: 10px;
    height: 40px; /* Hauteur fixe */
    display: flex;
    align-items: center;
}

.partner-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.partner-nav-link:hover {
    background-color: rgba(139, 0, 0, 0.05);
    transform: translateY(-2px);
}

.partner-nav-logo {
    height: 30px;
    width: auto;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
    filter: brightness(1);
}

.partner-nav-link:hover .partner-nav-logo {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Header réduit au scroll */
.main-header.scrolled {
    height: 70px; /* Hauteur réduite au scroll */
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

.main-header.scrolled .container {
    padding: 5px 0;
}

.main-header.scrolled .logo img {
    max-height: 50px;
}

.main-header.scrolled .nav-item {
    padding: 8px 14px;
    height: 36px; /* Hauteur réduite au scroll */
}

/* Ajustement pour le padding-top du body */
body {
    padding-top: 80px; /* Correspond à la hauteur du header */
    transition: padding-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation d'apparition au chargement */
@keyframes headerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-header {
    animation: headerFadeIn 0.6s ease-out forwards;
}

.main-nav ul li {
    opacity: 0;
    animation: headerFadeIn 0.5s ease-out forwards;
}

.main-nav ul li:nth-child(1) { animation-delay: 0.1s; }
.main-nav ul li:nth-child(2) { animation-delay: 0.2s; }
.main-nav ul li:nth-child(3) { animation-delay: 0.3s; }
.main-nav ul li:nth-child(4) { animation-delay: 0.4s; }
.main-nav ul li:nth-child(5) { animation-delay: 0.5s; }
.main-nav ul li:nth-child(6) { animation-delay: 0.6s; }
.main-nav ul li:nth-child(7) { animation-delay: 0.7s; }
.main-nav ul li:nth-child(8) { animation-delay: 0.8s; }

/* Styles pour mobile */
@media (max-width: 992px) {
    .main-header {
        height: 70px; /* Hauteur réduite sur mobile */
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    }
    
    body {
        padding-top: 70px !important; /* Correspond à la hauteur du header sur mobile */
    }
    
    .mobile-menu-toggle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: linear-gradient(135deg, #8B0000, #a30000);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: none;
        outline: none;
        box-shadow: 0 4px 10px rgba(139, 0, 0, 0.2);
        z-index: 1100;
        position: fixed;
        top: 10px !important; /* Ajusté pour être bien positionné */
        right: 20px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-menu-toggle:hover, 
    .mobile-menu-toggle:active {
        transform: scale(1.05);
        background: linear-gradient(135deg, #a30000, #8B0000);
    }
    
    .mobile-menu-toggle i {
        font-size: 1.4rem;
        transition: all 0.3s ease;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: white;
        z-index: 1050;
        transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        padding: 80px 20px 20px;
        overflow-y: auto;
        display: block;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        height: auto;
    }
    
    .main-nav .nav-item {
        display: block;
        width: 100%;
        padding: 15px 20px;
        border-radius: 8px;
        border-left: 3px solid transparent;
        height: auto;
        justify-content: flex-start;
    }
    
    .main-nav .nav-item::after {
        display: none;
    }
    
    .main-nav .nav-item:hover {
        transform: translateX(5px);
        border-left: 3px solid #8B0000;
    }
    
    .main-nav .nav-item.active {
        border-left: 3px solid #8B0000;
    }
    
    .partner-nav-item {
        margin: 20px 0 0;
        text-align: center;
        height: auto;
    }
    
    .partner-nav-link {
        display: inline-block;
        height: auto;
    }
    
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 1263px){
    .logo img {
        max-height: 47px;
    }
    
}
@media (max-width: 1195px){
    .logo img {
        max-height: 30px;
    }
    .main-nav .nav-item {
        padding: 10px 6px;
    }
   
}
@media (max-width: 990px){
    .logo img {
        max-height: 45px;
    }


    
}

/* Fix pour iOS */
@supports (-webkit-touch-callout: none) {
    .main-header {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: transform;
    }
    
    .main-nav {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: transform;
    }
    
    /* Correction des problèmes de visibilité sur Safari iOS */
    .main-header, 
    .mobile-menu-toggle,
    .main-nav.active {
        -webkit-transform: translate3d(0,0,0);
    }
} 