// Main Navigation
//--------------------------------------------------
// Menu Desktop
ul.menu {
  list-style: none;
  margin: 0;
  ul {
    list-style: none;
    margin: 0;
  }
}
@media #{$min-xl} {
    .primary-menu-not-set {
        opacity: 0;
        visibility: hidden;
        list-style: none;
        margin: 0;
        > li {
            margin-right: 20px;
            a {
                font-size: 15px;
                color: $button_secondary_color;
                font-weight: 700;
                line-height: 120px;
                position: relative;
                padding: 0 12px;
                &:hover {
                    color: $primary_color;
                }
            }
        }
    }
    .menu-toggle {
        display: none;
    }
    .main-navigation ul {
        display: block;
    }
    .primary-menu {
        list-style: none;
        margin: 0;
        padding: 0;
        li {
            position: relative;
            list-style: none;
            a {
                display: block;
                @include transition(all 300ms linear 0ms !important);
            }
        }
        > li {
            display: inline-block;
            vertical-align: middle;
            float: left;
            > a {
                font-size: 15px;
                letter-spacing: 0.02em;
                color: $button_secondary_color;
                font-weight: 700;
                line-height: 120px;
                position: relative;
                padding: 0 16px;
                &:before {
                    content: "";
                    position: absolute;
                    left: 15px;
                    right: 15px;
                    top: 0;
                    margin: auto;
                    background-color: $primary_color;
                    height: 2px;
                    transform-origin: right center;
                    -webkit-transform-origin: right center;
                    @include transform(scale(0, 1));
                    @include transition(transform 0.25s cubic-bezier(0.37, 0.31, 0.2, 0.85));
                }
            }
            &:hover > a,
            &.current_page_item > a,
            &.current-menu-item > a,
            &.current_page_ancestor > a,
            &.current-menu-ancestor > a {
                &:before {
                    transform-origin: left center;
                    -webkit-transform-origin: left center;
                    @include transform(scale(1, 1));
                }
                color: $primary_color;
            }
            &.menu-item-has-children{
                margin-right: 5px;
                > a:after{
                    font-family: Material-Design-Iconic-Font;
                    content: '\f2f9';
                    position: absolute;
                    top: 0;
                    padding-left: 7px;
                    color: inherit;
                    font-weight: bold;
                    font-size: 16px;
                }
            }
            > ul.back {
                right: 0 !important;
                left: auto !important;
                li > ul.back {
                    right: 100% !important;
                    left: auto !important;
                }
            }
            > .sub-menu li > ul.back {
                right: 100% !important;
                left: auto !important;
            }
        }

        .sub-menu {
            list-style: none;
            margin: 15px 0 0;
            position: absolute;
            background: #fff;
            padding: 25px 40px;
            top: 100%;
            left: -10px;
            min-width: 240px;
            z-index: 99;
            visibility: hidden;
            opacity: 0;
            @include box-shadow(0 3px 63px 0 rgba(#282828, 0.11));
            @include transition(all 300ms linear 0ms);
            @include border-radius(0 0 10px 10px);
            clip: rect(1px, 1px, 1px, 1px);
            li {
                overflow: visible;
                a {
                    color: $button_secondary_color;
                    font-size: 14px;
                    line-height: normal;
                    padding: 12px 0;
                    position: relative;
                    white-space: nowrap;
                    &:before{
                        position: absolute;
                        content: '\f2ee';
                        display: inline-block;
                        font-family: 'Material-Design-Iconic-Font';
                        font-size: 15px;
                        font-weight: bold;
                        color: $primary_color;
                        left: -20px;
                        opacity: 0;
                        @include transition(all 300ms ease 0s);
                    }
                }
                &:last-child > a {
                    margin-bottom: 0;
                }
                > a:hover,
                &.current_page_item > a,
                &.current-menu-item > a,
                &.current_page_ancestor > a,
                &.current-menu-ancestor > a {
                    color: $primary_color;
                    &:before{
                        opacity: 1;
                    }
                }
            }

            .sub-menu {
                top: 0;
                left: 100%;
            }
        }

        li:hover,
        li.focus, {
            overflow: visible;
            > .sub-menu {
                visibility: visible;
                opacity: 1;
                margin-top: 0;
                clip: inherit;
            }
        }
        li.megamenu {
            position: relative;
            .elementor-row{
                flex-wrap: nowrap;
            }
            .sub-menu {
                display: inline-flex;
                left: 15px;
                p {
                    margin-bottom: 0;
                }
                li{
                    > .container{
                        padding: 0;
                    }
                    li{
                        padding: 0;
                    }
                }
                .wpb_content_element {
                    margin-bottom: 0;
                }
                ul.menu{
                    min-width: 175px;
                }
            }
        }
    }
}

.admin-bar{
    .primary-menu-not-set{
        opacity: 1;
        visibility: visible;
    }
}

@media #{$max-lg} {
    .site-navigation {
        background-color: #fff;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        position: absolute;
        z-index: 1001;
        padding: 15px 20px;
        top: calc(100% + 30px);
        top: -webkit-calc(100% + 30px);
        top: -ms-calc(100% + 30px);
        top: -o-calc(100% + 30px);
        bottom: auto;
        left: 0;
        right: 0;
        visibility: hidden;
        opacity: 0;
        @include transition(all 300ms linear 0ms);
        z-index: -1;

        &.navigation-open {
            opacity: 1;
            visibility: visible;
            top: 100%;
            z-index: 999;
            overflow-y: scroll!important;
            max-height: 80vh!important;
        }
    }
    .primary-menu {
        list-style: none;
        margin: 0;
        padding: 0;

        li {
            position: relative;
            list-style: none;
            a {
                display: block;
                padding: 10px 0;
                font-size: 15px;
                color: $secondary_color;
                font-weight: 700;
            }

            &:hover,
            &.focus {

            }
        }
        li {
            &.current_page_item > a,
            &.current-menu-item > a,
            &.current_page_ancestor > a,
            &.current-menu-ancestor > a {
                color: $primary_color;
            }
            .link-icon {
                margin-right: 6px;
                font-size: 90%;
            }
        }

        .sub-menu {
            position: relative;
            padding-left: 20px;
            display: none;
            .container {
                padding: 0;
            }
            &.submenu-open {
                + .main-menu-toggle:before {
                    content: "\f2fc";
                }
            }
        }

        li.focus {
            > .sub-menu {
                visibility: visible;
                opacity: 1;
                max-height: none;
                overflow: visible;
            }
        }
    }
    .primary-menu-not-set {
        margin: 0;
        list-style: none;
        a {
            display: block;
            padding: 10px 0;
            color: #000;
            font-weight: 600;
            font-size: 15px;
            &:hover {
                color: $primary_color;
            }
        }
    }
    #main-menu-mobile {
        .btn-nav-mobile {
            color: #282828;
            display: inline-block;
            font-size: 16px;
            height: 32px;
            line-height: 32px;
            text-align: center;
            vertical-align: middle;
            width: 30px;
            cursor: pointer;
            position: relative;
            @include transition(all 300ms linear 0ms);

            &:before, &:after, span {
                @include transition(all 300ms linear 0ms);
                content: "";
                background-color: #282828;
                display: block;
                height: 2px;
                left: 0;
                margin: auto;
                position: absolute;
                right: 0;
                width: 22px;
                top: 21px;
            }
            &:before {
                top: 9px;
            }

            span {
                top: 15px;
            }

            &.opened{
                &:before {
                    top: 15px;
                    @include transform(rotate(45deg));
                }
                &:after {
                    @include transform(rotate(-45deg));
                    top: 15px;
                }
                span{
                    display: none;
                }
            }

        }
    }
    .main-menu-toggle {
        @include transition(all 300ms linear 0ms);
        cursor: pointer;
        display: inline-block;
        height: 25px;
        line-height: 25px;
        position: absolute;
        right: 0;
        text-align: center;
        top: 10px;
        width: 25px;
        background-color: $primary_color;
        border-radius: 2px;
        color: #fff;
        &:hover {
            background-color: $secondary_color;
        }
        &:before {
            content: "\f2f9";
            font-family: "Material-Design-Iconic-Font";
        }
    }
    #site-header-wrap {
        .mega-auto-width {
            display: block;
            > .wpb_column {
                width: 100%;
                .vc_column-inner {
                    padding: 0 !important;
                    border: none;
                }
            }
        }
        .vc_wp_custommenu {
            padding: 0;
            background-color: transparent;
        }
    }
    .mega-auto-width > .elementor-container > .elementor-row > .elementor-element .elementor-column-wrap {
        padding: 0 !important;
        border: none !important;
        margin: 16px 0 !important;
    }
}

.comment-navigation,
.posts-navigation,
.post-navigation {

    .site-main & {
        margin: 0 0 1.5em;
        overflow: hidden;
    }

    .nav-previous {
        float: left;
        width: 50%;
    }

    .nav-next {
        float: right;
        text-align: right;
        width: 50%;
    }
}

/* add class back when submenu out body */
ul.back {
    right: 100%;
    left: auto!important;
}

.mega-auto-width {
    > .elementor-container > .elementor-row {
        > .elementor-element {
            width: 285px;
            .elementor-column-wrap {
                padding: 0 40px;
                border-right: 2px solid #eaeaea;
                margin: 40px 0;
            }
            &:last-child .elementor-column-wrap {
                border-right: none;
            }
        }
        .elementor-widget-wp-widget-nav_menu ul.menu {
            background-color: transparent;
            @include box-shadow(none);
            @include border-radius(0px);
            margin-top: -8px;
            li {
                border: none;
                a {
                    background-color: transparent;
                    font-size: 14px;
                    color: #848e9f;
                    font-weight: normal;
                    padding: 8px 0 8px 22px;
                }
                &:hover > a,
                &.current_page_item > a,
                &.current-menu-item > a,
                &.current_page_ancestor > a,
                &.current-menu-ancestor > a {
                    color: $primary_color;
                }
                &:first-child {
                    a {
                        font-weight: 500;
                        font-size: 22px;
                        @include font-family-heading($heading_default_font);
                        color: $secondary_color;
                        display: block;
                        padding-left: 0;
                        &:before {
                            display: none;
                        }
                    }
                    &:hover > a,
                    &.current_page_item > a,
                    &.current-menu-item > a,
                    &.current_page_ancestor > a,
                    &.current-menu-ancestor > a {
                        color: $primary_color;
                    }
                }
                &:last-child a {
                    padding-bottom: 0;
                }
            }
        }
    }
    .elementor-section.elementor-section-boxed > .elementor-container {
        max-width: inherit;
    }
}