//
// Top navigation bar
// --------------------------------------------------

body.mainmenu-open {
    overflow: hidden;
}

nav#layout-mainmenu.navbar {
    background-color: @color-mainmenu;
    padding: 0 0 0 20px;
    line-height: 0;
    white-space: nowrap;

    a {
        text-decoration: none;
        &:focus {
            background: transparent;
        }
    }

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
        float: left;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;

        li {
            color: @color-mainmenu-inactive;
            display: inline-block;
            margin-right: 30px;
            position: relative;

            &:last-child { margin-right: 0; }

            &.active {
                &:after {
                    content: ' ';
                    position: absolute;
                    bottom: 0;
                    left: 50%;
                    margin-left: -8.5px;
                }
            }

            &.icon {
                margin-right: 0;
                i { margin-right: 0; }
                a { padding: 14px; }
            }

            &.power-off, &.preview {
                i { font-size: 20px; }
                a { padding: 22px 20px 20px 20px; }
            }

            &.account {
                margin-right: 0;
                line-height: 23px;

                a {
                    padding-right: 20px;
                    position: relative;
                    z-index: 590;
                }

                img {
                    width: 25px;
                    margin-right: 7px;
                    position: relative;
                    top: -2px;
                }
            }
        }

        &.nav { display: inline-block; }
    }
    .menu-toggle { display: none; }

    .toolbar-item {
        padding-right: 0;

        &:before, &:after {
            margin-top: 0;
        }
        &:before { left: -12px; }
        &:after { right: -12px; }

        &.scroll-active-before:before { color: @color-mainmenu-active; }
        &.scroll-active-after:after { color: @color-mainmenu-active; }
    }
}

nav#layout-mainmenu.navbar ul li .mainmenu-accountmenu {
    position: fixed;
    top: 63px;
    right: 0;
    background: @color-accountmenu-bg;
    z-index: 590;
    display: none;

    &.active {
        display: block;
    }

    &:after {
        .triangle(up, 22px, 12px, @color-accountmenu-bg);
        right: 40px;
        top: -12px;
        position: absolute;
    }

    ul {
        float: none;
        display: block;
    }

    li {
        padding: 0;
        margin: 0;
        font-weight: 400;
        text-align: left;
        display: block;

        a {
            display: block;
            padding: 12px 30px;
            text-align: left;
        }

        &:hover {
            background: #3d5265!important;
        }
    }

    li.divider {
        height: 1px;
        width: 100%;
        background-color: @color-accountmenu-divider;
    }

    @media (max-width: @screen-sm) {
        &:after {
            right: 71px;
        }
    }
}

nav#layout-mainmenu.navbar ul li a,
nav#layout-mainmenu .menu-toggle,
.mainmenu-collapsed li a {
    padding: 14px 0;
    display: inline-block;
    font-size: 14px;
    color: inherit;
    outline: none;

    &:hover {
        background-color: transparent !important;
    }

    &:active, &:focus {
        text-decoration: none;
        color: @color-mainmenu-inactive;
    }

    i {
        line-height: 1;
        font-size: 35px;
        vertical-align: middle;
        margin-right: 10px;
    }
}

nav#layout-mainmenu.navbar ul li {
    a {
        i { font-size: 28px; }
    }
    &.active a {
        i { font-size: 35px; }
    }
}

.mainmenu-collapsed li a i {
    width: 40px;
    text-align: left;
    display: inline-block;
}

nav#layout-mainmenu.navbar ul li:hover,
.mainmenu-collapsed li:hover {
    a {
        &:active, &:focus {
            color: @color-mainmenu-active !important;
        }
    }
}

.touch .mainmenu-collapsed li a:hover {
    color: @color-mainmenu-inactive;
}

nav#layout-mainmenu.navbar ul li,
.mainmenu-collapsed li {
    &.active, &.highlight {
        color: @color-mainmenu-active !important;
        font-weight: 600;

        a {
            color: @color-mainmenu-active !important;
        }
    }

    &:hover {
        color: @color-mainmenu-active;
        background: transparent;
    }
}

body.drag {
    nav#layout-mainmenu.navbar ul.nav,
    .mainmenu-collapsed ul {
        li:hover { color: @color-mainmenu-inactive; }
    }
}

@media (max-width: @menu-breakpoint-max) {
    nav#layout-mainmenu.navbar {
        ul.nav {display: none;}

        .menu-toggle {
            display: inline-block;
            color: @color-mainmenu-active!important;
            font-weight: 600;
        }
    }

    .mainmenu-collapsed {
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
        width: 0;
        background: @color-mainmenu-collapsed;
        .box-shadow(inset -5px 0 3px rgba(0,0,0,0.1));

        margin: 0;

        > div {
            display: relative;
            height: 100%;

            ul {
                overflow: hidden;
                padding: 0;
                margin: 0;

                li {
                    text-transform: uppercase;
                    list-style: none;
                    color: @color-mainmenu-inactive;

                    a {
                        white-space: nowrap;
                        display: block;
                        padding: 15px 20px;

                        &:hover {
                            text-decoration: none;
                        }
                    }
                }
            }
        }

        .vertical-scroll-marker(@color-mainmenu-inactive);
    }
}

body.mainmenu-open  .mainmenu-collapsed ul {
    position: fixed;
    left: 0;
    top: 10px;
    bottom: 10px;
}

@media (min-width: @menu-breakpoint-min) {
    #layout-canvas {position: static!important;}
    .mainmenu-collapsed {display: none!important;}
}
