@media screen and (min-width: 901px) {
    .desktop-header-bar {
        width: 100%;
        background: var(--body-black);
    }

    .desktop-header-bar.is-fixed {
        position: fixed;
        z-index: 100;
        inset: 0 0 auto;
        opacity: 0;
        transform: translateY(-100%);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.24);
        transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .22s ease;
    }

    .desktop-header-bar.is-fixed.is-visible {
        opacity: 1;
        transform: translateY(0);
        animation: pesok-header-enter .36s cubic-bezier(.22, 1, .36, 1) both;
    }
    .top-menu {
        display: none;
    }

    .middle-menu {
        justify-content: space-between;
        gap: 30px;
        max-width: 1170px;
        margin: 0 auto;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .middle-menu > a:first-child img {
        display: block;
    }
}

@keyframes pesok-header-enter {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .desktop-header-slot {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .desktop-header-bar.is-fixed {
        transition: none;
        animation: none;
    }
    .desktop-header-bar.is-fixed.is-visible {
        animation: none;
    }
}

.middle-menu__logo {
    flex-shrink: 0;
}

.middle-menu__logo img {
    display: block;
    width: 251px;
    height: auto;
}

.middle-menu__taglines {
    display: grid;
    flex: 0 0 auto;
    height: 24px;
    overflow: hidden;
}

.middle-menu__tagline {
    grid-area: 1 / 1;
    margin: 0;
    font-size: 15px;
    line-height: 24px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
}

.middle-menu__tagline strong {
    font-weight: 600;
    color: var(--white);
}

.middle-menu__tagline--active {
    opacity: 1;
    transform: translateY(0);
}

.middle-menu__tagline--leaving {
    opacity: 0;
    transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
    .middle-menu__tagline {
        transition: none;
    }
}

.middle-menu__contacts {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 26px;
}

.middle-menu__place p {
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    color: var(--white);
}

.middle-menu__place img {
    width: 16px;
    height: 16px;
}

.middle-menu__email,
.middle-menu__phone {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease-in-out;
}

.middle-menu__email,
.middle-menu__phone {
    font-size: 17px;
    font-weight: 600;
}

.middle-menu__email img {
    width: 20px;
}

.middle-menu__phone img {
    width: 18px;
}

.middle-menu__email:hover,
.middle-menu__phone:hover {
    color: var(--first);
}

.middle-menu__contacts .callback__button {
    flex-shrink: 0;
}

@media screen and (max-width: 1400px) {
    .middle-menu__email {
        display: none;
    }
}

@media screen and (max-width: 1080px) {
    .middle-menu__taglines {
        display: none;
    }
}

.btn-3d {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    text-decoration: none;
    padding: 0 0 5px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--white);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.btn-3d::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 5px;
    bottom: 0;
    border-radius: 100px;
    background: var(--second);
}

.btn-3d__in {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--first) 0%, var(--third) 100%);
    transition: transform 0.2s ease-in-out;
}

.btn-3d__text {
    display: flex;
    align-items: center;
    padding: 12px 16px 12px 22px;
}

.btn-3d__ico {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 0 14px;
    background: rgba(0, 0, 0, 0.12);
    font-size: 14px;
}

.btn-3d:hover .btn-3d__in,
.btn-3d:focus-visible .btn-3d__in {
    transform: translateY(3px);
}

.btn-3d:active .btn-3d__in {
    transform: translateY(5px);
}

.is-3d {
    box-shadow: 0 5px 0 var(--second);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.is-3d:hover,
.is-3d:focus-visible {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--second);
}

.is-3d:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 var(--second);
}

.header__logo-mobile .header__logo-mobile-img {
    width: auto;
    height: 30px;
    max-width: 100%;
    margin-top: 10px;
}

@media screen and (max-width: 360px) {
    .header__logo-mobile .header__logo-mobile-img {
        height: 26px;
    }
}

/* 01.12.2026: логотип в мобильной шапке крупнее (был 30/26px) — место освободили иконки почты и телефона */
.header__logo-mobile .header__logo-mobile-img {
    height: 38px;
    margin-top: 6px;
}

@media screen and (max-width: 389px) {
    .header__logo-mobile .header__logo-mobile-img {
        height: 34px;
        margin-top: 8px;
    }
}

@media screen and (max-width: 359px) {
    .header__logo-mobile .header__logo-mobile-img {
        height: 30px;
        margin-top: 10px;
    }
}

/* Логотип не сжимается по ширине (раньше flex ужимал его при фиксированной высоте — картинка сплющивалась);
   на самых узких экранах — уменьшается пропорционально (object-fit) */
@media screen and (max-width: 900px) {
    .top-menu .header__nav {
        gap: 12px;
    }

    .header__nav > .header__logo-mobile {
        flex: 0 1 auto;
        min-width: 0;
    }

    .header__logo-mobile .header__logo-mobile-img {
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
}
