/* __________ MENU ITEMS ____________ */

li.first-level-item{
    position: relative;
    height: 46px;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 0px 20px;
    background-color: var(--secondary-color-4);
    margin: 0;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    cursor: default;
}

li.first-level-item span{
    z-index: 1;
}

li.first-level-item:before{
    position: absolute;
    content: "";
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--main-color-2);
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

li.first-level-item.selected{
    background-color: var(--secondary-color-2)
}

li.first-level-item.current-level:before{
    height: 100%;
}

.menu{
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-flow: column wrap;
    flex-flow: column wrap;
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
}

li.menu-item{
    position: relative;
    height: 40px;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 0px 20px;
    background-color: var(--secondary-color-4);
    margin: 0px 0px 15px 0px;
}

li.menu-item a{
    z-index: 1;
}

li.menu-item:before{
    position: absolute;
    content: "";
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--main-color-2);
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

li.menu-item:hover:before{
    height: 100%;
}

/* ________ LOGO __________ */

a.logo-header{
    position: absolute;
    top: 0px;
    left: 10px;
}

a.logo-header img{
    max-height: 80px;
    width: auto;
    -webkit-transition: all 0.4s;
    transition: all 0.4s;
}

a.logo-header.active-menu img{
    max-height: 130px;
}

a.logo-header-mobile{
    display: none;
}

/* __________ MENU POSITION __________ */

#main-header{
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 50;
}

.nav-box{
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    height: 80px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

#nav-list{
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
}

/* _________ OPENING MENU _________ */

#main-header.open-menu{
    background-color: var(--main-color-4);
    height: auto;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

#main-header.open-menu:after{
    position: absolute;
    content: "";
    width: 100%;
    height: 10px;
    background-color: var(--secondary-color-4);
    bottom: 0;
}

#second-level-nav-list{
    display: none;
}

#second-level-nav-list.open-menu{
    display: block;
    margin: 40px 0px;
}

.second-level-box{
    display: none;
}

.second-level-box.selected{
    display: block;
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
}

.second-level-box.selected.transition{
    -webkit-transform: translateX(0%);
    transform: translateX(0%);
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

/* _________ INPUT OPENING MENU ________ */

label.open-close-menu{
    display: none;
    content:"";
    height: 30px;
    width: 30px;
    background-image: url("../../images/002-menu.svg");
    background-size: cover;
}

#mobile-menu{
    display: none;
}

#mobile-menu:checked ~ nav .mobile-nav-box .nav-box .mobile-header label{
    background-image: url("../../images/001-cross.svg");
}


/* ____________ DISPLAY NONE _________ */

.back-to-first-level-box{
    display: none;
}

/* _________ MEDIA QUERIES ___________ */

@media (max-width: 1200px){
    
    #main-header.open-menu:after{
    display: none;
    }
    
    #main-header{
        background-color: var(--main-color-4);
    }
    
    .nav-box{
        height: 60px;
    }
    
    .mobile-nav-box{
        position: relative;
    }
    
    .mobile-header{
        width: 100%;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: end;
        -ms-flex-pack: end;
        justify-content: flex-end;
    }
    
    label.open-close-menu{
        display: block;
    }
    
    #nav-list{
        position: absolute;
        left: -100%;
        top: 100px;
        overflow-x: hidden;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-flow: column nowrap;
        flex-flow: column nowrap;  
        -webkit-box-align: start;  
        -ms-flex-align: start;  
        align-items: flex-start;
    }
    
    li.first-level-item{
        margin-bottom: 15px;
        height: 40px;
    }
    
    .background-mobile-menu{
        content: "";
        position : absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 0vh;
        background-color: var(--main-color-4);
    }
    
    #mobile-menu:checked ~ .background-mobile-menu{
        height: 100vh;
    }
    
    #mobile-menu:checked ~ nav .nav-box #nav-list{
        left: 0;
    }
    
    #second-level-nav-list{
        position: absolute;
        right: -100%;
    }
    
    #mobile-menu:checked ~ nav #second-level-nav-list{
        right: 0;
    }
    
    a.logo-header{
        display: none;
    }
    
    a.logo-header-mobile{
        display: block;
        position: absolute;
        top: 2px;
        left: 5px;
    }

    a.logo-header-mobile img{
        max-height: 56px;
        width: auto;
        -webkit-transition: all 0.4s;
        transition: all 0.4s;
    }   
}

@media (max-width: 576px){
    
    #second-level-nav-list{
        width: 100%;
        -webkit-transition: all 0.2s;
        transition: all 0.2s;
    }
    
    .back-to-first-level-box{
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-flow: row wrap;
        flex-flow: row wrap;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        margin-bottom: 40px;
        width: 100%;
    }
    
    .arrow-menu.flaticon-back{
        display: -webkit-inline-box;
        display: -ms-inline-flexbox;
        display: inline-flex;
        width: 100%;
        height: 100%;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
    }
    
    .arrow-menu.flaticon-back:before { 
        content: "\f101"; 
        -webkit-transition: all 0.2s; 
        transition: all 0.2s;
    }
    
    #mobile-menu:checked ~ nav .nav-box #nav-list.close-menu{
        left: -100%;
    }
    
    #nav-list{
        top: 180px;
        -webkit-transition: all 0.2s;
        transition: all 0.2s;
    }
    
    .second-level-marked{
        display:none;
    }
    
    .second-level-marked.level-selected{
        height: 40px;
        display: -webkit-inline-box;
        display: -ms-inline-flexbox;
        display: inline-flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-flow: row wrap;
        flex-flow: row wrap;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        padding: 0px 20px;
        width: auto;
        background-color: var(--main-color-2);
    }
    
    
}