header{
    @include media-breakpoint-up(lg) {
        @if $header-sticky == "true"{
            position: sticky;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 99999;
        }
    }
    background: $header-background;
    a.nav-link{
        outline: unset;
    }
    .navbar{
        flex-wrap: wrap;
    }
    .navbar-toggler{
        border: 0;
        &:focus{
            box-shadow: unset;
            outline: unset;
        }
        @include media-breakpoint-down(lg) {
            margin-right: 1.5rem;
        }
    }
    button.dropdown-toggle{
        background: transparent;
        border: 0;
        outline: 0;
    }
    .language-dropdown{
        order: 6;
        padding: 0.5rem 0.75rem;
        padding-top: 0.1rem;
        @media screen and (max-width: 991px) {
            order: 3;
        }
        button{
            -webkit-appearance: none;
            border: 0;
            background: transparent;
            padding: 0;
            svg{
                min-width: 2rem;
                height: auto;
            }
        }
        .dropdown-menu{
            right: 0;
            left: unset !important;
            button{
                padding: 0.25rem 1rem !important;
            }
            svg{
                width: 2rem;
                margin-right: .5rem;
                height: auto;
            }

        }
    }
    .menu-bar{
        .megamenu{
            @extend .mt-0;
        }
        @include media-breakpoint-down(lg) {
            .dropdown-toggle{
                display: none;
            }
            &.collapsing, &.show{
                .megamenu, .dropdown-simple{
                    display: block;
                }
            }
            .megamenu{
                & > .nav-item{
                    & > .nav-link{
                        color: $dark;
                        padding-left: 0;
                        font-size: 1.2rem;
                        font-weight: 600;
                    }
                }
                .nav-item{
                    &.head{
                        padding: .5rem 0;
                    }
                    &.child{
                        .nav-link{
                            padding-left: 0;
                        }
                    }
                }
            }
        }
        .dropdown{
            .dropdown-simple {
                border: 0 !important;
            }
            .megamenu{
                border: 0 !important;
                &.dropdown-simple{
                    @include media-breakpoint-up(lg) {
                        flex-direction: column;
                        padding: .5rem 1rem;
                        padding-top: 1rem;
                        box-shadow: $box-shadow;
                    }
                    &:after{
                        display: none;
                    }
                }
                &:after{
                    content: "";
                    position: absolute;
                    left: 50%;
                    top: 0;
                    transform: translateX(-50%);
                    width: 100vw;
                    height: 100%;
                    background: $header-background;
                    z-index: -1;
                }
                &:not(.dropdown-simple){
                    @extend .container;
                }
                & > li.nav-item{
                    @extend .col-xl-2, .col-lg-4, .col-md-6, .col-12, .mb-3;
                    .megasubmenu{
                        @extend .list-unstyled;
                        li.nav-item{
                            @extend .mb-1;
                            .nav-link{
                                color: color-contrast($header-background);
                            }
                        }
                    }
                }
                @include media-breakpoint-up(lg) {
                    position: absolute;
                    width: 100%;
                    left: 50%;
                    transform: translateX(-50%);
                    flex-wrap: wrap;
                    border-color: $gray-300;
                    padding: 1rem 1.5rem;
                    & > li.nav-item{
                        & > a.nav-link{
                            font-weight: 600;
                            font-size: 1rem;
                            color: color-contrast($header-background);
                            padding: 0;
                        }
                    }
                    &.show{
                        display: flex;
                    }
                    .head{
                        .megasubmenu{
                            li.nav-item{
                                a.nav-link{
                                    padding: 0;
                                    &:hover{
                                        background-color: transparent;
                                    }
                                }
                            }
                        }
                    }
                    .nav-item{
                        .nav-link{
                            font-size: $font-size-sm;
                        }
                    }
                }
            }
        }
        @import "icon_header";
    }
    .megamenu{
        .nav-item{
            .nav-link{
                @extend .px-3;
                @extend .py-2;
            }
        }
    }
    .nav-link.dropdown-toggle:after{
        display: none;
    }
    .header-inner{
        @include media-breakpoint-down(lg) {
            padding-bottom: 1rem;
        }
        .navbar{
            @extend .pb-4;
            @extend .pt-4;
        }
        .navbar-brand{
            margin-right: 2rem;
            @include media-breakpoint-up(lg){
                padding-top: 1rem;
                padding-bottom: 1rem;
            }
            @include media-breakpoint-down(lg) {
                padding-top: .5rem;
                padding-bottom: .5rem;
            }
        }
        .menu-bar{
            width: auto;
            &.product-menu-bar{
                flex-grow: unset;
                .all-products{
                    i{
                        margin-left: .5rem;
                        font-size: 75%;
                        font-weight: 900;
                    }
                }
            }
            &.page-menu-bar{
                margin-left: 0;
                margin-right: auto;
                @if $pagemenu-full-width == "true"{
                    width: 100%;
                    ul li:first-child a{
                        padding-left: 0;
                    }
                }
            }
            .nav-item{
                .nav-link{
                    color: color-contrast($header-background);
                    font-weight: 600;
                    &:hover{
                        color: lighten(color-contrast($header-background), 25%);
                    }
                }
            }
            @include media-breakpoint-down(lg) {
                order: 6;
                width: 100%;
                .navbar-nav{
                    padding: .5rem 0;
                    .nav-link{
                        padding: .5rem 1rem;
                        padding-left: 0;
                    }
                    .megamenu{
                        width: 100%;
                        padding: 0;
                        margin: 0;
                        border-radius: 0;
                        .nav-link:not(:last-child){
                            border-bottom: 1px solid $gray-300;
                        }
                    }
                }
            }
            .pages-dropdown{
                .megasubmenu{
                    @include media-breakpoint-down(lg) {
                        position: unset !important;
                        padding-left: 0;
                    }
                    .nav-item{
                        margin-top: 0;
                        margin-bottom: 0;
                        padding-top: 0;
                        padding-bottom: 0;
                        @include media-breakpoint-down(lg) {
                            padding-left: 0;
                        }
                        a.nav-link{
                            @extend .dropdown-item;
                            @include media-breakpoint-down(lg) {
                                padding-left: 0;
                            }
                        }
                    }
                }
                &:hover{
                    .dropdown-menu:not(.icon-inner-menu){
                        display: block;
                    }
                }
            }
        }
        .icon-label{
            position: absolute;
            top: 0px;
            right: 0;
            transform: translate(0rem, -.5rem);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-width: 1.5rem;
            height: 1.5rem;
            border-radius: 2rem;
            font-size: .75rem;
            font-weight: 500;
            background: $basket-counter;
            &.notification{
                background: $warning;
                color: color-contrast($warning);
            }
            @extend .px-2;
            @extend .text-white;
        }
        .nav-icon{
            font-size: 1.25rem;
            color: color-contrast($header-background);
        }
        .dropdown-toggle{
            cursor: pointer;
        }
        .user-wrapper, .mini-basket-wrapper{
            .dropdown-toggle{
                padding: .5rem .75rem;
            }
        }
        .user-wrapper{
            @include media-breakpoint-down(lg) {
                margin-left: auto;
                order: 2;
            }
            .user-dropdown{
                h4{
                    text-align: left;
                }
                .dropdown-item{
                    background-color: $white;
                    @extend .px-0;
                    &:not(:last-child){
                        @extend .py-2;
                    }
                    i{
                        @extend .me-1;
                        width: 1.75rem;
                        font-size: 1rem;
                        line-height: 1;
                        text-align: center;
                    }
                    &#logout_link{
                        i{
                            font-weight: 800;
                        }
                    }
                    &:active{
                        color: initial;
                    }
                }
            }
            .dropdown{
                .login-dropdown{
                    min-width: 20rem;
                }
                .user-dropdown{
                    min-width: 15rem;
                }
                .login-dropdown, .user-dropdown{
                    @extend .pb-4;
                    @extend .px-4;
                    padding-top: 0;
                    .login-header{
                        text-align: center;
                        white-space: nowrap;
                        @extend .pt-3;
                    }
                    .input-wrapper{
                        @extend .mb-3;
                        .input-group{
                            @extend .mb-2;
                        }
                    }
                    .password-reset{
                        display: block;
                        @extend .mb-3;
                    }
                }
            }
        }
        .mini-basket-wrapper{
            @include media-breakpoint-down(lg) {
                order: 3;
            }
            .dropdown-toggle{
                position: relative;
            }
            .dropdown-menu{
                @include media-breakpoint-up(lg) {
                    min-width: 28rem;
                }
                @extend .pb-4;
                padding-top: 0;
                .basket-header{
                    text-align: center;
                    @extend .py-3;
                    @include media-breakpoint-down(lg) {
                        flex-shrink: 0;
                        position: relative;
                        &:after{
                            content: "\f038";
                            font:normal normal normal 14px/1 'Highbiza';
                            position: absolute;
                            top: 48%;
                            right: 1.5rem;
                            transform: translateY(-48%);
                            font-size: 1.5rem;
                        }
                    }

                }
                .basket-empty{
                    text-align: center;
                    @extend .my-4;
                    opacity: .5;
                }
                .basket-mini-items-wrapper{
                    @extend .px-4;
                    @extend .pb-2;
                    position: relative;
                    ul.basket-mini-items{
                        padding-left: 0;
                        list-style: none;
                        position: relative;
                        padding-bottom: 1rem;
                        @include media-breakpoint-up(lg) {
                            max-height: 23rem;
                            overflow: auto;
                        }

                        .product-line{
                            .row{
                                margin: 0;
                            }
                            .product-image-wrapper{
                                padding: 0;
                            }
                            &:not(:last-child){
                                @extend .mb-4;
                            }
                            .product-link{
                                @extend .text-dark;
                                &:not(:hover){
                                    text-decoration: unset;
                                }
                            }
                            .product-attr{
                                font-size: .8rem;
                                @extend .text-muted;
                            }
                            .product-price{
                                text-align: right;
                                .from_price{
                                    text-decoration: line-through;
                                    display: block;
                                    color: $gray-500;
                                    font-weight: 400;
                                    font-size: 1rem;
                                }
                                .first-session-price{
                                    font-weight: 700;
                                    font-size: 1rem;
                                }
                                .second-session-price{
                                    color: $gray-500;
                                    font-weight: 500;
                                    display: block;
                                    font-size: .75rem;
                                }
                            }
                        }
                    }
                    @include media-breakpoint-down(lg) {
                        flex-shrink: 1;
                        overflow: scroll;
                    }
                }
                @include media-breakpoint-down(lg) {
                    width: 100%;
                    left: 0;
                    right: unset;
                    top: 0;
                    position: fixed;
                    height: 100vh;
                    border: 0;
                    border-radius: 0;
                    flex-direction: column;
                    &.show{
                        display: flex;
                    }
                }
            }
            .basket-bottom{
                .basket-totals{
                    @extend .mb-3;
                    .totals-line{
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        p{
                            margin-bottom: 0;
                            padding: .3rem 0;
                            font-size: .9rem;
                        }
                        &.total{
                            p{
                                font-size: 1.2rem;
                            }
                        }
                    }
                }
                @include media-breakpoint-down(lg) {
                    flex-shrink: 0;
                }
            }
            @include media-breakpoint-down(lg) {
                .dropdown{
                    position: unset;
                }
            }    
        }
        .search-wrapper{
            @include media-breakpoint-up(xl) {
                max-width: 10rem;
            }
            @extend .me-3;
            @include media-breakpoint-down(lg) {
                order: 4;
                width: 100%;
                margin-right: 0;
                display: flex;
                align-items: center;
                margin-top: .5rem;
                .search_form{
                    width: 100%;
                }
            }
            @include media-breakpoint-up(lg){
                @if $justify-search == "true"{
                    margin-left: auto;
                }
            }
            .search-input-wrapper{
                position: relative;
                width: 100%;
                input{
                    padding-right: 1.6rem;
                    box-shadow: unset;
                    outline: unset;
                    background: $search-background;
                    border: 0px;
                    border-radius: $border-radius;
                    color: color-contrast($header-background);
                    padding-top: .5rem;
                    padding-bottom: .5rem;
                    -webkit-appearance: none;
                }
                button{
                    position: absolute;
                    top: 0;
                    right: 0;
                    width: 2.5rem;
                    height: 100%;
                    background: $search-background;
                    color: color-contrast($header-background);
                    border: 0px;
                    border-top-right-radius: $border-radius;
                    border-bottom-right-radius: $border-radius;
                }
            }
        }
        .alert-messages-header{
            width: 100%;
            #messages{
                width: 100%;
                .alert{
                    @extend .mt-3;
                }
            }
        }
    }

    // Header ordering and settings
    .navbar-brand{
        order: $order-logo;
    }
    .product-menu-bar{
        order: $order-products;
    }
    .page-menu-bar{
        order: $order-pages;
    }
    .search-wrapper{
        order: $order-search;
    }
    .user-wrapper{
        order: $order-user;
    }
    .mini-basket-wrapper{
        order: $order-basket;
    }
    @if $no-padding-header == "true"{
        .navbar.header-inner{
            padding: 0;
            .navbar-brand{
                padding: 0;
            }
        }
    }
    @if $border-width == 0px{
        .dropdown-menu{
            box-shadow: $box-shadow;
        }
    }
}