/* Theme 24 mobile nav drawer */
#notification-bottom > a {
    pointer-events: visible;
}

#container header #header_contact h4:first-child {
    margin-left: 0;
}

@media(min-width: 40rem) {
    body #container #navigation.opened + #nav-toggle {
        margin-top: 0!important;
    }
}

/* === Mobile nav drawer: column layout ===
   style.css sets #navigation { display: flex } with default row direction.
   When setupNavDrawerFooter() injects .nav-drawer-header and .nav-drawer-footer
   they become row-siblings of the nav ul, squishing everything to ~1/3 width.
   Force column so header / list / footer stack correctly. */
#navigation {
    flex-direction: column!important;
    align-items: stretch!important;
}

/* Nav list: fill remaining vertical space, scroll if needed */
#navigation > ul {
    flex: 1 1 auto!important;
    height: auto!important;
    margin: 0!important;
    overflow-y: auto!important;
    padding: 0!important;
}

/* All descendant uls: reset height/margin that style.css applies broadly */
#navigation.opened ul {
    height: auto!important;
    margin: 0!important;
}

/* Remove padding-top reserved for the close button — header provides clearance */
#navigation.opened #nav {
    padding-top: 0!important;
}

/* === Drawer header === */
#navigation .nav-drawer-header {
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary-blue, #21355a) 12%, #fff);
    display: block!important;
    flex-shrink: 0;
    padding: 1.25rem 3rem 1rem 1.5rem; /* 3rem right clears the X button */
}
#navigation .nav-drawer-header .company-branding {
    display: block;
    text-align: left;
}
#navigation .nav-drawer-header .header_logo {
    display: block;
    text-align: left;
}
#navigation.opened .header_logo img {
    display: none!important;
}
#navigation .nav-drawer-header .company-name {
    color: var(--color-dark-blue, #1a2844);
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
    text-transform: none;
}
#navigation .nav-drawer-header .company-tagline {
    color: var(--color-medium-blue, #3d5f8a);
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    margin-top: 0.15rem;
    text-transform: uppercase;
}

/* === Drawer footer === */
#navigation .nav-drawer-footer {
    border-top: 1px solid color-mix(in srgb, var(--color-primary-blue, #21355a) 12%, #fff);
    display: block!important;
    flex-shrink: 0;
    padding: 1.25rem 1.5rem 1.5rem;
}
#navigation .nav-drawer-phone {
    margin-bottom: 0.6rem;
}
#navigation .nav-drawer-phone .phone-call {
    align-items: center;
    border: 2px solid var(--color-medium-blue, #3d5f8a);
    border-radius: 4px;
    color: var(--color-medium-blue, #3d5f8a);
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.5rem;
    justify-content: center;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-decoration: none;
    width: 100%;
}
#navigation .nav-drawer-phone .phone-call::before {
    align-items: center;
    content: "\f4b9";
    display: flex;
    flex-shrink: 0;
    font-family: "Ionicons";
    font-size: 21px;
    height: 21px;
    justify-content: center;
    width: 21px;
}
#navigation .nav-drawer-phone .phone-call:hover {
    background: color-mix(in srgb, var(--color-primary-blue, #21355a) 8%, transparent);
}
#navigation .nav-drawer-phone .phone-call:active {
    background: color-mix(in srgb, var(--color-primary-blue, #21355a) 15%, transparent);
}
#navigation.opened .nav-drawer-contact a {
    background: var(--color-primary-blue, #21355a);
    border-radius: 5px;
    color: var(--box-text, #fff);
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    padding: 0.9rem 1rem;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    width: 100%;
}
#navigation.opened .nav-drawer-contact a:hover {
    background: var(--color-dark-blue, #1a2844);
}
#navigation.opened .nav-drawer-contact a:active {
    background: color-mix(in srgb, var(--color-dark-blue, #162038) 85%, #000);
}

/* === Suppress header/contact hidden in drawer mode === */
#navigation.opened #header_contact,
#navigation.opened .notification-contact {
    display: none!important;
}
#nav li.nav-contact-in-footer {
    display: none!important;
}

/* ================================================================
   Match desktop overflow drawer styles for links and list items
   ================================================================ */

/* Reset nav item padding and display — use border separators instead of gaps */
#navigation.opened #nav li {
    display: block!important;
    margin-top: 0!important;
    padding-bottom: 0!important;
}

/* === Top-level item borders === */
#navigation.opened #nav > li,
#navigation.opened #nav > .nav_placeholder > ul > li {
    border-left: 0!important;
    border-top: 1px solid color-mix(in srgb, var(--color-primary-blue, #21355a) 12%, #fff);
    margin: 0!important;
    padding: 0!important;
}
#navigation.opened #nav > li:first-child,
#navigation.opened #nav > .nav_placeholder > ul > li:first-child {
    border-top: 0;
}
#navigation.opened #nav > li + li::before,
#navigation.opened #nav > .nav_placeholder > ul > li + li::before {
    content: none;
    display: none;
}

/* === Top-level links === */
#navigation.opened #nav > li > a,
#navigation.opened #nav > .nav_placeholder > ul > li > a {
    align-items: center;
    background: none;
    border-radius: 0;
    display: flex!important;
    font-size: 0.92rem!important;
    font-weight: 600;
    justify-content: space-between;
    letter-spacing: 0.09em;
    line-height: 1.3;
    margin: 0;
    padding: 0.92rem 1.35rem!important;
    text-decoration: none;
    text-shadow: none;
    text-transform: uppercase;
    transition: background 0.15s ease, color 0.15s ease;
}
#navigation.opened #nav > li > a:hover,
#navigation.opened #nav > .nav_placeholder > ul > li > a:hover {
    background: rgba(0, 0, 0, 0.04);
}
#navigation.opened #nav > li > a:active,
#navigation.opened #nav > .nav_placeholder > ul > li > a:active {
    background: rgba(0, 0, 0, 0.07);
}

/* === Active/current page top-level === */
#navigation.opened #nav > li.active > a,
#navigation.opened #nav > li > a.active,
#navigation.opened #nav > .nav_placeholder > ul > li.active > a,
#navigation.opened #nav > .nav_placeholder > ul > li > a.active {
    background: color-mix(in srgb, var(--color-primary-blue, #21355a) 10%, #fff);
    color: var(--color-medium-blue, #3d5f8a);
}

/* === Dropdown chevron (replaces the large nav_drop arrow from style.css) === */
#navigation.opened #nav > li > a.nav_drop::after,
#navigation.opened #nav > .nav_placeholder > ul > li > a.nav_drop::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: ""!important;
    display: inline-block!important;
    flex-shrink: 0;
    height: 8px;
    margin-left: auto;
    opacity: 0.5;
    transform: rotate(45deg);
    width: 8px;
}

/* === Sub-nav dropdown containers === */
#navigation.opened #nav > li > ul,
#navigation.opened #nav > .nav_placeholder > ul {
    background: color-mix(in srgb, var(--color-primary-blue, #21355a) 6%, #fff);
    display: block!important;
    margin: 0!important;
    min-width: 0!important;
    opacity: 1!important;
    padding: 0!important;
    position: static!important;
    transition: none!important;
    visibility: visible!important;
    width: 100%!important;
}

/* === Sub-nav list items (regular dropdown) === */
#navigation.opened #nav > li > ul > li {
    border-left: 3px solid color-mix(in srgb, var(--color-medium-blue, #3d5f8a) 45%, #fff);
    margin: 0 0 0 1.5rem!important;
    opacity: 1!important;
    padding: 0!important;
    transform: none!important;
    width: 100%!important;
}
#navigation.opened #nav > li > ul > li.active,
#navigation.opened #nav > li > ul > li:has(> a.active) {
    border-left-color: var(--color-primary-blue, #21355a);
}

/* === Sub-nav list items (nav_placeholder direct children) === */
#navigation.opened #nav > .nav_placeholder > ul > li {
    border-left: 3px solid color-mix(in srgb, var(--color-medium-blue, #3d5f8a) 45%, #fff)!important;
    border-top: 0!important;
    margin: 0 0 0 1.5rem!important;
    opacity: 1!important;
    padding: 0!important;
    transform: none!important;
    width: 100%!important;
}
#navigation.opened #nav > .nav_placeholder > ul > li.active,
#navigation.opened #nav > .nav_placeholder > ul > li:has(> a.active) {
    border-left-color: var(--color-primary-blue, #21355a)!important;
}

/* === Sub-nav links === */
#navigation.opened #nav > li > ul > li > a,
#navigation.opened #nav > .nav_placeholder > ul > li > a {
    border-top: 1px solid color-mix(in srgb, var(--color-primary-blue, #21355a) 12%, #fff);
    color: var(--color-medium-blue, #3d5f8a)!important;
    display: block!important;
    font-size: 0.92rem!important;
    font-weight: 400!important;
    letter-spacing: 0.06em!important;
    line-height: 1.3!important;
    margin: 0;
    padding: 0.64rem 1.35rem!important;
    text-transform: uppercase!important;
    white-space: normal!important;
}
#navigation.opened #nav > li > ul > li:first-child > a,
#navigation.opened #nav > .nav_placeholder > ul > li:first-child > a {
    border-top: 0;
}
#navigation.opened #nav > li > ul > li.active > a,
#navigation.opened #nav > li > ul > li > a.active,
#navigation.opened #nav > .nav_placeholder > ul > li.active > a,
#navigation.opened #nav > .nav_placeholder > ul > li > a.active {
    background: color-mix(in srgb, var(--color-primary-blue, #21355a) 14%, #fff);
    font-weight: 800!important;
}
#navigation.opened #nav > li > ul > li > a:hover,
#navigation.opened #nav > .nav_placeholder > ul > li > a:hover {
    background: color-mix(in srgb, var(--color-primary-blue, #21355a) 17%, #fff);
    color: var(--color-primary-blue, #21355a)!important;
}
#navigation.opened #nav > li > ul > li > a:active,
#navigation.opened #nav > .nav_placeholder > ul > li > a:active {
    background: #ccd4e5;
}

/* Suppress old desktop-mode nav decorations (underline bar, hover arrows).
   Exclude .nav_drop so the chevron ::after rule above is not overridden. */
#navigation.opened #nav > li > a:not(.nav_drop)::after,
#navigation.opened #nav > .nav_placeholder > ul > li > a:not(.nav_drop)::after {
    content: none!important;
    display: none!important;
    width: 0!important;
}
#navigation.opened #nav > li > a:before,
#navigation.opened #nav > li:hover > a:before,
#navigation.opened #nav > .nav_placeholder > ul > li > a:before,
#navigation.opened #nav > .nav_placeholder > ul > li:hover > a:before {
    display: none!important;
    width: 0!important;
}

/* Override the inline top set by applyNavToggleInlineStyles() so the X button
   stays fixed at the viewport top-right when the drawer is open. */
#navigation.opened + #nav-toggle {
    right: 1.1rem!important;
    z-index: 1004!important;
}
