/*
 * EUROSPACE desktop header visual v4.1
 * Сохраняет структуру v4, меняет только визуальную геометрию шапки.
 */

@media (min-width: 992px) {
    /* Общая шапка: визуально единая с будущим светлым hero. */
    .eurospace-demo-header {
        background: #fbf8f5;
    }

    .eurospace-demo-header .es-header-v4 {
        min-height: 50px !important;
        border-top: 1px solid rgba(82, 41, 28, .05) !important;
        border-bottom: 1px solid rgba(82, 41, 28, .08) !important;
        background: #f8f4f1 !important;
    }

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

    /* Меню по масштабу как в рендерах: легче и компактнее. */
    .eurospace-demo-header .es-header-v4__menu {
        gap: clamp(30px, 2.8vw, 52px) !important;
    }

    .eurospace-demo-header .es-header-v4__link {
        min-height: 50px !important;
        gap: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
    }

    .eurospace-demo-header .es-header-v4__chevron {
        font-size: 10px !important;
        opacity: .8;
    }

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

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

    .eurospace-demo-header .es-header-v4__dropdown a {
        padding: 9px 11px !important;
        border-radius: 6px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
    }

    /* Контакты справа: остаются заметными, но не спорят с меню. */
    .eurospace-demo-header .es-header-v4__contacts {
        gap: 13px !important;
    }

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

    .eurospace-demo-header .es-header-v4__phone {
        font-size: 13px !important;
        font-weight: 650 !important;
        line-height: 1 !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-color: rgba(82, 41, 28, .13) !important;
        background: rgba(255, 255, 255, .72) !important;
    }

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

    /*
     * Главное отличие от текущего скрина:
     * logo + ratings становятся одной центральной группой.
     * Старый phase2 резервировал справа колонку под меню;
     * v4 меню уже перенёс наверх, поэтому эту пустоту убираем.
     */
    .eurospace-demo-header .main-head {
        padding: 0 !important;
        border-bottom: 1px solid rgba(82, 41, 28, .08) !important;
        background: #fffdfb !important;
    }

    .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: clamp(18px, 1.7vw, 28px) !important;
        min-height: 98px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    .eurospace-demo-header .es-demo-desktop-logo-slot,
    .eurospace-demo-header .es-main-header-logo {
        flex: 0 0 auto !important;
        width: clamp(260px, 17vw, 310px) !important;
        min-width: 260px !important;
        max-width: 310px !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: 310px !important;
        height: auto !important;
        margin: 0 !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: 9px !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 7px !important;
        width: 128px !important;
        min-width: 128px !important;
        min-height: 52px !important;
        padding: 7px 10px !important;
        border: 1px solid #e3d8d1 !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, .86) !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: 14px !important;
        line-height: 1 !important;
    }

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

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

    /* После переноса меню наверх эти элементы desktop не занимают место. */
    .eurospace-demo-header .es-demo-desktop-nav,
    .eurospace-demo-header .main-head_menu,
    .eurospace-demo-header .es-demo-mobile-head-actions {
        display: none !important;
    }
}

/* Ноутбуки: сохраняем всю строку без переноса. */
@media (min-width: 992px) and (max-width: 1260px) {
    .eurospace-demo-header .es-header-v4__inner {
        gap: 14px !important;
    }

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

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

    .eurospace-demo-header .es-header-v4__contacts {
        gap: 9px !important;
    }

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

    .eurospace-demo-header .es-header-v4__phone {
        font-size: 12px !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: 92px !important;
        gap: 16px !important;
    }

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

    .eurospace-demo-header .eurospace-rating-widget {
        width: 116px !important;
        min-width: 116px !important;
        min-height: 48px !important;
        padding: 6px 8px !important;
    }
}

/*
 * Mobile оставляем прежним.
 * Там уже отдельная адаптивная шапка и этот этап её не меняет.
 */
