/* ═══════════════════════════════════════════════════
   NAVIBE LIGHTBOX
═══════════════════════════════════════════════════ */

.nvlb-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.nvlb-overlay.nvlb-visible { opacity: 1; pointer-events: all; }

/* Контейнер фото — почти весь экран */
.nvlb-container {
    position: relative;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}

.nvlb-img {
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 40px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    transform: scale(0.94); opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34,1.15,0.64,1), opacity 0.3s ease;
    display: block;
    cursor: zoom-in;
    position: relative; z-index: 1;
}
.nvlb-img.nvlb-loaded { transform: scale(1); opacity: 1; }
.nvlb-img.nvlb-zoomed {
    max-width: none !important; max-height: none !important;
    cursor: zoom-out; width: auto; height: auto;
}

/* Спиннер */
.nvlb-spinner {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #fff; border-radius: 50%;
    animation: nvlb-spin 0.7s linear infinite;
    z-index: 2;
}
@keyframes nvlb-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ── Кнопка закрыть ── */
.nvlb-close {
    position: fixed; top: 18px; right: 18px; z-index: 100002;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff; font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; outline: none;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.15s;
}
.nvlb-close:hover { background: rgba(0,0,0,0.7); transform: scale(1.08); }

/* ── Навигация — заходят на фото, с градиентом ── */
.nvlb-prev,
.nvlb-next {
    position: fixed; top: 0; bottom: 0; z-index: 100001;
    width: 80px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; outline: none;
    color: #fff; font-size: 32px;
    transition: opacity 0.2s;
}
.nvlb-prev {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 100%);
}
.nvlb-next {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 100%);
}
.nvlb-prev:hover { background: linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%); }
.nvlb-next:hover { background: linear-gradient(to left,  rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%); }

.nvlb-prev span, .nvlb-next span {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    font-size: 24px; line-height: 1;
    transition: background 0.2s, transform 0.15s;
}
.nvlb-prev:hover span, .nvlb-next:hover span {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* ── Нижняя панель — заходит на фото с градиентом ── */
.nvlb-toolbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 100001;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 28px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.nvlb-toolbar-inner {
    display: flex; align-items: center; gap: 4px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 40px; padding: 7px 16px;
    backdrop-filter: blur(16px);
    pointer-events: all;
    white-space: nowrap;
}

.nvlb-counter {
    color: rgba(255,255,255,0.65); font-size: 13px;
    font-family: -apple-system,sans-serif; padding: 0 8px;
}
.nvlb-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.18); margin: 0 2px; }

.nvlb-tool-btn {
    background: transparent; border: none;
    color: rgba(255,255,255,0.85); cursor: pointer;
    padding: 6px 12px; border-radius: 20px;
    transition: background 0.2s, color 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-family: -apple-system,sans-serif;
    text-decoration: none; outline: none;
}
.nvlb-tool-btn:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }
.nvlb-tool-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Мобильный ── */
@media (max-width: 600px) {
    .nvlb-img {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .nvlb-prev { width: 56px; }
    .nvlb-next { width: 56px; }
    .nvlb-prev span, .nvlb-next span { width: 40px; height: 40px; font-size: 22px; }

    .nvlb-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 18px; }

    .nvlb-toolbar { padding: 24px 12px 20px; }
    .nvlb-tool-btn { padding: 8px 12px; font-size: 14px; }
    .nvlb-tool-btn svg { width: 17px; height: 17px; }
    .nvlb-tool-btn span { display: none; }
    .nvlb-counter { font-size: 13px; }
}
