.edge-main-menu {
    @include edgeRelativeHolderLayout();
    height: 100%;
    width: auto;

    ul {
        list-style: none outside none;
        margin: 0;
        padding: 0;
        text-align: left;

        li {
            position: relative;
            display: inline-block;
            float: left;
            padding: 0;
            margin: 0;

            a {
                font-family: $heading-font;


                &:hover {
                    color: #a1a1a1;
                }

                i:before {
                    margin: 0 7px 0 0;
                }

                .menu_icon_wrapper {
                    position: relative;
                    display: inline-block;
                    vertical-align: middle;
                }

                .edge-menu-featured-icon {
                    position: relative;
                    top: -7px;
                    left: 5px;
                    color: #a1a1a1;
                    font-size: 8px;
                    margin: 0;

                    &:before {
                        margin: 0;
                    }
                }
            }
        }
    }

    > ul {
        @include edgeRelativeHolderLayout();
        height: 100%;

        > li {
            float: left;
            height: 100%;
            box-sizing: border-box;

            > a {
                @include edgeRelativeHolderLayout();
                height: 100%;
                padding: 0 18px;
                color: $first-main-color;
                font-size: 15px;
                font-weight: 400;
                line-height: 16px;
                letter-spacing: 0.1em;
                text-transform: uppercase;
                box-sizing: border-box;

                > span.item_outer {
                    position: relative;
                    display: block;
                    top: 50%;
                    @include edgeTransform(translateY(-50%));

                    .item_text {
                        position: relative;
                        display: inline-block;
                        vertical-align: top;
                        border-bottom: 1px solid transparent;
                        top: 2px;
                        padding-bottom: 1px;
                    }
                }

                &:hover {
                    color: $first-main-color;
                    span.item_outer .item_text{
                        border-color: $default-border-color;
                        .edge-light-header &{
                            border-color: $default-background-color;
                        }
                        .edge-dark-header &{
                            border-color: $dark-color;
                        }
                    }
                }
            }

            &.edge-active-item > a {
                color: $first-main-color;

                span.item_outer .item_text{
                    border-bottom: 1px solid $default-border-color;
                    .edge-light-header &{
                        border-color: $default-background-color;
                    }
                    .edge-dark-header &{
                        border-color: $header-dark-color;
                    }
                }
            }

            &.has_sub {

                > a .edge-menu-arrow {
                    display: none;
                }
            }
        }
    }
}

.edge-light-header .edge-page-header > div:not(.edge-sticky-header):not(.fixed) {

    .edge-main-menu > ul > li {

        > a {
            color: $header-light-color;

            &:hover {
                color: $header-light-hover-color;
            }
        }

        &.edge-active-item > a {
            color: $header-light-hover-color;
        }
    }
}

.edge-dark-header .edge-page-header > div:not(.edge-sticky-header):not(.fixed) {

    .edge-main-menu > ul > li {

        > a {
            color: $header-dark-color;

            &:hover {
                color: $header-dark-color;
            }
        }

        &.edge-active-item > a {
            color: $header-dark-color;
        }
    }
}

/* Narrow drop down styles
   ========================================================================== */
.edge-drop-down{
    .narrow .second{
        &:not(.right){
            left: -18px;
        }
    }
}

.edge-drop-down,
.edge-vertical-menu {

    .second {
        position: absolute;
        display: block;
        left: 0;
        top: 100%;
        visibility: hidden;
        overflow: hidden;
        opacity: 0;
        z-index: 10;
        @include edgeTransition(top 0.15s ease-out);

        &.edge-drop-down-start {
            visibility: visible;
            overflow: visible;
            opacity: 1;
            @include edgeTransition(opacity 0.2s ease-out);
        }

        &.right {
            right: -8px;
            left: auto;
        }
    }

    .second .inner {
        position: relative;
        display: block;
        padding: 0;
        margin: 0;
        z-index: 997;
        border: 1px solid $light-border-color;


        ul {

            li {
                display: block;
                float: none;
                height: auto;

                .widget {
                    width: 100%;
                    margin: 0 !important;
                }

                a {
                    display: block;
                    float: none;
                    margin: 0;
                    padding: 3px 30px 0 30px;
                    line-height: 30px;
                    color: $default-text-color;
                    font-size: 15px;
                    font-weight: 400;
                    letter-spacing: 0;

                    .item_outer {
                        position: relative;
                        display: block;
                        overflow: hidden;
                        padding: 0;
                        box-sizing: border-box;
                        @include edgeTransition(padding .3s ease);
                    }

                    &:hover {
                        color: $first-main-color;
                    }
                }

                &.current-menu-ancestor > a,
                &.current-menu-item > a {
                    color: $first-main-color;

                    &:not(.no_link){
                        .item_text{
                            border-bottom: 1px solid $default-border-color;
                        }
                    }

                }

                &.sub {

                    > a {

                        .item_outer {

                            &:after {
                                position: absolute;
                                display: inline-block;
                                vertical-align: middle;
                                top: 0;
                                right: -2px;
                                content: '\35';
                                font-family: 'ElegantIcons';
                                font-size: 14px;
                                font-weight: normal;
                                font-style: normal;
                                text-rendering: auto;
                                -webkit-font-smoothing: antialiased;
                                -moz-osx-font-smoothing: grayscale;
                            }
                        }
                    }
                }
            }

            &.right {

                li {

                    a {
                        padding: 3px 30px 0 15px;

                        .item_outer {
                            @include edgeTransition(padding .2s ease-in-out);

                            &:before {
                                @include edgeTransform(translateY(-65%) scaleX(-1));
                                left: auto;
                                right: -15px;
                                @include edgeTransition(right 0.25s cubic-bezier(0.54, 0.49, 0, 1.75) 0s);
                            }
                        }

                        &:hover {

                            .item_outer {

                                &:before {
                                    left: auto;
                                    right: 0;
                                }
                            }
                        }
                    }

                    &.current-menu-ancestor > a,
                    &.current-menu-item > a {
                        .item_outer {
                            padding: 0 20px 0 10px;

                            &:before {
                                left: auto;
                                right: 0;
                            }
                        }
                        .item-text{
                            border-bottom: 1px solid $default-border-color;
                        }

                        &:hover {

                            .item_outer {

                                &:before {
                                    left: auto;
                                    right: 0;
                                }
                            }
                        }
                    }

                    &.sub {

                        > a {

                            .item_outer {

                                &:after {
                                    right: auto;
                                    left: -2px;
                                    content: "\34";
                                }
                            }
                        }
                    }

                    a {
                        text-align: right;
                    }

                    ul {
                        left: -100%;
                    }
                }
            }
        }
    }

    li.left_position .second {
        left: 0;
    }

    li.right_position .second {
        left: auto;
        right: 0;
    }

    > ul > li {
        &:hover > .second {
            z-index: 20;
        }
    }



    .narrow .second .inner {

        ul {
            position: relative;
            display: inline-block;
            vertical-align: middle;
            background-color: $default-background-color;
            padding: 17px 0 19px;

            li {
                width: 240px;

                ul {
                    position: absolute;
                    left: 100%;
                    top: -20px;
                    height: auto;
                    opacity: 0;
                    overflow: hidden;
                    z-index: 10;
                    -webkit-transform: translateZ(0);
                    @include edgeTransition(opacity .4s ease-out);
                    border: 1px solid $light-border-color;
                }

                &:hover ul {
                    z-index: 20;
                    opacity: 1;
                }

            }

            &.right li ul {
                left: -100%;
            }
        }
    }
}

.edge-drop-down{
    .second .inner {
        ul {
            li {
                a{
                    &:hover{
                        &:not(.no_link){
                            .item_text{
                                border-bottom: 1px solid $default-border-color;
                            }
                        }
                    }
                }
            }
        }
    }
}

.edge-vertical-menu {
    .second {
        left: calc(100%);
        top: -28px;
    }
}

/* Wide drop down styles
   ========================================================================== */
.edge-drop-down .wide {

    .second {

        .inner {
            background-color: $default-background-color;
            text-align: center;

            ul {

                li {

                    a {
                        padding: 2px 0 2px 30px;
                        color: $default-text-color;
                        border-left: 1px solid $light-border-color;

                        &:hover{
                            color: $first-main-color;
                        }
                    }

                    ul {
                        position: relative;
                        display: block;
                        top: 0;
                        left: 0;
                        visibility: visible;

                        li {

                            &:last-child {

                                a {
                                    padding-bottom: 0;
                                }
                            }
                        }
                    }
                }
            }

            > ul {
                position: relative;
                display: inline-block;
                vertical-align: middle;
                width: 1098px; // 2px is border on parent element
                box-sizing: border-box;

                @media only screen and (min-width: 1400px) {
                    .edge-grid-1300 & {
                        width: $grid-width-1300;
                    }
                }

                @media only screen and (min-width: 1300px) {
                    .edge-grid-1200 & {
                        width: $grid-width-1200;
                    }
                }

                @media only screen and (min-width: 1200px) {
                    .edge-grid-1000 & {
                        width: $grid-width-1000;
                    }
                }

                @media only screen and (min-width: 1024px) {
                    .edge-grid-800 & {
                        width: $grid-width-800;
                    }
                }

                > li {
                    float: left;
                    width: 25%;
                    box-sizing: border-box;
                    padding: 30px;
                    margin: 0;

                    &:first-child {

                        a{
                            border-left: none;
                            padding-left: 0;
                        }
                    }

                    &:last-child {
                        padding-right: 41px;
                        .widget_text {
                            padding-top: 8px;
                        }
                    }

                    &:nth-child(4n+1) {
                        clear: both;
                    }

                    > a {
                        color: $first-main-color;
                        font-size: 15px;
                        line-height: 30px;
                        font-weight: 400;
                        letter-spacing: 0.1em;
                        margin-top: -2px;
                        text-transform: uppercase;

                        &:hover{
                            text-decoration: none;
                            color: $first-main-color;
                        }

                        &.no_link {
                            cursor: default;
                        }

                        .item_outer {
                            padding: 0;
                            overflow: inherit;

                            &:before,
                            &:after {
                                display: none;
                            }
                        }
                    }

                    &.current-menu-ancestor > a,
                    &.current-menu-item > a {
                        color: $first-main-color;
                        letter-spacing: 0.1em;
                        &:not(.no_link){
                            .item_text{
                                border-bottom: 1px solid $default-border-color;
                            }
                        }
                    }
                }
            }
        }
    }

    &.left_position,
    &.right_position {

        .second .inner > ul {
            width: auto;
            white-space: nowrap;

            > li {
                float: none;
                display: inline-block;
                vertical-align: top;

                &:nth-child(4n+1) {
                    border-left: none;
                }
            }
        }

        .second ul li {
            width: 200px;
        }
    }
}

.edge-full-width-wide-menu {
    .edge-drop-down .wide .second {

        .inner {
            background-color: $default-background-color;
        }
    }

    .wide .second .inner {
        text-align: center;
    }

    .second .inner ul {
        text-align: left;
    }
}