/*
 * Страница /prices. Отдельный файл, т.к. public/styles/styles.css собирается
 * из rr_frontend и перезаписывается командой frontend:sync.
 * Цвета/шрифты/брейкпоинты — те же, что в styles.css.
 */

/* На остальных страницах body имеет padding-top: 100vh под hero-видео — здесь его нет. */
body.page-prices {
    padding-top: calc(var(--header-height, 64px) + 24px);
}

/* Отступ для якорей под фиксированной шапкой и липким меню; точное значение выставляет prices.js. */
html:has(body.page-prices) {
    scroll-padding-top: 260px;
}

.prices {
    padding-bottom: 80px;
}

.prices__header-trigger {
    height: 0;
    left: 0;
    position: fixed;
    top: 0;
    width: 0;
}

.prices__header {
    padding-top: 24px;
    text-align: center;
}

.prices__title {
    margin-bottom: 16px;
    text-transform: uppercase;
}

.prices__subtitle {
    color: #a38271;
    font-size: clamp(16px, 1.667vw, 24px);
}

/* ---------- Липкое меню ---------- */

.prices-nav {
    background-color: #fff;
    border-bottom: 1px solid #d8d8d8;
    margin-top: 32px;
    position: sticky;
    top: calc(var(--header-height, 64px) + 10px);
    z-index: 10;
}

/* Когда меню прилипло — закрываем белым полосу над ним, вокруг шапки. */
.prices-nav.is-stuck::before {
    background-color: #fff;
    bottom: 100%;
    content: "";
    height: calc(var(--header-height, 64px) + 10px);
    left: 0;
    position: absolute;
    right: 0;
}

.prices-nav__inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-block: 12px;
}

.prices-nav__top {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prices-nav__tabs {
    display: grid;
    flex-shrink: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prices-nav__tab {
    align-items: center;
    border: 1px solid #a38271;
    color: #a38271;
    display: flex;
    font-family: Spectral, Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    justify-content: center;
    letter-spacing: .06em;
    min-height: 44px;
    padding: 8px 24px;
    text-transform: uppercase;
    transition: color .35s ease-in-out, background-color .35s ease-in-out;
}

.prices-nav__tab + .prices-nav__tab {
    border-left: 0;
}

.prices-nav__tab.is-active {
    background: linear-gradient(270deg, #a38271, #745747);
    border-color: #a38271;
    color: #fff;
}

.prices-nav__groups {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0 -16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 16px 4px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), #0000);
    mask-image: linear-gradient(90deg, #000 calc(100% - 48px), #0000);
}

.prices-nav__groups.is-end {
    -webkit-mask-image: none;
    mask-image: none;
}

.prices-nav__groups::-webkit-scrollbar {
    display: none;
}

.prices-nav__groups[hidden] {
    display: none;
}

.prices-nav__groups-item {
    flex-shrink: 0;
}

.prices-nav__group {
    background-color: #f8faf7;
    border: 1px solid #f8faf7;
    display: block;
    font-size: 14px;
    padding: 8px 14px;
    transition: color .35s ease-in-out, border-color .35s ease-in-out, background-color .35s ease-in-out;
    white-space: nowrap;
}

.prices-nav__group.is-active {
    background-color: #fff;
    border-color: #a38271;
    color: #a38271;
}

/* ---------- Поиск ---------- */

.prices-search {
    flex-grow: 1;
    position: relative;
}

.prices-search__input {
    border-radius: 0;
    min-height: 44px;
    padding: 10px 96px 10px 44px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23a38271' stroke-width='1.6'%3E%3Ccircle cx='7.5' cy='7.5' r='6'/%3E%3Cpath d='m12 12 5 5'/%3E%3C/svg%3E") 16px 50% / 18px no-repeat;
}

.prices-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.prices-search__counter {
    color: #a3a3a3;
    font-size: 13px;
    pointer-events: none;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}

.prices-search__results {
    background-color: #fff;
    border: 1px solid #d8d8d8;
    border-top: 0;
    box-shadow: 0 0 46px 0 #0000002e;
    left: 0;
    list-style: none;
    margin: 0;
    max-height: min(420px, 50vh);
    overflow-y: auto;
    padding: 0;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 5;
}

.prices-search__results[hidden] {
    display: none;
}

.prices-search__option {
    border-bottom: 1px solid #f8faf7;
    cursor: pointer;
    display: grid;
    gap: 4px;
    padding: 10px 16px;
}

.prices-search__option.is-active {
    background-color: #f8faf7;
}

.prices-search__option-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.prices-search__option-name mark {
    background: none;
    color: #a38271;
    font-weight: 700;
}

.prices-search__option-meta {
    color: #a3a3a3;
    display: flex;
    font-size: 13px;
    gap: 12px;
    justify-content: space-between;
}

.prices-search__option-price {
    color: #323232;
    flex-shrink: 0;
}

.prices-search__empty {
    color: #a3a3a3;
    padding: 12px 16px;
}

/* ---------- Разделы и таблицы ---------- */

.prices-section {
    padding-top: 60px;
}

.prices-section__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.prices-section__title {
    text-transform: uppercase;
}

.prices-section__subtitle {
    color: #a38271;
    font-size: clamp(16px, 1.667vw, 24px);
}

.prices-group {
    padding-top: 48px;
}

.prices-group__title {
    margin-bottom: 20px;
}

.prices-table__subtitle {
    border-bottom: 1px solid #d8d8d8;
    padding: 28px 0 12px;
}

.prices-table__subtitle-text {
    color: #a38271;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0;
}

.prices-table__note {
    color: #a3a3a3;
    font-size: 14px;
    padding-block: 12px;
}

.prices-row {
    border-bottom: 1px solid #d8d8d8;
    column-gap: 16px;
    display: grid;
    grid-template-areas:
        "name name"
        "duration price";
    grid-template-columns: 1fr auto;
    padding-block: 14px;
    row-gap: 6px;
    transition: background-color .35s ease-in-out;
}

.prices-row__name {
    grid-area: name;
    line-height: 1.35;
}

.prices-row__duration {
    color: #a3a3a3;
    font-size: 14px;
    grid-area: duration;
    white-space: nowrap;
    align-self: center;
}

.prices-row__price {
    font-family: Spectral, Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    grid-area: price;
    text-align: right;
    white-space: nowrap;
}

.prices-row__price--muted {
    color: #a3a3a3;
    font-family: Involve, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.prices-table__head {
    display: none;
}

.prices-row.is-found {
    animation: prices-found 3s ease-in-out;
}

@keyframes prices-found {
    0%, 60% {
        background-color: #a3827133;
        box-shadow: inset 3px 0 0 #a38271;
    }

    100% {
        background-color: #0000;
        box-shadow: inset 3px 0 0 #0000;
    }
}

/* ---------- CTA ---------- */

.prices-cta {
    align-items: center;
    background-color: #f8faf7;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 80px;
    padding: 40px 16px;
    text-align: center;
}

.prices-cta__title {
    text-transform: uppercase;
}

.prices-cta__actions {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.prices-cta__phone {
    color: #a38271;
    font-family: Spectral, Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
}

/* ---------- Адаптив ---------- */

@media (min-width: 768px) {
    .prices {
        padding-bottom: 160px;
    }

    .prices__header {
        padding-top: 48px;
    }

    .prices-nav__top {
        align-items: center;
        flex-direction: row;
        gap: 24px;
    }

    .prices-nav__tab {
        padding-inline: 32px;
    }

    .prices-nav__groups {
        margin: 0;
        padding: 0 0 4px;
    }

    .prices-section {
        padding-top: 100px;
    }

    .prices-group {
        padding-top: 64px;
    }

    .prices-table__head {
        color: #a3a3a3;
        display: grid;
        font-family: Spectral, Arial, sans-serif;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: .06em;
        padding-block: 0 12px;
        text-transform: uppercase;
    }

    .prices-table__head .prices-row__price {
        font-family: inherit;
        font-size: inherit;
    }

    .prices-row {
        align-items: baseline;
        grid-template-areas: "name duration price";
        grid-template-columns: minmax(0, 1fr) 120px 140px;
        padding-block: 16px;
    }

    .prices-row--no-duration {
        grid-template-areas: "name price";
        grid-template-columns: minmax(0, 1fr) 140px;
    }

    .prices-row__duration {
        align-self: baseline;
        text-align: right;
    }

    .prices-cta {
        padding: 64px 32px;
    }

    .prices-cta__actions {
        flex-direction: row;
        gap: 32px;
    }
}

@media (min-width: 992px) {
    .prices-row {
        grid-template-columns: minmax(0, 1fr) 160px 180px;
    }

    .prices-row--no-duration {
        grid-template-columns: minmax(0, 1fr) 180px;
    }

    .prices-nav__group {
        padding: 8px 16px;
    }
}

@media (hover: hover) {
    .prices-nav__tab:not(.is-active):hover {
        background-color: #f8faf7;
    }

    .prices-nav__group:not(.is-active):hover {
        color: #a38271;
    }

    .prices-row:not(.prices-table__head):hover {
        background-color: #f8faf7;
    }

    .prices-cta__phone:hover {
        text-decoration: underline;
    }
}
