/* ========== МОДАЛЬНОЕ ОКНО ГАЛЕРЕИ ========== */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: pan-y pinch-zoom;
}

.gallery-modal.active {
    display: block;
    opacity: 1;
}

.gallery-modal-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.gallery-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.gallery-modal-image-container {
    width: 100%;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y pinch-zoom;
    overflow: hidden;
    position: relative;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gallery-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gallery-modal-prev,
.gallery-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-prev {
    left: 20px;
}

.gallery-modal-next {
    right: 20px;
}

.gallery-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .gallery-modal-image-container {
        height: 70vh;
    }
    
    .gallery-modal-prev,
    .gallery-modal-next {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .gallery-modal-prev {
        left: 10px;
    }
    
    .gallery-modal-next {
        right: 10px;
    }
    
    .gallery-modal-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .gallery-modal-counter {
        bottom: 10px;
        font-size: 14px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .gallery-modal-image-container {
        height: 60vh;
    }
    
    .gallery-modal-prev,
    .gallery-modal-next {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .gallery-modal-prev {
        left: 5px;
    }
    
    .gallery-modal-next {
        right: 5px;
    }
    
    .gallery-modal-content {
        max-height: 90vh;
    }
}