@use '../base/colors' as *;
@use '../layout/media_queries';

.header_navigation_topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    //font-family: 'brandontext_regular';
    font-family: var(--font-roboto);
    font-size: 16px;

    .header_nav_topbar_item {
        list-style: none;
        cursor: pointer;
        
        margin-right: 30px;
        &:last-child {
            margin-right: 0px;
        }
        position: relative;
        cursor: pointer;

        &:hover {
            border-bottom: none !important;
            .header_nav_topbar_submenu {
                visibility: visible;
                /* Pour l'effet de transition */
                opacity: 1;
            }
        }
        &.is-active {
            border-bottom: 2px solid var(--c-brand_rouge);
            padding-bottom: 1px;
        }
    }
    .header_nav_topbar_submenu {
        position: absolute;
        left: 0;
        z-index: 2;
        width: 187px;
        visibility:hidden;
        /* Pour l'effet de transition */
        opacity: 0;
        transition: visibility 0.2s,opacity 0.2s cubic-bezier(0.4, 0, 1, 1);
        padding-top: 10px;
        padding-left: 9px;
        padding-right: 16px;
        padding-bottom: 5px;
        text-align: left;
        background-color: var(--c-surface);
        border-radius: 3px;

        .header_nav_topbar_submenu_item {
            list-style: none;
            //font-family: 'brandontext_regular';
            font-family: var(--font-roboto);
            font-size: 15px;
            padding-bottom: 2px;
            &:hover {
                a {
                    color: var(--c-brand_rouge);
                }
            }
        }
    }

    .header_nav_lang {
        display: flex;
        font-family: 'brandontext_medium';
        .header_nav_lang_item {
            margin-right: 4px;
            &:last-child {
                margin-right: 0px;
            }
        }
    }
}
.header_navigation_main {
    display: grid;
    
    grid-template-rows: 1fr;
    grid-template-columns: 1fr;

    @include media_queries.media_min(tablet_701) {
        grid-template-columns: 140px 1fr;
    }
    @include media_queries.media_min(tablet_800) {
        grid-template-columns: 140px 1fr;
    }
    @include media_queries.media_min(tablet_900) {
        grid-template-columns: 171px 1fr;
    }
    @include media_queries.media_min(desktop_1000) {
        grid-template-columns: 200px 1fr;
    }
    @include media_queries.media_min(desktop_1200) {
        grid-template-columns: 200px 1fr;
    }
    @include media_queries.media_min(desktop_1500) {
        grid-template-columns: 240px 1fr;
    }
    @include media_queries.media_min(desktop_1800) {
        grid-template-columns: 240px 1fr;
    }

}
.header_nav_logo {
    position: relative;
    z-index: 10;
    @include media_queries.media_min(tablet_700) {
        margin-top: -7px;
    }
    @include media_queries.media_min(tablet_800) {
        margin-top: -7px;
    }
    @include media_queries.media_min(tablet_900) {
        margin-top: -17px;
    }


    @include media_queries.media_max(tablet_700) {
        width: 166px;
        margin-left: 43px;
    }
    @include media_queries.media_max(phone_500) {
        margin-left: 0px;
    }
    @include media_queries.media_max(phone_300) {
        margin-left: 0px;
    }



}
.header_nav_cont {
    
    @include media_queries.media_max(tablet_800) {
        margin-left: 40px;
        margin-right: 20px;
    }
    @include media_queries.media_min(tablet_800) {
        margin-left: 25px;
        margin-right: 0px;
    }
    @include media_queries.media_min(tablet_900) {
        margin-left: 30px;
        margin-right: 0px;
    }
    
    @include media_queries.media_max(tablet_700) {
        margin-top: -9px;
    }


    .header_nav {
        display: flex;
        row-gap: 13px;
        justify-content: center;
        @include media_queries.media_min(tablet_700) {
            justify-content: flex-start;
        } 
        @include media_queries.media_min(tablet_800) {
            justify-content: center;
        }
        flex-wrap: wrap;

        text-wrap-mode: nowrap;

        //font-family: 'brandontext_regular';
        font-family: var(--font-roboto);
        // wght Graisse
        // YTLC Hauteur miniscule
        // YTUC Hauteur majuscule
        // YTAS Hauteur des hampes ascendantes
        // YTDE Hauteur des hampes descendantes
        // wdth largeur horizontale des lettres
        font-variation-settings: 
            "wdth" 41,
            "wght" 662,
            "YTLC" 570,
            "YTUC" 760,
            "YTAS" 794,
            "YTDE" -275;
        
        @include media_queries.media_min(tablet_600) {
            font-size: 18px;
        }    
        @include media_queries.media_min(tablet_900) {
            font-size: 20px;
        }
        @include media_queries.media_min(desktop_1200) {
            font-size: 22px;
        }
        @include media_queries.media_min(desktop_1500) {
            font-size: 24px;
        }
        @include media_queries.media_min(desktop_1800) {
            font-size: 24px;
        }

        .header_nav_item {
            position: relative;
            cursor: pointer;

            &:hover {
                border-bottom: none !important;
                padding-bottom: 2px;
                .header_nav_sub_menu {
                    visibility: visible;
                    /* Pour l'effet de transition */
                    opacity: 1;
                }
            }
            &.is-active {
                border-bottom: 2px solid var(--c-brand_rouge);
                padding-bottom: 1px;
            }

            list-style: none;

            @media (min-width: 728px) and (max-width: 795px) {
                .decalage_gauche {
                    margin-left: -73px;
                }
            }

            &:nth-child(5) {
                margin-right: 10px;
            }
            @include media_queries.media_min(tablet_701) {
                margin-right: 20px;
            }    
            @include media_queries.media_min(tablet_900) {
                margin-right: 22px;
            }
            @include media_queries.media_min(desktop_1200) {
                margin-right: 28px;
            }
            @include media_queries.media_min(desktop_1500) {
                margin-right: 30px;
            }
            @include media_queries.media_min(desktop_1800) {
                margin-right: 30px;
            }
            &:last-child {
                margin-right: 0px;
            }

        }

        .header_nav_sub_menu {
            position: absolute;
            
            @media (min-width: 0px) {
                left: -10px;
            }
            @media (min-width: 900px) {
                left: 0px;
            }
            z-index: 2;
            visibility:hidden;
            /* Pour l'effet de transition */
            opacity: 0;
            transition: visibility 0.2s,opacity 0.2s cubic-bezier(0.4, 0, 1, 1);
            padding-top: 17px;
            padding-left: 27px;
            padding-right: 12px;
            padding-bottom: 10px;
            text-align: left;
            background-color: var(--c-surface);
            border-radius: 3px;

            .header_nav_sub_menu_item {
                list-style: circle;
                //font-family: 'brandontext_regular';
                font-family: var(--font-roboto);
                font-variation-settings: 
                    "wdth" 41, "wght" 552, "YTLC" 570, "YTUC" 760, "YTAS" 794, "YTDE" -275;
                @media (min-width: 0px) {
                    font-size: 16px;
                }
                @media (min-width: 900px) {
                    font-size: 18px;
                }
                padding-bottom: 3px;
                &:hover {
                    a {
                        color: var(--c-brand_rouge);
                    }
                }
            }
        }

        .header_nav_icones {
            display: flex;
        }
        .nav_icone {
            display: flex;

            .nav_icone_img {


                img {
                    @include media_queries.media_max(tablet_600) {
                        width: 83%;
                    }
                    @include media_queries.media_min(tablet_600) {
                        width: 83%;
                    }    
                    @include media_queries.media_min(tablet_900) {
                        width: 83%;
                    }
                    @include media_queries.media_min(desktop_1800) {
                        width: 83%;
                    }
                }
            }
            .nav_icone_img--agenda {
                margin-right: 13px;
                @include media_queries.media_min(tablet_600) {
                    margin-top: 1px;
                }    
                @include media_queries.media_min(tablet_900) {
                    margin-top: 2px;
                }
                @include media_queries.media_min(desktop_1800) {
                    margin-top: 2px;
                }
            }
            .nav_icone_img--ticket {
                width: 46px;
                margin-top: -4px;
            }
        }

        .nav_focus_black {
            background-color: var(--c-text);
            color: var(--c-text-invert);
            padding-left: 5px;
            padding-top: 3px;
            padding-bottom: 1px;
            padding-right: 6px;
            margin-top: -6px;
        }
    }

    /* accessibilité pour que les écran est le message "ouvrir le menu" mais non visible sur l'écran en mode normal*/
    .sr-only {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Par défaut : desktop visible, mobile caché */
    .header_nav--desktop { display: flex; align-items: center;}
    .header_nav--mobile { display: none; }
    .header_nav--mobile-icons { display: none; }
    .header_drawer { display: none; }

    /* ✅ Mobile < 700px : on inverse */
    @media (max-width: 700px) {
        .header_nav--desktop { display: none; }

    .header_nav--mobile {
        display: flex;
        justify-content: flex-end;
        margin-top: -21px;
    }

    .header_nav--mobile-icons {
        display: none;
        @include media_queries.media_min(phone_400) {
            display: flex;
        }
        justify-content: flex-end;
        margin-top: -23px;
        margin-right: 30px;
    }

        .hamburger_black {
            background-color: $noir;
        }
        .hamburger_white {
            background-color: $blanc;
        }
        .header_burger {
            position: relative;
            background: transparent;
            border: 0;
            cursor: pointer;

            width: 27px;

            padding: 8px;

            font-size: 26px;
            line-height: 1;
            
            img {
                width: 31px;
            }
            .burger_line {
                position: absolute;
                left: 0;
                width: 100%;
                height: 3px;
                transition:
                transform 0.25s ease,
                opacity 0.2s ease,
                top 0.25s ease;
            }

            .burger_line:nth-child(1) { top: 0; }
            .burger_line:nth-child(2) { top: 8px; }
            .burger_line:nth-child(3) { top: 16px; }

            &.is-open {
                .burger_line:nth-child(1) {
                    top: 8px;
                    transform: rotate(45deg);
                }

                .burger_line:nth-child(2) {
                    opacity: 0;
                }

                .burger_line:nth-child(3) {
                    top: 8px;
                    transform: rotate(-45deg);
                }
            }
        }

        .header_drawer {
            display: block;
            width: 100%;
            position: absolute;
            left: 0;
            
            border-top: 1px solid rgba(0,0,0,.1);
            background-color: rgba(0, 0, 0, 0.9);
            margin-top: 47px;

            font-family: var(--font-roboto);
            font-variation-settings: 
                "wdth" 41,
                "wght" 662,
                "YTLC" 570,
                "YTUC" 760,
                "YTAS" 794,
                "YTDE" -275;
            
            padding-bottom: 10px;
            padding-right: 10px;
            padding-left: 40px;
        }

        .header_drawer[data-open="false"] {
            display: none;
        }

        .header_drawer_inner {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 12px 0;
        }

        .header_drawer_link {
            display: block;
            width: fit-content;
            text-decoration: none;
            color: $blanc;
            padding: 6px 0;
            font-size: 26px;
            position: relative;
            cursor: pointer;


            &.is-open {
                border-bottom: none !important;
                .header_drawer_sub_menu {
                    display: block;
                    visibility: visible;
                    opacity: 1;
                }
            }
            &.is-active {
                border-bottom: 2px solid var(--c-brand_rouge);
                padding-bottom: 1px;
            }

            list-style: none;
        }
        .header_drawer_sub_menu {
            display: none;
            max-width: 300px;
            //position: absolute;
            left: 0;
            z-index: 2;
            visibility:hidden;
            /* Pour l'effet de transition */
            opacity: 0;
            transition: visibility 0.2s,opacity 0.2s cubic-bezier(0.4, 0, 1, 1);
            margin-top: 10px;
            margin-left: 20px;
            padding-top: 13px;
            padding-left: 23px;
            padding-right: 16px;
            padding-bottom: 10px;
            text-align: left;
            background-color: rgba(255, 255, 255, 0.93);
            border-radius: 3px;
        }
        .header_drawer_sub_menu_item {
            list-style: none;
                //font-family: 'brandontext_regular';
                font-family: var(--font-roboto);
                font-variation-settings: 
                    "wdth" 41, "wght" 552, "YTLC" 570, "YTUC" 760, "YTAS" 794, "YTDE" -275;
                font-size: 18px;
                padding-bottom: 4px;
                list-style: circle;
                color: var(--c-text);
                &:hover {
                    a {
                        color: var(--c-brand_rouge);
                    }
                }
        }
        .nav_focus_invert {
            background-color: var(--c-text-invert);
            color: var(--c-text);
            padding-inline: 5px;
            padding-top: 2px;
            padding-bottom: 1px;
        }
    }
    

}
