/* ============================================================
   LIGHTBOX CUSTOM OVERRIDES
   Версия: 1.0
   
   Переопределяет стили Lightbox2 для лучшего UX
   - Увеличивает размер фото на desktop
   - Фиксит overlay для правильного закрытия
   - Улучшает mobile experience
   ============================================================ */

/* Desktop: увеличиваем максимальный размер изображений */
@media (min-width: 1024px) {
    .lb-image {
        max-width: 90vw !important;
        max-height: 90vh !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .lb-image {
        max-width: 85vw !important;
        max-height: 85vh !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .lb-image {
        max-width: 95vw !important;
        max-height: 80vh !important;
    }
}

/* Overlay должен быть кликабельным и закрывать lightbox */
.lb-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    cursor: pointer !important;
}

/* Контейнер с изображением */
.lb-outerContainer {
    position: relative !important;
    z-index: 10001 !important;
}

/* Кнопка закрытия — всегда видимая и кликабельная */
.lb-close {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10002 !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.1) !important;
}

/* Кнопки навигации */
.lb-nav {
    z-index: 10001 !important;
}

.lb-prev,
.lb-next {
    cursor: pointer !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
}

.lb-prev:hover,
.lb-next:hover {
    opacity: 1 !important;
}

/* Data container (подпись) */
.lb-dataContainer {
    z-index: 10001 !important;
}

/* Mobile improvements */
@media (max-width: 767px) {
    .lb-close {
        top: 10px !important;
        right: 10px !important;
        width: 35px !important;
        height: 35px !important;
    }

    .lb-data {
        padding: 10px !important;
    }
}

/* ESC hint */
body.lb-disable-scrolling::after {
    content: 'Press ESC or click outside to close';
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Убираем конфликты с другими стилями */
.lightboxOverlay {
    z-index: 9999 !important;
}

.lightbox {
    z-index: 10000 !important;
}
