/**
 * EIA Slider Micro-Engine v1.0.0 (CSS)
 * Estilos base acelerados por GPU y navegación responsiva
 */

:root {
  --eia-slider-perspective: 1200px;
  --eia-slider-accent: #38bdf8;
  --eia-slider-bg: transparent;
  --eia-slider-card-radius: 16px;
  --eia-spring-easing: cubic-bezier(0.19, 1, 0.22, 1);
  --eia-slider-transition: transform 0.65s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.45s ease, filter 0.45s ease;
}

/* Contenedor Principal */
.eia-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  background: var(--eia-slider-bg);
  box-sizing: border-box;
}

.eia-slider *, .eia-slider *::before, .eia-slider *::after {
  box-sizing: border-box;
}

/* Viewport 3D */
.eia-slider-viewport {
  position: relative;
  width: 100%;
  perspective: var(--eia-slider-perspective);
  perspective-origin: center center;
  overflow: hidden;
  padding: 40px 0 60px;
}

/* Ambient Glow Reflexivo */
.eia-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}

/* Pista de Diapositivas (Track) */
.eia-slider-track {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  min-height: 480px;
  z-index: 2;
}

/* Diapositiva Individual */
.eia-slide {
  position: absolute;
  width: 320px;
  max-width: 85vw;
  transform-style: preserve-3d;
  transition: var(--eia-slider-transition);
  cursor: grab;
  will-change: transform, opacity, filter;
}

.eia-slide:active {
  cursor: grabbing;
}

/* Tarjeta / Contenido de la Diapositiva con Spotlight Glow */
.eia-slide-card {
  position: relative;
  width: 100%;
  border-radius: var(--eia-slider-card-radius);
  overflow: hidden;
  background: #1e293b;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  aspect-ratio: 4 / 5;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.eia-slide-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--spotlight-x, -999px) var(--spotlight-y, -999px),
    rgba(56, 189, 248, 0.18),
    transparent 60%
  );
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.eia-slide-card:hover::before {
  opacity: 1;
}

.eia-slide.is-active .eia-slide-card {
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(56, 189, 248, 0.35);
}

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

.eia-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(15, 23, 42, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  color: #fff;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   PRESET: HERO KEN BURNS & STAGGERED
   -------------------------------------------------------------------------- */
.eia-slider--hero .eia-slider-viewport {
  padding: 0;
}

.eia-slider--hero .eia-slider-track {
  min-height: 80vh;
}

.eia-slider--hero .eia-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;
}

.eia-slider--hero .eia-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

.eia-slider--hero .eia-slide.is-active .eia-slide-img {
  animation: eiaKenBurns 12s ease-out alternate infinite;
}

@keyframes eiaKenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

/* --------------------------------------------------------------------------
   CONTROLES DE NAVEGACIÓN
   -------------------------------------------------------------------------- */
.eia-slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.eia-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.eia-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--eia-slider-accent);
  transform: scale(1.06);
}

.eia-slider-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eia-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
}

.eia-dot.is-active {
  width: 28px;
  background: var(--eia-slider-accent);
}

/* Contador (01 / 06) */
.eia-slider-counter {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
}

.eia-slider-counter .eia-current {
  color: #fff;
  font-size: 16px;
}

/* Barra de Progreso de Autoplay */
.eia-slider-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.eia-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--eia-slider-accent);
  will-change: width;
}

/* --------------------------------------------------------------------------
   HOTSPOTS INTERACTIVOS
   -------------------------------------------------------------------------- */
.eia-hotspot-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--eia-slider-card-radius, 16px);
}

.eia-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.eia-hotspot-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--eia-slider-accent, #38bdf8);
  border: 2.5px solid #fff;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: eiaHotspotPulse 2s infinite;
  display: block;
  padding: 0;
}

@keyframes eiaHotspotPulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.eia-hotspot-card {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 16px;
  border-radius: 10px;
  width: 220px;
  color: #fff;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  z-index: 30;
}

.eia-hotspot:hover .eia-hotspot-card,
.eia-hotspot:focus-within .eia-hotspot-card {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   COMPARADOR ANTES / DESPUÉS
   -------------------------------------------------------------------------- */
.eia-before-after {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--eia-slider-card-radius, 16px);
}

.eia-ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eia-ba-before {
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.eia-ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
}

.eia-ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 3px;
  background: #fff;
  pointer-events: none;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .eia-slide {
    width: 260px;
  }
  .eia-slider-viewport {
    padding: 20px 0 40px;
  }
  .eia-slider-track {
    min-height: 380px;
  }
  .eia-hotspot-card {
    width: 180px;
    padding: 10px 12px;
  }
}

