:root {
    --site-header-height: 104px;
}

html {
    scroll-padding-top: calc(var(--site-header-height) + 18px);
}

body {
    padding-top: var(--site-header-height);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: rgba(251, 244, 233, .985);
    border-bottom: 1px solid #e6ddcf;
    box-shadow: 0 4px 12px rgba(29, 40, 35, .05);
    backdrop-filter: blur(10px);
}


body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

.site-header .container {
    width: min(calc(100% - 64px), 1380px);
}

.site-header__inner {
    font-family: var(--font-body);
    height: auto;
    min-height: var(--site-header-height);
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand__logo .custom-logo,
.brand__logo-placeholder {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 50%;
}

.brand__logo .custom-logo {
    object-fit: contain;
}

.brand__logo-placeholder {
    display: grid;
    place-items: center;
    border: 1.5px solid #cfc8bc;
    color: #aaa297;
    background: #fbf4e9;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

.brand__copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.brand__name {
    color: #0d8f45;
    /*
     * The approved mockup is essentially a clean UI grotesque in regular
     * weight. Segoe UI gives the closest stable rendering on Windows; Inter
     * is preferred when it is available.
     */
    font-family: var(--font-body);
    font-size: 31px;
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.brand__subtitle {
    color: #85837f;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
}

.header-divider {
    width: 1px;
    height: 54px;
    margin-left: 4px;
    background: #ded4c5;
    flex: 0 0 auto;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

.header-contacts__phones {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.header-contacts__phone-list {
    display: grid;
    gap: 3px;
}
.header-contacts__phone-list a {
    line-height: 1.05;
}

.header-contacts a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #0d8f45;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.15;
    font-weight: 500;
    text-decoration: none;
}

.header-contacts a:hover,
.header-contacts a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
}

.header-contacts__icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #0d8f45;
    background: rgba(13, 143, 69, .08);
    font-size: 11px;
    text-decoration: none;
    flex: 0 0 22px;
}

.primary-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 36px;
    padding: 0;
    border: 0;
    background: transparent;
}

.primary-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border-radius: 0;
    color: #252d29;
    background: transparent;
    box-shadow: none;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color .16s ease;
}

.primary-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: #0d8f45;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .16s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    color: #0d8f45;
    background: transparent;
    box-shadow: none;
    outline: none;
}

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

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-left: 8px;
    padding: 0 22px;
    border: 1px solid #0d8f45;
    border-radius: 7px;
    color: #fff;
    background: #0d8f45;
    box-shadow: 0 7px 18px rgba(13, 143, 69, .12);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.header-cta:hover,
.header-cta:focus-visible {
    color: #fff;
    background: #0d8f45;
    border-color: #0d8f45;
    box-shadow: 0 9px 22px rgba(13, 143, 69, .18);
    transform: translateY(-1px);
    outline: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid #d8d2c8;
    background: #fbf4e9;
    color: #0d8f45;
    padding: 9px 12px;
    border-radius: 7px;
    font-weight: 650;
}

@media (max-width: 1220px) {
    .site-header__inner {
        gap: 18px;
    }

    .brand__name {
        font-size: 28px;
    }

    .header-contacts {
        gap: 14px;
    }

    .header-contacts a {
        font-size: 14px;
    }

    .primary-nav {
        gap: 24px;
    }

    .header-cta {
        margin-left: 2px;
        padding-inline: 17px;
    }
}

@media (max-width: 1040px) {
    .header-contacts,
    .header-divider {
        display: none;
    }
}

@media (max-width: 900px) {
    :root {
        --site-header-height: 72px;
    }

    .site-header .container {
        width: calc(100% - 28px);
    }

    .site-header__inner {
        min-height: var(--site-header-height);
        gap: 14px;
    }

    .brand {
        gap: 11px;
        min-width: 0;
    }

    .brand__logo .custom-logo,
    .brand__logo-placeholder {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .brand__name {
        font-size: 20px;
        font-weight: 400;
        letter-spacing: 0;
    }

    .brand__subtitle,
    .header-cta {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        margin-left: auto;
        padding: 0 13px;
        cursor: pointer;
    }

    .primary-nav {
        position: absolute;
        top: calc(100% - 1px);
        left: 14px;
        right: 14px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px;
        border: 1px solid #e2ddd4;
        border-radius: 0 0 12px 12px;
        background: rgba(251, 244, 233, .99);
        box-shadow: 0 18px 42px rgba(29, 40, 35, .13);
        backdrop-filter: blur(10px);
    }

    .primary-nav.is-open {
        display: flex;
    }

    .primary-nav a {
        width: 100%;
        min-height: 48px;
        padding: 0 13px;
        border-radius: 8px;
    }

    .primary-nav a::after {
        display: none;
    }

    .primary-nav a:hover,
    .primary-nav a:focus-visible {
        background: rgba(13, 143, 69, .08);
    }
}

@media (max-width: 520px) {
    .site-header .container {
        width: calc(100% - 24px);
    }

    .brand {
        gap: 10px;
    }

    .brand__logo .custom-logo,
    .brand__logo-placeholder {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .brand__name {
        font-size: 18px;
        font-weight: 400;
        line-height: 1.05;
        letter-spacing: 0;
        white-space: normal;
    }

    .nav-toggle {
        min-height: 40px;
        padding-inline: 11px;
    }

    .primary-nav {
        left: 12px;
        right: 12px;
    }
}


/* Current-section indicator (scrollspy). */
.primary-nav a.is-active,
.primary-nav a[aria-current="location"] {
    color: #0d8f45;
}

.primary-nav a.is-active::after,
.primary-nav a[aria-current="location"]::after {
    transform: scaleX(.68);
}

@media (max-width: 900px) {
    .primary-nav a.is-active,
    .primary-nav a[aria-current="location"] {
        color: #0d8f45;
        background: rgba(13, 143, 69, .08);
    }
}


/* Mobile composition pass: compact header without affecting desktop. */
@media (max-width: 640px) {
    :root {
        --site-header-height: 64px;
    }

    .site-header .container {
        width: calc(100% - 24px);
    }

    .site-header__inner {
        min-height: var(--site-header-height);
        gap: 10px;
    }

    .brand {
        gap: 9px;
        min-width: 0;
    }

    .brand__logo .custom-logo,
    .brand__logo-placeholder {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .brand__name {
        font-size: 18px;
        line-height: 1.05;
        white-space: nowrap;
    }

    .nav-toggle {
        gap: 7px;
        min-height: 40px;
        padding: 0 11px;
        border-color: rgba(13, 143, 69, .20);
        border-radius: 10px;
        background: rgba(255, 253, 248, .52);
        font-size: 13px;
        line-height: 1;
        font-weight: 650;
    }

    .nav-toggle::before {
        content: '';
        width: 16px;
        height: 12px;
        flex: 0 0 16px;
        background:
            linear-gradient(currentColor, currentColor) 0 0 / 100% 1.5px no-repeat,
            linear-gradient(currentColor, currentColor) 0 50% / 100% 1.5px no-repeat,
            linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
        opacity: .88;
    }

    .primary-nav {
        left: 12px;
        right: 12px;
        padding: 6px;
        border-radius: 0 0 12px 12px;
    }

    .primary-nav a {
        min-height: 48px;
        padding-inline: 12px;
        font-size: 14px;
    }
}


/* Mobile/tablet navigation trigger: icon only. */
@media (max-width: 900px) {
    .nav-toggle {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        gap: 0;
        border-color: rgba(13, 143, 69, .20);
        border-radius: 10px;
        background: rgba(255, 253, 248, .52);
    }

    .nav-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .nav-toggle::before {
        content: '';
        width: 18px;
        height: 13px;
        flex: 0 0 18px;
        background:
            linear-gradient(currentColor, currentColor) 0 0 / 100% 1.5px no-repeat,
            linear-gradient(currentColor, currentColor) 0 50% / 100% 1.5px no-repeat,
            linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
        opacity: .90;
    }
}

@media (max-width: 640px) {
    .nav-toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
    }
}


/* Header wordmark logo */
.brand__separator {
    width: 1px;
    height: 46px;
    flex: 0 0 1px;
    background: rgba(167, 146, 112, .38);
}

.brand__wordmark {
    display: block;
    line-height: 0;
}

.brand__wordmark-image {
    display: block;
    width: auto;
    height: 31px;
    max-width: 270px;
    object-fit: contain;
    object-position: left center;
}

@media (max-width: 1220px) {
    .brand__wordmark-image {
        height: 28px;
        max-width: 235px;
    }
}

@media (max-width: 900px) {
    .brand__separator {
        height: 34px;
    }

    .brand__wordmark-image {
        height: 24px;
        max-width: 190px;
    }
}

@media (max-width: 640px) {
    .brand__separator {
        height: 30px;
        background: rgba(167, 146, 112, .34);
    }

    .brand__copy {
        display: flex;
        align-items: center;
    }

    .brand__subtitle {
        display: none;
    }

    .brand__wordmark-image {
        height: 22px;
        max-width: 180px;
    }
}

@media (max-width: 420px) {
    .brand__wordmark-image {
        height: 20px;
        max-width: 160px;
    }
}

@media (max-width: 360px) {
    .brand__wordmark-image {
        height: 18px;
        max-width: 140px;
    }
}
