/* Variables spécifiques à la navigation - autres variables dans assets/css/variables.css */

.main-navigation {
    display: flex;
    align-items: center;
    flex-grow: 1;
    z-index: 1;
}

/* Menu notification et recherche */
.menu-search,
.menu-notification {
    position: relative;
    z-index: 20;
}

.menu-notification {
    margin-left: auto;
}

.menu-notification .notification-icon,
.menu-search .search-icon {
    position: relative;
    top: 2px;
    display: inline-block;
    margin: 0 .25rem;
    width: 2.25rem;
    height: 2.25rem;
    background: url('../images/icon/notification.svg') no-repeat center;
    background-size: 1.125rem;
    border-radius: 2rem;
    outline: none;
    transition: background-color 0.3s ease;
}

.menu-search .search-icon {
    background-image: url('../images/icon/search.svg');
}

.menu-notification .notification-icon:hover,
.menu-search .search-icon:hover {
    background-color: var(--beige);
}

.search-dropdown,
.notification-dropdown {
    display: block;
    position: fixed;
    right: .75rem;
    top: 74px;
    width: 100%;
    width: calc(100% - 1.5rem);
    max-width: 396px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem;
    z-index: 1000;
    font-size: var(--font-normal-size);
    color: var(--artge-titre, #222);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-dropdown {
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    clip-path: inset(0 0 100% 0);
    transition: opacity 0.1s ease, clip-path 0.9s ease, visibility 0.3s ease, transform 0.3s ease;
}

.notification-dropdown .skelton {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--beige);
    min-height: 110px;
    width: 100%;
    border-radius: .5rem;
}

.menu-notification.is-active .notification-dropdown {
    opacity: 1;
    pointer-events: auto;
}

.menu-search.is-active .search-dropdown {
    /*
    transform: translateY(0);
    */
    opacity: 1;
    pointer-events: auto;
    cursor: default;
    visibility: visible;
    clip-path: inset(0 0 0 0);
    transition: opacity 0.12s ease, clip-path 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.menu-notification .notification-icon::after {
    opacity: 0;
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    bottom: -32px;
    transform: translateX(-50%);
    height: 10px;
    background: transparent;
    pointer-events: none;
    z-index: 1001;
    transition: opacity 0.3s ease;
}

.menu-notification.is-active .notification-icon::after {
    opacity: 1;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 16px solid #FFF;
    background: none;
}


.hero-push-card {
    width: 100%;
    border-radius: var(--hero-card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem 3.5rem;
    gap: 1rem;
    text-decoration: none !important;
}

.notification-dropdown .hero-push-card {
    padding: 1.25rem;
    transition: background-color 0.3s ease;
}

.notification-dropdown .hero-push-card:hover {
    background: var(--beige);
}

.notification-dropdown .hero-push-card:hover .hover-bright {
    filter: brightness(104%);
}

.notification-dropdown .hero-push-card .tagz {
    top: auto;
    left: auto;
    right: -10px;
    bottom: -10px;
}

@media (min-width: 992px) {
    .notification-dropdown {
        top: 92px;
        width: 395px;
    }
    .notification-dropdown .skelton {
        min-height: 160px;
    }
    .menu-notification .notification-icon::after {
        bottom: -36px;
    } 
    .notification-dropdown .hero-push-img {
        max-width: 94px;
    }
}

.search-dropdown {
    z-index: 990;
    max-width: none;
    width: 100%;
    top: 60px;
    left: 0;
    right: 0;
    border-radius: 0;
    background: var(--beige) url('../images/bg-search.png') no-repeat bottom center;
    background-size: 100% auto;
    min-height: 50vh;
    padding: 2rem 1rem 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    /*
    box-shadow: 0 16px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-20px);    
    transition: opacity 0.3s ease, transform 0.3s ease;
    */
    /* background-size: auto 80%;*/
}
.search-dropdown::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to bottom, 
            rgba(240,240,240,1) 0%,
            rgba(255,255,255,0) 10px,
            rgba(255,255,255,0) 100%);
}

.search-title {
    font-size: 35px;
    font-weight: 600;
    color: var(--artge-titre);
    margin-bottom: 1rem;
    text-align: center;
}

.search-here {
    background: #fff;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-topic p {
    font-weight: 600;
    margin: 1rem 1.5rem 0;
    color: var(--artge-light-text);
}

.search-topic ul {
    margin: 1rem 0;
}

.search-topic ul li a {
    display: block;
    width: 100%;
    font-size: var(--font-small-size);
    padding: 0.5rem 1rem 0.5rem 3rem;
}
.search-topic ul li a:hover {
    background: var(--beige);
}

.search-here form {
    display: flex;
    align-items: center;
    padding: .25rem;
}

.search-here form input[type="text"] {
    border-radius: 1rem;
    flex: 1 0 auto;
    padding: 1.25rem;
    outline: none;
}
.search-here form input[type="text"]:focus {
    background: var(--beige);
}

.bg-beige .search-here form input[type="text"]:focus {
    background: #fff;
}

.search-here form button {
    background: url('../images/icon/search.svg') no-repeat center;
    background-size: 1.5rem 1.5rem;
    width: 4rem;
    height: 4rem;
    margin: 0 .25rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    text-indent: -9999px;
    overflow: hidden;
    padding: 0;
    transition: background-color 0.2s;
}
.search-here form button:focus,
.search-here form button:hover {
    background-color: var(--beige);
    outline: none;
}


/*
.search-dropdown {
    display: block;
    position: fixed;
    left: 0;
    top: 74px;
    width: 100%;
    width: calc(100% - 1.5rem);
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
*/
/*
.menu-search.is-active .search-dropdown {
    opacity: 1;
    pointer-events: auto;
}
*/
@media (min-width: 992px) {
    .search-dropdown {
        padding: 5rem 1rem 7rem;
        top: 80px;
    }
}

/* Menu principal */
.nav-menu > li.has-mega-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.nav-menu li > a,
.nav-menu li > .menu-link-parent {
    font-size: var(--font-small-size);
    font-weight: 500;
    color: var(--artge-titre);
    line-height: 1.25;
    letter-spacing: 0.035em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 30px;
    padding: 7px 20px;
    transition: all 0.3s ease;
    user-select: none;
}

.sub-menu > li > a {
    font-size: var(--font-main-size);
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 2.375rem;
}

.sub-menu {
    margin-top: 1rem;
    /*
    margin-left: -1.125rem;
    */
}

.sub-menu .sub-menu {
    margin-top: 0;
    margin-left: 0;
    padding-left: 1.25rem;
}

.sub-menu .sub-menu > li > a {
    font-size: var(--font-small-size);
    font-weight: 500;
    line-height: 1.25;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu > .current-menu-ancestor > a,
.nav-menu .menu-link-parent:hover,
.nav-menu .current-menu-item > .menu-link-parent,
.nav-menu .current-menu-ancestor > .menu-link-parent {
    cursor: pointer;
    color: var(--artge-titre);
    background: var(--beige);
}

.nav-menu > li:hover > a,
.nav-menu > li:focus-within > a,
.nav-menu > li:hover > .menu-link-parent,
.nav-menu > li:focus-within > .menu-link-parent {
    color: var(--artge-titre);
    background: var(--rougeLT);
    background: var(--beige);
}

.nav-menu a.card .h4 {
    font-size: var(--font-main-size);
}

.nav-menu a.card:hover {
    background: transparent;
}

.nav-menu > li.menu-item-has-children > a::after,
.nav-menu > li.menu-item-has-children > .menu-link-parent::after {
    content: '';
    width: 12px;
    height: 12px;
    background: url('../images/icon/ic-arrow-down.svg') no-repeat center;
    background-size: contain;
    transition: transform 0.3s ease;
}

.mega-menu .container {
    max-width: var(--container-width);
}

.mega-menu-desc {
    display: block;
    font-size: 1.125rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Menu desktop */
@media (min-width: 992px) {
    .nav-menu {
        display: flex;
        gap: .5rem;
        align-items: center;
    }

    .nav-menu > li {
        position: relative;
        height: 80px;
        display: flex;
        align-items: center;
    }

    .nav-menu > li.has-mega-menu {
        cursor: pointer;
    }

    /* Mega menu */
    .mega-menu {
        position: fixed;
        left: 0;
        top: var(--header-height, 80px);
        width: 100vw;
        width: 100%;
        min-width: unset;
        max-width: none;
        border-radius: 0 0;
        box-shadow: 0 30px 22px rgba(0,0,0,0.05);
        z-index: 999;
        padding: 2rem 0;
        margin: 0;
        background: var(--beige);
        background: #aaa;
        background: #fff;
        background: linear-gradient(to bottom, 
            rgba(240,240,240,1) 0%,
            rgba(255,255,255,1) 10px,
            rgba(255,255,255,1) 100%);
        pointer-events: none;
        display: flex;
        justify-content: center;

        /*transform: translateY(-20px);*/

        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        clip-path: inset(0 0 100% 0);
        transition: opacity 0.1s ease, clip-path 0.9s ease, visibility 0.3s ease, transform 0.3s ease;
    }

    /*
    .admin-bar .mega-menu {
        top: var(--header-height, 108px);
    }
    */

    .nav-menu > li:hover .mega-menu,
    .nav-menu > li:focus-within .mega-menu {
        cursor: default;
        pointer-events: auto;        
        /*transform: translateY(0);*/
        opacity: 1;
        visibility: visible;
        clip-path: inset(0 0 0 0);
        transition: opacity 0.12s ease, clip-path 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    }

    .mega-menu-shadow,
    .mega-menu:after,
    .nav-menu > li:hover .mega-menu:after {
        content: '';
        height: 10px;
        width: 100%;
        display: block;
        background-color: aqua;
        z-index: 9999;
        position: absolute;
        bottom: -10px;
    }

    /* Overlay pour le mega menu */
    .mega-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998; /* Juste en dessous du mega menu */
        opacity: 0;
        visibility: hidden;
        /*
        transition: opacity 0.3s ease, visibility 0.3s ease;
        transition-delay: 0.3s;
        */
        transition: opacity 0.8s ease, visibility 0.9s ease;
        pointer-events: none;
    }

    /* Afficher l'overlay quand un mega menu est ouvert */
    body.mega-menu-open .mega-menu-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        /*
        transition-delay: 0.1s;
        */
    }
    .menu-toggle {
        display: none;
    }
}

/* Menu mobile */

@media (max-width: 991px) {
    .menu-toggle {
        background: transparent;
        position: absolute;
        right: 1rem;
        z-index: 999;
        border: none;
        background: none;
        padding: 1rem;
        padding: 22px 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .menu-toggle-icon {
        width: 24px;
        height: 2px;
        background-color: var(--artge-text);
        position: relative;
        transition: all 0.3s ease;
    }

    .menu-toggle-icon::before,
    .menu-toggle-icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 24px;
        height: 2px;
        background-color: var(--artge-text);
        transition: all 0.3s ease;
    }

    .menu-toggle-icon::before {
        top: -8px;
    }

    .menu-toggle-icon::after {
        bottom: -8px;
        width: 18px;
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-icon {
        background-color: transparent;
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
        transform: rotate(45deg);
        top: 0;
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
        transform: rotate(-45deg);
        bottom: 0;
        width: 24px;
    }

    .nav-container {
        position: fixed;
        z-index: -10;
        top: 3.75rem;
        left: 0;
        width: 100%;
        height: 100vh;
        height: calc(100vh - 3.75rem);
        background: #fff;
        padding: 1.75rem;
        padding-bottom: 5rem;
        /*
        transform: translateX(100%);
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        */
        opacity: 0;
        overflow: hidden;
        overflow-y: auto;
        visibility: hidden;
        clip-path: inset(0 0 100% 0);
        transition: all 3s ease;
        transition: opacity 0.1s ease, clip-path 0.9s ease, visibility 0.3s ease, transform 0.3s ease;
    }

    .admin-bar .nav-container {
        top: 6.625rem;
        height: calc(100vh - 6.625rem);
    }

    .nav-container.is-active {
        /*
        transform: translateX(0);
        transform: translateY(0);
        transition: all 3s ease;
        */
        cursor: default;
        pointer-events: auto;
        opacity: 1;
        visibility: visible;
        clip-path: inset(0 0 0 0);
        transition: opacity 0.12s ease, clip-path 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 5rem;
    }

    .mega-menu,
    .mega-menu-items .card-news,
    .mega-menu-desc {
        display: none;
    }

    .mega-menu.is-active {
        display: block;
    }

    /*    
    .mega-menu {
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        clip-path: inset(0 0 100% 0);
        transition: opacity 0.1s ease, clip-path 0.9s ease, visibility 0.3s ease, transform 0.3s ease;
    }

    .mega-menu.is-active {
        opacity: 1;
        visibility: visible;
        clip-path: inset(0 0 0 0);
        transition: opacity 0.12s ease, clip-path 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    }
    */
}
