/* Tariff block of every /private/ service page (section.tariff-private): "Все тарифы" link,
   "Квартира / Частный дом" tabs and the grid of lite cards. Loaded on /private/ only. */

/* "Все тарифы": a pill in the same soft brand tint as the card buttons; the full gradient on hover */
.tariff-private .tariff__all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 22px 0 26px;
    border-radius: 24px;
    background: linear-gradient(85.41deg, rgba(0, 187, 228, .14) 40.54%, rgba(162, 213, 55, .2) 102.22%);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: #0091c7;
    white-space: nowrap;
    transition: background .2s, color .2s, box-shadow .2s;
}

.tariff-private .tariff__all svg {
    flex: none;
    width: 18px;
    height: 18px;
    transition: transform .2s;
}

.tariff-private .tariff__all:hover,
.tariff-private .tariff__all:focus-visible {
    background: linear-gradient(85.41deg, #00bbe4 40.54%, #a2d537 102.22%);
    box-shadow: 0 10px 24px rgba(100, 212, 219, .3);
    color: #fff;
    outline: none;
}

.tariff-private .tariff__all:hover svg {
    transform: translateX(3px);
}

/* "Квартира / Частный дом": a compact segmented control (light track, white sliding thumb)
   instead of the two big blue blocks; the tabs are buttons, so they work from the keyboard too */
.tariff-private .tariff__tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: max-content;
    max-width: 100%;
    margin: 24px auto 0;
    padding: 5px;
    background: #eef3f7;
    border-radius: 30px;
}

.tariff-private .tariff__tabs::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc(50% - 5px);
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 4px 14px rgba(20, 60, 110, .1);
    transition: transform .3s ease;
}

.tariff-private .tariff__tabs:has(.tariff__tab--active[data-tabs-path="2"])::before {
    transform: translateX(100%);
}

.tariff-private .tariff__tab {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 210px;
    height: 50px;
    padding: 0 28px;
    border: 0;
    border-radius: 25px;
    background: none;
    box-shadow: none;
    font: inherit;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: .01em;
    color: #5b6b80;
    cursor: pointer;
    transition: color .2s;
}

.tariff-private .tariff__tab:hover {
    background: none;
    color: #00a2de;
}

.tariff-private .tariff__tab--active {
    color: #00a2de;
}

/* the site resets outline-width to 0 with !important: a ring instead */
.tariff-private .tariff__tab:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 162, 222, .35);
}

.tariff-private .tariff__tab span {
    white-space: nowrap;
}

.tariff-private .tariff__tab svg {
    flex: none;
    width: 22px;
    height: 22px;
}

/* browsers without :has() cannot move the thumb: mark the active tab itself */
@supports not selector(:has(*)) {
    .tariff-private .tariff__tabs::before {
        display: none;
    }

    .tariff-private .tariff__tab--active {
        background: #fff;
        box-shadow: 0 4px 14px rgba(20, 60, 110, .1);
    }
}

@media screen and (max-width: 480px) {
    /* the title gets its own line, "Все тарифы" goes under it */
    .tariff-private .tariff__top {
        flex-wrap: wrap;
        row-gap: 14px;
    }

    .tariff-private .tariff__all {
        height: 42px;
        padding: 0 18px 0 20px;
        font-size: 15px;
    }

    .tariff-private .tariff__tabs {
        width: 100%;
        margin-top: 20px;
    }

    .tariff-private .tariff__tab {
        min-width: 0;
        height: 46px;
        padding: 0 10px;
        gap: 8px;
        font-size: 15px;
    }

    .tariff-private .tariff__tab svg {
        width: 20px;
        height: 20px;
    }
}

/* the narrowest phones: no room for the icons next to "Частный дом" */
@media screen and (max-width: 374px) {
    .tariff-private .tariff__tab {
        padding: 0 6px;
        font-size: 15px;
    }

    .tariff-private .tariff__tab svg {
        display: none;
    }
}

/* "Выберите тариф": a plain grid of lite tariff cards (tariff-cards.css). The slider has no
   swiper-container class, so main.min.js builds no carousel; the swiper-* classes only carry layout. */
.tariff-private .tariff__slider {
    margin-top: 32px;
    overflow: visible;
}

/* the site's page CSS gives this wrapper width: 18% (sized for the carousel) */
.tariff-private .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

.tariff-private .tariff-card.swiper-slide {
    width: auto;
    height: auto;
    margin: 0;
}

/* one row: four flat cards or three house cards share the full width */
@media screen and (min-width: 1366px) {
    .tariff-private .swiper-wrapper {
        grid-template-columns: none;
        grid-auto-columns: minmax(0, 1fr);
        grid-auto-flow: column;
        gap: 24px;
    }
}

/* "Частный дом" has three cards: one row of three from 992px, the odd third card centred below that */
@media screen and (min-width: 992px) and (max-width: 1365px) {
    .tariff-private .swiper-wrapper:has(.tariff-card--inactive.tariff-card--active) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media screen and (min-width: 680px) and (max-width: 991px) {
    .tariff-private .tariff-card--inactive.tariff-card--active:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 10px);
    }
}

@media screen and (max-width: 679px) {
    .tariff-private .swiper-wrapper {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
}

/* FAQ: the site's 305px title min-width pushes the cards off small screens */
@media screen and (max-width: 576px) {
    #faq .qa-card__title {
        min-width: 0;
    }
}
