/*================================================================
                 NAVIGATION TOGGLE STYLES
================================================================*/

.menuToggle { display:block; position:relative; width:50px; height:46px; background:#333; }
.menuToggle:before, .menuToggle:after, .menuToggle > span:before {
    content:" ";
    position:absolute;
    left:15%;
    border-radius:2px;
    width:70%; height:3px;
    background:#fff;
}

.menuToggle:before { top:11px; }
.menuToggle:after { top:21px; }
.menuToggle > span:before { top:31px; }

.menuToggle:hover, .menuToggle:focus, .js-menu-active .menuToggle { background:#111; }

@media (min-width:48em){
    .menuToggle { display:none; }
}

/*================================================================
                 NAVIGATION STYLES
================================================================*/

/*
    THESE STYLES will probably not be needed or adjusted in main
    - * for example is most efficient when not a child of a class
       -- hopefully you already are using the box sizing globally
    - you may not need text-decoration etc. depending on your global anchors
*/
.js-clickMenu a { color:#fff; text-decoration:none; }
.js-clickMenu * {
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
}

/* ================= DEFAULT SETTINGS ================= */

.js-clickMenu { position:relative; z-index:1000; }
.js-clickMenu ul { margin:0; padding:0; list-style:none; background:#111; }
.js-clickMenu li { border-top:1px solid #999; }
.js-clickMenu li:first-child { border-top:0; }
.js-clickMenu li a { display:block; padding:10px; position:relative; }

.js-clickMenu .hasSub span:after,
.js-clickMenu .subMenu .hasSub:after {
    content:" ";
    display:inline-block;
    position:absolute; top:15px; right:10px;
    margin:5px 0 0 5px;
    vertical-align:middle;
    border:5px solid transparent;
    /* Extra is for anti-aliasing issues in firefox and others */
    border:5px solid rgba(0,0,0,0);
    border-top-color:#fff;
    -webkit-transform: scale(0.98);
        -ms-transform: scale(0.98);
            transform: scale(0.98);
}

.js-clickMenu .subMenu { position:relative; }
.js-clickMenu .subMenu ul li { position:relative; }

.js-clickMenu > ul > li:hover > a, .js-clickMenu > ul > .opened > a,
.js-clickMenu > ul > li > a:hover, .js-clickMenu > ul > li > a:focus { background:#333; }

.js-clickMenu ul {
    max-height:0;
    opacity:0;
    overflow:hidden;
    -wekbit-transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
            transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

.js-clickMenu .subMenu li:hover > a, .js-clickMenu .subMenu .opened > a,
.js-clickMenu .subMenu a:hover, .js-clickMenu .subMenu li a:focus { background:#444; }

/* ================= MENU TOGGLE FUNCTIONALITY ================= */

.js-menu-active .js-clickMenu > ul { max-height:80em; opacity:1; }
.js-clickMenu .opened > ul,
.js-clickMenu .opened > .subMenu > ul { max-height:80em; opacity:1; }


@media (min-width:48em){
    .js-clickMenu ul { overflow:visible; }
    .js-clickMenu li { border-top:0; }

    .js-clickMenu > ul { display:table; width:100%; table-layout:fixed; max-height:80em; opacity:1; }
    .js-clickMenu > ul > li { display:table-cell; vertical-align:middle; }
    .js-clickMenu > ul > li > a { display:table; width:100%; padding:0; background:#999; }
    .js-clickMenu > ul > li > a > span { display:table-cell; padding:0 10px; height:40px; vertical-align:middle; text-align:center; }

    .js-clickMenu .hasSub span:after { position:static; }
    .js-clickMenu .subMenu .hasSub:after { top:8px; right:5px; }

    .js-clickMenu .subMenu ul { display:block; position:absolute; z-index:-1; left:0; top:-100em; min-width:100%; background:#333; }    

    .js-clickMenu li:nth-last-child(-n+2) .subMenu ul { left:auto; right:0; }
    .js-clickMenu li:nth-last-child(-n+2) .subMenu ul ul { margin-left:0; }

    .js-clickMenu .subMenu a { margin:5px; padding:3px 10px; background:#999; }

    .js-clickMenu .subMenu li:hover > a,
    .js-clickMenu .subMenu a:hover, .js-clickMenu .subMenu a:focus,
    .js-clickMenu .subMenu .opened > a { color:#000; background:#ddd; }


    /* ================= HOVER FUNCTIONALITY (MAYBE JS FAILED) ================= */

    .js-clickMenu li:hover > .subMenu > ul { top:0; max-height:80em; opacity:1; }
    .js-clickMenu li:hover > ul { left:100%; top:-5px; margin-left:-5px; max-height:80em; opacity:1; }

    /* Eh if you need IE8 Support have pragmming add in a class - This will work for every other browser in the meantime */
    .js-clickMenu li:nth-last-child(-n+2) li:hover > ul { left:auto; right:100%; margin-right:-5px; }


    /* ================= HOVER FUNCTIONALITY REMOVED AND OPENED FUNCTIONALITY ADDED ON SETUP ================= */

    .js-enabled li:hover > .subMenu > ul { top:0; max-height:0; opacity:0; }
    .js-enabled li:hover > ul { left:0; top:-5px; max-height:0; opacity:0; }
    .js-enabled li:nth-last-child(-n+2) li:hover > ul { right:0; }

    .js-enabled ul ul {
        -wekbit-transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, left 0.4s ease-in-out, right 0.4s ease-in-out;
                transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out, left 0.4s ease-in-out, right 0.4s ease-in-out;
    }
    .js-enabled .subMenu ul ul { top:-5px; }

    .js-enabled .subMenu ul { top:0; overflow:hidden; }
    .js-enabled .opened > .subMenu > ul, .js-enabled .opened:hover > .subMenu > ul { top:0; max-height:80em; opacity:1; }
    .js-enabled .opened > ul, .js-enabled .opened:hover > ul { left:100%; top:-5px; margin-left:-5px; max-height:80em; opacity:1; }
    .js-enabled li:nth-last-child(-n+2) .opened > ul,
    .js-enabled li:nth-last-child(-n+2) .opened:hover > ul { right:100%; margin-right:-5px; }

    .js-enabled .animated > ul,
    .js-enabled .animated .subMenu > ul { overflow:visible; z-index:10; }
    .js-enabled .animating > ul { z-index:-1; }
}

/*================================================================
                 MEGA MENU NAVIGATION STYLES
================================================================*/

@media(min-width:48em){
    .megaMenu .subMenu {
        position:absolute;
        top:100%; left:0;
        width:100%; max-height:0;
        background:#333;
        overflow:hidden;
        -wekbit-transition: all 0.5s ease-in-out;
                transition: all 0.5s ease-in-out;
    }

    .megaMenu .subMenu .hasSub:after { display:none; }

    .megaMenu .subMenu ul { position:static; max-height:80em; width:100%; overflow:hidden; background:transparent; max-height:80em; opacity:1; }
    .megaMenu .subMenu ul ul { margin-left:0; }
    .megaMenu .subMenu > ul > li { float:left; width:25%; }
    .megaMenu .subMenu > ul > li:nth-child(4n+1) { clear:left; }

    /* ================= HOVER FUNCTIONALITY (MAYBE JS FAILED) ================= */

    .megaMenu li:hover .subMenu { max-height:30em; padding:20px; }
    .megaMenu li:hover > .subMenu > ul,
    .megaMenu li:hover > ul { max-height:80em; opacity:1; }

    /* ================= HOVER FUNCTIONALITY REMOVED ON SETUP ================= */

    .js-enabled .megaMenu li:hover > .subMenu { max-height:0; padding:0; }
    .js-enabled .megaMenu .opened > .subMenu, .js-enabled .megaMenu .opened:hover > .subMenu { max-height:30em; padding:20px; }

}