/**
 * PUBLIKATE 2027 - HERO SLIDER CSS
 * Ancho Completo Ajustado al Viewport (Sin Scrollbar Horizontal)
 * Gap Inferior: 20px (o 0px si hay imagen de fondo)
 * Animaciones Aceleradas por GPU y Soporte Táctil
 */

/* Prevención global de scrollbar horizontal */
html, body {
  overflow-x: clip;
  max-width: 100%;
}

@supports not (overflow-x: clip) {
  html, body {
    overflow-x: hidden;
  }
}

/* Sección principal del slider: 100% de ancho útil de pantalla sin desbordamiento */
.hero-slider-section {
  width: 100%;
  max-width: 100%;
  position: relative;
  left: 0;
  right: 0;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 0 !important; /* Gap inferior 0px solicitado */
  overflow: hidden;
  background: #070a14;
  box-sizing: border-box;
}

/* Contenedor con aspect ratio proporcional 100% responsive (CLS = 0, sin cortes) */
.hero-slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1983 / 793;
  overflow: hidden;
  background: #070a14;
  box-sizing: border-box;
}

.hero-slider-track {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Diapositivas individuales con transición fluida cross-fade pura sin deformación */
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
  will-change: opacity;
  z-index: 1;
  overflow: hidden;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-slide-link {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  overflow: hidden;
}

.hero-slide-link:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: -2px;
}

/* Imagen 100% responsiva: siempre conserva sus proporciones íntegras */
.hero-slide-img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #070a14;
}

/* Flechas de navegación modernas Midnight Glassmorphism */
.hero-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.hero-slider-arrow:hover {
  background: rgba(220, 38, 38, 0.9);
  border-color: #ef4444;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.65);
}

.hero-slider-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.hero-slider-arrow.prev {
  left: 2rem;
}

.hero-slider-arrow.next {
  right: 2rem;
}

/* Dots e Indicador de Progreso Dinámico de 7 Segundos */
.hero-slider-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 10;
  background: rgba(7, 10, 20, 0.7);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-slider-dot {
  position: relative;
  width: 42px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: visible;
  transition: all 0.3s ease;
}

/* Área táctil extendida para accesibilidad WCAG / Lighthouse (mínimo 48x48px) */
.hero-slider-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 48px;
  min-height: 48px;
}

.hero-slider-dot.active {
  background: rgba(255, 255, 255, 0.35);
  width: 56px;
}

.hero-dot-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* =========================================================================
   RESPONSIVIDAD MÓVIL (Smartphones y Tablets)
   ========================================================================= */
@media (max-width: 768px) {
  .hero-slider-arrow {
    width: 38px;
    height: 38px;
  }
  .hero-slider-arrow.prev {
    left: 0.5rem;
  }
  .hero-slider-arrow.next {
    right: 0.5rem;
  }

  .hero-slider-dots {
    bottom: 0.6rem;
    padding: 0.25rem 0.6rem;
    gap: 0.45rem;
  }

  .hero-slider-dot {
    width: 26px;
    height: 4px;
    border-radius: 2px;
  }

  .hero-slider-dot.active {
    width: 36px;
  }
}

/* En pantallas móviles (< 640px) ocultamos las flechas para que no tapen el texto
   y optimizamos los dots para máxima visibilidad sin estorbar la gráfica */
@media (max-width: 640px) {
  .hero-slider-arrow {
    display: none !important;
  }

  .hero-slider-dots {
    bottom: 0.4rem;
    padding: 0.2rem 0.5rem;
    gap: 0.35rem;
    background: rgba(7, 10, 20, 0.8);
  }

  .hero-slider-dot {
    width: 20px;
    height: 3px;
    border-radius: 2px;
  }

  .hero-slider-dot.active {
    width: 28px;
  }
}

/* Utilidad accesible */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
