/*
 * EUROSPACE menu fit to hero design v4.2
 * Ничего не меняет в логике меню, только подгоняет текущую approved-структуру
 * под светлый hero со skyline.
 */

@media (min-width: 992px) {
    /* Вся шапка воспринимается как единая светлая "надстройка" над hero. */
    .eurospace-demo-header {
        position: relative;
        z-index: 50;
        background: transparent !important;
    }

    /* Первая строка меню */
    .eurospace-demo-header .es-header-v4 {
        min-height: 46px !important;
        border-top: none !important;
        border-bottom: 1px solid rgba(82, 41, 28, .07) !important;
        background: rgba(255, 253, 250, .92) !important;
        backdrop-filter: saturate(120%) blur(4px);
    }

    .eurospace-demo-header .es-header-v4__inner {
        min-height: 46px !important;
        gap: 18px !important;
    }

    .eurospace-demo-header .es-header-v4__menu {
        gap: clamp(26px, 2.6vw, 48px) !important;
    }

    .eurospace-demo-header .es-header-v4__link {
        min-height: 46px !important;
        gap: 5px !important;
        color: #4f2a1d !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        text-decoration: none !important;
    }

    .eurospace-demo-header .es-header-v4__link:hover {
        opacity: .8;
    }

    .eurospace-demo-header .es-header-v4__chevron {
        font-size: 10px !important;
        transform: translateY(-1px) !important;
        opacity: .75;
    }

    /* Dropdown'ы спокойные, светлые, в стиле hero */
    .eurospace-demo-header .es-header-v4__dropdown {
        top: calc(100% - 1px) !important;
        left: -10px !important;
        min-width: 252px !important;
        padding: 8px !important;
        border: 1px solid rgba(82, 41, 28, .10) !important;
        border-radius: 10px !important;
        background: rgba(255, 253, 250, .985) !important;
        box-shadow: 0 14px 34px rgba(62, 33, 24, .10) !important;
    }

    .eurospace-demo-header
    .es-header-v4__item:nth-child(2)
    .es-header-v4__dropdown {
        min-width: 308px !important;
    }

    .eurospace-demo-header .es-header-v4__dropdown a {
        padding: 9px 11px !important;
        border-radius: 6px !important;
        color: #4f2a1d !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.25 !important;
    }

    .eurospace-demo-header .es-header-v4__dropdown a:hover,
    .eurospace-demo-header .es-header-v4__dropdown a:focus-visible {
        background: #f4ece6 !important;
    }

    /* Контакты справа должны быть компактными и не спорить с навигацией. */
    .eurospace-demo-header .es-header-v4__contacts {
        gap: 11px !important;
    }

    .eurospace-demo-header .es-header-v4__phones {
        gap: 12px !important;
    }

    .eurospace-demo-header .es-header-v4__phone {
        color: #4f2a1d !important;
        font-size: 13px !important;
        font-weight: 650 !important;
        line-height: 1 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    .eurospace-demo-header .es-header-v4__messengers {
        gap: 5px !important;
    }

    .eurospace-demo-header .es-header-v4__icon {
        width: 28px !important;
        height: 28px !important;
        flex: 0 0 28px !important;
        border: 1px solid rgba(82, 41, 28, .12) !important;
        background: rgba(255, 255, 255, .72) !important;
        box-shadow: none !important;
    }

    .eurospace-demo-header .es-header-v4__icon:hover {
        transform: translateY(-1px) !important;
        background: rgba(255, 255, 255, .96) !important;
    }

    .eurospace-demo-header .es-header-v4__icon img {
        width: 15px !important;
        height: 15px !important;
    }

    /*
     * Вторая строка с лого и рейтингами:
     * делаем её максимально близкой к рендеру —
     * белая/молочная, низкая, логотип по центру вместе с рейтингами.
     */
    .eurospace-demo-header .main-head {
        padding: 0 !important;
        border-bottom: 1px solid rgba(82, 41, 28, .06) !important;
        background: rgba(255, 253, 250, .95) !important;
        backdrop-filter: saturate(115%) blur(3px);
    }

    .eurospace-demo-header .main-head .row,
    .eurospace-demo-header .main-head .es-main-header-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 18px !important;
        min-height: 86px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    .eurospace-demo-header .es-demo-desktop-logo-slot,
    .eurospace-demo-header .es-main-header-logo {
        flex: 0 0 auto !important;
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .eurospace-demo-header .head-logo,
    .eurospace-demo-header .head-logo .logo,
    .eurospace-demo-header .head-logo .logo img,
    .eurospace-demo-header .es-demo-desktop-logo-slot .head-logo,
    .eurospace-demo-header .es-demo-desktop-logo-slot .logo,
    .eurospace-demo-header .es-demo-desktop-logo-slot .logo img {
        display: block !important;
        width: 100% !important;
        max-width: 260px !important;
        height: auto !important;
        margin: 0 auto !important;
    }

    .eurospace-demo-header .es-demo-desktop-ratings,
    .eurospace-demo-header .es-main-header-ratings {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .eurospace-demo-header .eurospace-rating-widget {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 2px 6px !important;
        width: 118px !important;
        min-width: 118px !important;
        min-height: 48px !important;
        padding: 6px 8px !important;
        border: 1px solid rgba(82, 41, 28, .11) !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, .78) !important;
        box-shadow: none !important;
    }

    .eurospace-demo-header .eurospace-rating-widget__platform {
        font-size: 12px !important;
        line-height: 1.05 !important;
    }

    .eurospace-demo-header .eurospace-rating-widget__score {
        gap: 3px !important;
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .eurospace-demo-header .eurospace-rating-widget__star {
        font-size: 12px !important;
    }

    .eurospace-demo-header .eurospace-rating-widget__count {
        grid-column: 1 / -1 !important;
        font-size: 10px !important;
        line-height: 1.05 !important;
    }

    /*
     * В approved-версии верхнее меню уже единственное.
     * На всякий случай жёстко прячем старые phase2 desktop links,
     * если они где-то ещё остались в шаблоне.
     */
    .eurospace-demo-header .main-head_menu,
    .eurospace-demo-header .es-demo-desktop-nav,
    .eurospace-demo-header .es-single-catalog-cta {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1260px) {
    .eurospace-demo-header .es-header-v4__inner {
        gap: 12px !important;
    }

    .eurospace-demo-header .es-header-v4__menu {
        gap: 18px !important;
    }

    .eurospace-demo-header .es-header-v4__link,
    .eurospace-demo-header .es-header-v4__phone {
        font-size: 12px !important;
    }

    .eurospace-demo-header .es-header-v4__phones {
        gap: 8px !important;
    }

    .eurospace-demo-header .es-header-v4__icon {
        width: 26px !important;
        height: 26px !important;
        flex-basis: 26px !important;
    }

    .eurospace-demo-header .main-head .row,
    .eurospace-demo-header .main-head .es-main-header-row {
        min-height: 82px !important;
        gap: 14px !important;
    }

    .eurospace-demo-header .es-demo-desktop-logo-slot,
    .eurospace-demo-header .es-main-header-logo {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
    }

    .eurospace-demo-header .eurospace-rating-widget {
        width: 112px !important;
        min-width: 112px !important;
    }
}

/* Мобильную шапку здесь не трогаем. */
