/* Header overrides are separate from the existing page layout. */
.header {
    border-bottom: 1px solid #dce1da;
    box-shadow: 0 4px 18px #08284608;
}

.header-inner {
    min-height: 148px;
    gap: 32px;
}

.brand {
    flex-shrink: 0;
}

.brand img {
    width: 166px;
    height: 132px;
}

.main-navigation {
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.main-navigation a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: color 150ms ease, background-color 150ms ease;
}

.main-navigation a::after {
    position: absolute;
    right: 20px;
    bottom: 5px;
    left: 20px;
    height: 3px;
    border-radius: 2px;
    background: var(--green);
    content: "";
    transform: scaleX(0);
    transition: transform 150ms ease;
}

.main-navigation a:hover,
.main-navigation a:focus-visible {
    color: var(--green);
    background: #edf3ed;
}

.main-navigation a:hover::after,
.main-navigation a:focus-visible::after {
    transform: scaleX(1);
}

.header .button-small {
    min-height: 54px;
    padding: 14px 22px;
    border-radius: 6px;
    font-size: 16px;
    white-space: nowrap;
}

@media (max-width: 1050px) {
    .header-inner {
        gap: 18px;
    }

    .main-navigation {
        gap: 4px;
    }

    .main-navigation a {
        padding-right: 14px;
        padding-left: 14px;
        font-size: 17px;
    }
}

@media (max-width: 800px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px 18px;
        padding: 10px 0 14px;
    }

    .brand img {
        width: 138px;
        height: 110px;
    }

    .header .main-navigation {
        order: 3;
        width: 100%;
        gap: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }

    .main-navigation a {
        justify-content: center;
        flex: 1;
        min-height: 50px;
        padding: 12px 8px;
        background: #f3f5f0;
        font-size: 17px;
    }
}

@media (max-width: 380px) {
    .header .button-small {
        padding: 12px 14px;
        gap: 12px;
        font-size: 14px;
    }

    .main-navigation a {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-navigation a,
    .main-navigation a::after {
        transition: none;
    }
}
