/* Masquer les éléments Alpine.js pendant le chargement */
[x-cloak] { display: none !important; }

/* Style pour bloquer le scroll quand le menu est ouvert */
body.menu-open {
    overflow: hidden;
    height: 100vh;
}

/* Overlay flou */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Styles spécifiques à la navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    position: relative;
}

.logo {
    font-size: 2.0rem;
    font-weight: 600;
    color: #FF6A00;
    letter-spacing: 1px;
    text-decoration: none;
}

.logo span {
    color: #333333;
}

nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.menu {
    display: flex;
    gap: 4rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0 2rem;
    transition: all 0.3s ease;
}

.menu > li {
    position: relative;
}

.menu-link, .menu-btn {
    background: none;
    border: none;
    color: #333333;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6em 1.2em;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4em;
    text-decoration: none;
    position: relative;
}

.menu-link::after, .menu-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FF6A00;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu-link:hover::after, .menu-btn:hover::after, .menu-link:focus::after, .menu-btn:focus::after {
    width: 80%;
}

.menu-link:hover, .menu-btn:hover, .menu-link:focus, .menu-btn:focus {
    background: none;
    color: #333333;
    outline: none;
}

.menu-btn svg {
    width: 1em;
    height: 1em;
    margin-left: 0.2em;
    fill: #FF6A00;
    transition: transform 0.3s ease;
}

.menu-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Dropdown */
.dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 120%;
    min-width: 200px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 0.5em 0;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

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

.dropdown li {
    width: 100%;
}

.dropdown-link, .dropdown-btn {
    background: none;
    border: none;
    color: #333333;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    width: 100%;
    padding: 0.8em 1.5em;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4em;
    text-decoration: none;
    position: relative;
}

.dropdown-link::after, .dropdown-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #FF6A00;
    transition: all 0.3s ease;
}

.dropdown-link:hover::after, .dropdown-btn:hover::after, .dropdown-link:focus::after, .dropdown-btn:focus::after {
    width: 100%;
}

.dropdown-link:hover, .dropdown-btn:hover, .dropdown-link:focus, .dropdown-btn:focus {
    background: rgba(255, 106, 0, 0.05);
    color: #333333;
}

/* Sous-dropdown */
.has-submenu {
    position: relative;
}

.sub-dropdown {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 180px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0.5em 0;
    z-index: 210;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    list-style: none;
}

.sub-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Bouton Burger */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 106, 0, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    margin-left: 1rem;
    padding: 10px;
}

.burger-btn:hover {
    background: rgba(255, 106, 0, 0.2);
}

.burger-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    margin: 2.5px 0;
    background: #FF6A00;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.burger-btn[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.burger-btn[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

/* Menu mobile */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: #ffffff;
    display: none;
    flex-direction: column;
    padding: 100px 1.5rem 2rem;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    z-index: 999;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.show {
    transform: translateX(0);
}

.mobile-menu > li {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.mobile-menu > li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mobile-menu .menu-btn {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu .dropdown.show {
    max-height: 500px;
    padding: 0.5rem 0 0 1rem;
}

.mobile-menu .dropdown-link {
    display: block;
    padding: 0.6rem 0;
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 1rem;
}

.mobile-menu .dropdown-link:hover {
    color: #FF6A00;
}

.mobile-menu .sub-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    margin-left: 0.5rem;
    border-left: 2px solid #f0f0f0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu .sub-dropdown.show {
    max-height: 500px;
}

/* Styles pour mobile */
@media (max-width: 1024px) {
    .burger-btn {
        display: flex;
    }
    
    .mobile-menu {
        display: flex;
    }
}

@media (max-width: 768px) {
    .navbar-inner {
        padding: 0.8rem 1rem;
    }

    .logo img {
        max-height: 40px;
        width: auto;
    }

    .menu-link, .menu-btn {
        padding: 0.8rem 0;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-inner {
        padding: 0.5rem;
    }

    .logo img {
        max-height: 35px;
    }

    .mobile-menu {
        padding: 80px 1rem 1rem;
        max-width: 280px;
    }

    .menu-link, .menu-btn {
        font-size: 0.9rem;
    }
    
    .burger-btn {
        width: 40px;
        height: 40px;
    }
}

/* Sélecteur de langue */
.language-selector {
    display: flex;
    align-items: center;
}

.language-dropdown {
    position: relative;
}

.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.language-button:hover {
    background: rgba(255, 106, 0, 0.1);
}

.language-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 180px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    z-index: 100;
    display: none;
}

.language-menu.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background 0.2s ease;
}

.language-option:hover {
    background: rgba(255, 106, 0, 0.05);
}

.language-option.active {
    background: rgba(255, 106, 0, 0.1);
}
