/* ===== TXP MORPH MEJORADO - SIN TEMBLOR ===== */
.txp-morph svg {
    position: absolute;
    width: 0;
    height: 0;
}

.txp-morph {
    position: relative;
    padding: 4rem 1.5rem;
    text-align: center;
    background: rgb(255, 255, 255);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    

    /* Previene cualquier desbordamiento durante la animación */
}

.txp-morph-container {
    position: relative;
    font-size: clamp(3rem, 15vw, 10rem);
    font-weight: 700;
    filter: url(#txp-threshold);
    user-select: none;
    line-height: 1;
    color: rgb(0, 0, 0);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    
}

.txp-word-rotator {
    position: relative;
    height: 1.3em;
    display: flex;
    justify-content: center;
    align-items: center;
    --words: 4;
    height: 1.5em; /* Un poco más de altura para móvil */

    /* Asegura que el contenedor mantenga su tamaño */
    min-width: max-content;
    margin: 0 auto;
}

.txp-word {
    position: absolute;
    top: 50;
    left: 50;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    white-space: nowrap;
    animation: txp-rotate-smooth calc(var(--words) * 3s) infinite ease-in-out;
    animation-fill-mode: both;

    /* Optimizaciones para animaciones suaves */
    will-change: opacity, filter, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.txp-word:nth-child(1) {
    animation-delay: 0s;
}

.txp-word:nth-child(2) {
    animation-delay: -3s;
}

.txp-word:nth-child(3) {
    animation-delay: -6s;
}

.txp-word:nth-child(4) {
    animation-delay: -9s;
}

/* Keyframe optimizado - SIN TEMBLOR */
@keyframes txp-rotate-smooth {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.9);
    }

    5% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }

    25% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }

    30% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(1.1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .txp-morph-container {
        font-size: clamp(2.8rem, 16vw, 6rem);
    }

    .txp-word {
        white-space: normal;
        padding: 0 1rem;

        /* Añade padding en móvil para mejor legibilidad */
    }
}
