/* Header styles remain local to .header. Mobile-first layout. */
.header {
    --header-background: #fff;
    --header-ink: #06254d;
    --header-muted: #84909e;
    --header-accent: #007d5b;
    --header-accent-dark: #006d50;
    --header-soft: #eaf7f1;
    --header-border: #e7eeed;
    --header-max-width: 1344px;
    position: relative;
    z-index: 100;
    width: 100%;
    min-height: 50px;
    color: var(--header-ink);
    background: var(--header-background);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.header :where(a, button, nav, ul, li, dialog, img, span, div, svg, form, input, label, aside, p, h2) {
    box-sizing: border-box;
}

.header--enhanced {
    position: fixed;
    top: 0;
    left: 0;
    height: 50px;
}

.header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: min(100%, var(--header-max-width));
    min-height: 50px;
    margin-inline: auto;
    padding-inline: 20px;
}

.header__logo-link {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    flex-shrink: 0;
    border-radius: 4px;
    text-decoration: none;
}

.header__logo-link .custom-logo {
    display: block;
    width: 120px;
    height: auto;
}

.header__nav {
    order: 3;
    flex-basis: 100%;
    padding-block: 10px 16px;
}

.header--enhanced .header__nav {
    display: none;
}

.header__nav-list,
.header__drawer-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.header__nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.header__nav-link {
    display: block;
    padding: 8px 6px;
    border-radius: 7px;
    color: var(--header-ink);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 160ms ease, background-color 160ms ease;
}

.header__nav-link:hover,
.header__nav-link--active {
    color: var(--header-accent);
    background: var(--header-soft);
}

.header__nav-link:active {
    background: #dcf0e5;
}

.header__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
}

.header__search-toggle,
.header__search-submit,
.header__search-close,
.header__menu-toggle,
.header__menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--header-ink);
    background: transparent;
    font: inherit;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.header__search-toggle {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.header__search-toggle:hover,
.header__search-toggle:active,
.header__search-toggle[aria-expanded="true"] {
    color: var(--header-accent);
    background: var(--header-soft);
}

.header__search-toggle[hidden],
.header__menu-toggle[hidden] {
    display: none;
}

.header__search-icon,
.header__close-icon,
.header__drawer-icon,
.header__drawer-chevron,
.header__promo-arrow {
    display: block;
    flex-shrink: 0;
}

.header__login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 16px;
    border: 1px solid #d9eae4;
    border-radius: 9px;
    color: var(--header-accent);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.header__login:hover {
    border-color: #acdcca;
    background: var(--header-soft);
}

.header__login:active {
    background: #dcf0e5;
}

.header__login--desktop {
    display: none;
}

.header__menu-toggle {
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 30px;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 4px 6px #0000001a;
}

.header__menu-toggle:hover {
    background: #f1f8f7;
}

.header__menu-line {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: #2c3e50;
}

.header__search-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 20px;
    width: min(360px, calc(100vw - 40px));
    padding: 18px;
    border: 1px solid var(--header-border);
    border-radius: 14px;
    background: var(--header-background);
    box-shadow: 0 12px 32px #06254d1a;
}

.header__search-panel[hidden] {
    display: none;
}

.header:not(.header--enhanced) .header__search-panel {
    position: static;
    order: 4;
    display: block;
    width: 100%;
    margin-bottom: 16px;
    box-shadow: none;
}

.header__search-label {
    display: block;
    margin-bottom: 10px;
    padding-right: 24px;
    font-size: 13px;
    font-weight: 600;
}

.header__search-field {
    display: flex;
    align-items: center;
    min-width: 0;
    border: 1px solid #d9e8e3;
    border-radius: 9px;
    background: #f8fbfa;
}

.header__search-field:focus-within {
    border-color: var(--header-accent);
}

.header__search-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px 0 0 9px;
    color: var(--header-ink);
    background: transparent;
    font: inherit;
}

.header__search-input::placeholder {
    color: var(--header-muted);
}

.header__search-submit {
    width: 42px;
    height: 42px;
    border-radius: 0 9px 9px 0;
    color: var(--header-accent);
}

.header__search-submit:hover {
    background: var(--header-soft);
}

.header__search-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--header-muted);
}

.header__search-close:hover {
    color: var(--header-ink);
    background: #f1f5f4;
}

.header:not(.header--enhanced) .header__search-close {
    display: none;
}

.header__drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 365px;
    max-width: calc(100vw - 44px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 20px 0 0 20px;
    color: var(--header-ink);
    background: var(--header-background);
    box-shadow: -12px 0 45px #06254d24;
}

.header__drawer:not([open]) {
    display: none;
}

.header__drawer[open] {
    animation: header-drawer-in 240ms ease-out;
}

.header__drawer::backdrop {
    background: rgba(8, 25, 40, 0.35);
    backdrop-filter: blur(4px);
    touch-action: none;
}

.header__drawer-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 22px 20px 24px;
}

.header__drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header__drawer-top .custom-logo {
    width: 136px;
    height: 36px;
}

.header__drawer-brand {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
}

.header__drawer-logo {
    display: block;
    width: 136px;
    height: auto;
}

.header__menu-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--header-border);
    border-radius: 10px;
    color: #7b8796;
    background: #f8faf9;
}

.header__menu-close:hover {
    color: var(--header-ink);
    background: #edf4f1;
}

.header__drawer-tagline {
    margin: 10px 0 26px;
    color: var(--header-muted);
    font-size: 12px;
}

.header__drawer-nav {
    margin-bottom: 16px;
}

.header__drawer-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.header__drawer-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--header-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
}

.header__drawer-icon {
    color: #9aa6b3;
}

.header__drawer-label {
    flex: 1;
    min-width: 0;
}

.header__drawer-chevron {
    color: #b6c0ca;
}

.header__drawer-link:hover {
    color: var(--header-accent);
    background: #f1f8f5;
}

.header__drawer-link--active,
.header__drawer-link--active:hover {
    color: var(--header-accent);
    background: var(--header-soft);
    font-weight: 600;
}

.header__drawer-link--active .header__drawer-icon,
.header__drawer-link--active .header__drawer-chevron {
    color: var(--header-accent);
}

.header__drawer-link:active {
    background: #dcf0e5;
}

.header__login--mobile {
    min-height: 44px;
    margin-bottom: 24px;
    border-radius: 11px;
}

.header__promo {
    margin-top: 0;
    padding: 18px;
    border: 1px solid #d8eee3;
    border-radius: 16px;
    background: #f0f9f4;
}

.header__promo-title {
    margin: 0 0 7px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}

.header__promo-icon {
    display: block;
    margin-bottom: 12px;
    color: var(--header-accent);
}

.header__promo-text {
    margin: 0 0 16px;
    color: #7a8c83;
    font-size: 13px;
    line-height: 1.6;
}

.header__promo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff;
    background: var(--header-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 160ms ease;
}

.header__promo-link:hover,
.header__promo-link:active {
    background: var(--header-accent-dark);
}

.header :where(a, button, input):focus-visible {
    outline: 2px solid var(--header-accent);
    outline-offset: 3px;
}

.header__search-input:focus-visible {
    outline-offset: -3px;
}

@keyframes header-drawer-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@media (min-width: 1100px) {
    .header,
    .header--enhanced {
        height: 76px;
    }

    .header__inner {
        height: 76px;
        min-height: 76px;
        padding-inline: 32px;
        flex-wrap: nowrap;
        gap: 18px;
    }

    .header__logo-link .custom-logo {
        width: 152px;
    }

    .header__nav,
    .header--enhanced .header__nav {
        order: 0;
        display: block;
        flex-basis: auto;
        padding: 0;
    }

    .header__nav-list {
        flex-wrap: nowrap;
        gap: 3px;
    }

    .header__nav-link {
        padding: 9px 7px;
        font-size: 13px;
    }

    .header__search-toggle {
        width: 36px;
        height: 36px;
    }

    .header__login--desktop {
        display: inline-flex;
    }

    .header__menu-toggle {
        display: none;
    }

    .header__search-panel {
        right: 32px;
    }

    .header:not(.header--enhanced) {
        height: auto;
    }

    .header:not(.header--enhanced) .header__inner {
        height: auto;
        flex-wrap: wrap;
    }
}

@media (min-width: 1280px) {
    .header__nav-list {
        gap: 8px;
    }

    .header__nav-link {
        font-size: 14px;
    }
}

@media (max-width: 359px) {
    .header__drawer-content {
        padding-inline: 16px;
    }

    .header__drawer-link {
        gap: 10px;
        padding-inline: 12px;
        font-size: 13px;
    }

    .header__promo {
        padding: 16px;
    }

    .header__promo-title {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header__nav-link,
    .header__search-toggle,
    .header__search-submit,
    .header__search-close,
    .header__menu-close,
    .header__menu-toggle,
    .header__login,
    .header__drawer-link,
    .header__promo-link {
        transition: none;
    }

    .header__drawer[open] {
        animation: none;
    }
}
