/* Лайтбокс оверлей */
.nk-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.nk-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Контейнер для изображения */
.nk-lightbox-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default; /* Показываем, что это не кликабельная зона для закрытия */
}

/* Изображение */
.nk-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: default; /* Предотвращаем cursor: pointer */
}

.nk-lightbox-image.loaded {
    opacity: 1;
}

/* Кнопки навигации */
.nk-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    transition: .3s;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    opacity: .7;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    z-index: 10;
}
.nk-lightbox-nav svg{
    width: 8px;
    height: auto;
}
.active .nk-lightbox-nav {
    opacity: 1;
    pointer-events: auto;
}
.nk-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.4);
}

.nk-lightbox-nav.prev {
    left: 20px;
}

.nk-lightbox-nav.next {
    right: 20px;
}

.nk-lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Кнопка закрытия (крестик) */
.nk-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 1000000;
    background: rgba(0, 0, 0, .3);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: .3s;
    border: none;
    cursor: pointer;
}

.nk-lightbox-close svg{
    width: 15px;
    height: auto;
}
.active .nk-lightbox-close {
    opacity: 1;
    pointer-events: auto;
}

.nk-lightbox-close:hover {
    transform: rotate(90deg);
}

.nk-lightbox-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Счетчик */
.nk-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 30px;
    z-index: 1000000;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.active .nk-lightbox-counter {
    opacity: 0;
}

/* Загрузчик */
.nk-lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: nk-spin 1s linear infinite;
    z-index: 999999;
}

@keyframes nk-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Стили для сетки галереи */
.nk-gallery-grid {
    margin: 20px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    
    .nk-lightbox-close {
        width: 44px;
        height: 44px;
        top: 10px;
        right: 15px;
    }
    
    .nk-lightbox-counter {
        font-size: 14px;
        padding: 6px 16px;
        bottom: 15px;
    }
    .nk-lightbox-nav {
    background: rgba(0, 0, 0, 0.05);
    transition: .3s;
    width: 40px;
    height: 40px;
    }
    .nk-lightbox-nav:hover{
    background: rgba(0, 0, 0, 0.1);
    } 
    .nk-lightbox-close {
    background: rgba(0, 0, 0, .1);    
}
}

@media (max-width: 560px) {
    .nk-lightbox-close {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
    .nk-lightbox-nav {
    background: rgba(0, 0, 0, 0);
    }
    .nk-lightbox-nav:hover{
    background: rgba(0, 0, 0, 0);
    } 
}

/* Анимация появления */
@keyframes nk-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
