@import "_Logo.scss";

@media screen and (max-width: 769px) {
    nav.navbar-static-side {
        display: none;
    }

    &:not(.body-small) .navbar .top-menu a.nav-min-navigation {
        padding-left: 0;
        padding-right: 0;

        .logo-navigation-wrapper-small {
            display: flex;
        }
    }
}

&.body-small {
    &:not(.mini-navbar) {
        nav.navbar-static-side {
            top: -100%;
            z-index: 12;
        }
    }

    .logo-navigation-wrapper {
        img {
            display: none;
        }
    }

    nav.navbar-static-side {
        top: 0%;
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: $menu-color;

        .footer {
            position: relative;
            background-color: $menu-color;
            margin-top: -1px;

            i {
                display: inline-block;
                margin-bottom: 20px;
                margin-top: 5px;
                font-size: 3vw;
                cursor: pointer;
            }
        }

        #side-menu {
            & > li {
                float: left;
                width: calc(100% / 3);
                height: calc(100vw / 3);
                position: unset;
                border-top: 0;

                &:first-child {
                    display: none;
                }

                &.dropdown {
                    & > a {
                        padding: 10px;

                        &:after {
                            content: "\f107";
                            font-family: 'FontAwesome';
                            display: block;
                            text-align: center;
                            color: $secondary-color;
                            font-size: 3vw;
                            padding-bottom: 2px;
                            position: absolute;
                            bottom: 0;
                        }
                    }

                    & > ul {
                        display: none;
                    }

                    @media only screen and (min-width:$min-screen-md) {
                        &:hover {
                            & > a:after {
                                color: $menu-color;
                                font-weight: bold;
                            }
                        }
                    }

                    &.active {
                        border: 0;

                        & > a:after {
                            content: "\f106";
                            color: $accent-color;
                            font-weight: bold;
                        }

                        &.active-dropdown {
                            & > ul {
                                display: block;
                                position: relative;
                                top: 0;
                                left: -1px;
                                width: calc(100% - 1px);
                                min-width: unset;

                                &:before {
                                    content: unset;
                                }

                                & > li {
                                    a {
                                        font-size: 2.7vw;
                                        padding: 10px 9px 10px 9px;

                                        &:hover {
                                            border-right: 0;
                                            text-decoration: underline;
                                            text-decoration-color: $accent-color;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                & > a {
                    height: 100%;
                    text-align: center;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex-direction: column;
                    border-bottom: 1px solid $icon-border-color;
                    border-right: 1px solid $icon-border-color;

                    & > i {
                        display: block;
                        font-size: 8vw;
                        margin-bottom: 3vw;
                    }

                    span.nav-label {
                        display: block;
                        font-size: 2.9vw;
                    }
                }

                &.menu-sort-item-selected:not(.menu-item-issorting){
                    background: rgba(255,255,255,0.7);
                }
            }
        }
    }
}

.nav-min-navigation {
    & {
        color: $light-color;
        background-color: transparent;
        text-decoration: none;
        margin: 0;
        text-align: right;
        padding: 6px 20px;
        min-height: 49px;

        &:hover, &:focus {
            color: darken($light-color, 10%);
        }

        .logo-navigation-wrapper {
            position: absolute;
        }

        .logo-navigation {
            height: 38px;
            float: left;
            background-repeat: no-repeat;
            background-size: contain;

            &.logo-with-title {
                position: relative;
                overflow: visible;

                .logo-title {
                    text-align: left;
                    margin-left: 75px;
                    margin-top: 17px;
                    opacity: 1;
                    font-size: 11px;
                    font-weight: normal;
                    color: $logo-title-color;
                    white-space: nowrap;
                }
            }

            @include logo-classes-generator("", $logo-image, $logo-image-small);
            @include logo-classes-generator("-cm", $logo-image-cm, $logo-image-small-cm);
            @include logo-classes-generator("-wt", $logo-image-wt, $logo-image-small-wt);

            @include logo-classes-generator("-wa", $logo-image-wa, $logo-image-small-wa);
            @include logo-classes-generator("-wf", $logo-image-wf, $logo-image-small-wf);
            @include logo-classes-generator("-wg", $logo-image-wg, $logo-image-small-wg);
            @include logo-classes-generator("-wm", $logo-image-wm, $logo-image-small-wm);
            @include logo-classes-generator("-wm-2", $logo-image-wm-2, $logo-image-small-wm-2);
            @include logo-classes-generator("-wr", $logo-image-wr, $logo-image-small-wr);
            @include logo-classes-generator("-ws", $logo-image-ws, $logo-image-small-ws);


            &.logo-granule {
                @include logo-classes-generator("-granules", $logo-image-granules, $logo-image-granules-small);
                @include logo-classes-generator("-gr-b2b", $logo-image-gr-b2b, $logo-image-gr-b2b-small);
                @include logo-classes-generator("-gr-bi", $logo-image-gr-bi, $logo-image-gr-bi-small);
                @include logo-classes-generator("-gr-dt", $logo-image-gr-dt, $logo-image-gr-dt-small);
                @include logo-classes-generator("-gr-to", $logo-image-gr-to, $logo-image-gr-to-small);
                @include logo-classes-generator("-gr-wr", $logo-image-gr-wr, $logo-image-gr-wr-small);
                @include logo-classes-generator("-gr-st", $logo-image-gr-st, $logo-image-gr-st-small);
                @include logo-classes-generator("-gr-ios", $logo-image-gr-ios, $logo-image-gr-ios-small);
                @include logo-classes-generator("-gr-in", $logo-image-gr-in, $logo-image-gr-in-small);
            }
            /*&.menu-logo-large {
                width: 180px;
                background-image: $logo-image;
            }

            &.menu-logo-small {
                width: 70px;
                position: relative;
                margin-right: 10px;
                margin-left: 10px;
                background-image: $logo-image-small;
            }

            &.menu-logo-large-cm {
                width: 180px;
                background-image: $logo-image-cm;
            }

            &.menu-logo-small-cm {
                width: 70px;
                position: relative;
                margin-right: 10px;
                margin-left: 10px;
                background-image: $logo-image-small-cm;
            }

            &.menu-logo-large-wt {
                width: 180px;
                background-image: $logo-image-wt;
            }

            &.menu-logo-small-wt {
                width: 180px;
                background-image: $logo-image-small-wt;
            }

            &.logo-granule {
                width: 180px;

                &.menu-logo-large-granules {
                    background-image: $logo-image-granules;
                }

                &.menu-logo-small-granules {
                    background-image: $logo-image-granules-small;
                }

                &.menu-logo-large-gr-b2b {
                    background-image: $logo-image-gr-b2b;
                }

                &.menu-logo-small-gr-b2b {
                    background-image: $logo-image-gr-b2b-small;
                }

                &.menu-logo-large-gr-bi {
                    background-image: $logo-image-gr-bi;
                }

                &.menu-logo-small-gr-bi {
                    background-image: $logo-image-gr-bi-small;
                }

                &.menu-logo-large-gr-dt {
                    background-image: $logo-image-gr-dt;
                }

                &.menu-logo-small-gr-dt {
                    background-image: $logo-image-gr-dt-small;
                }

                &.menu-logo-large-gr-to {
                    background-image: $logo-image-gr-to;
                }

                &.menu-logo-small-gr-to {
                    background-image: $logo-image-gr-to-small;
                }

                &.menu-logo-large-gr-wr {
                    background-image: $logo-image-gr-wr;
                }

                &.menu-logo-small-gr-wr {
                    background-image: $logo-image-gr-wr-small;
                }

                &.menu-logo-large-gr-st {
                    background-image: $logo-image-gr-st;
                }

                &.menu-logo-small-gr-st {
                    background-image: $logo-image-gr-st-small;
                }
            }*/
        }
    }
}
    nav.navbar-static-side {
        & #side-menu {
            @include no-select();

            .menu-line {
                border-color: $icon-border-color;
                margin-top: 0px;
                margin-bottom: 0px;
            }
        }

        .footer {
            font-size: 11px;
            background-color: transparent;
            border-top: 1px solid $icon-border-color;
            color: $icon-color;
            padding: 8px 0px;

            i {
                display: none;
            }
        }

        &.mini-navbar .footer {
            display: none;
        }

        &.navbar-default {
            height: 100%;
            max-height: 100%;
            border-right: 1px solid $divider-color;

            .nav {
                .nav-header {
                    padding: 0px;
                    background: transparent;
                    color: $light-color;
                    border-right: 4px solid $menu-color;
                    margin-right: -2px;

                    a {
                        color: $light-color;
                        background-color: transparent;
                        text-decoration: none;
                        margin: 0;
                        text-align: right;
                        padding: 6px 20px;
                        min-height: 49px;

                        &:hover, &:focus {
                            color: darken($light-color, 10%);
                        }

                        .logo-navigation-wrapper {
                            position: absolute;
                        }

                        .logo-navigation {
                            height: 38px;
                            float: left;
                            background-repeat: no-repeat;
                            background-size: contain;

                            &.menu-logo-large {
                                width: 180px;
                                background-image: $logo-image;
                            }

                            &.menu-logo-small {
                                width: 70px;
                                position: relative;
                                margin-right: 10px;
                                background-image: $logo-image-small;
                            }

                            &.menu-logo-large-cm {
                                width: 180px;
                                background-image: $logo-image-cm;
                            }

                            &.menu-logo-small-cm {
                                width: 70px;
                                position: relative;
                                margin-right: 10px;
                                background-image: $logo-image-small-cm;
                            }
                        }
                    }

                    .logo-element {
                        .dropdown {
                            .dropdown-backdrop {
                                display: none;
                            }

                            a {
                                padding: 0;

                                span {
                                    display: inline-block;
                                    color: $light-color;
                                    font-size: 15px;
                                }
                            }
                        }
                    }

                    .logout-option {
                        .dropdown-menu {
                            &:hover {
                                background-color: darken($light-color, 3%);

                                a {
                                    color: darken($menu-main-text-color, 15%);
                                }
                            }

                            a {
                                color: $menu-main-text-color;
                                padding: 0 15px;
                            }
                        }
                    }

                    & + li {
                        border-top: 1px solid $divider-color;

                        &.active, &:hover {
                            border-top: 1px solid $divider-color;
                        }
                    }
                }

                ul {
                    //Edge bulletin bug
                    list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=);

                    &.dropdown-menu {
                        min-width: 200px;

                        li {
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }
                    }
                }

                li:not(.nav-header) {
                    & > a, & > a:active {
                        color: $menu-main-text-color;
                        text-decoration: none;
                        padding-left: 20px;
                        background-color: transparent;

                        @media screen and (max-height: 700px) {
                            padding: 1.75vh 20px 1.75vh 25px;
                        }
                    }

                    & > a > i {
                        margin-right: 5px;
                    }

                    & > a > span {
                        font-weight: 500;
                    }

                    @media only screen and (min-width:$min-screen-md) {
                        &:hover, &:focus {
                            & > a {
                                color: $menu-secondary-text-color;
                                background-color: darken($secondary-color, 5%);
                            }
                        }
                    }

                    &.active {
                        background-color: $secondary-color;
                        border-left: 10px solid $accent-color;

                        & > a {
                            color: $menu-secondary-text-color;
                            padding-left: 10px;

                            i {
                                color: $accent-color;
                            }

                            span {
                                font-weight: 600;
                            }
                        }
                    }

                    .dropdown-menu.collapse.in {
                        display: none;
                    }

                    @media only screen and (min-width: 768px) {
                       &.dropdown:hover .dropdown-menu, &.dropdown.active-dropdown .dropdown-menu {
                            display: block;
                            height: auto !important;
                        }
                    }

                    .dropdown-menu {
                        margin: 0;
                        border-radius: 0;
                        margin-top: -1px;
                        border: 1px solid $divider-color;

                        &.dropdown-menu-right {
                            position: absolute;
                            float: right;
                            top: 0;
                            left: 100%;
                        }

                        &:before {
                            content: "";
                            width: 0;
                            height: 0;
                            border-top: 10px solid transparent;
                            border-bottom: 10px solid transparent;
                            border-right: 10px solid $divider-color;
                            position: absolute;
                            left: -10px;
                            top: 15px;
                        }

                        &.dropdown-menu-top {
                            top: auto;
                            bottom: 0;

                            &:before {
                                top: auto;
                                bottom: 10px;
                            }
                        }

                        li a {
                            margin: 0;
                            padding: 14px 20px 14px 25px;
                            line-height: 1.42857143;
                            color: $menu-secondary-text-color;
                            background-color: $secondary-color;

                            &:hover {
                                border-right: 10px solid $accent-color;
                            }
                        }
                    }

                    &.at-mimic-hover{
                        .dropdown-menu{
                            display: block;
                            height: auto !important;
                        }
                    }
                }
            }
        }
    }

    .logo-navigation-wrapper-large {
        display: flex;
    }

    .logo-navigation-wrapper-small {
        display: none;
    }

    &.mini-navbar nav.navbar-default .nav > li:not(.nav-header) > a {
        @media only screen and (max-height: 870px) {
            font-size: 13px;
            padding: 10px 20px 10px 25px;
        }

        @media only screen and (max-height: 695px) {
            font-size: 11px;
            padding: 8px 20px 8px 25px;
        }
    }

    &:not(.mini-navbar) nav.navbar-default .nav > li:not(.nav-header) > a {
        @media only screen and (max-height: 775px) {
            font-size: 11px;
            padding: 10px 20px 10px 25px;
        }
    }

    &.mini-navbar .nav-label,
    &.mini-navbar .navbar-default .nav li a span {
        display: initial;
    }

    &.mini-navbar #side-menu .nav-label,
    &.mini-navbar .navbar-default #side-menu.nav li a span {
        display: none;
    }

    &.mini-navbar {
        nav.navbar-default {
            .nav-header {
                padding: 0;

                a.nav-min-navigation {
                    padding: 6px 3px;

                    .logo-navigation-wrapper-large {
                        display: none;
                    }

                    .logo-navigation-wrapper-small {
                        display: flex;
                    }
                }
            }
        }
    }

    a.nav-min-navigation {
        &:hover {
            background-color: unset;
        }
    }

    &.body-small {
        #page-wrapper {
            margin-left: 0;
        }

        a.nav-min-navigation {
            padding: 6px 3px;

            .logo-navigation-wrapper-large {
                display: none;
            }

            .logo-navigation-wrapper-small {
                display: flex;
            }
        }
    }

    &:not(.body-small) {
        .top-menu {
            a.nav-min-navigation {
                .logo-navigation-wrapper-large {
                    display: none;
                }

                .logo-navigation-wrapper-small {
                    display: none;
                }
            }
        }
    }

    @media only screen and (min-width: $min-screen-sm) {
        #SetMobileMenu {
            display: none;
        }
    }
    // Tablet and mobile
    @media only screen and (max-width: $max-screen-sm) {
        .mobile-menu-load-fix {
            display: none;
        }
    }
    //For autotests
    .autotest-menu {
        .dropdown > a {
            pointer-events: none;
        }
    }

    &.mini-navbar {
        .autotest-menu {
            .dropdown > a {
                pointer-events: all;
            }
        }
    }
    //For touch devices
    &:not(.body-small).touch-device #main-menu-navbar {
        ul.nav:not(.autotest-menu){
            .dropdown:not(.active-dropdown):hover > .dropdown-menu {
                display: none;
            }
        }
    }
