@layer pages {

    .banner-grid {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr 1fr;
        align-items: center;

        @media (max-width: 48rem) {
            grid-template-columns: 1fr;
        }
    }

    .banner-info {
        max-width: 29.125rem;
        @media (max-width: 48rem) {
            grid-row: 1;
            max-width: 100%;
            padding: var(--space-4) 0;

            .rating-main {
                max-width: 8.875rem;
                height: auto;
            }
        }

        .banner-cta {
            @media (max-width: 48rem) {
                flex-direction: column;
            }
        }
    }

    .services {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: var(--space-3);
        margin-top: 5.625rem;

        @media (max-width: 64rem) {
            grid-template-columns: repeat(3, 1fr);
        }

        @media (max-width: 48rem) {
            grid-template-columns: repeat(2, 1fr);
            margin-top: 3.5rem;
        }

        .service {
            background: var(--white);
            border-radius: var(--radius);
            border: 1px solid var(--color-border);
            padding: var(--space-3);
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
            cursor: pointer;
            position: relative;
            text-decoration: none;
            box-shadow: var(--shadow-soft);
            transition: all ease-in-out .2s;

            span {
                display: block;
                letter-spacing: 0;
                word-break: break-word;
            }

            &:hover {
                color: inherit;
                box-shadow: var(--shadow-card);
            }
        }
    }

    .medical-field-wrapper {
        @media (max-width: 48rem) {
            display: grid;
            grid-template-rows: 18.25rem;
            transition: ease-in-out grid-template-rows .3s;
            margin-top: var(--space-4);
            overflow: hidden;
            position: relative;

            &:before {
                content: '';
                position: absolute;
                height: 112px;
                inset: auto 0 0 0;
                background: linear-gradient(to top, var(--color-bg), transparent);
            }

            &.open {
                &:before {
                    display: none;
                }
            }
        }
    }

    .medical-field-section, .promotions-section, .specialists-section, .reviews-section, .news-section {
        display: flex;
        flex-direction: column;
        margin-top: 5.625rem;

        @media (max-width: 48rem) {
            margin-top: 3.5rem;
        }
    }

    .medical-field-section {
        .medical-fields-toggler {
            display: none;
        }

        @media (max-width: 48rem) {
            .medical-fields-toggler {
                display: flex;
            }
        }

        .medical-fields {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            align-content: start;
            gap: var(--space-3);
            margin-top: var(--space-5);
            align-items: start;
            height: max-content;

            @media (max-width: 64rem) {
                grid-template-columns: repeat(3, 1fr);
            }

            @media (max-width: 48rem) {
                grid-template-columns: repeat(2, 1fr);
                margin-top: 0;
                min-height: 0;
                overflow: hidden;
            }

            .field {
                border-radius: var(--radius);
                background: var(--blue-8);
                padding: var(--space-3);
                color: var(--color-brand);
                cursor: pointer;
                width: 100%;
                overflow: hidden;
                text-wrap: nowrap;
                text-overflow: ellipsis;
                display: block;
                line-height: 1.4;
                box-sizing: border-box;

                &:hover {
                    background: var(--blue-16);
                }
            }
        }
    }

    .reviews-slider {
        --slide-width: 85%;
    }

    /* Базовые стили панели — в компоненте .cta-block, здесь только отступы главной */
    .analysis-section {
        margin-top: 5.625rem;

        form {
            margin-top: var(--space-2);
        }

        @media (max-width: 48rem) {
            margin-top: 3.5rem;

            form div {
                flex-direction: column;
            }
        }
    }

    .aggregators-section,
    .yandex-reviews-section {
        margin-top: 5.625rem;
    }

    .aggregators-section {
        .aggregators-section__head {
            p {
                margin-top: var(--space-1);
                color: var(--color-gray);
            }
        }

        .aggregators-section__grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: var(--space-4);
            margin-top: var(--space-4);
        }

        .aggregator-card {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            min-height: 8.5rem;
            padding: var(--space-4);
            color: var(--color-text);
            text-decoration: none;
            background: var(--color-white);
            border: 1px solid var(--color-border);
            border-radius: var(--radius);
            box-shadow: var(--shadow-soft);
            transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;

            &:hover {
                transform: translateY(-0.1875rem);
                border-color: var(--color-brand);
            }
        }

        .aggregator-card__mark {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 11.5rem;
            height: 3.5rem;
            flex: 0 0 11.5rem;

            img {
                display: block;
                width: 100%;
                height: 100%;
                object-fit: contain;
                object-position: center;
            }
        }

        .aggregator-card--prodoctorov .aggregator-card__mark {
            width: 12rem;
            flex-basis: 12rem;
        }

        .aggregator-card--napopravku .aggregator-card__mark {
            width: 12rem;
            flex-basis: 12rem;
        }

        .aggregator-card__body {
            display: flex;
            flex: 1 1 auto;
            min-width: 0;
            flex-direction: column;
            gap: var(--space-1);

            strong {
                font-size: 1.25rem;
            }

            span {
                color: var(--color-gray);
            }
        }

        .aggregator-card__arrow {
            color: var(--color-brand);
            font-size: 1.75rem;
        }

        @media (max-width: 48rem) {
            margin-top: 3.5rem;

            .aggregators-section__grid {
                grid-template-columns: 1fr;
                gap: var(--space-3);
            }

            .aggregator-card {
                min-height: 7rem;
                padding: var(--space-3);
            }

            .aggregator-card__mark {
                width: 9rem;
                height: 2.75rem;
                flex-basis: 9rem;
            }

            .aggregator-card--prodoctorov .aggregator-card__mark {
                width: 9.5rem;
                flex-basis: 9.5rem;
            }

            .aggregator-card--napopravku .aggregator-card__mark {
                width: 9.5rem;
                flex-basis: 9.5rem;
            }
        }
    }

    .yandex-reviews-section {

        .yandex-reviews-section__head {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: var(--space-4);
            margin-bottom: var(--space-4);

            p {
                margin-top: var(--space-1);
                color: var(--color-gray);
            }
        }

        .yandex-reviews-section__widget {
            display: flex;
            justify-content: center;
            overflow: hidden;

            iframe {
                display: block;
                width: 100%;
                max-width: 48rem;
                height: 48rem;
                border: 0;
                border-radius: var(--radius);
                background: var(--color-white);
                box-shadow: 0 0.75rem 2.5rem rgba(22, 43, 82, 0.08);
            }
        }

        @media (max-width: 48rem) {
            margin-top: 3.5rem;

            .yandex-reviews-section__head {
                align-items: stretch;
                flex-direction: column;

                .btn {
                    width: 100%;
                }
            }

            .yandex-reviews-section__widget iframe {
                height: 42rem;
            }
        }
    }


}
