/* ============================================================
   The Joker House — mini galería en las tarjetas del listado (25-nov-2026)
   Sustituye al rollover. La capa .jhg se monta SOBRE la portada (misma caja:
   sin CLS) solo cuando el producto tiene más de una foto.
   ============================================================ */

.jh-cat-card__img-wrap { position: relative; overflow: hidden; }

.jhg {
  position: absolute;
  inset: 0;
  z-index: 1;               /* por debajo de favoritos, etiquetas y distintivo BF */
}

/* Carril: deslizable con el dedo (scroll-snap nativo) y por botones en escritorio */
.jhg__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}
.jhg__track::-webkit-scrollbar { display: none; }

.jhg__slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #fff;
}
.jhg__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* todas llenan el hueco igual que la portada */
  opacity: 0;
  transition: opacity .28s cubic-bezier(.16, 1, .3, 1);
  -webkit-user-drag: none;
  user-select: none;
}
.jhg__img.is-ok { opacity: 1; }
/* Si la portada es cuadrada (cubos, kendamas…) la tienda la enseña entera:
   en ese producto todas las fotos se ven enteras, igual que la portada */
.jhg--sq .jhg__img { object-fit: contain; }

/* Flechas: discretas, solo con el ratón encima */
.jhg__btn {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #111;
  background: rgba(255, 255, 255, .94);
  border: 1.5px solid #111;
  border-radius: 50%;
  box-shadow: 0 4px 12px -4px rgba(17, 17, 17, .35);
  cursor: pointer;
  opacity: 0;
  transform: scale(.86);
  transition: opacity .2s ease, transform .25s cubic-bezier(.16, 1, .3, 1), background-color .15s ease, color .15s ease;
}
.jhg__btn--prev { left: 10px; }
.jhg__btn--next { right: 10px; }
.jhg__btn:hover { background: #111; color: #fff; }
.jhg__btn:active { transform: scale(.92); }
.jhg__btn:focus-visible { outline: 2px solid #FFD600; outline-offset: 2px; opacity: 1; }
.jh-cat-card__img-wrap:hover .jhg__btn { opacity: 1; transform: scale(1); }

/* Indicador: rayitas en una píldora blanca, abajo al centro */
.jhg__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, .9);
  border-radius: 999px;
  box-shadow: 0 2px 8px -3px rgba(17, 17, 17, .3);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.jhg__dots i {
  display: block;
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(17, 17, 17, .28);
  transition: width .25s cubic-bezier(.16, 1, .3, 1), background-color .2s ease;
}
.jhg__dots i.is-on { width: 16px; background: #111; }
.jh-cat-card__img-wrap:hover .jhg__dots { opacity: 1; }

/* Táctil: sin flechas; las rayitas siempre visibles para que se sepa que hay más fotos */
@media (hover: none) {
  .jhg__btn { display: none; }
  .jhg__dots { opacity: 1; bottom: 8px; padding: 4px 6px; }
}

/* Editor en vivo: mientras se arrastra una tarjeta, la galería no se mueve ni se ve */
.jhev-arrastrando .jhg__track,
.jhev-arrastrando.jh-cat-card .jhg__track { overflow: hidden; scroll-snap-type: none; }
.jhev-arrastrando .jhg__btn,
.jhev-arrastrando .jhg__dots { display: none; }

@media (prefers-reduced-motion: reduce) {
  .jhg__img, .jhg__btn, .jhg__dots, .jhg__dots i { transition: none; }
}

/* Favoritos, etiquetas y distintivo Black Friday siempre por encima de la galería */
.jhg-on > .jh-wish,
.jhg-on > .jh-cat-card__flags,
.jhg-on > .jh-cat-card__bf,
.jhg-on > .jh-cat-card__flag { z-index: 3; }
