/* Full-width background */
.p-nav {
    position: relative;
    z-index: 18;
    background: #00305e;
    color: #fff;
    font-family: forma-djr-deck, sans-serif;
    font-size: 16px;
    font-weight: 600;
}

/* Max-width inner container */
.p-nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

/* Top bar */
.p-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.p-menu-label {
    display: none;
    color: #fff;
    font-size: 1rem;
}

.p-nav-toggle {
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

/* Main menu row */
.p-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    background: #00305e;
}

.p-nav-menu>li {
    position: relative;
    flex: 1 0 0;
    text-align: center;
    z-index: 1;
}

.p-nav-menu>li>a,
.p-nav-menu>li>.p-submenu-row>a {
    display: block;
    padding: 1rem .9rem;
    color: #fff;
    text-decoration: none;
    line-height: 1;
}

.p-nav-menu>li>a:hover,
.p-nav-menu>li>.p-submenu-row>a:hover {
    color: #00305e !important;
    background: #fec10d;
}

.p-nav-menu .parent-selected,
.p-nav-menu .nav-selected {
    color: #fec10d !important;
    font-weight: bold;
}

/* Submenu panel */
.p-subnav {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 12rem;
    width: 100%;
    background: #00305e;
    margin: 0;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    z-index: 10;
}

.p-subnav li a {
    display: block;
    padding: .7rem 1rem;
    color: #fff;
    text-decoration: none;
    text-align: left;
    white-space: nowrap;
}

.p-subnav li a:hover {
    color: #00305e !important;
    background: #fec10d;
}

/* Desktop: pure CSS hover */
@media (min-width: 769px) {
    .p-nav-bar {
        display: none;
    }

    .p-menu-label {
        display: none;
    }

    .p-nav-toggle {
        display: none;
    }

    .p-submenu-toggle {
        display: none;
    }

    .p-nav-menu {
        flex-direction: row;
    }

    .p-nav-menu>li:hover>.p-subnav,
    .p-nav-menu>li:focus-within>.p-subnav,
    .p-nav-menu>li>.p-subnav:hover {
        display: block;
    }

    .p-has-submenu::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 10px;
        background: transparent;
        z-index: 5;
    }

    .p-subnav {
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        min-width: 12rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .p-nav-inner {
        padding: 0.5rem 1rem;
    }

    .p-menu-label {
        display: inline-block;
    }

    .p-nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        border-top: 1px solid #444;
    }

    .p-nav-menu.p-active {
        display: flex;
    }

    .p-nav-menu>li {
        text-align: left;
        flex: 0 0 auto;
    }

    .p-subnav {
        padding-left: 15px;
    }

    .p-submenu-row {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .p-submenu-toggle {
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 0 1rem;
        font-size: 1rem;
        line-height: 1;
    }

    .p-submenu-toggle::after {
        content: "▾";
        display: inline-block;
        transition: transform .2s ease;
    }

    .p-has-submenu.p-open>.p-submenu-row>.p-submenu-toggle::after {
        transform: rotate(180deg);
    }

    .p-has-submenu .p-subnav {
        position: static;
        width: 100%;
        box-shadow: none;
    }

    .p-has-submenu.p-open>.p-subnav {
        display: block;
    }
}