/* ==========================================================
   HERO GALVAMIX
   Orden: 1 Contenedor · 2 Fondos · 3 Contenido y CTA ·
          4 Navegación · 5 Barra de progreso · 6 Animaciones ·
          7 Pausa · 8 Responsive · 9 Movimiento reducido
   ========================================================== */

/* ---------- 1. Contenedor ---------- */

.gx-hero {
  position: relative;
  overflow: hidden;
  --gx-hero-width: 100%;
  width: var(--gx-hero-width);
  min-height: 80vh !important;
  height: 75vh;
  z-index: 10;
}

.gx-hero__widget {
  position: static !important;
}

/* ---------- 2. Capas de fondo (deslizan de derecha a izquierda) ---------- */

.gx-hero__bgs {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0 !important;
  overflow: hidden;
}

/* Sin clase: esperando fuera de pantalla, a la derecha */
.gx-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: translateX(100%);
  will-change: transform;
}

/* Visible */
.gx-hero__bg.is-active {
  transform: translateX(0);
}

/* Ya salió, fuera de pantalla a la izquierda */
.gx-hero__bg.is-prev {
  transform: translateX(-100%);
}

/* Lo usa el JS para recolocar una capa sin animarla */
.gx-hero__bg.no-anim {
  transition: none;
}

/* Overlay: más oscuro a la izquierda, donde va el texto */
.gx-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.4) 55%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

/* ---------- 3. Contenido y CTA ---------- */

.gx-hero__content {
  position: relative;
  z-index: 2;
  animation: gx-enter 0.8s ease 0.1s backwards; /* entrada inicial */
}

/* Estado intermedio mientras cambia el texto (lo pone el JS) */
.gx-hero__content.is-changing {
  opacity: 0;
  transform: translateY(16px);
}

/* ---------- 4. Navegación (puntos, botón de pausa y flechas de navegación) ---------- */

.gx-hero__nav {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  position: absolute !important;
  width: 100%;
  z-index: 2;
  border: 0;
  box-sizing: border-box;
  bottom: -95%;
  left: 0;
  animation: gx-enter 0.8s ease 0.4s backwards; /* entrada inicial */
}

.gx-hero__tab {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

/* Área táctil más grande sin cambiar cómo se ve el punto */
.gx-hero__tab::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.gx-hero__tab:hover {
  background: rgba(255, 255, 255, 0.6);
}

.gx-hero__tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  background: transparent;
}

.gx-hero__tab:focus {
  background: transparent;
}

.gx-hero__tab.is-active {
  background: #fff;
  transform: scale(1.25);
}

.gx-hero__pause {
  position: absolute;
  right: 1.9rem;
  bottom: 1.5rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: none;
  cursor: pointer;
}

.gx-hero__pause:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gx-hero__pause:focus {
  background: transparent;
}

.gx-hero__pause:focus:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gx-hero__icon {
  width: 20px;
  height: 20px;
  fill: #fff;
  pointer-events: none;
}

/* Por defecto se ve el ícono de pausa */
.gx-hero__icon--play {
  display: none;
  margin-left: 2px; /* compensa la forma del triángulo */
}

/* Al pausar, se cambia por el de reanudar */
.gx-hero__pause[aria-pressed="true"] .gx-hero__icon--pause {
  display: none;
}

.gx-hero__pause[aria-pressed="true"] .gx-hero__icon--play {
  display: block;
}

.gx-hero__pause:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.gx-hero__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.gx-hero__arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gx-hero__arrow:focus {
  background: transparent;
}

.gx-hero__arrow:focus:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gx-hero__arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.gx-hero__arrow--prev {
  left: 1.5rem;
}
.gx-hero__arrow--next {
  right: 1.5rem;
}

/* El ícono es un chevron dibujado con bordes */
.gx-hero__arrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.gx-hero__arrow--next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

.gx-hero__arrow--prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

/* ---------- 5. Barra de progreso (la crea el JS) ---------- */

.gx-hero__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.gx-hero__progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}

.gx-hero__progress-bar.is-running {
  animation: gx-progress linear forwards;
}

/* ---------- 6. Animaciones ---------- */

@keyframes gx-progress {
  to {
    transform: scaleX(1);
  }
}

@keyframes gx-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* ---------- 7. Pausa del autoplay ---------- */

/* Con el botón de pausa */
.gx-hero.is-paused .gx-hero__progress-bar {
  animation-play-state: paused;
}

/* Al pasar el cursor (solo en dispositivos con ratón) */
@media (hover: hover) {
  .gx-hero:hover .gx-hero__progress-bar {
    animation-play-state: paused;
  }
}

/* Al navegar con el teclado */
.gx-hero:has(:focus-visible) .gx-hero__progress-bar {
  animation-play-state: paused;
}

/* ---------- 8. Responsive ---------- */

/* Tablet */
@media (max-width: 1024px) {
  .gx-hero__content {
    padding-left: 5vw;
    padding-right: 5vw;
  }

  .gx-hero__desc {
    max-width: 34rem;
  }
}

/* Móvil */
@media (max-width: 767px) {
  .gx-hero {
    min-height: 100vh !important;
    min-height: 100svh !important;
    height: 100vh;
    height: 100svh;
  }

  .gx-hero__content {
    padding: 0 1.25rem 5rem;
  }

  .gx-hero__title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    line-height: 1.15;
  }

  .gx-hero__bg {
    background-position: 70% center;
  }

  .hero-container-btn {
    flex-wrap: wrap;
  }

  .gx-hero__nav {
    gap: 1rem;
    padding: 0 1.25rem;
  }

  .gx-hero__arrow {
    display: none;
  }
}

/* ---------- 9. Movimiento reducido ----------
   Transiciones con !important para ganarle a los estilos
   de Elementor. Las imágenes cambian con fundido en lugar
   de deslizar. */

@media (prefers-reduced-motion: reduce) {
  .gx-hero__bg,
  .gx-hero__bg.is-active,
  .gx-hero__bg.is-prev {
    transform: none;
  }

  .gx-hero__bg {
    opacity: 0;
    transition:
      opacity 0.4s ease,
      transform 0.6s ease !important;
  }

  .gx-hero__bg.is-active {
    opacity: 1;
  }

  .gx-hero__content,
  .gx-hero__nav {
    animation: none;
  }
  .hero-btn,
  .gx-hero__content,
  .gx-hero__tab,
  .gx-hero__arrow,
  .gx-hero__pause {
    transition: all 0.3s ease !important;
  }
}
