/*  Responsive navigation menu */

@media (max-width: @TabletBreakpoint) {
    .admin-content-wrap {
        float: right;
    }
    .help-tutorial.clearfix {
        display: none !important;
    }
    .noscrolling {
        overflow-y: hidden !important;
    }
    .btn .overlay-navbar-open {
        color: @mainColor;
    }
    .overlay-navbar-close {
        color: black;
        padding-right: 15px;
    }
    .mobile-menu-closer {
        position: absolute;
        top: 14px;
        right: 15px;
    }
    .overlay-navbar-open-container {
        display: flex;
        align-items: center;
    }
    .overlayed-mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: -200%;
        background-color: rgb(245, 245, 245);
        transition: .3s left;
        transition-timing-function: ease-in-out; // FIXME: remove this
        z-index: 100501;
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
        width: 80vw;
        margin-left: 0;
        box-shadow: 2px 0px 11px 0px #00000075;

        will-change: left;
        transform: translate3d(0,0,0);

        .overlayed-mobile-menu-container {
            position: relative;
            width: 100%;
            >.dropdown-menu {
                padding-top: 80px;
                padding-bottom: 80px;
            }
            .dropdown-menu {
                position: relative;
                display: block;
                width: 100%;
                background: 0;
                border: 0;
                box-shadow: none;
                box-shadow: unset;
                color: white;
                z-index: 0;
                overflow-x: hidden;
                li.active>a {
                    background-color: @mainColor !important;
                }
                li>a {
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    font-size: 15px;
                    padding-top: 10px;
                    padding-bottom: 10px;
                }
                .hint {
                    display: none;
                }
            }
            .dropdown-submenu {
                position: static;
                position: unset;

                .dropdown-menu {
                    left: 0;
                    a {
                        padding-left: 35px;
                    }
                }
                a:after {
                    display: none;
                }
            }
        }
        .overlayed-mobile-menu-closer {
            position: absolute;
            top: 14px;
            right: 15px;
            z-index: 2;
            button {
                color: white;
            }
        }
        .overlayed-mobile-menu__content {
            position: absolute;
            z-index: 10000;
            width: 100%;
        }
        .overlayed-mobile-menu__title-container {
            padding-left: 10px;
            background-color: #fff;
            margin: 0;
            padding-top: 10px;
            padding-bottom: 10px;
            font-weight: normal;
            box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.322);
            position: relative;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1;
            h3 {
                margin: 0;
                padding-right: 100px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }
        }
    }
    .navbar-admin-top {
        display: block !important;
        position: fixed !important;
        transform: translate3d(0, 0, 0);
        top: 0;
        bottom: 0;
        right: 0;
        left: -200%; // FIXME: remove this
        z-index: 100500;
        background-color: rgba(39, 72, 104, 0.322);
        transition: .3s left;
        transition-timing-function: ease-in-out;
        width: 80vw;
        margin-left: 0;
        background-color: rgb(245, 245, 245);
        box-shadow: 2px 0px 11px 0px #00000075;
        height: 100vh;
        overflow-y: auto;
        .dropdown-menu {
            display: none !important;
        }
    }
    .navbar-admin-top.open,
    .overlayed-mobile-menu.open {
        left: 0;
    }

    // Resets styles for mobile
    .navbar,
    .subnav,
    .navbar-inner {
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        .caret {
            display: none;
        }
        li>a {
            color: black;
            font-size: 15px;
        }
        .dropdown-toggle {
            padding-top: 13px !important;
            padding-bottom: 13px !important;
        }
    }
    // endof Resets styles for mobile

    // .actions is top panel (on mobiles)
    .nav__actions {
        top: 0 !important;
    }

    .title__lang-selector {
        margin-right: 5px;
    }

    .title__lang-selector .dropdown {
        display: inline-block;
        min-height: @inputHeight;
    }

    .title__lang-selector .dropdown-toggle {
        color: darken(rgb(100, 140, 181), 10%);
        text-decoration: none;
        font-weight: normal;
    }

    .title__lang-selector .caret {
        display: none;
    }

    // side menu
    .subnav {
        position: relative !important;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        overflow-y: auto;

        .nav.hover-show.nav-pills {
            .nav-first {
                padding-top: 80px;
            }

            .navbar-hr:last-child {
                margin-bottom: 80px;
            }

            li.dropdown {
                display: inline-block;
                width: 100%;
            }

            li.dropdown > .dropdown-menu > li {
                height: auto;
                height: unset;
            }
        }

        .menu-heading {
            background-color: #fff;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1;

            &__title-block {
                display: flex;
                align-items: center;
                padding-left: 10px;
                margin: 0;
                padding-top: 10px;
                padding-bottom: 10px;
                line-height: 40px;
                box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.322);
                cursor: pointer;

                &.openned .caret {
                    transform: rotate(180deg);
                }
            }

            &__title-text {
                word-wrap: break-word;
                overflow-wrap: break-word;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow-x: hidden;
                max-width: 60%;
                max-width: ~"calc(100% - 120px)";   // 100% - Close button
                margin-left: 5px;
                margin-right: 5px;
            }

            &__title-caret {
                display: inline-block;
                transition: .3s all;
            }

            &__dropdowned {
                overflow: hidden;
                transition: .3s all !important;
                height: 0;
                position: relative;
            }

            &__dropdowned-menu {
                width: 100%;
                max-width: unset;

                &.dropdown-menu {
                    display: block !important;
                    position: absolute;
                    width: 100%;
                    min-width: unset !important;
                    max-width: none !important;
                    max-width: unset !important;
                    border-left: 0;
                    border-right: 0;
                    right: 0;
                    left: 0;
                    top: 0;
                    opacity: 1;

                    .divider {
                        display: none;
                    }
                }
            }
        } // end of .menu-heading

    }

    .navbar.navbar-inverse {

        .navbar-inner {
            border: 0 !important;
            padding: 5px;

            .nav-ult {
                .brand .cs-icon {
                    padding-left: 8px;
                    padding-right: 15px;
                }
            }

            .navbar-right {
                margin: 0;
                width: 100%;

                .dropdown {
                    width: 100%;
                }
                .divider-vertical {
                    display: none;
                }
            }
        }

    }
}

// Hide quick-search and quick-menu
@media (max-width: @TabletBreakpoint) {
    .subnav {
        .search,
        .quick-menu-container {
            display: none;
        }
    }
}

@media (max-width: @TabletBreakpoint) {
    .navbar-admin-top.open {
        top: 0px !important;
    }
}

/* /Responsive navigation menu */