/* ==========================================================================
   Visor de fotos de Nucho (assets/js/nucho-gallery.js)
   .ng   = galería embebida (página de producto, vista rápida)
   .nglb = pantalla completa con zoom por pellizco / doble toque / rueda
   ========================================================================== */

.ng {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
}

.ng-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 40%, #1a1a1a, #000 75%);
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.ng-track {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ng-track.dragging {
    transition: none;
}

.ng-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}

.ng-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease-out;
    pointer-events: none;
    filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.7));
}

/* Zoom que sigue al mouse (solo compus) */
.ng-slide.zoomed img {
    transform: scale(2.2);
    transition: transform 0.12s ease-out;
}

/* Brillo de carga mientras baja la foto */
.ng-slide.loading {
    background: linear-gradient(100deg, #0d0d0d 30%, #1c1c1c 50%, #0d0d0d 70%) 0 0 / 300% 100%;
    animation: ngShimmer 1.2s infinite linear;
}

@keyframes ngShimmer {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}

.ng-nav {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s, background 0.25s;
    z-index: 2;
}

.ng-prev { left: 14px; transform: translateX(-8px); }
.ng-next { right: 14px; transform: translateX(8px); }

.ng-stage:hover .ng-nav,
.ng-nav:focus-visible {
    opacity: 1;
    transform: none;
}

.ng-nav:hover {
    background: var(--primary, #c00205);
}

.ng-count,
.ng-expand {
    position: absolute;
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    color: #ddd;
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
}

.ng-count {
    left: 12px;
    bottom: 12px;
    padding: 5px 11px;
    pointer-events: none;
}

.ng-expand {
    right: 12px;
    bottom: 12px;
    border: 0;
    padding: 7px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.ng-expand:hover {
    background: var(--primary, #c00205);
    color: #fff;
}

.ng.single .ng-nav,
.ng.single .ng-count,
.ng.single .ng-dots,
.ng.single .ng-thumbs {
    display: none;
}

.ng-dots {
    display: none;
    justify-content: center;
    gap: 6px;
}

.ng-dots span {
    width: 7px;
    height: 7px;
    border-radius: 4px;
    background: #444;
    transition: width 0.3s, background 0.3s;
}

.ng-dots span.on {
    width: 22px;
    background: var(--accent, #EBF000);
}

.ng-thumbs {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ng-thumbs::-webkit-scrollbar {
    display: none;
}

.ng-thumb {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 0;
    padding: 0;
    background: #111;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.25s, transform 0.25s;
}

.ng-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ng-thumb:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.ng-thumb.on {
    opacity: 1;
}

/* Barrita que se desliza debajo de la miniatura activa */
.ng-thumb-ind {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 68px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary, #c00205), var(--accent, #EBF000));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

@media (hover: none) {
    .ng-nav { display: none; }
    .ng-dots { display: flex; }
    .ng-slide { cursor: default; }
}

/* ===== Pantalla completa ===== */
.nglb {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.96);
    display: none;
    flex-direction: column;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.nglb.open {
    display: flex;
}

.nglb-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    color: #bbb;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 3;
}

.nglb-tools {
    display: flex;
    gap: 6px;
}

.nglb-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #2a2a2a;
    background: rgba(25, 25, 25, 0.8);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.nglb-btn:hover {
    background: var(--primary, #c00205);
}

.nglb-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.nglb-stage.zoomed {
    cursor: move;
}

.nglb-img {
    max-width: 92vw;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    pointer-events: none;
}

.nglb-img.anim {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nglb-side {
    position: absolute;
    top: 50%;
    margin-top: -26px;
    width: 52px;
    height: 52px;
    z-index: 3;
}

.nglb-prev { left: 16px; }
.nglb-next { right: 16px; }

.nglb-thumbs {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    z-index: 3;
}

.nglb-thumbs button {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    background: #111;
    opacity: 0.5;
    cursor: pointer;
    flex-shrink: 0;
}

.nglb-thumbs button.on {
    opacity: 1;
    border-color: var(--accent, #EBF000);
}

.nglb-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nglb-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: #777;
    font-size: 11px;
    letter-spacing: 1px;
    pointer-events: none;
    white-space: nowrap;
}

.nglb.single .nglb-side,
.nglb.single .nglb-thumbs {
    display: none;
}

@media (max-width: 600px) {
    .nglb-side { display: none; }
}
