.departments-menu {
    max-height: 5.067em;
    max-width: 16.250em;

    @media (min-width: 1025px)  {
        .dropdown-backdrop {
            z-index: -1;
            display: none;
        }
    }

    button {
        background-color: transparent;
        font-size: 1em;
        color: #444;
        font-weight: 500;
        border: 2px solid #eee;
        border-radius: 3px;
        padding: 0.938rem 1rem;
        justify-content: center;
        align-items: center;
        display: flex;

        &:hover {
            color: #555;
        }

        &:hover,
        &:focus,
        &:active {
            box-shadow: none;
        }

        i {
            padding-right: 0.633em;
            line-height: 1.1;
        }

        @include media-breakpoint-up(lg) {
            @include media-breakpoint-down(lg) {
                span {
                    //display: none;
                }
            }
        }
    }

    &.show>.dropdown-menu {
        transition: 0.2s ease-in-out;
    }

    > .dropdown-menu {
        transform: translate(0px, 24px) rotate(0deg) skew(0deg, 0deg) scale(1, 1);
        //margin: 0 0.938em;
        margin: 0 15px;
        padding: 0;
        border: none;
        right: 0;
        z-index: 1;

        &::before {
            content: '';
            transform: rotate(45deg);
            width: 44px;
            height: 44px;
            border: 2px solid #eee;
            background-color: #fff;
            position: absolute;
            left: 40%;
            border-radius: 4px;
            z-index: -1;
            top: -6px;
        }

        > li {
            padding: 0 1.143em;
            background-color: #fff;
            border-right: 2px solid #eee;
            border-left: 2px solid #eee;

            &:nth-child(1) {
                border-top: 2px solid #eee;
                border-top-left-radius:.25rem;
                border-top-right-radius:.25rem;
            }

            &:nth-last-child(1) {
                border-bottom: 2px solid #eee;
                border-bottom-left-radius:.25rem;
                border-bottom-right-radius:.25rem;
            }

            &.highlight > a {
                font-weight: 500;
            }

            &.color > a{
                color: #e14546;
            }

            > a {
                display: block;
                border-bottom: 1px solid #ddd;
                padding: 0.608em 0.357em;
                font-size: 0.938em;
                color: $color-body;
                font-weight: normal;
            }

            &:first-child {
                > a {
                    padding: 1.1em 0.357em 0.6em;
                }
            }

            &:last-child {
                > a {
                    border-bottom: none;
                }
            }
        }

        .yamm-tfw {
            > .dropdown-menu {
                >li {
                    padding: 0;
                }
            }
        }

        .menu-item-has-children {
            .dropdown-toggle:after {
                background: none;
            }

    		a[data-toggle="dropdown"], a[data-toggle="dropdown-hover"] {
    			&::after {
    				font-family: 'FontAwesome';
    				border-top: none;
                    content: "\f105" #{"/*rtl:\"\f104\"*/"};
                    float: right;
    				border-left: none;
    				border-right: none;
    				width: auto;
    				height: auto;
    			}
    		}

    		> .dropdown-menu{
    			top: 0;
    			padding: 0;
                margin: 0;
                font-size: 0.938em;
                border: 2px solid #eee;
                border-top-left-radius: 0;
                border-bottom-left-radius: 0;
                //overflow: hidden;

                li > a {
                    font-size: 0.933em;
                    line-height: 1.6em;
                    display: block;

                    @include hover-focus() {
                        color: #000;
                    }
                }

    			> li.menu-item:not(.menu-item-object-static_block){
    				width: 277px;
                    padding: 0 1.143em;

    				&:first-child {
    					margin-top: 1.143em;
    				}

                    // &.menu-item-has-children {
                    //     .dropdown-menu {
                    //         transition: all .25s ease 0s;
                    //         left: 0;
                    //     }
                    //
                    //     &:hover {
                    //         .dropdown-menu {
                    //             left: 99%;
                    //         }
                    //     }
                    // }

    				> a {
    					border-bottom: 0;
    					padding: 0.35em 1.429em;
    				}

    				.dropdown-menu {
    					top: -2px;
    					left: 99%;
    				}
    			}
    		}
    	}
    }

    > .menu-item,
    .dropdown-menu > .menu-item {
        position: static;
        display: block;
        padding: 0 1.143em;
    }
}

.header-v1 {
    .departments-menu {
        > .dropdown-menu {
            &::after {
                content: "";
                width: 25px;
                height: 4px;
                background-color: #fff;
                display: block;
                position: absolute;
                top: 1px;
                z-index: 9;
                left: 48.4%;
                border-radius: 100px;
                transform: translate(-50%, -50%);

                // @media (min-width: 1600px) and (max-width: 1900px) {
                //     left: 47.4%;
                // }
            }
        }

        button {
            color: #fff;
            display: block;
            height: 52px;
        }
    }
}

.page-template-template-homepage-v1,
.page-template-template-homepage-v2{
    .header-v1 .departments-menu {
        button {
            color: #444;
            border-color: #eee;
            background-color: transparent;

            &::after {
                filter: none;
            }
        }
    }
}

.page-template-template-homepage-v1 .header-v1,
.page-template-template-homepage-v1 .header-v3,
.page-template-template-homepage-v1 .header-v4,
.page-template-template-homepage-v1 .header-v5,
.page-template-template-homepage-v1 .header-v6,
.page-template-template-homepage-v2 .header-v1,
.page-template-template-homepage-v2 .header-v3,
.page-template-template-homepage-v2 .header-v4,
.page-template-template-homepage-v2 .header-v5,
.page-template-template-homepage-v2 .header-v6,
.page-template-template-homepage-v5 .header-v1,
.page-template-template-homepage-v5 .header-v3,
.page-template-template-homepage-v5 .header-v4,
.page-template-template-homepage-v6 .header-v1,
.page-template-template-homepage-v6 .header-v4,
.page-template-template-homepage-v6 .header-v3,
.page-template-template-homepage-v5 .header-v5,
.page-template-template-homepage-v5 .header-v6,
.page-template-template-homepage-v6 .header-v5,
.page-template-template-homepage-v6 .header-v6{
    .departments-menu {
        > .dropdown-menu {
            @include media-breakpoint-up(xl) {
                display: block;
            }
        }
    }
}

.header-v2,
.header-v3,
.header-v4,
.header-v5,
.header-v6,
.header-v10 {
    .departments-menu {
        @include make-col(0.5);
        padding: 0;

        button {
            padding: 0;
            border: none;
            justify-content: inherit;
            width: 20px;
            margin-left: 20px;

            &.dropdown-toggle::after {display: none;}

            i {
                padding-right: .8em;
                text-shadow: #909090 0px 1px 0px;
            }
        }

        span {
            display: none;
        }

        button::before{
            opacity: 0;
        }

        &.show button::before{
            content: '';
            transform: rotate(45deg);
            width: 44px;
            height: 44px;
            border: 2px solid #eee;
            background-color: #fff;
            position: absolute;
            left: 5px;
            border-radius: 4px;
            top: 34px;
            z-index: -1;
            opacity: 1;
        }

        &.show button::after{
            content: "";
            width: 26px;
            height: 2px;
            background-color: #fff;
            display: block;
            position: absolute;
            bottom: -26px;
            right: 33px;
            z-index: 9;

            @include media-breakpoint-up(xl) {
                @include media-breakpoint-down(xxl) {
                    left: 50%;
                    transform: translate(-78%);
                }
            }

            @include media-breakpoint-up(ni) {
                @include media-breakpoint-down(xxl) {
                    transform: translate(-78%);
                }
            }
        }

        >.dropdown-menu {
            left: -202px;
            right: 0;
            min-width: 270px;
            margin: 0;

            @media (min-width: 700px) and (max-width: 800px) {
    	        left: -182px;
    	    }

            @media (min-width: 1400px) and (max-width: 1900px) {
                min-width: 270px;
                left: -200px;
            }

            @include media-breakpoint-up(ni) {
                @include media-breakpoint-down(uw) {

                }
            }
        }

        >.dropdown-menu::before {
            right: 5px;
            left: auto;
            display: none;
        }
    }
}

.header-v4,
.header-v3 {
    .departments-menu {
        @include media-breakpoint-up(xl) {
            @include media-breakpoint-down(xl) {
                @include make-col(0.7);
            }
        }
    }
}

.page-template-template-homepage-v5,
.page-template-template-homepage-v6 {
    .header-v3,
    .header-v4 {
        .departments-menu {
            button::before {
                opacity: 1;
            }
        }
    }
}

.page-template-template-homepage-v5 .header-v3,
.page-template-template-homepage-v6 .header-v4 {
    .stuck .departments-menu {

        button::after{
            display: none;
        }

        &.show button::after {
            right: 38px;
        }
    }

    .departments-menu {
        @include media-breakpoint-up(xl) {
            button::before,
            &.show button::before{
                content: '';
                transform: rotate(45deg);
                width: 44px;
                height: 44px;
                border: 2px solid #eee;
                background-color: #f8f8f8;
                position: absolute;
                left: 5px;
                border-radius: 4px;
                top: 34px;
                z-index: -1;
            }
        }

        &.show button::after,
        button::after{
            content: "";
            width: 26px;
            height: 2px;
            background-color: #f8f8f8;
            display: block;
            position: absolute;
            bottom: -26px;
            right: 33px;
            z-index: 9;

            @include media-breakpoint-up(xl) {
                @include media-breakpoint-down(uw) {
                    left: 37%;
                    transform: translate(-78%);
                }
            }
        }
    }
}

.header-v4 .departments-menu.show button::before {
    @include media-breakpoint-down(lg) {
        top: 41px;
        border-color: transparent;
    }
}

.page-template-template-homepage-v5 .header-v3,
.header-v3 {
    .departments-menu {
        @include media-breakpoint-up(lg) {
            button::before,
            &.show button::before {
                background-color: #f8f8f8;
            }
        }
    }
}

.header-v4,
.page-template-template-homepage-v6 .header-v4 {
    .departments-menu {
        @include media-breakpoint-up(xl) {
            button::before,
            &.show button::before {
                top: 42px;
                border: 2px solid #fff;
                background-color: #fff;
            }
        }
    }
}

.header-v3 {
    .departments-menu  {
        > .dropdown-menu {
            border: none;

            &::before {
                border: none;
                background-color: #f8f8f8;
                border-radius: 6px;
            }

            &.animated-dropdown {
                > li {
                    &:first-child {
                        border-top-right-radius: 0;
                    }

                    &:last-child {
                        border-bottom-right-radius: 0;
                    }
                }
            }

            > li {
                background-color: #f8f8f8;

                &:first-child {
                    border-top-left-radius: 6px;
                    border-top-right-radius: 6px;
                }

                &:last-child {
                    border-bottom-left-radius: 6px;
                    border-bottom-right-radius: 6px;
                }
            }

            .menu-item-has-children {
                > .dropdown-menu {
                    background-color: #fff;
                    //border: none;
                    top: 0;
                }
            }
        }

        &.show button::after {
            background-color: #f8f8f8;
        }
    }
}

.header-v4 {
    .departments-menu {
        >.dropdown-menu {
            top: 25px;
            border-top: none;
            border-top-left-radius: 0;
            border-top-right-radius: 0;

            &::before {
                border-top-right-radius: 10px;
                border: none;
            }

            >li {
                &:last-child {
                    border-bottom-left-radius: 6px;
                    border-bottom-right-radius: 6px;
                }
            }

            >li:nth-child(1) {
                border-top-left-radius: 0;
                border-top-right-radius: 0;
                border-top: none;
            }

            .menu-item-has-children>.dropdown-menu {
                top: 0;
                border-top: none;
            }
        }
    }
}

.header-v4,
.header-v5 {
    .departments-menu,
    .handheld-navigation {
        button i {
            text-shadow: #fff 0 1px 0px;
            color: #fff;
        }
    }
}

.header-v5 {
    .departments-menu {

        @include media-breakpoint-up(lg) {
            @include media-breakpoint-down(lg) {
                margin-bottom: 0;
            }
        }

        @include media-breakpoint-up(xl) {
            button::before,
            &.show button::before {
                top: 35px;
                border: 2px solid transparent;
            }
        }
    }
}

.header-v6 {
    .departments-menu {
        button i {
            text-shadow: #030303 0 1px 0;
        }

        >.dropdown-menu {
            left: -14px;
            right: auto;
        }

        >.dropdown-menu::before {
            right: auto;
            left: 5px;
        }
    }
}

.header-v4 {
    .departments-menu {
        button::after {
            display: none !important;
        }
    }
}

.page-template-template-homepage-v1,
.page-template-template-homepage-v2 {
    .header-v3,
    .header-v4 {
        .departments-menu button::before {
            content: '';
            transform: rotate(45deg);
            width: 44px;
            height: 44px;
            background-color: #fff;
            position: absolute;
            left: 5px;
            border-radius: 4px;
            z-index: -1;
            opacity: 1;
        }
    }
}

.page-template-template-homepage-v5 .header-v1,
.page-template-template-homepage-v6 .header-v1,
.page-template-template-homepage-v7 .header-v1,
.page-template-template-homepage-v8 .header-v1,
.page-template-template-homepage-v9 .header-v1,
.page-template-template-homepage-v10 .header-v1,
.page-template-template-homepage-v11 .header-v1,
.page-template-template-homepage-v12 .header-v1 {
    .departments-menu button{
        background-color: transparent;
        color: #444;
        border-color: #eee;
    }
}

.page-template-template-homepage-v1 .header-v5,
.page-template-template-homepage-v1 .header-v6,
.page-template-template-homepage-v2 .header-v5,
.page-template-template-homepage-v2 .header-v6,
.page-template-template-homepage-v6 .header-v3,
.page-template-template-homepage-v5 .header-v4,
.page-template-template-homepage-v5 .header-v5,
.page-template-template-homepage-v5 .header-v6,
.page-template-template-homepage-v6 .header-v5,
.page-template-template-homepage-v6 .header-v6{
    .departments-menu button::before {
        content: '';
        transform: rotate(45deg);
        width: 44px;
        height: 44px;
        background-color: #fff;
        position: absolute;
        left: 5px;
        border-radius: 4px;
        z-index: -1;
        opacity: 1;
    }

    .departments-menu button::after {
        content: "";
        width: 26px;
        height: 2px;
        background-color: #fff;
        display: block;
        position: absolute;
        bottom: -26px;
        right: 33px;
        z-index: 9;
    }
}

.page-template-template-homepage-v1 .header-v6,
.page-template-template-homepage-v2 .header-v6,
.page-template-template-homepage-v5 .header-v6,
.page-template-template-homepage-v6 .header-v6 {
    .departments-menu button::before {
        background-color: #fff;
        border: 2px solid #eee;
        top: 34px;
    }
}

.page-template-template-homepage-v1,
.page-template-template-homepage-v2,
.page-template-template-homepage-v6{
    .header-v3 {
        .departments-menu button::before {
            background-color: #f8f8f8;
            border: 2px solid #eee;
            top: 34px;
        }

        .departments-menu button::after {
            content: "";
            width: 26px;
            height: 2px;
            background-color: #f8f8f8;
            display: block;
            position: absolute;
            bottom: -26px;
            right: 33px;
            z-index: 9;
        }
    }
}

.page-template-template-homepage-v4,
.page-template-template-homepage-v6,
.page-template-template-homepage-v7,
.page-template-template-homepage-v8{
    .header-v3 {
        .departments-menu.show button::before {
            background-color: #f8f8f8;
            border: 2px solid #eee;
            top: 34px;
        }
    }
}

.page-template-template-homepage-v3,
.page-template-template-homepage-v4,
.page-template-template-homepage-v7,
.page-template-template-homepage-v8,
.page-template-template-homepage-v9,
.page-template-template-homepage-v10,
.page-template-template-homepage-v11,
.page-template-template-homepage-v12{
    .header-v3 {
        .departments-menu.show button::after {
            background-color: #f8f8f8;
        }
    }
}

.page-template-template-homepage-v1 .header-v1,
.page-template-template-homepage-v2 .header-v1,
.page-template-template-homepage-v5 .header-v5,
.page-template-template-homepage-v5 .header-v6,
.page-template-template-homepage-v6 .header-v5,
.page-template-template-homepage-v6 .header-v6 {
    .sticky-wrapper .techmarket-sticky-wrap.stuck .departments-menu>.dropdown-menu,
    .sticky-wrapper .techmarket-sticky-wrap.stuck .departments-menu button::before,
    .sticky-wrapper .techmarket-sticky-wrap.stuck .departments-menu button::after {
        transition: all 0.25s ease 0s;
    	opacity: 0;
    	visibility: hidden;
    }
}

.page-template-template-homepage-v1 .header-v1,
.page-template-template-homepage-v2 .header-v1,
.page-template-template-homepage-v5 .header-v5,
.page-template-template-homepage-v5 .header-v6,
.page-template-template-homepage-v6 .header-v5,
.page-template-template-homepage-v6 .header-v6 {
    .sticky-wrapper .techmarket-sticky-wrap.stuck .departments-menu.show>.dropdown-menu,
    .sticky-wrapper .techmarket-sticky-wrap.stuck .departments-menu.show button::before,
    .sticky-wrapper .techmarket-sticky-wrap.stuck .departments-menu.show button::after {
        transition: all 0.25s ease 0s;
        opacity: 1;
        visibility: visible;
    }
}
