/* ============================================================
   product-card-carousel.css
   Per-card autoplay image carousel (same behaviour as the
   reference LaptopCard component: autoplay, hover arrows on
   desktop, dot indicators, per-card randomized speed/direction).

   Sizing intentionally reuses the existing .j-product-card__img-wrap
   box (aspect-ratio 1/1, same radius/shadow) — nothing about the
   card's overall size or grid arrangement changes.
   ============================================================ */

/* The image wrap already has position:relative + aspect-ratio 1/1
   from jumia-mobile.css — .j-carousel just adds the moving parts. */
.j-product-card__img-wrap.j-carousel {
  overflow: hidden;
}

.j-carousel__viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.j-carousel__track {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
  transition: transform 0.45s ease;
}

.j-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  display: block;
  text-decoration: none;
}

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

/* Prev / Next arrows — hidden on touch/mobile, shown on hover (desktop) */
.j-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  box-shadow: var(--j-shadow-sm);
  color: #222;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
  padding: 0;
}
.j-carousel__arrow svg { width: 16px; height: 16px; }
.j-carousel__arrow--prev { left: 8px; }
.j-carousel__arrow--next { right: 8px; }
.j-carousel__arrow:hover { background: #fff; }

@media (min-width: 768px) {
  .j-carousel__arrow { display: flex; }
  .j-product-card:hover .j-carousel__arrow { opacity: 1; }
}

/* Dot indicators */
.j-carousel__dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 999px;
}

.j-carousel__dot {
  height: 5px;
  width: 5px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: width 0.25s ease, background 0.18s ease;
}
.j-carousel__dot:hover { background: rgba(255, 255, 255, 0.85); }
.j-carousel__dot.is-active {
  width: 14px;
  background: var(--j-orange);
  box-shadow: none;
}
