/* ===============================
   Estilos Base para el Hero Carousel
   =============================== */
#heroCarousel {
    width: 100%;
    height: 85vh;
    position: relative;
    overflow: hidden;
}

.carousel-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease-in-out;
}

.carousel-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    position: relative;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-item.active {
    position: relative;
    opacity: 1;
}

.scrolled .carousel-item.active {
    transform: scale(1.05);
    /* Hace un ligero zoom */
    transition: transform 0.5s ease-in-out;
}

.carousel-item.active .carousel-content {
    opacity: 1;
}

.carousel-text {
    flex: 1;
    text-align: center;
    padding-left: 5%;
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.carousel-item.active .carousel-text {
    opacity: 1;
    transform: translateY(0);
}

.carousel-text h1 {
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 300;
    border-top: 1px solid #000 !important;
    border-bottom: 1px solid #000 !important;
    padding: 5px 10px;
}

.carousel-text p {
    font-size: 18px;
    color: #333;
    line-height: 1.6;
}

.carousel-img {
    flex: 1;
    max-width: 50%;
    height: 500px;
    object-fit: contain;
    transition: transform 1s ease-in-out;
}

.carousel-item.active .carousel-img {
    transform: scale(1.02);
}

/* ===============================
   Controles y Elementos Adicionales
   =============================== */
.carousel-control-prev,
.carousel-control-next {
    width: 45px;
    height: 45px;
    background-color: rgba(200, 200, 200, 0.8);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    color: white;
    transform: translateY(-50%);
    transition: background 0.3s ease-in-out;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 25px;
    height: 25px;
    filter: invert(1) brightness(0) saturate(100%) hue-rotate(180deg);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: #40a5dd;
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    filter: invert(1) brightness(2);
}

.carousel-indicators button {
    background-color: rgb(161, 164, 167) !important;
    opacity: 0.5;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.carousel-indicators .active {
    background-color: #40a5dd !important;
    opacity: 1;
    transform: scale(1.2);
}

.carousel-indicators button:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.btn-custom {
    background: #303c7a !important;
    border: none !important;
    color: white !important;
    padding: 7px 15px !important;
    font-size: 16px !important;
    font-weight: 300 !important;
    text-transform: uppercase !important;
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out !important;
}

.btn-custom:hover {
    background: #40a5dd;
    color: white;
    transform: scale(1.05);
}

/* ===============================
   Media Queries para Responsividad
   =============================== */

/* Tablets y Laptops (max-width: 992px) */
@media (max-width: 992px) {
    #heroCarousel {
        height: 85vh;
        /* Ligeramente menor altura */
    }

    .carousel-content {
        flex-direction: column;
        text-align: center;
    }

    .carousel-text {
        text-align: center !important;
        padding: 10px;
    }

    .carousel-img {
        max-width: 100%;
        height: 300px;
    }
}

/* Móviles (max-width: 768px) */
@media (max-width: 768px) {
    #heroCarousel {
        height: 80vh;
        /* Reducir la altura en móviles */
    }

    .carousel-content {
        flex-direction: column;
        justify-content: center;
    }

    .carousel-text,
    .carousel-img {
        max-width: 100%;
        flex: unset;
    }

    .carousel-img {
        width: 100%;
        height: auto;
    }

    .carousel-text h1 {
        font-size: 1.5rem;
    }

    .carousel-text p {
        font-size: 1rem;
    }
}

/* Móviles Pequeños (max-width: 576px) */
@media (max-width: 576px) {
    #heroCarousel {
        height: 75vh;
        /* Altura más reducida para pantallas muy pequeñas */
    }

    .carousel-text h1 {
        font-size: 1.25rem;
    }

    .carousel-text p {
        font-size: 0.9rem;
    }
}

/* =============================== */
/*  ANIMACIONES*/
/* =============================== */

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
        filter: blur(8px);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* ✨ Título con Efecto de Deslizamiento y Fade */
@keyframes slideInDown {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🎭 Subtítulo con Movimiento Sutil desde la Izquierda */
@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 🎬 Botón con Efecto de Aparición y Expansión */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


/* Ocultar antes de animación */
.carousel-img,
.carousel-text h1,
.carousel-text p,
.carousel-text .btn-custom {
    opacity: 0;
}

/* Activa la animación cuando el slide está activo */
.carousel-item.active .carousel-img.animate {
    animation: zoomIn 1.1s ease-out forwards;
}

.carousel-item.active .carousel-text h1.animate {
    animation: slideInDown 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.carousel-item.active .carousel-text p.animate {
    animation: fadeInLeft 1.3s ease-in-out 0.5s forwards;
}

.carousel-item.active .carousel-text .btn-custom.animate {
    animation: popIn 1.3s cubic-bezier(0.25, 1, 0.5, 1) 0.8s forwards;
}