/* Main Menu */

.w3-bar.menu-bar {
    overflow: visible;
    padding: 0;
}




/* Giving a background-color to the nav container. */
nav {
    margin:0;
    padding: 0 15px;
    position: relative;
    z-index: 1000;
    font-size: 0;
}


/* Since we'll have the "ul li" "float:left"
* we need to add a clear after the container. */

nav:after {
    content:"";
    display:table;
    clear:both;
}

/* Styling the links */
nav a {
    display:block;
    padding:5px 7px;
    color:#FFF;
    font-size:16px;
    text-decoration:none;
    font-family: 'Roboto Condensed', 'DIN Condensed', sans-serif-condensed, Impact, sans-serif;
    font-weight: bold;
}

.nav-menu > li > a.nav-link {
    border-bottom: none;
}

/* Background color change on Hover */
nav a:hover {
    background-color: rgba(0,0,0,0.3);
}

.menu-item-has-children:hover {
    background-color: rgba(0,0,0,0.3);
}

/* Hide responsive toggle by default */
.menu-toggle {
    display: none;
}

/* Removing padding, margin and "list-style" from the "ul",
* and adding "position:reltive" */
nav ul {
    padding:0;
    margin: 0;
    list-style: none;
    position: relative;
    display: inline-block;
    border-left: 1px solid #fff;

}

/* Positioning the navigation items inline */
nav ul li {
    margin: 0px;
    display:inline-block;
    float: left;
    /*background-color: rgba(0, 0, 0, 0.2);*/
    border-right: 1px solid #fff;
}

nav ul ul {
    background-color: rgb(103, 120, 17);
    text-align: left;
    position: absolute;
    /* has to be the same number as the "line-height" of "nav a" */
    top: 34px;
    margin-left: -1px;
    transition:all 0.3s ease-in-out;
}

/* Active page highlight */
nav ul li.active, nav ul li.childselected > a {
    font-weight: bold;
}

/* First Tier Dropdown */
nav ul ul li {
    width:200px;
    float:none;
    display:list-item;
    position: relative;
    margin: 0 0 -1px -1px;
}

/* Second, Third and more Tiers
* We move the 2nd and 3rd etc tier dropdowns to the left
* by the amount of the width of the first tier.
*/

nav ul ul ul {
    position: absolute;
    left: 200px;
    top: 0px;
}


/* Change ' +' in order to change the Dropdown symbol */
nav li > a:after { content:  ' ▾'; }
nav li > a:only-child:after { content: ''; }

nav ul li ul li > a:after { content:  ' ▸'; }
nav ul li ul li > a:only-child:after { content: ''; }



.navbar-nav > .menu-item-has-children:hover > a {
pointer-events: none;
}
.navbar-nav > .menu-item-has-children > a {
pointer-events: auto;
}


.menu-bar .navbar-nav > .menu-item-has-children.up {
    background:rgba(0, 0, 0, 0.3);
}

/* Hide links in footer with class "header-only" */
#footer .nav-item.header-only {
    display: none;
}
/* Hide links in header with class "footer-only" */
#header .nav-item.footer-only {
    display: none;
}

/* Hide dropdowns by default, display dropdowns on Hover */

.main-navigation ul.sub-menu li a {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    display: block;
    transition:all 0.2s ease-in-out;
    overflow: hidden;
    border: 0px solid rgba(256, 256, 256, 0); 
}

.main-navigation .menu-item-has-children:hover > ul.sub-menu > li > a{
    display: inherit;
    max-height: 70px;
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #fff;
    border: 1px solid rgba(256, 256, 256, 1);
    overflow: visible;

}




/* Styles for reponsive menu */

@media all and (max-width : 768px) {

    /* Disable tap on top level dropdown items 

    .navbar-nav > .menu-item-has-children > a {
    pointer-events: none;
}
    */

    nav {
        margin: 0;
        transition:all 3s ease-in-out;
        padding: 0;
    }

    nav a {
        margin-right: 45px;
    }

    .main-navigation .menu-item-has-children:hover {
        background-color: inherit;
    }

    nav li > a::after, nav ul li ul li > a::after {
        content: '';
    }
    /*Restyle menu into stack */

    nav ul {
        border-left: none;

    }

    nav ul::after {
        display: block;
        clear: both;
        width: 100%;
        content: '';
    }

    nav ul::after {
        border-left: none;
    }

    nav ul ul {

        text-align: left;
        display: inherit;
        position: relative;
        top: 0;
        border-top: none;
        background-color: rgba(0, 0, 0, 0);
        background: none;
    }

    nav ul li {
        position: relative;
        padding: 0 calc(50% - 200px);
        border-right: none;
    }


    nav ul ul ul {
        position: relative;
        left: 0;
        top: 0;
        margin: 0px 0 0 40px;
        width: calc(100% - 40px);
        background: none;
    }

    nav ul ul li {
        border: none;
    }

    .main-navigation  .menu-item-has-children span {
        display: block;
        cursor: pointer;
        width: 46px;
        position: absolute;
        right: calc(50% - 200px);
        top: 0;
        font-size: 20px;
        color: #fff;
        text-align: center;

    }

    .main-navigation  .menu-item-has-children > span::before {
        content: '✕';
        display:inline-block;
        transform: rotate(45deg);
        transition:transform 0.5s ease-in-out;
    }

    .main-navigation  .menu-item-has-children.up > span::before {
        content: '✕';
        transform: rotate(0deg);
    }
    .sub-menu a::before {
        content: '';
        width: 20px;
        display: inline-block;
    }

    /* Hide the navigation menu by default */
    /* Also hide the  */
    /*.toggle + a,*/
    .main-navigation ul.menu li a {
        max-height: 0;
        padding: 0 7px;
        overflow: hidden;
        transition:all 0.5s;
    }

    .main-navigation  .menu-item-has-children > span, .main-navigation  .menu-item-has-children > span::before
    {   height: 0;
        line-height: 0px;
        overflow: hidden;
    }



    /* Stylinf the toggle lable */
    .menu-toggle {
        display: block;
        background-color: #677811;
        padding:14px 20px;
        color:#FFF;
        font-size:17px;
        text-decoration:none;
        border:none;
        width: fit-content;
        margin: auto;
    }


    .menu-toggle:hover {
        background-color: #456200;
        cursor: pointer;

    }

    /* Display Dropdown when clicked on Parent Lable */
    .main-navigation.toggled ul.menu > li > a {
        max-height: 46px;
        padding: 10px 7px;
        display: inherit;
    }

    .main-navigation.toggled .nav-menu > .menu-item-has-children > span, .main-navigation.toggled .nav-menu > .menu-item-has-children > span::before
    {   height: 45px;
        line-height: 45px;
        overflow: hidden;
    }

    .main-navigation .menu-item-has-children span:hover {
        background-color: rgba(0,0,0,0.3);
    }


    .main-navigation.toggled > div > ul > li {
        border-top: 1px solid rgba(256, 256, 256, 0.5);
    }

    /* Change menu item's width to 100% */
    nav ul, nav ul li, nav ul ul li, nav ul ul ul li {
        display: block;
        width: 100%;
        clear: both;
        text-align: left;
    }

    nav a:hover
    {
        background-color: rgba(0, 0, 0, 0.4);
    }

    /* Override dropdown hover */


    .main-navigation ul.sub-menu li a {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        display: block;
        transition:all 0.2s ease-in-out;
        overflow: hidden;
        border-bottom: 0px solid rgba(256, 256, 256, 0.5); 
    }

    .main-navigation .menu-item-has-children:hover > ul.sub-menu > li > a{
        display: inherit;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border: 0px solid rgba(256, 256, 256, 0);
        overflow: hidden;

    }

    /* Transitions on toggle up instead */
    .up > .sub-menu {
        background-color: #48540c;    
    }

    .main-navigation.toggled .nav-menu > .menu-item-has-children.up > ul.sub-menu > li > a, .main-navigation.toggled .nav-menu > .menu-item-has-children.up > ul.sub-menu > li.up > ul.sub-menu > li > a{
        display: inherit;
        max-height: 90px;
        padding-top: 10px;
        padding-bottom: 10px;
        border-top: 1px solid rgba(256, 256, 256, 0.5);
        overflow: visible;

    }

    .main-navigation.toggled .menu-item-has-children.up > .sub-menu > li > span, .main-navigation.toggled .menu-item-has-children.up > .sub-menu > li > span::before
    {   height: 45px;
        line-height: 45px;
        overflow: hidden;
    }


}

@media all and (max-width : 330px) {

    nav ul li {
        display:block;
        width: 94%;
    }

}

/* HIde or show classes */

#header .footer-only {
    display: none;
}

#footer .header-only {
    display: none;
}
