/* Hero slider — Formación en Eneagrama (index-nuevo) */

.hero-eneagrama {
  position: relative;
  width: 100%;
  overflow-x: hidden;
  background-color: #1a0a2e;
  background-image: url("../img/slider/fondo.webp");
  background-size: cover;
  background-position: center;
  padding: 2.5rem 0 3rem;
}

@media (min-width: 768px) {
  .hero-eneagrama {
    min-height: 420px;
    padding: 3rem 0 3.5rem;
    display: flex;
    align-items: center;
    overflow-x: visible;
  }
}

.hero-eneagrama-inner {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
  box-sizing: border-box;
}

/* Evita desbordes típicos de columnas flex */
.hero-eneagrama-inner .hero-carousel-wrap {
  min-width: 0;
}

/*
 * Carrusel: centrado en móvil.
 * En PC: columna con offset-md-6 (mitad derecha). NO usar margin:auto en la columna
 * porque centra el bloque en toda la fila y anula el layout.
 */
.hero-carousel-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0 1rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .hero-carousel-wrap {
    padding: 1rem 0;
    justify-content: flex-end;
  }
}

.hero-carousel-glow {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .hero-carousel-glow {
    margin-left: auto;
    margin-right: 0;
  }
}

@media (min-width: 992px) {
  .hero-carousel-glow {
    max-width: 420px;
  }
}

/* Pantallas muy grandes (iMac 27", 4K, etc.): carrusel y hero más grandes */
@media (min-width: 1400px) {
  .hero-eneagrama {
    min-height: clamp(480px, 36vw, 700px);
  }
  .hero-carousel-glow {
    max-width: clamp(440px, 28vw, 620px);
  }
}

.hero-carousel-glow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 200, 220, 0.12) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Móvil: resplandor más contenido para no rozar el borde del viewport */
@media (max-width: 767px) {
  .hero-carousel-glow::before {
    width: 108%;
    height: 108%;
  }
}

.hero-carousel-glow .carousel {
  position: relative;
  z-index: 1;
}

.hero-carousel-glow .carousel-inner {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero-carousel-glow .carousel-item img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 24px;
}

/* Controles circulares blancos */
.hero-eneagrama .hero-carousel-btn {
  width: 44px;
  height: 44px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  opacity: 1;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Móvil: flechas cerca del borde de la imagen */
.hero-eneagrama .carousel-control-prev.hero-carousel-btn {
  left: 6px;
}

.hero-eneagrama .carousel-control-next.hero-carousel-btn {
  right: 6px;
}

/* Escritorio: flechas en el fondo morado, alejadas del cartel */
@media (min-width: 768px) {
  .hero-eneagrama .carousel-control-prev.hero-carousel-btn {
    left: -56px;
  }

  .hero-eneagrama .carousel-control-next.hero-carousel-btn {
    right: -56px;
  }
}

.hero-eneagrama .hero-carousel-btn .hero-carousel-arrow {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  line-height: 44px;
  color: #111;
}

.hero-eneagrama .hero-carousel-btn .carousel-control-prev-icon,
.hero-eneagrama .hero-carousel-btn .carousel-control-next-icon {
  display: none;
}

/* === TABLET (768–1024 px: iPad mini, iPad, iPad Pro, etc.) === */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Fondo: desplazado -50px a la izquierda, vertical centrada */
  .hero-eneagrama {
    background-position: -50px center;
  }

  /* El carrusel sigue en col-md-6 offset-md-6 (Bootstrap),
     pero lo alineamos a la izquierda dentro de su columna
     para que el texto del fondo quede visible a la izquierda */
  .hero-carousel-wrap {
    justify-content: flex-start;
    padding-left: 0.5rem;
  }

  /* A 768 px un col-6 mide ~369 px: reducimos el glow para que quepa */
  .hero-carousel-glow {
    max-width: 310px;
    margin-left: 0;
    margin-right: auto;
  }

  /* Flechas dentro del carrusel: a -56px se salen del viewport en tablet */
  .hero-eneagrama .carousel-control-prev.hero-carousel-btn {
    left: 6px;
  }
  .hero-eneagrama .carousel-control-next.hero-carousel-btn {
    right: 6px;
  }
}

/* Tablet 820px+: carrusel un poco más a la derecha */
@media (min-width: 820px) and (max-width: 1024px) {
  .hero-carousel-wrap {
    padding-left: 3rem;
  }
}

/* Tablet 992px+: carrusel más a la derecha aún (iPad Pro ~1014px) */
@media (min-width: 992px) and (max-width: 1024px) {
  .hero-carousel-wrap {
    padding-left: 6rem;
  }
}

/* Móvil: carrusel centrado en el layout */
@media (max-width: 767px) {
  .hero-eneagrama {
    background-position: center top;
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }

  .hero-eneagrama::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(26, 10, 46, 0.55) 0%,
      rgba(26, 10, 46, 0.35) 40%,
      rgba(26, 10, 46, 0.75) 100%
    );
    z-index: 0;
    pointer-events: none;
  }

  .hero-eneagrama-inner {
    position: relative;
    z-index: 1;
  }

  .hero-carousel-wrap {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-carousel-glow {
    max-width: min(100%, 520px);
    width: 100%;
  }
}
