/* ========== СТИЛИ ДЛЯ СТРАНИЦЫ ОТЗЫВОВ ========== */

/* Сетка галереи */
.reviews-gallery {
    margin-top: 40px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* Карточка отзыва */
.review-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3 / 4;
    background: var(--color-gray-100);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.review-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.review-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.review-card:hover img {
    transform: scale(1.05);
}

.review-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.review-card:hover .review-overlay {
    opacity: 1;
}

.review-overlay i {
    color: white;
    font-size: 2.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.review-card:hover .review-overlay i {
    transform: scale(1);
}

/* ========== МОДАЛЬНОЕ ОКНО - НЕ БЛОКИРУЕТ ПРОКРУТКУ ========== */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.review-modal.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Затемнение */
.review-modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(5px);
    cursor: pointer;
    z-index: 1;
    pointer-events: auto;
    border-radius: 5px;
}

/* Контент модального окна */
.review-modal__content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: auto;
    max-width: 90vw;
    max-height: 90vh;
}

/* Контейнер для изображения */
.review-modal__image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.review-modal__image {
    max-width: 85vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.review-modal__image:hover {
    transform: scale(1.02);
}

/* Подпись */
.review-modal__caption {
    text-align: center;
    color: white;
    font-size: 0.9rem;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 50px;
    margin-top: 20px;
    font-weight: 500;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопки навигации - десктопная версия */
.review-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.review-modal__nav:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.review-modal__nav i {
    font-size: 1.3rem;
}

.review-modal__prev {
    left: -70px;
}

.review-modal__next {
    right: -70px;
}

/* Кнопка закрытия - десктопная версия */
.review-modal__close {
    position: absolute;
    top: -60px;
    right: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.review-modal__close:hover {
    background: rgba(226, 26, 89, 0.8);
    transform: rotate(90deg);
}

.review-modal__close i {
    font-size: 1.2rem;
}

/* ========== ПЛАНШЕТЫ (768px - 1024px) ========== */
@media (max-width: 1024px) and (min-width: 769px) {
    .review-modal__image {
        max-width: 85vw;
        max-height: 75vh;
    }
    
    .review-modal__prev {
        left: -50px;
    }
    
    .review-modal__next {
        right: -50px;
    }
    
    .review-modal__close {
        top: -50px;
    }
}

/* ========== МОБИЛЬНЫЕ УСТРОЙСТВА (до 768px) ========== */
@media (max-width: 768px) {
    .reviews-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .review-modal__content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 95%;
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .review-modal__image {
        max-width: 100%;
        max-height: 70vh;
    }
    
    /* Кнопки навигации - фиксированные на экране */
    .review-modal__nav {
        position: fixed;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        top: 50%;
        transform: translateY(-50%);
    }
    
    .review-modal__nav:active {
        transform: translateY(-50%) scale(0.95);
    }
    
    .review-modal__nav i {
        font-size: 1.2rem;
    }
    
    .review-modal__prev {
        left: 15px;
        right: auto;
    }
    
    .review-modal__next {
        right: 15px;
        left: auto;
    }
    
    /* Кнопка закрытия - фиксированная */
    .review-modal__close {
        position: fixed;
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
    }
    
    .review-modal__close:active {
        transform: scale(0.95) rotate(90deg);
    }
    
    .review-modal__caption {
        margin-top: 20px;
        padding: 8px 16px;
        font-size: 0.8rem;
        white-space: normal;
        max-width: 90%;
    }
}

/* ========== МАЛЕНЬКИЕ МОБИЛЬНЫЕ (до 480px) ========== */
@media (max-width: 480px) {
    .reviews-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .review-modal__nav {
        width: 40px;
        height: 40px;
    }
    
    .review-modal__nav i {
        font-size: 1rem;
    }
    
    .review-modal__prev {
        left: 10px;
    }
    
    .review-modal__next {
        right: 10px;
    }
    
    .review-modal__close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .review-modal__image {
        max-height: 65vh;
    }
    
    .review-modal__caption {
        font-size: 0.7rem;
        padding: 6px 12px;
        margin-top: 15px;
    }
}

/* ========== ОЧЕНЬ МАЛЕНЬКИЕ МОБИЛЬНЫЕ (до 360px) ========== */
@media (max-width: 360px) {
    .review-modal__nav {
        width: 36px;
        height: 36px;
    }
    
    .review-modal__prev {
        left: 8px;
    }
    
    .review-modal__next {
        right: 8px;
    }
    
    .review-modal__close {
        width: 36px;
        height: 36px;
        top: 8px;
        right: 8px;
    }
    
    .review-modal__image {
        max-height: 60vh;
    }
}

/* ========== LANDSCAPE ОРИЕНТАЦИЯ НА МОБИЛЬНЫХ ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .review-modal__image {
        max-height: 70vh;
    }
    
    .review-modal__nav {
        width: 40px;
        height: 40px;
    }
    
    .review-modal__prev {
        left: 15px;
    }
    
    .review-modal__next {
        right: 15px;
    }
    
    .review-modal__close {
        top: 10px;
        right: 10px;
    }
    
    .review-modal__caption {
        margin-top: 15px;
        padding: 6px 12px;
        font-size: 0.7rem;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .review-modal__image-wrapper {
        animation: none;
    }
    
    .review-card,
    .review-card img,
    .review-overlay,
    .review-overlay i,
    .review-modal__nav,
    .review-modal__close {
        transition: none !important;
    }
    
    .review-card:hover {
        transform: none;
    }
    
    .review-card:hover img {
        transform: none;
    }
}