/* ============================================================
   Product Gallery — In-page auto-rotate + zoom, dark futuristic
   ============================================================ */

.nf-gallery {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 100px;
}

/* Empty state */
.nf-gallery--empty {
    aspect-ratio: 1;
    border-radius: 20px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border: 1px solid rgba(212, 175, 55, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(212, 175, 55, 0.3);
}

.nf-gallery--empty .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
}

.nf-gallery--empty p {
    font-family: "Orbitron", sans-serif;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0;
}

/* ── Main image wrapper ── */
.nf-gallery__main-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #060606 0%, #181818 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    aspect-ratio: 1 / 1;
}

/* HUD scan line */
.nf-gallery__main-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 175, 55, 0.4),
        transparent
    );
    z-index: 5;
    animation: nf-gal-scan 6s 2s infinite linear;
    opacity: 0;
    pointer-events: none;
}

@keyframes nf-gal-scan {
    0% {
        top: 0%;
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    95% {
        opacity: 0.7;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Inner — clips zoom/transform */
.nf-gallery__main-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.nf-gallery__main-inner.is-zoomed {
    cursor: grab;
}

.nf-gallery__main-inner.is-zoomed:active {
    cursor: grabbing;
}

/* The actual image */
.nf-gallery__main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition:
        transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        opacity 0.25s ease;
    transform-origin: center center;
    user-select: none;
    pointer-events: none;
}

.nf-gallery__main-img.is-switching {
    opacity: 0;
    transform: scale(0.97);
}

/* ── Zoom controls ── */
.nf-gallery__zoom-controls {
    position: absolute;
    bottom: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.nf-gallery__zoom-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(0, 0, 0, 0.72);
    color: rgba(212, 175, 55, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 0;
}

.nf-gallery__zoom-btn:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.6);
    color: #d4af37;
}

/* ── Image counter badge ── */
.nf-gallery__counter {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: "Orbitron", monospace;
    font-size: 10px;
    font-weight: 700;
    color: #d4af37;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.18);
    padding: 5px 10px;
    border-radius: 6px;
    letter-spacing: 0.1em;
    z-index: 5;
    pointer-events: none;
}

.nf-gallery__counter-sep {
    opacity: 0.45;
    margin: 0 1px;
}

/* ── Thumbnails row ── */
.nf-gallery__thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.25) transparent;
}

.nf-gallery__thumbs::-webkit-scrollbar {
    height: 3px;
}
.nf-gallery__thumbs::-webkit-scrollbar-track {
    background: transparent;
}
.nf-gallery__thumbs::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.25);
    border-radius: 2px;
}

.nf-gallery__thumb {
    flex-shrink: 0;
    width: 76px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: #111;
    cursor: pointer;
    transition:
        border-color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
    position: relative;
}

.nf-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.nf-gallery__thumb:hover img,
.nf-gallery__thumb.is-active img {
    opacity: 1;
}

.nf-gallery__thumb:hover {
    border-color: rgba(212, 175, 55, 0.45);
    transform: translateY(-2px);
}

.nf-gallery__thumb.is-active {
    border-color: #d4af37;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
    transform: translateY(-3px);
}

/* Auto-rotate progress line on active thumb */
.nf-gallery__thumb.is-active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #d4af37;
    border-radius: 0 0 2px 2px;
    animation: nf-thumb-prog var(--nf-gal-interval, 3500ms) linear;
}

@keyframes nf-thumb-prog {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .nf-gallery {
        position: static;
    }
}

@media (max-width: 640px) {
    .nf-gallery__thumb {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }
}
