/* Исходные стили из вашего модифицированного reviews.css */
.yandex-reviews-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.yandex-embed {
    flex: 1 1 420px;
    min-width: 300px;
    position: relative;
}

.yandex-embed iframe {
    display: block;
    box-shadow: 0 8px 28px rgba(10, 30, 50, 0.08);
    transition: transform .28s ease, box-shadow .28s ease;
}

.yandex-actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
}

.yandex-actions .btn-view-yandex,
.yandex-actions .btn-expand-iframe {
    background: #575f65;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.yandex-actions .btn-expand-iframe {
    background: #575f65;
    color: #fff;
}

.site-reviews {
    flex: 0 1 320px;
    min-width: 260px;
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(11, 59, 102, 0.06);
    box-shadow: 0 6px 20px rgba(11, 59, 102, 0.03);
}

.site-reviews h3 {
    margin: 0 0 12px 0;
    color: #082b45;
}

.site-review {
    border-top: 1px dashed rgba(11, 59, 102, 0.06);
    padding: 10px 0;
}

.site-review:first-of-type {
    border-top: none;
    padding-top: 0;
}

.review-author {
    display: inline-block;
    margin-right: 8px;
    color: #0b456f;
    font-weight: 700;
}

.review-date {
    color: #7a8aa0;
    font-size: 0.85rem;
}

.review-text {
    margin: 6px 0 0;
    color: #475e73;
    line-height: 1.4;
}

.btn-leave-review {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(11, 59, 102, 0.06);
    background: linear-gradient(180deg, #fff, #f7fbff);
    color: #073046;
    cursor: pointer;
}

@media (max-width: 900px) {
    .yandex-reviews-wrapper {
        flex-direction: column;
    }
    .yandex-embed {
        order: 1;
    }
    .site-reviews {
        order: 2;
    }
}

.site-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-review {
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(11, 59, 102, 0.06);
    box-shadow: 0 6px 18px rgba(11, 59, 102, 0.03);
}

.site-review header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, #f0f4f7, #e6eef8);
    display: inline-block;
    flex: 0 0 44px;
    position: relative;
    box-shadow: inset 0 -6px 12px rgba(11, 59, 102, 0.03);
}

.review-avatar::before {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><circle cx='12' cy='8' r='3.2' stroke='%23073046' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M4.5 19c0-3.2 3.6-5.6 7.5-5.6s7.5 2.4 7.5 5.6' stroke='%23073046' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.95;
    margin: 10px auto 0;
}

.review-author {
    color: #0b456f;
    font-weight: 700;
}

.review-score {
    color: #f0a500;
    font-weight: 700;
    margin-left: auto;
}

.review-date {
    color: #7a8aa0;
    font-size: 0.85rem;
    margin-left: 8px;
}

.review-text {
    margin: 0;
    color: #415867;
    line-height: 1.45;
}

@media (max-width: 520px) {
    .review-avatar {
        width: 38px;
        height: 38px;
    }
    .review-avatar::before {
        width: 20px;
        height: 20px;
        margin-top: 9px;
    }
}

.col-12.d-flex.px-0 {
    padding-left: 0;
    padding-right: 0;
}

/* Боковые пустые блоки — регулируйте width (px или %) */
.side-gap {
    flex: 0 0 25%;
    max-width: 25%;
    min-width: 16px;
}

/* Если нужно разное с двух сторон — используем классы */
.side-gap-left {
    margin-right: 0;
}
.side-gap-right {
    margin-left: 0;
}

/* Основная обёртка виджета — занимает оставшееся место */
.widget-wrapper {
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

/* Контейнер и iframe как прежде */
.widget-container {
    width: 100%;
    height: 100%;
    position: relative;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.widget-frame {
    width: 100%;
    height: 550px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-sizing: border-box;
    display: block;
    overflow: hidden;
}

.widget-frame-gallery {
    width: 100%;
    height: 900px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-sizing: border-box;
    display: block;
    overflow: hidden;
}

.widget-caption {
    box-sizing: border-box;
    text-decoration: none;
    color: #b3b3b3;
    font-size: 10px;
    font-family: "YS Text", sans-serif;
    padding: 0 16px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
    left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-height: 14px;
    white-space: nowrap;
}

/* Адаптив: уменьшаем высоту и боковые отступы на мелких экранах */
@media (max-width: 768px) {
    .side-gap {
        flex: 0 0 3%;
        max-width: 3%;
    }
    .widget-container {
        height: 720px;
    }
}

@media (max-width: 480px) {
    .side-gap {
        flex: 0 0 8px;
        max-width: 40px;
    }
    .widget-container {
        height: 600px;
    }
}

/* Стили для галереи отзывов */
.reviews-gallery .clickable-thumb {
    box-shadow: 0 6px 18px rgba(11, 59, 102, 0.06);
    transition: transform 0.2s ease;
}
.reviews-gallery .clickable-thumb:hover {
    transform: scale(1.02);
}

/* Адаптивность для мобильных */
@media (max-width: 767.98px) {
    .yandex-reviews-wrapper {
        gap: 12px; /* Уменьшенный отступ между виджетом и галереей */
    }
    .yandex-embed {
        order: -1; /* Виджет Яндекс.Карт первым */
    }
    .reviews-photos {
        order: 0; /* Фотографии вторыми */
    }
    .widget-frame {
        height: 550px !important; /* Увеличенная высота для видимости отзыва */
    }
    .widget-caption {
        font-size: 0.85rem; /* Чуть крупнее для читаемости */
    }
    .btn-gradient {
        width: 100%; /* Полноширинная кнопка */
        justify-content: center;
        font-size: 0.95rem; /* Уменьшенный шрифт */
    }
    .reviews-gallery {
        overflow-x: auto; /* Горизонтальная прокрутка */
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Скрыть скроллбар в Firefox */
    }
    .reviews-gallery::-webkit-scrollbar {
        display: none; /* Скрыть скроллбар в Chrome/Safari */
    }
    .gallery-row-top {
        display: contents; /* Игнорируем разделение на ряды */
    }
    .gallery-row-bottom {
        display: none !important;
    }
    .reviews-gallery .flex-shrink-0 {
        width: 80% !important; /* Один ряд, крупные изображения */
        scroll-snap-align: start;
    }
    /* Отключение анимаций для row на мобильных */
    .row {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        transition: none !important;
    }
}

/* Десктоп: два горизонтальных ряда с горизонтальной прокруткой */
@media (min-width: 768px) {
    .yandex-embed {
        order: 0; /* Виджет слева */
    }
    .reviews-photos {
        order: 0; /* Фотографии справа */
        height: 550px; /* Совпадает с высотой .yandex-embed */
        display: flex;
        flex-direction: column;
    }
    .reviews-gallery {
        flex: 1 1 auto; /* Занимает доступное пространство */
        max-height: 490px; /* Оставляем место для кнопки (~60px) */
        display: flex;
        flex-direction: column;
        gap: 10px; /* Отступ между рядами */
    }
    .gallery-row-top,
    .gallery-row-bottom {
        flex: 1 1 240px; /* Каждый ряд ~240px */
        max-height: 240px; /* Ограничиваем высоту ряда */
        overflow-x: auto; /* Горизонтальная прокрутка */
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Скрыть скроллбар в Firefox */
    }
    .gallery-row-top::-webkit-scrollbar,
    .gallery-row-bottom::-webkit-scrollbar {
        display: none; /* Скрыть скроллбар в Chrome/Safari */
    }
    .gallery-row-top .flex-shrink-0,
    .gallery-row-bottom .flex-shrink-0 {
        width: 50% !important; /* 2 изображения в ряду */
        scroll-snap-align: start;
    }
    .gallery-row-top .clickable-thumb,
    .gallery-row-bottom .clickable-thumb {
        max-height: 240px; /* Ограничиваем высоту изображений */
        object-fit: cover; /* Сохраняем пропорции */
        width: 100%; /* Заполняет контейнер .flex-shrink-0 */
    }
    .widget-frame {
        height: 550px !important; /* Увеличенная высота для видимости отзыва */
    }
}