﻿/* ============================================
   ГАЛЕРЕЯ ОТЗЫВОВ - ПОЛНЫЙ CSS ФАЙЛ
   ============================================ */

/* Базовые стили */
:root {
    --gallery-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gallery-overlay: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.8));
    --gallery-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --gallery-shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.25);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.3s ease;
}

/* 1. ПРЕВЬЮ ГАЛЕРЕИ */
.reviews-gallery-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
    background: transparent;
}

@media (min-width: 768px) {
    .reviews-gallery-section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

@media (min-width: 992px) {
    .reviews-gallery-section {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

.gallery-preview-grid {
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .gallery-preview-grid {
        margin-bottom: 3rem;
    }
}

.gallery-preview-grid .row {
    justify-content: center;
    margin: 0 -8px;
}

@media (min-width: 576px) {
    .gallery-preview-grid .row {
        margin: 0 -12px;
    }
}

.gallery-preview-grid .row > [class*="col-"] {
    padding-right: 8px;
    padding-left: 8px;
    margin-bottom: 16px;
}

@media (min-width: 576px) {
    .gallery-preview-grid .row > [class*="col-"] {
        padding-right: 12px;
        padding-left: 12px;
        margin-bottom: 20px;
    }
}

.gallery-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--gallery-shadow);
    height: 180px;
    width: 100%;
    background: #fff;
}

@media (min-width: 576px) {
    .gallery-preview-item {
        height: 200px;
        border-radius: 14px;
    }
}

@media (min-width: 768px) {
    .gallery-preview-item {
        height: 220px;
        border-radius: 16px;
    }
}

@media (min-width: 992px) {
    .gallery-preview-item {
        height: 240px;
    }
}

@media (min-width: 1200px) {
    .gallery-preview-item {
        height: 260px;
    }
}

.gallery-preview-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--gallery-shadow-hover);
}

.preview-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    transition: transform 0.5s ease;
}

.gallery-preview-item:hover .preview-image {
    transform: scale(1.05);
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gallery-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.gallery-preview-item:hover .preview-overlay {
    opacity: 1;
}

.preview-icon {
    color: white;
    font-size: 1.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

@media (min-width: 768px) {
    .preview-icon {
        font-size: 2rem;
    }
}

.gallery-preview-item:hover .preview-icon {
    transform: scale(1);
}

.preview-more {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .preview-more {
        padding: 5px 14px;
        font-size: 0.9rem;
        bottom: 15px;
        right: 15px;
    }
}

/* 2. КНОПКА ОТКРЫТИЯ ГАЛЕРЕИ */
.gallery-open-btn {
    background: var(--gallery-primary);
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition-fast);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-block;
    text-decoration: none;
    outline: none;
}

@media (min-width: 768px) {
    .gallery-open-btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
}

.gallery-open-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: white;
}

.gallery-open-btn:active {
    transform: translateY(-1px);
}

.gallery-open-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.7s ease;
}

.gallery-open-btn:hover::after {
    left: 100%;
}

/* 3. МОДАЛЬНОЕ ОКНО ГАЛЕРЕИ */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

    .gallery-modal.show {
        display: block;
        opacity: 1;
    }

/* 4. КОНТЕЙНЕР ГАЛЕРЕИ */
.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 5. СЛАЙДЕР */
.gallery-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

@media (min-width: 768px) {
    .gallery-slider {
        padding: 60px 40px;
    }
}

.gallery-slide {
    position: absolute;
    width: 90%;
    height: 80%;
    opacity: 0;
    transform: translateX(100px) scale(0.9);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

@media (min-width: 768px) {
    .gallery-slide {
        width: 85%;
        height: 85%;
    }
}

@media (min-width: 992px) {
    .gallery-slide {
        width: 80%;
        height: 90%;
    }
}

.gallery-slide.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.gallery-slide.prev {
    opacity: 0.3;
    transform: translateX(-100px) scale(0.9);
    z-index: 1;
}

.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .gallery-slide img {
        border-radius: 12px;
    }
}

.gallery-slide img:hover {
    transform: scale(1.01);
}

/* 6. НАВИГАЦИЯ (СТРЕЛКИ) */
.gallery-nav {
    position: absolute;
    top: 50%;
 
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    touch-action: manipulation;
    user-select: none;
    pointer-events: auto;
    outline: none;
}

@media (min-width: 768px) {
    .gallery-nav {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}

@media (min-width: 992px) {
    .gallery-nav {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.gallery-nav:active {
    transform:  scale(0.95);
}

.gallery-nav-prev {
    left: 10px;
}

.gallery-nav-next {
    right: 10px;
}

@media (min-width: 768px) {
    .gallery-nav-prev {
        left: 20px;
    }

    .gallery-nav-next {
        right: 20px;
    }
}

@media (min-width: 992px) {
    .gallery-nav-prev {
        left: 30px;
    }

    .gallery-nav-next {
        right: 30px;
    }
}

/* 7. ИНДИКАТОРЫ */
.gallery-indicators {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 1000;
    padding: 0 20px;
    pointer-events: auto;
}

.gallery-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .gallery-indicator {
        width: 12px;
        height: 12px;
    }
}

.gallery-indicator.active {
    background: white;
    transform: scale(1.3);
}

.gallery-indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

/* 8. ИНФОРМАЦИЯ О СЛАЙДЕ */
.gallery-info {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: none;
}

@media (min-width: 768px) {
    .gallery-info {
        bottom: 70px;
        right: 30px;
        padding: 10px 20px;
        font-size: 1rem;
    }
}

.gallery-counter {
    color: white;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 9. КНОПКА ЗАКРЫТИЯ */
.gallery-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    z-index: 1001;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-fast);
    cursor: pointer;
    pointer-events: auto;
    outline: none;
}

@media (min-width: 768px) {
    .gallery-close-btn {
        top: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
}

.gallery-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.gallery-close-btn:active {
    transform: scale(0.95);
}

/* 10. АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ */
/* Мобильные устройства (портретный режим) */
@media (max-width: 767px) and (orientation: portrait) {
    .gallery-slider {
        padding: 20px 15px;
    }

    .gallery-slide {
        width: 95%;
        height: 75%;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .gallery-nav-prev {
        left: 5px;
    }

    .gallery-nav-next {
        right: 5px;
    }

    .gallery-indicators {
        bottom: 20px;
        gap: 8px;
    }

    .gallery-indicator {
        width: 8px;
        height: 8px;
    }

    .gallery-info {
        bottom: 50px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .gallery-close-btn {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Мобильные устройства (ландшафтный режим) */
@media (max-width: 767px) and (orientation: landscape) {
    .gallery-slider {
        padding: 15px 10px;
    }

    .gallery-slide {
        width: 80%;
        height: 90%;
    }

    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .gallery-indicators {
        bottom: 15px;
    }

    .gallery-info {
        bottom: 40px;
        right: 10px;
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Планшеты */
@media (min-width: 768px) and (max-width: 1024px) {
    .gallery-slider {
        padding: 40px 30px;
    }

    .gallery-slide {
        width: 90%;
        height: 85%;
    }
}

/* 11. ЛОАДЕР */
.gallery-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    z-index: 10000;
    display: none;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 12. ОШИБКИ */
.gallery-error {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    padding: 20px;
    background: rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    display: none;
    z-index: 10001;
    max-width: 90%;
    width: 300px;
}

/* 13. АНИМАЦИИ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gallery-modal.show {
    animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-slide.active {
    animation: slideIn 0.5s ease-out;
}

/* 14. КЛАСС ДЛЯ БЛОКИРОВКИ SCROLL */
body.gallery-open {
    overflow: hidden !important;
}

/* 15. ОБЩИЕ СТИЛИ */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }
}

@media (min-width: 992px) {
    .section-title {
        font-size: 3rem;
    }
}

.section-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem;
}

@media (min-width: 768px) {
    .section-subtitle {
        font-size: 1.1rem;
    }
}

/* 16. ФИКСЫ ДЛЯ БРАУЗЕРОВ */
@supports (-webkit-touch-callout: none) {
    .gallery-modal {
        -webkit-backdrop-filter: blur(5px);
    }
}

/* Уменьшение motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-slide,
    .gallery-preview-item,
    .gallery-nav,
    .gallery-close-btn,
    .gallery-open-btn {
        transition: none !important;
        animation: none !important;
    }

    .gallery-slide {
        transition: opacity 0.3s ease !important;
    }
}




.gallery-slide.slide-in-left {
    transform: translateX(-100px) scale(0.9);
    opacity: 0;
}

.gallery-slide.slide-in-right {
    transform: translateX(100px) scale(0.9);
    opacity: 0;
}

.gallery-slide.slide-out-left {
    transform: translateX(-100px) scale(0.9);
    opacity: 0;
}

.gallery-slide.slide-out-right {
    transform: translateX(100px) scale(0.9);
    opacity: 0;
}

.gallery-slide.active {
    transform: translateX(0) scale(1);
    opacity: 1;
}