/* ============================================================
   ОБОЛОЧКА ХЕДЕРА
   ============================================================ */

.siteHeaderShell {
    z-index: 60;
    background: linear-gradient(var(--surface-soft) 0, #fff 100%);
    height: 96px;
    padding-top: 10px;
    position: relative;
}

.siteHeaderShell .header {
    width: auto;
    margin: 0;
    position: fixed;
    top: 4px;
    left: 12px;
    right: 12px;
}

/* ============================================================
   ХЕДЕР
   ============================================================ */

.header {
    z-index: 80;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    background: #ffffffe0;
    border: 1px solid #0e447b17;
    border-radius: 4px;
    align-items: center;
    gap: 24px;
    height: 86px;
    padding: 0 max(26px, 50vw - 740px);
    display: flex;
    transition: background-color .35s, border-color .35s, box-shadow .35s;
    box-shadow: 0 10px 34px #071e380f;
}

.header.scrolled {
    -webkit-backdrop-filter: blur(20px) saturate(.82);
    backdrop-filter: blur(20px) saturate(.82);
    background: #ffffffb8;
    border-color: #1472d324;
    box-shadow: 0 14px 40px #071e3821;
}

/* ---------- Логотип ---------- */
.logo {
    flex: none;
    align-items: center;
    gap: 14px;
    display: flex;
}

.headerLogoLink {
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    display: flex;
}

.headerLogo {
    object-fit: contain;
    width: 70px;
    height: 66px;
    display: block;
}

/* ---------- Навигация ---------- */
.nav {
    justify-content: space-evenly;
    align-items: center;
    flex: 1;
    gap: 0;
    margin: 0 10px;
    font-size: var(--fs-body);
    font-weight: 650;
    display: flex;
}

.nav > a {
    text-align: center;
    flex: 1;
    min-width: 0;
    color: inherit;
    white-space: nowrap;
    transition: color .2s;
    padding: 33px 4px;
    position: relative;
    display: block;
    width: 100%;
}

.nav > a:hover {
    color: var(--accent);
}

.nav > a:after {
    content: "";
    background: var(--accent);
    height: 2px;
    transition: transform .25s;
    position: absolute;
    bottom: 22px;
    left: 22%;
    right: 22%;
    transform: scaleX(0);
}

.nav > a:hover:after {
    transform: scaleX(1);
}

/* ---------- Телефоны и кнопка ---------- */
.headerAside {
    flex: none;
    align-items: center;
    gap: 15px;
    display: flex;
}

.headerPhones {
    border-left: 1px solid var(--border);
    flex-direction: column;
    gap: 5px;
    padding-left: 16px;
    display: flex;
}

.headerPhones a {
    letter-spacing: .025em;
    white-space: nowrap;
    color: var(--accent-deep);
    font-size: var(--fs-small);
    font-weight: 800;
    transition: color .2s;
}

.headerPhones a:before {
    content: "";
    background: var(--success);
    border-radius: 50%;
    width: 5px;
    height: 5px;
    margin: 0 8px 2px 0;
    display: inline-block;
}

.headerPhones a:hover {
    color: var(--accent);
}

.headerCta {
    color: #fff;
    background: var(--accent);
    text-transform: uppercase;
    letter-spacing: .055em;
    padding: 16px 19px;
    font-size: var(--fs-caption);
    font-weight: 800;
    transition: all .3s;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.headerCta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px #1472d340;
}

/* ---------- Скрытые по умолчанию ---------- */
.mobileContacts,
.mobileHeaderPhone {
    display: none;
}

.burger {
    display: none;
    font-size: 25px;
    line-height: 1;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 1180px) {
    .header { gap: 16px; }
    .nav { margin: 0; font-size: var(--fs-small); }
    .nav > a { padding-left: 2px; padding-right: 2px; }
    .headerPhones { padding-left: 12px; }
    .headerCta { padding: 15px 14px; }
}

@media (max-width: 1050px) {
    .nav { gap: 15px; }
    .nav > a:nth-last-of-type(-n+3) { display: none; }
    .headerCta { display: none; }
}

@media (max-width: 760px) {
    .siteHeaderShell {
        height: 80px;
        padding-top: 6px;
    }

    .siteHeaderShell .header {
        top: 3px;
        left: 7px;
        right: 7px;
    }

    .header {
        gap: 8px;
        height: 68px;
        padding: 0 12px 0 14px;
    }

    .headerLogoLink {
        width: 54px;
        height: 54px;
    }

    .headerLogo {
        width: 54px;
        height: 52px;
    }

    .headerAside {
        display: none;
    }

    .mobileHeaderPhone {
        color: var(--accent-deep);
        white-space: nowrap;
        background: #ffffffb8;
        border: 1px solid #b9d8f2;
        border-radius: 999px;
        align-items: center;
        margin-left: auto;
        padding: 8px 10px;
        font-size: var(--fs-caption);
        font-weight: 800;
        line-height: 1;
        display: flex;
    }

    .burger {
        color: var(--accent-deep);
        background: var(--surface-soft);
        border-radius: 11px;
        place-items: center;
        width: 40px;
        height: 40px;
        margin-left: 2px;
        padding: 0;
        font-size: 23px;
        line-height: 1;
        display: grid;
    }

    .nav {
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
        background: #fffffffa;
        border: 1px solid #d2e3f1;
        border-radius: 0 0 16px 16px;
        flex-direction: column;
        align-items: stretch;
        width: auto;
        height: auto;
        max-height: calc(100dvh - 84px);
        margin: 0;
        padding: 10px 17px 15px;
        display: none;
        position: fixed;
        top: 76px;
        left: 7px;
        right: 7px;
        overflow-y: auto;
        box-shadow: 0 18px 42px #07233f2b;
        justify-content: flex-start;
        gap: 0;
    }

    .nav.open {
        display: flex;
    }

    .nav > a {
        text-align: left;
        width: 100%;
        min-height: 0;
        margin: 0;
        flex: none;
        border-bottom: 1px solid #e7eff6;
        line-height: 1.15;
        padding: 11px 3px;
        font-size: var(--fs-small);
    }

    .nav > a:after {
        display: none;
    }

    .nav > a:nth-last-of-type(-n+3) {
        display: block;
    }

    .mobileContacts {
        border-top: 0;
        flex-direction: column;
        gap: 5px;
        margin-top: 4px;
        padding-top: 10px;
        display: flex;
    }

    .mobileContacts span {
        text-transform: uppercase;
        letter-spacing: .12em;
        color: var(--text-muted);
        margin-bottom: 2px;
        font-size: var(--fs-nano);
    }

    .mobileContacts a {
        color: var(--accent-deep);
        border: 0;
        padding: 3px 0;
        font-size: var(--fs-body);
        font-weight: 800;
    }
}

@media (max-width: 390px) {
    .mobileHeaderPhone {
        padding: 7px 8px;
        font-size: var(--fs-caption);
    }

    .headerLogoLink {
        width: 48px;
        height: 48px;
    }

    .headerLogo {
        width: 48px;
        height: 46px;
    }
}

/* ============================================================
   ГЛАВНАЯ: хедер плавает поверх hero
   ============================================================ */

body.homePage .siteHeaderShell {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    padding-top: 10px;
    background: transparent;
    pointer-events: none;
}

body.homePage .siteHeaderShell .header {
    pointer-events: auto;
}

body.homePage {
    padding-top: 0;
}

@media (max-width: 760px) {
    body.homePage .siteHeaderShell {
        padding-top: 6px;
    }
}