/* ============================================================
   STYLE_HERO.CSS - HERO / CARRUSEL PRINCIPAL
   ============================================================ */
   /* ============================================================
   FIX HERO BLACK SCREEN AL CARGAR
   ============================================================ */

/* FONDO BASE - evita parpadeo negro antes de que carguen las imágenes */
.hero-container,
.background-carousel {
  background-color: #000; /* seguridad por si no carga imagen */
  background-image: url('assets/img/reserva/home_carrusel1.png'); /* tu imagen fija */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Mostrar inmediatamente la primera imagen mientras el JS inicia */
.background-carousel .bg-slide:first-child {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2;
  transition: none !important; /* evita el fade negro inicial */
}

/* Evita que las transiciones oculten el primer frame */
.bg-slide {
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}


.hero-container {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  overflow: hidden;
  background: url('assets/img/reserva/home_carrusel1.png') center center / cover no-repeat;
}

/* Carrusel de fondo */
.background-carousel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: url('assets/img/reserva/home_carrusel1.png') center center / cover no-repeat; /* Fallback inicial */
}

/* Slides del carrusel */
.bg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s ease-in-out, visibility 1.5s ease-in-out;
}

/* Slide activo */
.bg-slide.active {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2;
}

/* Fallback si JS tarda */
.background-carousel .bg-slide:first-child {
  opacity: 1;
  visibility: visible;
}

/* Capa de overlay (texto y formulario) */
.overlay {
  position: relative;
  z-index: 3;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
}

.overlay h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .hero-container {
    height: 60vh;
  }
  .overlay h1 {
    font-size: 1.6rem;
  }
}
