/**
 * Casos de Éxito - Estilos
 */

/* Elimino márgenes de Elementor */
.elementor-widget-casos_exito,
.elementor-widget-casos_exito > .elementor-widget-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding: 0 !important;
}

/* Sección principal */
.casos-exito-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: #000;
    margin: 0;
    padding: 0;
}

/* Container del video */
.casos-exito-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.casos-exito-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.casos-exito-video.active {
    opacity: 1;
}

/* Imagen de fondo fallback */
.casos-exito-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.casos-exito-fallback.active {
    opacity: 1;
}

/* Gradiente como fallback genérico, le podemos porner los tonos que querramos */
.casos-exito-fallback-gradient {
    background: linear-gradient(135deg, 
        #1a1a2e 0%, 
        #16213e 25%, 
        #0f3460 50%, 
        #1a1a2e 75%, 
        #0d1b2a 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Overlay sobre el video */
.casos-exito-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0.30) 100%);
    z-index: 2;
}

/* Contenido */
.casos-exito-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 60px 80px;
    box-sizing: border-box;
}

/* Título del CPT */
.casos-exito-title {
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 112%;
    letter-spacing: 0.4px;
    padding: 20px 0 0 20px; /* VER */
    /* padding: 93px 0 0 113px; */
}

/* Play button wrapper */
.casos-exito-play-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

.casos-exito-play-wrapper.hidden {
    opacity: 0;
    pointer-events: none;
}

.casos-exito-play-wrapper.visible {
    opacity: 1;
    pointer-events: auto;
}

.casos-exito-play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    transition: transform 0.3s ease;
}

.casos-exito-play-btn:hover {
    transform: scale(1.1);
}

.casos-exito-play-btn svg {
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.casos-exito-play-text {
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 110%;
    letter-spacing: 0.44px;
}

/* Cards wrapper */
.casos-exito-cards-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0 40px 20px; /* VER */
}

/* Flechas de navegación */
.casos-exito-arrow {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.casos-exito-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.casos-exito-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Container de cards */
.casos-exito-cards-container {
    flex: 1;
    overflow: hidden;
    max-width: calc(328px * 3 + 26px);
}

.casos-exito-cards-track {
    display: flex;
    gap: 13px;
    transition: transform 0.4s ease-in-out;
}

/* Card individual */
.casos-exito-card {
    flex-shrink: 0;
    width: 328px;
    height: 112px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    box-sizing: border-box;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Estado inactivo */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5.5px);
    -webkit-backdrop-filter: blur(5.5px);
}

.casos-exito-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.casos-exito-card.active {
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(17px);
    -webkit-backdrop-filter: blur(17px);
}

/* Imagen de la card */
.casos-exito-card-image {
    flex-shrink: 0;
    width: 86px;
    height: 86px;
    border-radius: 7px;
    overflow: hidden;
}

.casos-exito-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info de la card */
.casos-exito-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    height: 86px;
    justify-content: center;
}

.casos-exito-card-title {
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 110%;
    letter-spacing: 0.44px;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.casos-exito-card-org {
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 130%;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.casos-exito-card-country {
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 130%;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    text-transform: uppercase;
}

/* ==================== RESPONSIVE ==================== */

/* Laptop */
@media (max-width: 1200px) {
    .casos-exito-content {
        padding: 50px 60px;
    }
    
    .casos-exito-title {
        font-size: 36px;
    }
    
    .casos-exito-card {
        width: 320px;
        height: 100px;
        padding: 12px;
    }
    
    .casos-exito-card-image {
        width: 76px;
        height: 76px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .casos-exito-content {
        padding: 40px 16px;
    }
    
    .casos-exito-title {
        font-size: 28px;
    }
    
    .casos-exito-cards-wrapper {
        gap: 8px;
        position: relative;
    }
    
    /* Ocultar flecha izquierda en tablet/mobile */
    .casos-exito-arrow-left {
        display: none;
    }
    
    .casos-exito-arrow-right {
        width: 36px;
        height: 36px;
        min-width: 36px;
        position: absolute;
        right: 0;
        z-index: 10;
    }
    
    .casos-exito-cards-container {
        width: 100%;
        max-width: none;
        overflow-x: scroll !important;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-right: 50px;
        touch-action: pan-x;
    }
    
    .casos-exito-cards-container::-webkit-scrollbar {
        display: none;
    }
    
    .casos-exito-cards-track {
        display: flex;
        gap: 10px;
        width: max-content;
        transform: none !important;
    }
    
    .casos-exito-card {
        width: 180px;
        height: 70px;
        padding: 8px;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .casos-exito-card-image {
        width: 54px;
        height: 54px;
    }
    
    .casos-exito-card-title {
        font-size: 14px;
    }
    
    .casos-exito-card-org {
        font-size: 11px;
    }
    
    .casos-exito-card-country {
        font-size: 10px;
    }
}


@media (max-width: 600px) {
    /* Video menos zoom en mobile */
    .casos-exito-video,
    .casos-exito-fallback {
        object-position: center center;
    }
    
    .casos-exito-content {
        padding: 30px 12px;
    }
    
    .casos-exito-title {
        padding: 40px 0 0 18px;
        font-size: 24px;
    }
    
    .casos-exito-play-btn svg {
        width: 50px;
        height: 50px;
    }
    
    .casos-exito-play-text {
        font-size: 14px;
    }
    
    .casos-exito-cards-wrapper {
        gap: 6px;
        padding: 0 0 24px 18px;
    }
    
    .casos-exito-arrow-right {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .casos-exito-arrow-right svg {
        width: 16px;
        height: 16px;
    }
    
    .casos-exito-cards-container {
        padding-right: 44px;
    }
    
    .casos-exito-card {
        width: 160px;
        height: 60px;
        padding: 6px;
        gap: 8px;
        border-radius: 6px;
    }
    
    .casos-exito-card-image {
        width: 48px;
        height: 48px;
        border-radius: 4px;
    }
    
    .casos-exito-card-title {
        font-size: 13px;
    }
    
    .casos-exito-card-org {
        font-size: 10px;
    }
    
    .casos-exito-card-country {
        font-size: 9px;
    }
}


@media (max-width: 400px) {
    .casos-exito-content {
        padding: 24px 10px;
    }
    
    .casos-exito-title {
        font-size: 20px;
    }
    
    .casos-exito-cards-container {
        padding-right: 40px;
    }
    
    .casos-exito-card {
        width: 140px;
        height: 54px;
        padding: 5px;
        gap: 6px;
    }
    
    .casos-exito-card-image {
        width: 44px;
        height: 44px;
    }
    
    .casos-exito-card-title {
        font-size: 12px;
    }
    
    .casos-exito-card-org {
        font-size: 9px;
    }
    
    .casos-exito-card-country {
        font-size: 8px;
    }
}
