/* ============================================
   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;
}

/* Sección de texto (izquierda) - 40% del ancho - FONDO BLANCO */
.carousel-text-section {
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    padding: 30px;
    background: #ffffff;
}

/* Sección de imagen (derecha) - 60% del ancho - FONDO BLANCO */
.carousel-image-section {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    padding: 20px;
}

/* 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: 1px solid #e0e0e0;
}

.carousel-content.bg-white {
    background-color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.suite-logo {
    max-width: 250px;
    height: auto;
    display: inline-block;
    margin: 0 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 45%;
        padding: 20px;
    }

    .carousel-image-section {
        flex: 0 0 55%;
        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;
    }

    .carousel-text-section {
        flex: 0 0 auto;
        padding: 20px;
        order: 2;
    }

    .carousel-image-section {
        flex: 0 0 auto;
        min-height: 300px;
        padding: 20px;
        order: 1;
    }

    /* 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: 15px;
    }

    .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%;
        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;
    }
}
