nav {
    display: block;
    background: #bababa;
    position: relative;
    min-height: 40px;
}

nav,
nav a {
    color: #1b467e;
    text-decoration: none;
    font-family: "Open Sans Condensed", sans-serif;
    font-size: 100%;
}

nav a {
    display: block;
    padding: 10px 2.2em;
}

nav a:hover {
    color: #444;
}

nav ul {
    padding: 0;
    margin: 0;
}

nav ul li {
    float: left;
    display: inline;
    position: relative;
    border-right: 1px solid white;
    width: 195px;
}

nav ul li:nth-child(8) {
    border-right: none;
}

nav ul li ul {
    left: 0;
    top: 100%;
    background: #fff;
}

nav ul li ul li {
    background: #fff;
    border-bottom: thin solid #999;
}

nav ul ul {
    display: none;
}

nav li:hover>ul {
    display: block;
    position: absolute;
    z-index: 1000;
    width: 120px;
}

nav ul ul li:hover>ul {
    right: -120px;
    top: 0;
    left: auto;
}


/*Hide checkbox and label by default*/

nav>input,
nav>label {
    display: none;
}

nav>label {
    width: 100%;
    float: left;
    padding: 10px;
    border-bottom: thin solid #999;
    padding-right: 0;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}


/********************************************** RESPONSIVE **********************************************/

@media (max-width: 1024px) {
    nav>label,
    nav ul li ul {
        display: block;
    }
    nav>ul {
        display: none;
        clear: both;
    }
    nav>input:checked+ul {
        display: block;
    }
    nav ul ul li a:before {
        display: inline;
    }
    nav ul li {
        float: none;
        display: block;
        border-right: none;
        padding-left: 10px;
        width: 100%;
        background: #5f7490;
        border-bottom: thin solid #999;
    }
    nav ul li a {
        color: #fff;
    }
    nav ul li a:hover {
        color: #000;
    }
    nav ul li ul li {
        width: 100%;
        left: 0;
    }
    nav ul li ul li a {
        color: #1b467e;
    }
    nav li:hover ul {
        position: relative;
        width: auto;
    }
    nav ul ul li:hover>ul {
        right: auto;
        top: auto;
        left: auto;
    }
}
