/* Общий контейнер */
.wrapper_reviews {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
    font-family: 'Gilroy', 'Arial', sans-serif;
    position: relative;
    scroll-margin-top: 100px;
}

.wrapper_reviews::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 1px;
    background: #eee;
    z-index: 1;
}

/* Шапка секции */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 43px;
    font-weight: 500;
    color: #000;
    line-height: 1.1;
    margin-bottom: 15px;
    letter-spacing: -0.8px;
}

.section-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Внутренние секции */
.reviews-section,
.videos-section {
    margin-bottom: 70px;
    scroll-margin-top: 100px;
}

.section-header-inner {
    margin-bottom: 30px;
}

.section-title-inner {
    font-size: 28px;
    font-weight: 600;
    color: #000;
    margin: 0;
}

/* Карусельные контейнеры */
.reviews-carousel-container,
.videos-carousel-container {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

/* Треки */
.reviews-track,
.videos-track {
    display: flex;
    gap: 30px;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.reviews-track:active,
.videos-track:active {
    cursor: grabbing;
}

.reviews-track.dragging,
.videos-track.dragging {
    transition: none;
}

/* Индикатор перетаскивания */
.drag-indicator {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 15px;
    font-weight: 500;
}

/* Лоадер */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e70000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader p {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Карточка отзыва */
.review-card {
    width: 320px;
    min-width: 320px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.review-card:hover {
    border-color: #2c5282;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Шапка отзыва */
.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2c5282 0%, #4299e1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.author-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 4px 0;
}

.review-date {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

/* Рейтинг */
.rating {
    color: #ffc107;
    font-size: 18px;
    letter-spacing: 1px;
}

/* Галерея фото в отзыве */
.review-gallery {
    margin: 10px 0;
}

.gallery-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    height: 200px;
}

.main-photo {
    grid-row: 1 / 3;
    grid-column: 1;
    border-radius: 6px 0 0 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-photo:hover img {
    transform: scale(1.05);
}

.small-photo {
    position: relative;
    overflow: hidden;
    border-radius: 0 6px 0 0;
    cursor: pointer;
}

.small-photo:nth-child(3) {
    border-radius: 0 0 6px 0;
}

.small-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.small-photo:hover img {
    transform: scale(1.05);
}

.more-photos-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    z-index: 2;
}

/* Текст отзыва */
.review-text-container {
    position: relative;
}

.review-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin: 0;
}

.review-text.collapsed {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    line-clamp: 6;
}

.read-more-btn {
    background: none;
    border: none;
    color: #2c5282;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 0;
    text-align: left;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: #e70000;
}

/* Карточка видео */
.video-card {
    width: 380px;
    min-width: 380px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.video-card:hover {
    border-color: #e70000;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f8f8f8;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0;
    transition: all 0.3s ease;
    opacity: 0.9;
    z-index: 2;
}

/* Создаем треугольник через CSS */
.play-btn::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 24px solid white;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    margin-left: 6px;
}

/* Эффект при наведении */
.video-card:hover .play-btn {
    background: rgba(231, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 30px rgba(231, 0, 0, 0.5);
}

/* Для темных превью */
.video-thumbnail.dark .play-btn {
    background: rgba(0, 0, 0, 0.8);
}

.video-thumbnail.dark:hover .play-btn {
    background: rgba(231, 0, 0, 0.9);
}

.video-info {
    padding: 20px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-counter {
    display: inline-block;
    background: #f0f7ff;
    color: #2c5282;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Навигация карусели */
.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.carousel-arrow {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-arrow:hover {
    background: #f8f8f8;
    border-color: #2c5282;
    color: #2c5282;
}

.carousel-arrow:active {
    transform: scale(0.95);
}

/* Модальное окно для галереи фото */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.gallery-modal.active {
    display: block;
}

/* Затемнение фона для галереи */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

/* Контент галереи */
.gallery-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #111;
    border-radius: 20px;
    overflow: hidden;
    z-index: 1001;
    max-width: 90vw;
    max-height: 90vh;
    width: 900px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: -0.3px;
}

.gallery-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e70000 0%, #cc0000 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.gallery-close:hover::before {
    opacity: 1;
}

.gallery-close:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(231, 0, 0, 0.3);
}

.gallery-close span {
    position: relative;
    z-index: 1;
    line-height: 1;
    transition: transform 0.3s ease;
}

.gallery-body {
    padding: 25px;
}

.gallery-main-photo {
    width: 100%;
    height: 500px;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
}

.gallery-main-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.gallery-thumbnail.active {
    border-color: #e70000;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Красивое модальное окно для видео */
#videoModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

#videoModal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Затемнение фона */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Контент модального окна */
.modal-content {
    position: relative;
    z-index: 10001;
    background: #111;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Шапка модального окна */
.modal-header {
    padding: 25px 30px;
    background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: -0.3px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e70000 0%, #cc0000 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.modal-close:hover::before {
    opacity: 1;
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(231, 0, 0, 0.3);
}

.modal-close span {
    position: relative;
    z-index: 1;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* Тело модального окна */
.modal-body {
    padding: 0;
    position: relative;
}

/* Контейнер видео-плеера */
.video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 соотношение */
    background: #000;
    overflow: hidden;
}

.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}

/* Прелоадер */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #e70000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid transparent;
    border-radius: 50%;
    background: linear-gradient(45deg,
            rgba(231, 0, 0, 0.2),
            rgba(231, 0, 0, 0.1),
            rgba(231, 0, 0, 0.05)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.video-loading p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Кнопка повторной загрузки */
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #e70000 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(231, 0, 0, 0.3);
}

.retry-btn:hover {
    background: linear-gradient(135deg, #cc0000 0%, #b30000 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(231, 0, 0, 0.4);
}

.retry-btn svg {
    transition: transform 0.3s ease;
}

.retry-btn:hover svg {
    transform: rotate(180deg);
}

/* Эффекты при открытии/закрытии */
#videoModal.closing .modal-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#videoModal.closing .modal-content {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Анимация загрузки для iframe */
.video-player-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    animation: loadingShimmer 1.5s infinite;
    z-index: 1;
}

@keyframes loadingShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Общие стили для кнопок и состояний */
.error-state {
    padding: 60px 20px;
    text-align: center;
}

.error-state .spinner {
    border-top-color: #ff3333;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .wrapper_reviews {
        padding: 0 40px;
    }

    .review-card {
        width: 300px;
        min-width: 300px;
    }

    .video-card {
        width: 350px;
        min-width: 350px;
    }

    .play-btn {
        width: 70px;
        height: 70px;
    }

    .play-btn::before {
        border-left: 20px solid white;
        border-top: 14px solid transparent;
        border-bottom: 14px solid transparent;
        margin-left: 5px;
    }

    .gallery-content,
    .modal-content {
        width: 95vw;
    }
}

@media (max-width: 992px) {
    .wrapper_reviews {
        margin: 60px auto;
        padding: 0 30px;
    }

    .section-title {
        font-size: 38px;
    }

    .section-title-inner {
        font-size: 24px;
    }

    .review-card {
        width: 50%;
        min-width: 280px;
    }

    .video-card {
        width: 320px;
        min-width: 320px;
    }

    .play-btn {
        width: 65px;
        height: 65px;
    }

    .play-btn::before {
        border-left: 18px solid white;
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        margin-left: 4px;
    }

    .gallery-content,
    .modal-content {
        width: 95vw;
        border-radius: 16px;
    }

    .video-player-container {
        height: 400px;
    }

    .modal-header {
        padding: 20px 25px;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .gallery-main-photo {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .wrapper_reviews {
        margin: 50px auto;
        padding: 0 25px;
    }

    .section-title {
        font-size: 32px;
    }

    .section-title-inner {
        font-size: 22px;
    }

    .drag-indicator {
        display: none;
    }

    .review-card {
        width: 50%;
        min-width: 260px;
    }

    .video-card {
        width: 300px;
        min-width: 300px;
    }

    .play-btn {
        width: 60px;
        height: 60px;
    }

    .play-btn::before {
        border-left: 16px solid white;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        margin-left: 3px;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header {
        padding: 18px 22px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
    }

    .video-loading p {
        font-size: 14px;
    }

    .retry-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .gallery-main-photo {
        height: 350px;
    }

    .video-player-container {
        height: 350px;
    }

    .gallery-thumbnails {
        padding: 5px 0;
    }

    .gallery-thumbnail {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 576px) {
    .wrapper_reviews {
        margin: 40px auto;
        padding: 0 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .reviews-track,
    .videos-track {
        gap: 20px;
    }

    .review-card {
        width: 90%;
        min-width: 240px;
        padding: 20px;
    }

    .video-card {
        width: 280px;
        min-width: 280px;
    }

    .play-btn {
        width: 55px;
        height: 55px;
    }

    .play-btn::before {
        border-left: 14px solid white;
        border-top: 9px solid transparent;
        border-bottom: 9px solid transparent;
        margin-left: 2px;
    }

    .video-thumbnail {
        height: 200px;
    }

    .modal-content {
        border-radius: 10px;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
    }

    .video-loading p {
        font-size: 13px;
    }

    .gallery-main-photo {
        height: 300px;
    }

    .video-player-container {
        height: 250px;
    }

    .carousel-arrow {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .wrapper_reviews {
        padding: 0 15px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-title-inner {
        font-size: 20px;
    }

    .review-card {
        width: 90%;
        min-width: 220px;
    }

    .video-card {
        width: 260px;
        min-width: 260px;
    }

    .play-btn {
        width: 50px;
        height: 50px;
    }

    .play-btn::before {
        border-left: 12px solid white;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        margin-left: 1px;
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 400px) {
    .modal-content {
        border-radius: 8px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .play-btn {
        width: 45px;
        height: 45px;
    }

    .play-btn::before {
        border-left: 10px solid white;
        border-top: 7px solid transparent;
        border-bottom: 7px solid transparent;
    }
}