/* ======================================
   MENU CUSTOM ARTINOV42
   ====================================== */

/* Reset du menu */
.custom-menu,
.custom-menu * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Container du menu */
.custom-menu {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
    z-index: 1000;
}

/* S'assurer que le menu mobile est au-dessus de tout */
@media screen and (max-width: 1279px) {
    .custom-menu {
        z-index: 10001; /* Au-dessus de tout */
    }
}

.custom-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

/* Logo */
.custom-menu-logo {
    flex-shrink: 0;
}

.custom-menu-logo a {
    display: block;
    width: 280px;
    height: 75px;
    background: url('../images/LOGO.png') no-repeat left center;
    background-size: contain;
    text-indent: -9999px;
}

/* Navigation */
.custom-menu-nav {
    display: flex;
    align-items: center;
    list-style: none;
}

.custom-menu-nav > li {
    position: relative;
    margin-left: 5px;
}

.custom-menu-nav > li > a {
    display: block;
    padding: 10px 18px;
    color: #2C3E50;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.custom-menu-nav > li > a:hover {
    color: #8B7355;
}

.custom-menu-nav > li > a strong {
    font-weight: 700;
    color: #8B7355;
}

/* Lien actif (avec strong ou classe active) - Même style pour tous */
.custom-menu-nav > li > a:has(strong),
.custom-menu-nav > li > a strong,
.custom-menu-nav > li > a.active {
    color: #8B7355 !important;
    font-weight: 700;
    font-size: 14px; /* Même taille que les autres liens */
    letter-spacing: 0.5px; /* Même espacement */
}

/* Support pour la classe active (solution principale recommandée) */
.custom-menu-nav > li > a.active {
    color: #8B7355 !important;
    font-weight: 700;
    font-size: 14px; /* Même taille que les autres liens */
    letter-spacing: 0.5px; /* Même espacement */
}

/* Dropdown */
.custom-menu-nav .dropdown {
    position: relative;
}

.custom-menu-nav .dropdown > a {
    cursor: pointer;
}

.custom-menu-nav .dropdown > a::after {
    content: '▼';
    font-size: 10px;
    margin-left: 6px;
    color: #8B7355;
}

.custom-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-top: 3px solid #8B7355;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
}

.custom-menu-nav .dropdown:hover .custom-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-menu-dropdown li {
    border-bottom: 1px solid #f0f0f0;
}

.custom-menu-dropdown li:last-child {
    border-bottom: none;
}

.custom-menu-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #5A5A5A !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.custom-menu-dropdown a:hover,
.custom-menu-dropdown a:focus,
.custom-menu-dropdown a:active,
.custom-menu-dropdown a:visited {
    background: #f9f9f9;
    color: #8B7355 !important;
    padding-left: 25px;
}

.custom-menu-dropdown a:visited {
    color: #5A5A5A !important;
}

.custom-menu-dropdown a:visited:hover {
    color: #8B7355 !important;
}

/* Hamburger - Masqué par défaut */
.custom-menu-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8B7355 0%, #6B5B4F 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

.custom-menu-hamburger:hover {
    background: linear-gradient(135deg, #6B5B4F 0%, #5A4A3F 100%);
    transform: scale(1.05);
}

.custom-menu-hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #F5F5DC;
    margin: 3px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.custom-menu-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.custom-menu-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.custom-menu-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ======================================
   RESPONSIVE < 1280px
   ====================================== */

@media screen and (max-width: 1279px) {
    /* Afficher le hamburger */
    .custom-menu-hamburger {
        display: flex;
    }

    /* Masquer le menu desktop */
    .custom-menu-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 0 20px 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        overflow-y: auto;
        z-index: 10001; /* Au-dessus de l'overlay */
        pointer-events: none; /* Ne bloque pas les clics quand inactif */
    }

    .custom-menu-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto; /* Permet les clics quand actif */
    }
    
    /* S'assurer que les items du menu sont cliquables */
    .custom-menu-nav.active > li {
        pointer-events: auto;
    }
    
    .custom-menu-nav.active > li > a {
        pointer-events: auto !important;
    }

    /* Overlay */
    .custom-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 10000; /* En dessous du menu */
        pointer-events: none; /* Ne bloque pas les clics quand inactif */
    }

    .custom-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto; /* Bloque les clics en arrière-plan quand actif */
    }

    /* Header du menu mobile */
    .custom-menu-nav::before {
        content: 'MENU';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, #8B7355 0%, #6B5B4F 100%);
        color: #F5F5DC;
        padding: 20px;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 3px;
        text-align: center;
        pointer-events: none; /* Ne bloque pas les clics */
        z-index: 1;
    }

    /* Bouton fermer */
    .custom-menu-close {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        color: #F5F5DC;
        font-size: 24px;
        line-height: 36px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 10000;
    }

    .custom-menu-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

    /* Items du menu mobile */
    .custom-menu-nav > li {
        margin: 0;
        border-bottom: 1px solid rgba(139, 115, 85, 0.1);
    }

    .custom-menu-nav > li:last-child {
        border-bottom: none;
    }

    .custom-menu-nav > li > a {
        padding: 18px 25px;
        font-size: 15px;
        pointer-events: auto !important; /* Assure que les liens sont cliquables */
        cursor: pointer !important;
        position: relative;
        z-index: 1;
    }

    .custom-menu-nav > li > a:hover {
        background: rgba(139, 115, 85, 0.05);
        padding-left: 30px;
    }

    /* Dropdown mobile */
    .custom-menu-nav .dropdown > a::after {
        content: '▸';
        float: right;
        transform: rotate(0deg);
        transition: transform 0.3s ease;
    }

    .custom-menu-nav .dropdown.active > a::after {
        transform: rotate(90deg);
    }

    .custom-menu-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-left: 4px solid #8B7355;
        box-shadow: none;
        background: #f9f9f9;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .custom-menu-nav .dropdown.active .custom-menu-dropdown {
        max-height: 500px;
    }

    .custom-menu-dropdown a {
        padding: 14px 25px 14px 50px;
        font-size: 14px;
        color: #5A5A5A !important;
        pointer-events: auto !important; /* Assure que les liens sont cliquables */
        cursor: pointer !important;
        position: relative;
        z-index: 1;
    }

    .custom-menu-dropdown a::before {
        content: '▸';
        margin-right: 10px;
        color: #8B7355 !important;
    }

    .custom-menu-dropdown a:hover,
    .custom-menu-dropdown a:focus,
    .custom-menu-dropdown a:active {
        background: rgba(139, 115, 85, 0.08);
        color: #8B7355 !important;
        padding-left: 55px;
    }
    
    .custom-menu-dropdown a:visited {
        color: #5A5A5A !important;
    }
    
    .custom-menu-dropdown a:visited:hover {
        color: #8B7355 !important;
    }

    /* Logo agrandi sur mobile */
    .custom-menu-logo a {
        width: 220px;
        height: 60px;
    }
}

/* Mobile très petit < 480px */
@media screen and (max-width: 479px) {
    .custom-menu-container {
        padding: 0 15px;
        min-height: 60px;
    }

    .custom-menu-logo a {
        width: 180px;
        height: 55px;
    }

    .custom-menu-hamburger {
        width: 45px;
        height: 45px;
    }

    .custom-menu-nav {
        padding: 70px 0 20px 0;
    }

    .custom-menu-nav > li > a {
        padding: 16px 20px;
        font-size: 14px;
    }
}
