/* ============================================================
   REPLIKA — Baraja de ejemplos de Imagen Premium
   Abanico 3D de tarjetas: la activa al frente y recta, las demás
   giradas, hundidas y en escala menor. La geometría (posición,
   rotación, profundidad) la calcula js/img-stack.js y llega como
   transform inline; aquí viven el aspecto y las transiciones.
   ============================================================ */

.ivs {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
}
.ivs[hidden] { display: none; }

/* ---- Escenario ---- */
.ivs-stage {
  position: relative;
  width: 100%;
  outline: none;
  /* el arrastre horizontal es nuestro; el scroll vertical sigue siendo del navegador */
  touch-action: pan-y;
}

/* Halo superior y sombra de contacto: dan volumen sin depender de las tarjetas */
.ivs-wash,
.ivs-shadow {
  position: absolute; left: 50%;
  border-radius: 999px;
  pointer-events: none;
  transform: translateX(-50%);
}
.ivs-wash {
  top: 6%; width: 62%; height: 46%;
  background: color-mix(in srgb, var(--ink-000) 6%, transparent);
  filter: blur(60px);
}
.ivs-shadow {
  bottom: 2%; width: 74%; height: 24%;
  background: rgba(0, 0, 0, 0.55);
  filter: blur(46px);
}

.ivs-cards {
  position: absolute; inset: 0;
  perspective: 1100px;
}

/* ---- Tarjeta ---- */
.ivs-card {
  position: absolute; bottom: 0; left: 50%;
  margin-left: calc(var(--ivs-w, 420px) / -2);
  width: var(--ivs-w, 420px);
  height: var(--ivs-h, 258px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 3px solid color-mix(in srgb, var(--ink-000) 8%, transparent);
  box-shadow: 0 26px 60px -20px rgba(0, 0, 0, 0.8);
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition:
    transform 0.55s var(--ease-out-cine),
    opacity 0.38s linear;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ivs-card.is-active { cursor: grab; }
/* mientras se arrastra, la tarjeta sigue al dedo sin suavizado */
.ivs.is-dragging .ivs-card.is-active { cursor: grabbing; transition: opacity 0.38s linear; }
/* las que quedan fuera del abanico no reciben clics */
.ivs-card.is-out { pointer-events: none; }

.ivs-card-in { position: relative; width: 100%; height: 100%; }

.ivs-card-pic {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.ivs-card-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0) 56%);
  pointer-events: none;
}

.ivs-card-title {
  position: absolute; left: 18px; right: 18px; bottom: 15px;
  z-index: 2;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Velo sobre las inactivas: la activa es la única a plena luz */
.ivs-card::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.45);
  transition: opacity 0.45s var(--ease-out-cine);
  pointer-events: none;
}
.ivs-card.is-active::after { opacity: 0; }

/* Huecos aún sin imagen: negro liso hasta que lleguen las piezas */
.ivs-card.is-blank { background: #000; }
.ivs-card.is-blank::after { background: rgba(0, 0, 0, 0.3); }

/* ---- Flechas + puntos ---- */
.ivs-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
}

.ivs-arrow {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--dur-fast, 0.16s) var(--ease-out-cine),
    border-color var(--dur-fast, 0.16s) var(--ease-out-cine),
    color var(--dur-fast, 0.16s) var(--ease-out-cine),
    transform var(--dur-fast, 0.16s) var(--ease-out-cine);
}
.ivs-arrow:hover { color: var(--text); border-color: var(--border-strong); }
.ivs-arrow:active { transform: scale(0.93); }
.ivs-arrow svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.ivs-dots { display: flex; align-items: center; gap: 9px; }
.ivs-dot {
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 24%, transparent);
  cursor: pointer;
  transition:
    background var(--dur-fast, 0.16s) var(--ease-out-cine),
    transform var(--dur-fast, 0.16s) var(--ease-out-cine);
}
.ivs-dot:hover { background: color-mix(in srgb, var(--text) 48%, transparent); }
.ivs-dot.is-active { background: var(--text); transform: scale(1.28); }

/* ---- Móvil ---- */
@media (max-width: 640px) {
  .ivs { gap: 16px; }
  .ivs-nav { gap: 14px; }
  .ivs-arrow { width: 36px; height: 36px; }
  .ivs-arrow svg { width: 16px; height: 16px; }
  .ivs-dots { gap: 7px; }
  .ivs-dot { width: 6px; height: 6px; }
  .ivs-card { border-width: 2px; }
  .ivs-card-title { font-size: 0.84rem; left: 14px; right: 14px; bottom: 12px; }
}

/* ---- Modo ligero y movimiento reducido ---- */
html.perf-lite .ivs-wash,
html.perf-lite .ivs-shadow { display: none; }
html.perf-lite .ivs-card { box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.8); }

@media (prefers-reduced-motion: reduce) {
  .ivs-card,
  .ivs-card::after { transition: none; }
}
