/* EUROSPACE FastAPI: соответствие финальной шапке site */

.eurospace-demo-header .main-head {
    border-bottom: 1px solid #e5d9d2;
    background: #fff;
}

.eurospace-demo-header .head-logo,
.eurospace-demo-header .head-logo .logo,
.eurospace-demo-header .head-logo .logo img {
    display: block;
}

.eurospace-demo-header .head-logo .logo img {
    height: auto;
}

/* Кнопки верхнего уровня прайса в PHP-версии были ссылками.
   В FastAPI они являются button, поэтому повторяем исходное оформление. */
.es-demo .es-demo-price-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid #e2d7d0;
    border-radius: 6px;
    color: #52291c;
    background: #fff;
    font: inherit;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.es-demo .es-demo-price-tabs button:hover,
.es-demo .es-demo-price-tabs button.is-active {
    border-color: #52291c;
    color: #fff;
    background: #52291c;
}

@media (min-width: 992px) {
    .eurospace-demo-header .main-head .row {
        display: grid !important;
        grid-template-columns:
            clamp(260px, 17vw, 340px)
            minmax(250px, auto)
            minmax(520px, 1fr) !important;
        align-items: center !important;
        gap: clamp(18px, 2.3vw, 38px) !important;
        min-height: 122px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .eurospace-demo-header .es-demo-desktop-logo-slot {
        display: block !important;
        width: clamp(260px, 17vw, 340px) !important;
        min-width: clamp(260px, 17vw, 340px) !important;
        max-width: 340px !important;
        padding: 0 !important;
    }

    .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 {
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
    }

    .eurospace-demo-header .es-demo-desktop-ratings {
        display: flex !important;
        align-items: stretch;
        gap: 10px;
        width: auto !important;
        min-width: 250px;
        margin: 0;
        padding: 0 !important;
    }

    .eurospace-demo-header .es-demo-desktop-nav {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: clamp(18px, 1.7vw, 30px);
        min-width: 0;
        flex-wrap: wrap;
    }

    .eurospace-demo-header .es-demo-desktop-nav__link {
        display: inline-flex !important;
        padding: 0;
        border: 0;
        color: #52291c;
        background: transparent;
        font-size: clamp(16px, 1.12vw, 20px);
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
        text-decoration: none !important;
    }

    .eurospace-demo-header .es-demo-mobile-head-actions {
        display: none !important;
    }

    /* Ограничиваем заголовок тем же визуальным масштабом, что в site. */
    .es-site .es-demo-hero h1 {
        font-size: clamp(42px, 3.25vw, 64px) !important;
        line-height: 1.06 !important;
    }
}

@media (min-width: 992px) and (max-width: 1300px) {
    .eurospace-demo-header .main-head .row {
        grid-template-columns:
            250px
            minmax(215px, auto)
            minmax(420px, 1fr) !important;
        gap: 16px !important;
        min-height: 112px !important;
    }

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

    .eurospace-demo-header .es-demo-desktop-ratings {
        min-width: 215px;
        gap: 6px;
    }

    .eurospace-demo-header .es-demo-desktop-nav {
        gap: 17px;
    }
}

@media (max-width: 991px) {
    .eurospace-demo-header .header_top-panel {
        display: none !important;
    }

    .eurospace-demo-header .main-head .row {
        display: grid !important;
        grid-template-columns:
            minmax(0, 1fr)
            clamp(78px, 21vw, 102px)
            auto !important;
        align-items: center;
        gap: clamp(5px, 1.8vw, 10px) !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .eurospace-demo-header .es-demo-desktop-logo-slot,
    .eurospace-demo-header .es-demo-mobile-head-actions {
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
    }

    .eurospace-demo-header .es-demo-desktop-nav {
        display: none !important;
    }

    .eurospace-demo-header .es-demo-desktop-ratings {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 4px;
        width: clamp(78px, 21vw, 102px) !important;
        min-width: 0;
        margin: 0;
        padding: 0 !important;
    }

    .eurospace-demo-header .es-demo-mobile-head-actions {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        min-width: 42px;
    }

    .eurospace-demo-header .head-logo .logo,
    .eurospace-demo-header .head-logo .logo img {
        width: min(100%, 230px) !important;
        max-width: 100% !important;
    }
}

@media (max-width: 767px) {
    .es-demo .es-demo-price-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .es-demo .es-demo-price-tabs button {
        width: 100%;
        white-space: normal;
    }
}
