
.header-wrapper {
    position: relative; 
    z-index: 300;
    @include box-shadow($header-wrapper-shadow);

    &.shadow-none {
        @include box-shadow(none);

        .container-shadow {
            display: none;
        }
    }

    #mini-cart .cart-head.only-icon {
        .cart-details {
            display: none;
        }
    }
}

/* Header Top */

.header-top {
    font-size: 14px;
}

.header-top .container { 
    position: relative; 
}

.topnav,
.login-links,
.view-switcher {
    a {
        display: inline-block; 
        line-height: 20px; 
        padding: 8px; 
        text-decoration: none; 
        white-space: nowrap; 
    }
    
    ul {
        list-style: none;
    }
    
    > li > a {
        margin: 8px 0; 
        padding: 0 8px; 
        
        .dropdown-menu & {
            margin: 0;
        }
    }
}

.topnav {
    > li {
        > a {
            padding: 0 40px 0 0;

            @media #{$screen-normal} {
                padding: 0 25px 0 0;
            }

            @media #{$screen-medium} {
                border-left: 1px solid rgba(0, 0, 0, 0.2);
                padding: 0 4px;
                
                .glyphicon { 
                    margin-right: 5px; 
                    margin-left: 5px;
                    width: 14px;
                    text-align: center;
                }
                
                .menu-label { 
                    display: none; 
                }
            }
        }
        
        &:last-child > a {
            @media #{$screen-medium} {
                border-right: 1px solid rgba(0, 0, 0, 0.2);
            }
        }
        &.last-child > a {
            @media #{$screen-medium} {
                border-right: 1px solid rgba(0, 0, 0, 0.2);
            }
        }
    }
}

.welcome-msg { 
    float: left; 
    line-height: 20px; 
    padding: 8px 10px 8px 0;
    
    @media #{$screen-large} {
        display: none;
    }
}

.login-links { 
    float: left; 
    padding-left: 20px; 
    padding-right: 20px; 
    
    .header-top .left & {
        padding-left: 0;
    }
    
    @media #{$screen-small} {
        position: absolute; 
        padding-right: 5px; 
        right: 12px; 
        top: 40px;
    }
    
    &.pos2 {
        position: absolute;
        padding-right: 5px;
        right: 12px;
        top: 42px;
    }
    
    .avatar { 
        width: 28px; 
        height: 28px; 
    }
    
    a { 
        padding: 8px 2px; 
    }
}

#lang_sel {
    height: auto;
    display: block;
    
    li {
        width: auto;
    }
    
    a.lang_sel_sel {
        background-image: none;
        background-color: transparent;
        border-radius: 0;
        border-width: 0;
        box-shadow: none;
        font-size: 14px;
        line-height: 16px;
        height: 36px;
        padding: 8px 12px;
        display: block;
        
        @media #{$screen-medium} {
            width: 38px !important;
            text-indent: -1000px;
            padding-left: 10px;
            position: relative;
            
            img.iclflag {
                margin-right: 0;
            }
        }
    }
    
    ul ul {
        top: 100%;
        right: 0;
        left: auto;
        height: auto;
        border-width: 0;
        z-index: 1000;
        @include box-shadow(0 6px 12px rgba(0, 0, 0, 0.176));
        @include transition($menu-narrow-transition);
        
        a,
        a:visited {
            border-width: 0;
            padding: 6px 12px;
            font-size: 14px;
            line-height: 1.42857;
            display: block;
            
            img.iclflag {
                margin-top: 4px;
            }
        }
        
        li {
            float: none;
            font-size: 14px;
        }
    }
    
    img.iclflag {
        background-position: center center;
        border: 1px solid #EEEEEE;
        display: inline-block;
        height: 12px !important;
        line-height: 1;
        margin-right: 5px;
        margin-top: 2px;
        padding: 0;
        width: 16px !important;
        float: left;
    }
}

/* Menu */
.menu-wrapper {
    position: relative;

    @media #{$screen-medium} {
        margin-top: 80px !important;

        &.hide-search {
            margin-top: 25px !important;
        }
    }
    
    .container { 
        position: relative; 
    }
    
    .view-switcher { 
        margin-left: 8px; 
    }
    
    .middle { 
        display: none;
        
        @media #{$screen-medium} {
            display: block;
        } 

        .sticky-header & {
            display: block;
        }
    }
}

#main-menu { 
    float: left; 
    position: relative; 
    z-index: 20;
    
    @media #{$screen-normal} {
        display: none;
    } 
    
    body.mobile & {
        display: none;
    }
    
    &.menu-right {
        float: right;
    }
}

#main-mobile-menu { 
    float: left; 
    display: none; 
    padding-top: 25px;

    @media #{$screen-normal} {
        display: block;
        margin-top: 0 !important;
    } 
    
    .searchform-middle & {
        margin-top: 0;

        @media #{$screen-medium} {
            padding-top: 25px;
        }
    }

    body.mobile & {
        display: block; 
        margin-top: 0;
    }
}

body.mobile .header-menu-right {
    #main-mobile-menu {
        float: right;
        margin-top: 0;
        padding-top: 0;
        margin-right: 15px;

        @media #{$screen-normal} {
            float: none;
        }
    }

    .quick-access {
        margin-top: 0;
        padding-top: 0;

        .searchform .text {
            position: static;

            input {
                display: block !important;
                width: 200px !important;
            }
        }
    }
}

#main-mobile-toggle { 
    cursor: pointer; 
    display: inline-block; 
    height: 60px; 
    
    > span { 
        float: left; 
        display: inline-block; 
        line-height: 36px;
    }
    
    .btn { 
        padding: 5px 7px 7px; 
        margin: -1px 0 0 20px;
        border-width: 1px;
    }
    
    .icon-bar { 
        border-radius: 1px; 
        display: block; 
        width: 21px; 
        height: 3px; 
        margin-top: 3px; 
    }

    .accordion-menu { 
        position: absolute; 
        left: 15px; 
        right: 15px; 
        display: none; 
        z-index: 20; 
    }
}

.header {
    .left {
        @media #{$screen-medium} {
            float: none !important; 
            text-align: center;
        }
    }
    
    .right {
        @media #{$screen-medium} {
            float: none !important;
        }        
    }

    .logo-center {
        text-align: center;
        
        .logo img {
            margin-top: -15px;
            margin-left: auto;
            margin-right: auto;
        }
    }
    
    .logo img {
        @media #{$screen-medium} {
            max-width: 420px;
        }
        
        @media #{$screen-small} {
            max-width: 280px;
        }
    }

    &.header-menu-right {
        .logo {
            display: none;
        }

        .menu-wrapper .logo {
            display: block;

            @media #{$screen-normal} {
                float: none !important;
            }
        }

        @media #{$screen-medium} {
            .logo {
                display: block;
            }

            .menu-wrapper .logo {
                display: none;
            }
        }
    }
}

/* View Switcher, Mini Cart */

.header .switcher-wrapper { 
    margin-bottom: 15px;
    margin-top: -4px;

    @media #{$screen-medium} {
        display: none;
    }
    
    .view-switcher,
    #mini-cart { 
        float: right; 
    }
}

.header.searchform-middle .switcher-wrapper {
    margin-top: 0;
}

.view-switcher { 
    float: left;
}

.view-switcher .dropdown-toggle,
#mini-cart .dropdown-toggle {
    padding: 8px 12px; 
    height: 36px; 
    font-size: 14px;
    border-radius: 0; 
    border-width: 0;
    @include box-shadow(none);
}

#mini-cart .dropdown-toggle {
    padding-left: 10px;
    padding-right: 10px;
}

#mini-cart {
    .dropdown-toggle { 
        cursor: pointer;
        text-transform: none;
        white-space: nowrap;

        .cart-details {
            .searchform-middle & {
                width: 175px;

                @media #{$screen-medium} {
                    width: auto;
                }
            }
        }
    }
    
    .dropdown-menu { 
        top: 46px; 
        right: 0; 
        left: auto; 
        width: 290px; 
        padding: 24px 20px 20px;
    }
    
    .header-top .left & {
        margin-left: 0; 
        margin-right: 8px; 
        
        .dropdown-menu { 
            left: 0; 
            right: auto; 
        }
    }

    .cart_list_wrap {
        max-height: 300px;
        overflow-y: auto;
        overflow-x: hidden;

        &.scroll-wrapper {
            margin-right: -5px;
        }
    }
}

.view-switcher {
    
    .dropdown-toggle {
        
        @media #{$screen-medium} {
            width: auto !important;
            
            .flag { 
                margin-right: 0; 
            }
            
            .menu-label { 
                display: none; 
            }
        }

        .caret { display: none; }
    }
    
    .dropdown-menu { 
        left: auto; 
        right: 0; 
    }
    
    .open .dropdown-toggle {
        @include box-shadow($btn-box-shadow);
    }
}

.quick-access { 
    float: right; 
    margin-top: 8px; 
    margin-bottom: 5px;
    
    @media #{$screen-normal} {
        margin-top: 26px;

        .header-menu-right & {
            margin-top: 26px;
        }
    }
    
    body.mobile & {
        margin-top: 26px;
    }
}

#mini-cart,
#search-form { 
    float: left; 
    margin-left: 8px; 
}

#search-form {
    position: relative; 
    z-index: 30; 
    
    .searchform-middle & {
        margin-left: 0;

        @media #{$screen-medium} {
            margin: auto;
        }

        .searchform .text input {
            width: 175px !important;
            left: -175px !important;
            display: inline-block !important;

            @media #{$screen-medium} {
                width: 200px !important;
                left: -200px !important;
            }
        }
    }

    @media #{$screen-medium} {
        position: absolute; 
        margin: auto; 
        left: 0; 
        right: 0; 
        top: -50px; 
        width: 237px;
        
        .searchform-middle & {
            top: auto;
            bottom: -110px;

            &.middle {
                top: -60px;
                bottom: auto;
            }
        }
    }

    .searchform-middle .switcher-wrapper & {
        float: right;
        margin-left: 20px;
    }
}

#mini-cart {
    &.open .dropdown-toggle {
        @include box-shadow($btn-box-shadow);
    }
}

@media #{$screen-medium} {
    .header.header-logo-center {
        .logo {
            margin-top: 0;
        }
    }
}

/* Sticky Header */

.sticky-header { 
    position: fixed; 
    overflow: hidden; 
    visibility: hidden; 
    top: 0; 
    left: 0; 
    right: 0; 
    z-index: 300;
    @include box-shadow($header-wrapper-shadow);
    
    @media #{$screen-normal} {
        display: none !important;
    }
    
    body.mobile & {
        display: none !important;
    }
    
    .header {
        padding-top: 0; background-color: transparent;

        .logo {
            margin-top: 0;
            margin-right: 15px;
        }
    }
    
    .menu-wrapper { 
        background-color: transparent; 
        margin: 0; 
    }
    
    .logo img { 
        margin-top: 0; 
        margin-right: 10px; 
        height: 40px; 
        width: auto; 
    }
    
    .quick-access { 
        margin-top: 9px; 
        margin-bottom: 3px; 
    }
    
    #mini-cart .dropdown-menu { 
        top: 42px;
    }

    #mini-cart .cart-head.sticky-only-icon {
        .cart-details {
            display: none;
        }
    }
}

/* Extra Styles */
.header-top .left .view-switcher .dropdown-menu {
    left: 0;
    right: auto;
}

/* Header Block */
.header-contact {
    margin-top: -2px;
    font-size: 12px;

    @media #{$screen-medium} {
        display: none;
    }
}

.header-block.well { 
    float: left; 
    line-height: 1.5;
    padding: 5px 11px;
    margin-left: 10px; 
    border-radius: 0;

    &.noborder {
        border-width: 0;
    }

    &.nobg {
        background: transparent;
        padding: 0 10px;
        margin-top: 3px;

        @media #{$screen-large} {
            margin-top: 20px;
            margin-bottom: 0px;
        }
    }
}

.header-block .fa { 
    font-size: 16px; 
    width: 18px; 
    text-align: center;
}

.header-on-banner {
    position: absolute;
    width: 100%;

    @media #{$screen-min-desktop} {
        @include box-shadow(none);

        .header-top,
        .header,
        .menu-wrapper {
            background: transparent;
            @include box-shadow(none);
        }

        .header-top {
            border-width: 0;
        }

        .container-shadow {
            display: none;
        }

        .header .logo img {
            display: none;

            &.header-banner-logo {
                display: block;
            }
        }

        .view-switcher .dropdown,
        #lang_sel > ul > li,
        &.header-wrapper .searchform button,
        #mini-cart .dropdown-toggle,
        #mini-cart .dropdown-toggle .cart-icon,
        #mini-cart .dropdown-toggle .cart-details,
        #main-mobile-toggle .btn,
        .header-block.well,
        .menu-wrapper {
            background: transparent;
            border-color: transparent;
            @include box-shadow(none);
        }

        .mega-menu,
        .mega-menu > ul,
        .mega-menu > ul > li,
        .mega-menu > ul > li > a,
        .mega-menu > ul > li > h5 {
            background: transparent !important;
            border-color: transparent !important;
            @include box-shadow(none);
        }


        .view-switcher .dropdown.open,
        #lang_sel > ul > li:hover,
        &.header-wrapper .searchform button:hover, &.header-wrapper .searchform button:focus,
        #mini-cart.open .dropdown-toggle, #mini-cart .dropdown-toggle:hover, #mini-cart .dropdown-toggle:focus,
        #main-mobile-toggle .btn:hover, #main-mobile-toggle .btn:focus {
            @include box-shadow($btn-box-shadow);
        }
    }

    @media #{$screen-medium} {
        position: relative;

        .header .logo img.header-banner-logo {
            display: none;
        }
    }
}