#navbar-main {
    justify-content: center;
    padding: 0;
}

#navbar-main .nav-item a {
    color: #FFFFFF;
    text-decoration: none;
}

#navbar-main .nav-item:hover {
    background: color-mix(in srgb, var(--color-hilite) 50%, transparent);
}

#navbar-main .nav-item a {
    padding: 0.66rem;
     text-transform: uppercase;
}

#navbar-main .nav-item.active {
    background: var(--color-hilite);
}

#navbar-main ul {
    padding: 1rem;
}

.header {
    position: absolute;
    z-index: 20;
    width: 100%;
    background-color: var(--color-bg);
}

.header .bg-primary {
  --bs-bg-opacity: 0;
}

.contact-us-wrapper .header .bg-primary {
    --bs-bg-opacity: 1;
    background-color: var(--color-bg) !important;
}

.contact-us-wrapper .header {
    top: 0;
    right: 0;
    left: 0;
}

/* ==========================================================================
   Hamburger toggler
   ========================================================================== */

.menu-main-toggler {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
}

.menu-main-toggler .navbar-toggler-icon {
    display: inline-block;
    width: 1.4em;
    height: 1.4em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.menu-main-toggler:hover,
.menu-main-toggler:focus-visible {
    border-color: #2A9D8F;
}

.menu-main-toggler:focus-visible {
    outline: 2px solid #2A9D8F;
    outline-offset: 2px;
}

/* ==========================================================================
   Dropdown toggle caret (split from the link -- see menu--main.html.twig)
   ========================================================================== */

/* nav-item with a dropdown now holds TWO inline children (link + caret)
   instead of one <a> covering the whole row, so it needs to lay them out
   side by side itself. */
#navbar-main .nav-item.dropdown {
    display: flex;
    align-items: center;
}

/* The link keeps its own padding (set above); the caret gets a small
   independent tap target rather than inheriting the link's 1rem padding. */
.dropdown-toggle-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    color: inherit;
    cursor: pointer;
}

.dropdown-toggle-caret:focus-visible {
    outline: 2px solid #2A9D8F;
    outline-offset: 2px;
}

.dropdown-toggle-caret .caret-icon::after {
    content: "";
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

/* Flip the caret when the dropdown is open, so it reads as an indicator
   rather than a static decoration. */
.dropdown-toggle-caret[aria-expanded="true"] .caret-icon::after {
    transform: rotate(-135deg);
}

/* ==========================================================================
   Dropdown panel + items
   ========================================================================== */

#navbar-main .dropdown-menu {
    background-color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#navbar-main .dropdown-item,
#navbar-main .dropdown-item:visited {
    display: block;
    color: #212529;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
}

#navbar-main .dropdown-item:hover,
#navbar-main .dropdown-item:focus,
#navbar-main .dropdown-item:active {
    background-color: var(--color-hilite);;
    text-decoration: none;
}

#navbar-main .dropdown-item.active {
    color: #2A9D8F;
}

/* Nested submenu (third level+, if any) -- positions to the side of its
   parent dropdown-item rather than stacking below it. */
#navbar-main .dropdown-submenu {
    position: relative;
}

#navbar-main .dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Desktop only: right-align the whole nav. Kept out of mobile on purpose —
   a permanent flex row here is what was breaking the mobile breakpoints:
   the expanded menu tried to sit BESIDE the toggler instead of below it. */
@media (min-width: 992px) {
    #main-navigation {
        display: flex;
        justify-content: flex-end;
        gap: 0.2rem;
    }

    /* Force the collapse open on desktop regardless of toggle state */
    .menu--main .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }

    .menu-main-toggler {
        display: none !important;
    }
}

/* Below lg (992px): hamburger visible and pushed to the RIGHT; menu
   drops below it full-width when expanded. */
@media (max-width: 991.98px) {
    /* Row that wraps: toggler on line 1 (pushed right by margin-left:auto),
       expanded collapse content forced onto line 2 at full width. */
    #main-navigation {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding-right: 3rem;
    }

    .menu-main-toggler {
        display: inline-flex;
        align-items: center;
        margin: 0.75rem 1rem;
        margin-left: auto;   /* <-- pushes hamburger to the right edge */
        order: 1;
    }

    /* Full-width second row so the open menu drops BELOW the toggler,
       not next to it. */
    .menu--main .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        order: 2;
    }

    #navbar-main {
        justify-content: space-between;
        align-items: stretch;
        width: 100%;
    }

    #navbar-main ul {
        padding: 0.25rem 1rem 1rem;
        width: 100%;
        flex-direction: column;
    }

    #navbar-main .nav-item a {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    #navbar-main .nav-item.active > a {
        border-left: 3px solid #2A9D8F;
        padding-left: calc(1rem - 3px);
    }

    /* dropdown parent needs to stretch full width too, and let the link
       take remaining space while the caret stays a fixed tap target */
    #navbar-main .nav-item.dropdown {
        flex-wrap: wrap;
        width: 100%;
    }

    #navbar-main .nav-item.dropdown > a {
        flex: 1 1 auto;
    }

    /* On mobile, the dropdown behaves like an accordion, not a floating
       panel -- drop the floating-panel chrome and let it sit inline. */
    #navbar-main .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background-color: transparent;
        padding: 0 0 0 1rem;
    }

    #navbar-main .dropdown-item,
    #navbar-main .dropdown-item:visited {
        color: #FFFFFF;
    }

    #navbar-main .dropdown-item:hover,
    #navbar-main .dropdown-item:focus,
    #navbar-main .dropdown-item.active {
        color: var(--color-hilite);
    }

    #navbar-main .dropdown-submenu > .dropdown-menu {
        position: static;
        margin-top: 0;
    }
}

/* Very small screens: trim padding to fit more items per screen */
@media (max-width: 400px) {
    #navbar-main .nav-item a {
        padding: 0.65rem 0.75rem;
    }

    #navbar-main .nav-item.active > a {
        padding-left: calc(0.75rem - 3px);
    }
}