/* ============================================
   CAROUSEL ENMARCADO - Estilos Personalizados
   ============================================ */

/* Contenedor principal del carousel con fondo BLANCO */
.carousel-wrapper {
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Marco del carousel sin borde ni sombra - FONDO BLANCO */
.carousel-frame {
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: #fff;
    position: relative;
    border: none;
}

/* ============================================
   ANIMACIONES DE FADE PERSONALIZADAS
   ============================================ */

/* Fade para el carousel completo - optimizado para evitar doble efecto */
.carousel-fade .carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: block;
}

.carousel-fade .carousel-item.active {
    position: relative;
    opacity: 1;
    z-index: 1;
}

/* Prevenir transiciones en elementos que no están activos */
.carousel-fade .carousel-item:not(.active) .carousel-text-section,
.carousel-fade .carousel-item:not(.active) .carousel-image-section,
.carousel-fade .carousel-item:not(.active) .carousel-content * {
    transition: none !important;
    opacity: 0;
}

/* Animación de fade para la sección de texto - solo cuando está activo */
.carousel-item.active .carousel-text-section {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.8s ease-out 0.2s forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animación de fade para la sección de imagen - solo cuando está activo */
.carousel-item.active .carousel-image-section {
    opacity: 0;
    transform: translateX(30px);
    animation: slideInRight 0.8s ease-out 0.4s forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animación específica para elementos del contenido */
.carousel-item.active .carousel-content h1,
.carousel-item.active .carousel-content h4,
.carousel-item.active .carousel-content h6 {
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDown 0.6s ease-out 0.6s forwards;
}

@keyframes fadeInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-item.active .carousel-content p {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out 0.8s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-item.active .carousel-content .suite-logo {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.6s ease-out 0.7s forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carousel-item.active .carousel-content .btn {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out 1s forwards;
}

/* ============================================
   LAYOUT DE DOS COLUMNAS
   ============================================ */

/* Layout de dos columnas: texto a la izquierda, imagen a la derecha */
.carousel-split-layout {
    display: flex;
    align-items: stretch;
    min-height: 500px;
    background: #ffffff;
    margin: 0 !important;
    padding: 0 !important;
}

/* Sección de texto (izquierda) - 55% del ancho - FONDO BLANCO */
.carousel-text-section {
    flex: 0 0 55%;
    display: flex;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff;
}

/* Sección de imagen (derecha) - 45% del ancho - FONDO BLANCO */
.carousel-image-section {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    padding: 20px;
    margin: 0 !important;
}

/* Imagen del carousel */
.carousel-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Contenido del texto */
.bg-black-70 {
    background-color: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(10px);
}

.carousel-content {
    text-align: center;
    width: 100%;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.carousel-content.bg-white {
    background-color: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.suite-logo {
    max-width: 200px;
    height: auto;
    display: inline-block;
    margin: 10px auto 10px auto;
}

/* ============================================
   CONTROLES E INDICADORES
   ============================================ */

/* Indicadores personalizados */
.carousel-frame .carousel-indicators {
    bottom: 20px;
    z-index: 10;
}

.carousel-frame .carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(0, 128, 0, 0.5);
    border: 2px solid #fff;
    transition: all 0.3s ease;
}

.carousel-frame .carousel-indicators .active {
    background-color: #008000;
    width: 40px;
    border-radius: 6px;
}

/* Controles del carousel */
.carousel-frame .carousel-control-prev,
.carousel-frame .carousel-control-next {
    width: 60px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 128, 0, 0.7);
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-frame .carousel-control-prev {
    left: 20px;
}

.carousel-frame .carousel-control-next {
    right: 20px;
}

.carousel-frame .carousel-control-prev:hover,
.carousel-frame .carousel-control-next:hover {
    opacity: 1;
    background: rgba(0, 128, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.carousel-frame .carousel-control-prev-icon,
.carousel-frame .carousel-control-next-icon {
    width: 30px;
    height: 30px;
}

/* Botón Read More personalizado */
.carousel-content .btn-success {
    background: linear-gradient(135deg, #008000 0%, #005500 100%) !important;
    border: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.carousel-content .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 128, 0, 0.4);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets y pantallas medianas */
@media (max-width: 992px) {
    .carousel-split-layout {
        min-height: 400px;
    }

    .carousel-text-section {
        flex: 0 0 50%;
        padding: 0;
    }

    .carousel-image-section {
        flex: 0 0 50%;
        padding: 15px;
    }

    .carousel-content h1 {
        font-size: 2.5rem !important;
    }

    .suite-logo {
        max-width: 200px;
    }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
    .carousel-split-layout {
        flex-direction: column;
        min-height: auto;
        align-items: center;
    }

    .carousel-text-section {
        flex: 0 0 auto;
        padding: 0;
        order: 2;
        width: 100%;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .carousel-text-section .carousel-content {
        max-width: 100%;
        text-align: center;
        padding: 0 10px 30px;
    }

    .carousel-image-section {
        flex: 0 0 auto;
        min-height: 300px;
        padding: 20px;
        order: 1;
        width: 100%;
        justify-content: center;
    }

    /* Excepción para el slide de Countdown: Texto arriba (1), Video abajo (2) */
    .countdown-slide .carousel-text-section {
        order: 1 !important;
    }

    .countdown-slide .carousel-image-section {
        order: 2 !important;
    }

    /* Simplificar animaciones para móvil - evitar doble efecto */
    .carousel-item.active .carousel-text-section {
        animation: fadeInSimple 0.6s ease-out forwards;
    }

    .carousel-item.active .carousel-image-section {
        animation: fadeInSimple 0.6s ease-out 0.2s forwards;
    }

    @keyframes fadeInSimple {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    .carousel-item.active .carousel-content h1,
    .carousel-item.active .carousel-content h4,
    .carousel-item.active .carousel-content h6,
    .carousel-item.active .carousel-content p,
    .carousel-item.active .carousel-content .suite-logo,
    .carousel-item.active .carousel-content .btn {
        animation: fadeInSimple 0.5s ease-out 0.4s forwards;
    }

    .carousel-content {
        padding: 15px 10px !important;
    }

    .carousel-content h1 {
        font-size: 2rem !important;
    }

    .carousel-content h4 {
        font-size: 1.2rem !important;
    }

    .carousel-content p {
        font-size: 0.9rem !important;
    }

    .suite-logo {
        max-width: 180px;
    }

    .carousel-frame .carousel-control-prev,
    .carousel-frame .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .carousel-frame .carousel-control-prev-icon,
    .carousel-frame .carousel-control-next-icon {
        width: 20px;
        height: 20px;
    }

    .carousel-frame .carousel-indicators {
        bottom: 10px;
    }
}

/* Móviles */
@media (max-width: 576px) {
    .carousel-image-section {
        min-height: 250px;
    }

    .carousel-frame {
        border-radius: 10px;
    }

    .carousel-wrapper .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .carousel-text-section {
        padding: 0;
    }

    .carousel-content h1 {
        font-size: 1.5rem !important;
    }

    .carousel-content h4,
    .carousel-content h6 {
        font-size: 1rem !important;
    }

    .carousel-content p {
        font-size: 0.85rem !important;
    }

    .suite-logo {
        max-width: 150px;
    }

    .carousel-content .btn-success {
        padding: 8px 20px !important;
        font-size: 0.9rem;
    }
}

/* Controles del carousel (flechas prev/next) */
.carousel-control-prev,
.carousel-control-next {
    z-index: 15 !important;
}

/* Responsive - Móviles */
@media (max-width: 768px) {
    .carousel-split-layout {
        flex-direction: column;
    }

    .carousel-text-section,
    .carousel-image-section {
//        width: 100%;
    }

    .carousel-text-section {
        padding: 0;
    }

    .carousel-image-section {
        padding: 15px;
    }

    .carousel-content {
        min-height: auto;
        padding: 20px;
        margin-bottom: 20px;
    }

    /* Asegurar que los botones queden debajo de los controles */
    .botones-carousel {
        margin-top: 15px;
        margin-bottom: 40px;
        position: relative;
        z-index: 5;
    }

    .carousel-control-prev,
    .carousel-control-next {
        z-index: 20 !important;
    }
}

/* ================================
   HERO/DIAPOSITIVAS - MEJORAS MÓVIL
   ================================ */
@media (max-width: 767.98px) {
    /* Ocultar tarjetas flotantes para evitar solapados */
    .floating-card { display: none !important; }

    /* Logo más pequeño */
    .hero-logo { max-width: 160px; height: auto; }

    /* Ajustes de la imagen hero/diapositiva */
    .w-md-50 .img-fluid { max-height: 320px; width: 100%; object-fit: contain; }

    /* Titulares y texto responsivo */
    .landing-page h2 { font-size: clamp(1rem, 5vw, 1.25rem); }
    .landing-page p { font-size: clamp(.9rem, 3.5vw, 1rem); }

    /* Botones ocupan todo el ancho y mejor separación en móvil */
    .btn-transparente { width: 100% !important; padding: .6rem .8rem; min-height: 44px; }
    .mt-4.d-flex { flex-direction: column !important; gap: .75rem !important; }

    /* Iconos y badges más pequeños para encajar */
    .icon-circle { width: 64px; height: 64px; }
    .feature-icon-premium i { font-size: 1.6rem !important; }

    /* Estadísticas compactas */
    .hero-stats { gap: 1rem; font-size: .9rem; }
}
