/* --- RESET Y FONDO --- */
.ps-process-section {
    position: relative;
    padding: 9px 0;
    background-color: #0b0e1b !important; /* Azul marino muy oscuro */
    min-height: 518px;
    display: block;
    width: 100%;
    overflow: hidden;
}

/* Fix para Partículas */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Contenedor Principal */
.ps-container {
    position: relative;
    z-index: 10; /* Asegura que el texto esté al frente */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.ps-process-header {
    text-align: center;
    margin-bottom: 70px;
}

/* 1. Definimos la animación (si no la tienes ya en este archivo) */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. Aplicamos el efecto al título */
.ps-process-main-title {
    font-size: 48px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    text-align: center;
    
    /* Configuración del Gradiente Animado */
    background: linear-gradient(-45deg, #1e50a0, #9b4d96, #23a6d5, #23d5ab);
    background-size: 300% 300%;
    animation: gradientShift 4s ease-in-out infinite;

    /* Magia para que el gradiente solo esté en el texto */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block; /* Importante para que el clip funcione bien */
    width: 100%;
}

/* Grilla de Pasos */
.ps-process-steps {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    margin-top: -34px;
}

.ps-step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Cajas de Números */
.ps-step-number-box {
    width: 75px;
    height: 75px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    font-family: 'Inter', sans-serif;
}

.step-blue { background-color: #1e50a0; }
.step-purple { background-color: #9b4d96; }
.step-blue-dark { background-color: #0a2e63; }
.step-gradient { background: linear-gradient(135deg, #1e50a0, #9b4d96); }


/* Textos */
.ps-step-title {
    color: #ffffff !important;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.ps-step-desc {
    color: #ffffff !important;
    font-size: 14px;
    line-height: 1.5;
    max-width: 220px;
    font-family: 'Inter', sans-serif;
}

/* Línea divisoria */
.ps-step-divider {
    flex: 0.3;
    height: 1px;
    border-top: 2px dashed rgba(255,255,255,0.2);
    margin-top: 38px;
}


/* ==========================================================================
   CORRECCIÓN FINAL: CARRUSEL DE PROCESO CON PUNTOS FIJOS ABAJO (4 PASOS)
   ========================================================================== */


/* ==========================================================================
   VERSION CORREGIDA CON POSICIONAMIENTO CENTRADO ABSOLUTO (4 PASOS REALES)
   ========================================================================== */

/* 1. Desplazamiento exacto de los bloques fijando las posiciones de manera limpia */
@keyframes processCardsMove {
    0%, 20% { transform: translateX(0); }
    25%, 45% { transform: translateX(-100%); }
    50%, 70% { transform: translateX(-200%); }
    75%, 95% { transform: translateX(-300%); }
    100% { transform: translateX(0); }
}

/* 2. Puntos fijos abajo que cambian de color en su propio sitio */
@keyframes processDotsActive {
    0%, 20% {
        background-image: 
            radial-gradient(circle, #33cccc 5px, transparent 6px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px);
    }
    25%, 45% {
        background-image: 
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, #33cccc 5px, transparent 6px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px);
    }
    50%, 70% {
        background-image: 
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, #33cccc 5px, transparent 6px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px);
    }
    75%, 95% {
        background-image: 
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, #33cccc 5px, transparent 6px);
    }
    100% {
        background-image: 
            radial-gradient(circle, #33cccc 5px, transparent 6px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px),
            radial-gradient(circle, rgba(255, 255, 255, 0.25) 4px, transparent 5px);
    }
}

@media (max-width: 768px) {
    .ps-process-section {
        padding: -3px 0 110px 0 !important;
        height: auto;
        overflow: hidden !important; 
    }

    .ps-process-header {
        margin-bottom: 50px;
    }

    .ps-process-main-title {
        font-size: 30px;
        margin-top: 0;
    }

    /* 1. LA CINTA: Mide 400% para alojar perfectamente los 4 pasos */
    .ps-process-steps {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 400% !important; 
        margin-top: 0;
        gap: 0 !important;
        padding: 0 !important;
        /* Usamos una animación calculada exclusivamente para móvil */
        animation: processCarouselMobile 12s ease-in-out infinite !important;
    }

    /* Ocultamos los divisores correctamente */
    .ps-step-divider,
    .ps-step-item::after {
        display: none !important; 
    }

    /* 2. LAS TARJETAS: Cada una ocupa el 25% de la cinta (100% de la pantalla) */
    .ps-step-item { 
        flex: 0 0 25% !important;
        width: 25% !important;
        max-width: 25% !important;
        min-width: 25% !important;
        margin-bottom: 0 !important;
        padding: 0 40px !important; 
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important; 
        justify-content: center !important;
    }

    .ps-step-item > * {
        text-align: center !important;
    }

    .ps-step-desc {
        margin: 0 auto !important;
        max-width: 280px !important;
    }

    /* 3. LOS PUNTOS (Mantenemos tu animación original de puntos) */
    .ps-process-section::after {
        content: "";
        position: absolute;
        bottom: 35px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 15px;
        z-index: 15;
        
        background-position: 0px center, 25px center, 50px center, 75px center;
        background-repeat: no-repeat;
        
        animation: processDotsActive 12s ease-in-out infinite !important;
    }

    .ps-process-steps:hover,
    .ps-process-section:hover::after {
        animation-play-state: paused !important;
    }
}

/* 4. NUEVA ANIMACIÓN MATEMÁTICAMENTE EXACTA PARA MÓVIL */
/* Al estar fuera del @media o dentro, funcionará igual porque la llamamos arriba */
@keyframes processCarouselMobile {
    0%, 20% { transform: translateX(0); }
    25%, 45% { transform: translateX(-25%); } /* Mueve exactamente la Tarjeta 2 */
    50%, 70% { transform: translateX(-50%); } /* Mueve exactamente la Tarjeta 3 */
    75%, 95% { transform: translateX(-75%); } /* Mueve exactamente la Tarjeta 4 */
    100% { transform: translateX(0); }
}

@media (max-width: 400px) {
    .ps-process-main-title {
        font-size: 30px;
        margin-top: 47px;
    }
    .ps-step-number-box {
        width: 65px;
        height: 65px;
        font-size: 22px;
        margin-bottom: 15px;
    }
    .ps-step-title {
        font-size: 19px;
    }
}