/**
 * @package Helix V3 Framework
 * @author JoomShaper http://www.joomshaper.com
 * @copyright Copyright (c) 2010 - 2016 JoomShaper
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
 */


/* **************     Start Megamenu     *************** */
/* ****************************************************** */
.sp-megamenu-parent {
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 9;
    display: block;
    float: right;
    >li {
        display: inline-block;
        position: relative;
        padding: 0;
        margin-left: 1px;
        &.active>a,
        &:hover>a {
            color: #fff;
        }
        &.menu-justify {
            position: static;
        }

        >a {
            display: inline-block;
            line-height: 70px;
            padding: 0 15px;
            font-size: 16px;
            text-transform: uppercase;
            color: #999999;
        }
        &.sp-has-child>a:after{
            font-family: "FontAwesome";
            content: " \f107";
        }
    }

    .sp-module {
        padding: 10px;
    }

    .sp-mega-group {
        list-style: none;
        padding: 0;
        margin: 0;

        .sp-mega-group-child {
            list-style: none;
            padding: 0;
            margin: 0;
        }
    }

    .sp-dropdown {
        margin: 0;
        position: absolute;
        z-index: 10;
        display: none;

        .sp-dropdown-inner {
            box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2);
            padding: 10px 0;
        }

        .sp-dropdown-items {
            list-style: none;
            padding: 0;
            margin: 0;

            .sp-has-child>a:after{
                font-family: "FontAwesome";
                content: " \f105";
                float: right;
            }
        }

        &.sp-menu-center {
            margin-left: 45px;
        }

        &.sp-dropdown-main {
            top: 70px;
            z-index: 999;
            &.sp-menu-right,
            &.sp-menu-full {
                left: 0;
            }

            &.sp-menu-left {
                right: 0;
            }
        }

        &.sp-dropdown-sub {
            top: 0;
            left: 100%;
            .sp-dropdown-inner {
                box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
            }
        }

        //List Item
        li.sp-menu-item { //child sub
                          display: block;
                          padding: 0;
                          position: relative;
                          &:not(:last-child){
                              margin-bottom: 1px;
                          }
                          >a {
                              display: block;
                              padding: 10px 15px;
                              color: #fff;
                              cursor: pointer;

                              &.sp-group-title {
                                  text-transform: uppercase;
                                  font-weight: bold;
                              }

                              &:not(.sp-group-title):hover {
                                  background-color: #fff;
                              }
                          }

                          &.active>a:not(.sp-group-title) {
                              background-color: #fff;
                          }
        }
    }

    .sp-dropdown-mega {
        >.row {
            margin-top: 30px;
            &:first-child {
                margin-top: 0;
            }
        }
    }

    //Has Child
    .sp-has-child {
        &:hover {
            >.sp-dropdown {
                display: block;
            }
        }
    }

    //Fade Animation
    &.menu-fade {
        .sp-has-child:hover {
            >.sp-dropdown {
                -webkit-animation: spMenuFadeIn 400ms;
                animation: spMenuFadeIn 400ms;
            }
        }
    }

    //Zoom Animation
    &.menu-zoom {
        .sp-has-child:hover {
            >.sp-dropdown {
                -webkit-animation: spMenuZoom 400ms;
                animation: spMenuZoom 400ms;
            }
        }
    }

    //Fade in up Animation
    &.menu-fade-up {
        .sp-has-child:hover {
            >.sp-dropdown {
                -webkit-animation: spMenuFadeInUp 400ms;
                animation: spMenuFadeInUp 400ms;
            }
        }
    }
    &.menu-slide-down {
        .sp-has-child:hover {
            >.sp-dropdown {
                opacity: 1;
                visibility: visible;
                top: 70px;
            }
            .sp-has-child{
                > .sp-dropdown {
                    top: 0;
                }
            }
        }

    }
}

/* **************     Start Off Canvas    *************** */
/* ****************************************************** */

#offcanvas-toggler {
    float: right;
    line-height: 70px;
    margin-left: 15px;
    font-size: 20px;
    >i {
        .transition(~'color 400ms, background-color 400ms');
        &:hover {
            color: #fff;
        }
    }
}

body.offcanvas {
    .body-innerwrapper{
        right: 320px;
    }
    .offcanvas-overlay {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        opacity: 1;
        z-index: 9999;
    }
}
.body-innerwrapper{
    position: relative;
    overflow-x: hidden;
    -webkit-transition: .4s;
    transition: .4s;
    right: 0;
}

.close-offcanvas {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1;
    border-radius: 100%;
    width: 25px;
    height: 25px;
    line-height: 23px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #fff;
    color: #fff;
}

.offcanvas-menu {
    width:  320px;
    height: 100%;
    background-color: #222222;
    color: #fff;
    position: fixed;
    top: 0;
    right: -320px;
    z-index: 99999;
    overflow: inherit;
    -webkit-transition: .4s;
    transition: .4s;
    .offcanvas-inner {
        .sp-module {
            margin-top: 20px;
            border-bottom: 1px solid rgba(0,0,0,0.08);
            margin-bottom: 50px;
            &:after{
                display: none;
            }

            &:last-child{
                border-bottom: none;
                margin-bottom: 0;
            }

            &.off-canvas-menu{
                padding: 0;
            }

            .sp-module-title {
                font-size: 16px;
                line-height: 1;
                text-transform: uppercase;
            }

            ul {
                > li{
                    border: 0;
                    position: relative;
                    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
                    overflow: hidden;
                    a {
                        .transition(300ms);
                        padding:10px 20px;
                        font-size: 14px;
                        text-transform: uppercase;
                        color: #fff;
                        font-weight: 500;
                        line-height: 28px;
                    }
                    &:hover,
                        &:focus,
                        &.active{
                        a{
                            background: #2d2d2d;
                        }
                    }
                    a {
                        &:hover,
                            &:focus{
                            background: #2d2d2d;
                        }
                    }
                    ul {
                        > li{
                            &.active,
                            &:hover,
                                &:focus {
                                > a{
                                    background: #3e3e3e !important;

                                }
                            }
                            > a{
                                &:hover,
                                    &:focus{
                                    background: #3e3e3e !important;
                                }
                            }
                        }
                    }

                    .offcanvas-menu-toggler {
                        display: inline-block;
                        position: absolute;
                        top: 0;
                        right: 0;
                        padding:13px 20px;
                        cursor: pointer;
                        .open-icon {
                            display: none;
                        }

                        .close-icon {
                            display: inline;
                        }

                        &.collapsed {
                            .open-icon {
                                display: inline;
                            }
                            .close-icon {
                                display: none;
                            }
                        }
                    }

                    >a:after  {
                        display: none;
                    }

                    ul {
                        background: rgba(0,0,0,0.02);
                        >li > a{padding-left: 30px;}
                    }
                }
            }

            &:first-child {
                margin-top: 0;
                padding: 30px;
            }
        }
        .search {
            margin-top: 25px;
            input {
                width: 100%;
                background: #fff;
                height: 45px !important;
                border-color: #5f5f5f;
                color: #000;
            }
        }
    }
}

.ltr {

    .offcanvas-menu {
        .transition(.4s);
    }

    .body-innerwrapper:after {
        right: 0;
    }

    .offcanvas-menu {
        right: -320px;
    }

    &.offcanvas {
        .offcanvas-menu {
            right: 0;
        }
    }
}

.offcanvas {
    width: 100%;
    height: 100%;
    position: relative;

    .body-innerwrapper:after {
        width: 100%;
        height: 100%;
    }

    .offcanvas-menu {
        right: 0;

        ul.nav-child li {
            padding-left: 10px;
        }
    }
}

.menu .nav-child.small {
    font-size: inherit;
}


/* **************   Start Menu Animation   *************** */
/* ****************************************************** */
/* Menu Slide Down
   ====================================================== */
.menu-slide-down{
    .sp-has-child {
        >.sp-dropdown {
            top: 60px;
            opacity: 0;
            visibility: hidden;
            display: block;
            transition: all 500ms ease;
            &.sp-dropdown-mega{
                left: auto;
                right: 0;
            }
        }
    }
}
@-webkit-keyframes spMenuFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes spMenuFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@-webkit-keyframes spMenuZoom {
    0% {
        opacity: 0;
        -webkit-transform: scale(.8);
    }

    100% {
        opacity: 1;
        -webkit-transform: scale(1);
    }
}

@keyframes spMenuZoom {
    0% {
        opacity: 0;
        transform: scale(.8);
        -webkit-transform: scale(.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        -webkit-transform: scale(1);
    }
}

@-webkit-keyframes spMenuFadeInUp {
    0% {
        opacity: 0;
        -webkit-transform: translate3d(0, 30px, 0);
    }

    100% {
        opacity: 1;
        -webkit-transform: none;
    }
}

@keyframes spMenuFadeInUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    100% {
        opacity: 1;
        transform: none;
    }
}
