/* ==========================================================================
   pgal — galería de fotos en las cards de producto
   Escritorio: al pasar el mouse muestra la 2ª foto; con 3+ fotos, flechas y puntos.
   Celular/táctil: galería deslizable con el dedo y puntos.
   ========================================================================== */
.pgal { position: relative; width: 100%; height: 100%; overflow: hidden; }
.pgal-track {
    display: flex; width: 100%; height: 100%;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.pgal-track::-webkit-scrollbar { display: none; }
.pgal-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: block; }

.pgal-dots {
    position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3; display: flex; justify-content: center; gap: 5px;
    pointer-events: none; transition: opacity .25s;
}
.pgal-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, .28); box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); transition: width .25s, background .25s; }
.pgal-dots i.on { width: 16px; border-radius: 3px; background: var(--pgal-accent, #111); }

.pgal-btn {
    position: absolute; top: 50%; z-index: 4; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%;
    display: none; align-items: center; justify-content: center; cursor: pointer; user-select: none;
    background: rgba(255, 255, 255, .92); color: #111; font: 700 20px/1 system-ui, sans-serif;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .2s, transform .2s;
}
.pgal-btn:hover { transform: scale(1.08); }
.pgal-btn.prev { left: 10px; }
.pgal-btn.next { right: 10px; }

/* Escritorio (mouse, clase is-mouse puesta por pgal.js): la tira se mueve con transform, sin scroll */
.pgal.is-mouse .pgal-track { overflow: visible; scroll-snap-type: none; transition: transform .45s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
@media (hover: hover) and (pointer: fine) {
    .pgal .pgal-dots { opacity: 0; }
    .pgal:hover .pgal-dots { opacity: 1; }
    .pgal[data-n="2"] .pgal-dots { display: none; }          /* con 2 fotos alcanza con el cambio al pasar el mouse */
    .pgal.has-nav .pgal-btn { display: flex; }
    .pgal.has-nav:hover .pgal-btn { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .pgal-track { scroll-behavior: auto; } .pgal.is-mouse .pgal-track { transition: none; } }
