.primary-header {
    z-index: 10001;
    position: sticky;
    top: 0;
    transition: all 1.3s ease;
    height: 110px;
    max-width: 100vw;
    margin: 0;
}

.primary-header.shrink {
    height: 80px;
    box-shadow: 0 1px 3px rgba(0, 63, 122, 0.12), 0 1px 2px rgba(0, 63, 122, 0.24);
    border-radius: 8px;
    top: 20px;
    max-width: 70vw;
    margin: auto;
    align-items: center;
}

.header-content {
    background-color: #fff;
    display: flex;
    padding: 20px 10px;
    position: relative;
}

.header-content > div:last-child {
    flex-grow: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.menu-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
}

.menu-panel {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid #b9dbff;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
    background-color: #e8f3ff;
    border-color: #7db8f1;
    box-shadow: 0 6px 14px rgba(6, 83, 160, 0.16);
    outline: none;
}

.menu-toggle__line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #0d4f8b;
    border-radius: 2px;
}

#logo-container {
    padding-left: 10rem;
    padding-right: 10px;
}

#logo-container > a {
    display: flex;
    align-items: center;
    height: 100%;
}

#logo-container > a > img {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
}

.primary-header.shrink #logo-container {
    height: inherit;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 15px;
}

.primary-header.shrink #logo-container > a {
    height: 100%;
}

.primary-header.shrink #logo-container > a > img {
    padding-left: 0;
    object-fit: contain;
}

#menu-container {
    flex-grow: 1;
}

.primary-header .menu {
    list-style-type: none;
    margin: 0;
    padding: 2px 0;
    overflow: visible;
    display: flex;
    justify-content: flex-end;
}

.primary-header .menu-item {
    display: inline-block;
    margin-left: 10px;
    margin-right: 10px;
    position: relative;
}

.primary-header .menu-item > a {
    display: block;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    color: #0a2b4d;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 900;
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    font-size: 0.95em;
}

.primary-header .menu-item > a:hover {
    box-shadow: 0 8px 18px rgba(6, 83, 160, 0.2), 0 2px 6px rgba(2, 22, 45, 0.12);
    background-color: #e8f3ff;
    border-color: #b9dbff;
    color: #0d4f8b;
    cursor: pointer;
}

.primary-header .menu-item-border {
    background: linear-gradient(180deg, #2f98ff 0%, #0d73da 100%);
    border: 1px solid #0d73da;
    color: #fff;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(6, 83, 160, 0.28), 0 2px 6px rgba(2, 22, 45, 0.14);
    text-align: center;
    text-decoration: none;
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    display: flex;
    align-items: center;
}

.primary-header .menu-item-border > a {
    color: inherit;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.primary-header .menu-item-border:hover {
    background: #e8f3ff;
    border-color: #b9dbff;
    color: #0d4f8b;
    box-shadow: 0 8px 18px rgba(6, 83, 160, 0.2), 0 2px 6px rgba(2, 22, 45, 0.12);
}

.primary-header .menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: #fff;
    border: 1px solid #d7e9fb;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(2, 22, 45, 0.18);
    z-index: 10050;
}

.primary-header .menu .menu-item-has-children:hover::after,
.primary-header .menu .menu-item-has-children:focus-within::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 10px;
}

.primary-header .menu .menu-item:hover > .sub-menu,
.primary-header .menu .menu-item:focus-within > .sub-menu {
    display: block;
}

.primary-header .menu .sub-menu .menu-item {
    display: block;
    margin: 0;
}

.primary-header .menu .sub-menu .menu-item > a {
    display: block;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}

@media screen and (max-width: 1090px) {
    .menu-phone {
        display: none;
    }
}

@media screen and (max-width: 850px) {
    #logo-container {
        padding-left: 1rem;
    }
}

@media screen and (max-width: 830px) {
    .header-content {
        align-items: center;
        flex-wrap: nowrap;
    }

    .header-content > div:last-child,
    .menu-group {
        align-items: center;
    }

    .header-content > div:last-child {
        flex-grow: 0;
    }

    #logo-container {
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 0;
    }

    #logo-container > a > img {
        display: block;
        width: auto;
        height: auto;
        max-height: 56px;
        max-width: 100%;
        object-fit: contain;
    }

    .menu-toggle {
        display: inline-flex;
        position: relative;
        z-index: 10080;
    }

    .menu-group {
        position: relative;
        width: auto;
        justify-content: flex-end;
    }

    .menu-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: min(88vw, 380px);
        height: 100vh;
        padding: 18px 12px;
        border-right: 1px solid #d7e9fb;
        border-radius: 0;
        box-shadow: 0 16px 30px rgba(2, 22, 45, 0.28);
        background-color: #fff;
        z-index: 10070;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        overflow-y: auto;
        transform: translateX(0);
        transition: transform 260ms ease;
    }

    .primary-header.menu-open .menu-panel {
        display: flex;
        transform: translateX(0);
        animation: fitt-menu-drawer-in 260ms ease both;
    }

    #menu-container,
    .menu-panel > div {
        width: 100%;
    }

    #menu-container .menu,
    .menu-panel > div .menu {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        gap: 6px;
        padding-top: 10px;
    }

    #menu-container .menu-item,
    .menu-panel > div .menu-item {
        display: block;
        margin: 0;
    }

    #menu-container .menu-item > a,
    .menu-panel > div .menu-item > a {
        text-align: left;
    }

    .menu-panel #menu-container .menu .sub-menu {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 6px 0 0 0 !important;
        padding: 0 0 0 16px !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        transform: none !important;
    }

    .menu-panel #menu-container .menu .sub-menu .menu-item > a {
        white-space: normal;
        padding-left: 12px;
    }

    .primary-header .menu .menu-item-has-children:hover::after,
    .primary-header .menu .menu-item-has-children:focus-within::after {
        display: none;
    }
}

body.menu-open-mobile {
    overflow: hidden;
}

@keyframes fitt-menu-drawer-in {
    from {
        transform: translateX(-105%);
    }

    to {
        transform: translateX(0);
    }
}

@media screen and (min-width: 831px) {
    #menu-container .menu > .menu-item {
        position: relative;
    }

    #menu-container .menu > .menu-item > .sub-menu {
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        right: auto;
    }
}
