/* Light Fancy - Упрощенная версия без миниатюр */
.fancybox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999998;
    display: none;
}

.fancybox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
}

.fancybox-content {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
}

.fancybox-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    cursor: zoom-in;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* УВЕЛИЧЕНИЕ ВО ВЕСЬ ЭКРАН */
.fancybox-image.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95vw;
    max-height: 125vh;
    width: auto;
    height: auto;
    cursor: zoom-out;
    z-index: 1000000;
    border-radius: 0;
    box-shadow: none;
}

.fancybox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000001;
    transition: all 0.3s ease;
}

.fancybox-close:hover {
    background: #ff0000;
    transform: rotate(90deg);
}

.fancybox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    text-align: center;
    font-size: 16px;
    z-index: 1000001;
}

.fancybox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 1000001;
}

.fancybox-prev,
.fancybox-next {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    margin: 0 30px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 1000001;
}

.fancybox-prev:hover,
.fancybox-next:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.fancybox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 1000001;
}

.fancybox-active {
    display: flex !important;
}

body.fancybox-open {
    overflow: hidden;
}

/* Стили для полноэкранного режима */
.fancybox-zoom-close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    z-index: 1000002;
    display: none;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.fancybox-zoom-close:hover {
    background: #ff0000;
    transform: rotate(90deg) scale(1.1);
}

/* Затемнение для увеличенного режима */
.fancybox-overlay.zoomed {
    background: rgba(0, 0, 0, 0.98);
    z-index: 999999;
}

/* Скрываем элементы при увеличении */
.fancybox-image.zoomed ~ .fancybox-close,
.fancybox-image.zoomed ~ .fancybox-nav,
.fancybox-image.zoomed ~ .fancybox-counter,
.fancybox-image.zoomed ~ .fancybox-caption {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Показываем кнопку закрытия при увеличении */
.fancybox-image.zoomed ~ .fancybox-zoom-close {
    display: flex;
}

/* Адаптивность */
@media (max-width: 768px) {
    .fancybox-content {
        max-width: 95vw;
        max-height: 70vh;
    }
    
    .fancybox-image {
        max-height: 70vh;
    }
    
    .fancybox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .fancybox-zoom-close {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .fancybox-prev,
    .fancybox-next {
        width: 50px;
        height: 50px;
        margin: 0 15px;
        font-size: 20px;
    }
    
    .fancybox-caption {
        bottom: 15px;
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .fancybox-counter {
        top: 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .fancybox-prev,
    .fancybox-next {
        width: 40px;
        height: 40px;
        margin: 0 10px;
        font-size: 18px;
    }
    
    .fancybox-close {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .fancybox-zoom-close {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
}