header {
    width: 100%;
    background-color: #FFFFFF;
    z-index: 500;
    position: fixed;
    top: 0;
    box-shadow: 0 0 5px 1px rgba(20, 20, 20, 0.2);
    letter-spacing: 0.05rem;
    min-width: 270px;
}

header > div, .menu {
    max-width: 75rem;
    margin: 0 auto;
}

header a, header a:visited {
    color: #287DB4;
}

header a:hover {
    color: #1B5F91;
}

.header-topbar {
    padding: 0.1rem 1rem;
    border-bottom: 1px solid #CCCCCC;
    min-height: 2.5rem;
}

.header-topbar > div {
    display: inline-block;
    vertical-align: top;
}

#banner {
    max-width: 50%;
    line-height: 0;
}

#accountwrapper, #cartwrapper {
    margin-left: 13px;
    float: right;
}

#accountwrapper {
    margin-left: 15px;
    padding-top: 0.7rem;
    font-size: 0.9rem;
    float: right;
}

#searchwrapper, #cartwrapper {
    padding-top: 0.45rem;
}

#open-search {
    display: none;
    float: right;
}

#cartwrapper a:before {
    font-size: 35px;
    line-height: 33px;
    content: '\e611';
}

#cartwrapper a:hover:before,
#open-search:hover:before {
    color: #333333;
}

#cartwrapper a:before,
#search-submit:before,
#open-search:before {
    font-family: 'icons-blank-theme';
    margin: 0;
    vertical-align: top;
    display: inline-block;
    font-weight: normal;
    overflow: hidden;
    speak: none;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    color: #8f8f8f;
}

#searchwrapper {
    float: right;
    position: relative;
}

#searchwrapper input {
    width: 250px;
    border: 1px solid #BBBBBB;
}

#search-submit {
    /* Submit button (magnifying glass) for searching */
    display: inline-block;
    background: none;
    -moz-box-sizing: content-box;
    border: 0;
    box-shadow: none;
    line-height: inherit;
    text-decoration: none;
    text-shadow: none;
    font-weight: 400;
    padding: 5px 0;
    position: absolute;
    right: 10px;
    top: 0;
    z-index: 1;
}

#search-submit:before {
    font-size: 22px;
    line-height: 36px;
    content: '\e615';
}

#open-search:before {
    font-size: 35px;
    line-height: 33px;
    content: '\e615';
    font-family: 'icons-blank-theme';
    vertical-align: middle;
}

#search-submit:hover:before {
    color: #3399CC;
}

#mobile-menu {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
}

#mobile-menu.active {
    border-bottom: 1px solid #3399CC;
}

#main-nav > li {
    /* Column for each menu tab */
    text-transform: uppercase;
    display: inline-block;
}

#main-nav > li > a {
    display: block;
    padding: 0.6rem 1.5rem;
}

.sub-menu li:hover,
#sub-nav li:hover {
    -webkit-transition: 0.2s;
    transition: 0.2s;
}

#main-nav > li.current-menu-item > a,
#main-nav > li.current-menu-ancestor > a,
#main-nav > li:hover > a {
    /* Current navigation tab is highlighted, as well as hovered tab */
    background-color: #3399CC;
    color: #FFFFFF;
}

.sub-menu {
    background-color: #FFFFFF;
    border: 1px solid #3399CC;
    position: absolute;
    display: none;
}

#main-nav > li:hover > .sub-menu {
    /* Dropdown menu visible on hover */
    display: block;
}

.sub-menu > li > a {
    /* Individual links */
    display: block;
    padding: 0.5rem 1.5rem;
    max-width: 100%;
}

.sub-menu > li:hover {
    background-color: #CEE6F0;
}

li:first-child .sub-menu .sub-menu {
    /* Child pages of child pages don't display in the main navigation except the store. */
    display: block;
    position: static;
    border: 0;
    border-bottom: 1px solid #5BADD6;
}

li:first-child .sub-menu .sub-menu li a {
    text-transform: none;
    padding: 0.25rem 0 0.25rem 3rem;
}

/* Under navigation bar for child pages */

#sub-nav {
    background-color: #3399CC;
}

#sub-nav li {
    display: inline-block;
}

#sub-nav a {
    display: block;
    padding: 0.4rem 1.5rem;
    color: #FFFFFF;
}

#sub-nav .current-menu-ancestor,
#sub-nav .current-menu-item,
#sub-nav ul li:hover {
    background-color: #5BADD6;
}

@media only screen and (max-width: 50rem) {

    .header-topbar {
        padding: 0.25rem;
    }
}

@media only screen and (max-width: 49rem) {

    #cartwrapper {
        padding: 0;
        margin: 0;
    }

    #searchwrapper {
        float: none;
        width: 100%;
    }

    #searchwrapper input {
        max-width: unset;
        width: 100%;
    }

    #search-submit,
    #searchwrapper,
    #accountwrapper {
        display: none;
    }

    #open-search {
        display: inline-block;
    }
}

@media only screen and (max-width: 50rem) {
    /* Collapse header */

    #main-nav,
    #sub-nav,
    #main-nav > li:hover .sub-menu {
        /* Main and sub navigation now invisible */
        display: none;
    }

    #main-nav > li {
        /* Navigation columns fill the screen width */
        text-align: center;
        width: 100%;
    }

    #main-nav ul {
        /* Navigation menus also fill */
        margin-left: 0;
        width: 100%;
        text-transform: initial;
    }

    .sub-menu > li {
        width: auto;
        display: inline-block;
    }

    .sub-menu > li > a {
        padding: 0.4rem 1.4rem;
    }

    #main-nav > li.current-menu-item > .sub-menu,
    #main-nav > li.current-menu-ancestor > .sub-menu {
        display: inline-block;
        position: static;
        text-align: center;
    }

    .sub-menu > li.current-menu-item {
        background-color: #CEE6F0;
    }

    .sub-menu > li.current-menu-item > a {
        color: #1B5F91;
    }
}

@media only screen and (min-width: 50.01rem) {

    #main-nav {
        display: block !important; /* Override js */
    }
}

@media only screen and (max-width: 45rem) {

    header {
        font-size: 0.95rem;
    }

    #banner {
        max-width: 70%;
    }
}

@media only screen and (max-width: 30rem) {

    #open-search, #cart {
        padding: 0;
    }

    li.current-menu-item > .sub-menu > li,
    li.current-menu-ancestor > .sub-menu > li {
        display: block;
        border-bottom: 1px solid #CCCCCC;
        white-space: nowrap;
    }

    li.current-menu-item > .sub-menu > li:last-child,
    li.current-menu-ancestor .sub-menu > li:last-child {
        border-bottom: 0;
    }
}