@media (max-width: 700px) {
    .section-espacios + .container.my-5 {
        max-width: 98vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .section-espacios + .container.my-5 .row {
        flex-direction: column !important;
        gap: 24px !important;
    }
    .section-espacios + .container.my-5 .col-4 {
        width: 100% !important;
        max-width: 98vw !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
    }
    .section-espacios + .container.my-5 .col-4 > div {
        max-width: 95vw !important;
        height: 260px !important;
        top: 0 !important;
        transform: none !important;
        margin-bottom: 0 !important;
    }
    .section-espacios + .container.my-5 .col-4:nth-child(2) > div {
        height: 320px !important;
    }
}

.stack-card {
    position: sticky;
    top: 180px;
    margin-bottom: 32px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(44, 50, 99, .12);
    display: flex;
    align-items: center;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.3s;
    z-index: 1;
    min-height: 400px;
}

.stack-card.k1 {
    background: #5f5fa4;
    color: #fff;
}

.stack-card.k2 {
    background: #ff5460;
    color: #fff;
}

.stack-card.k3 {
    background: #05a593;
    color: #fff;
}

.stack-card.k4 {
    background: #f8ca69;
    color: #333;
}

.stack-card.k5 {
    background: #ec7963;
    color: #fff;
}

.stack-card-content {
    flex: 2;
    padding: 32px 32px 32px 40px;
    min-width: 220px;
}

.stack-card-img {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.stack-card-img img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    background: #fff;
}

@media (max-width: 700px) {
    .stack-cards {
        max-width: 98vw;
    }

    .stack-card {
        flex-direction: column;
    min-height: 320px !important;
    }

    .stack-card-content {
        padding: 24px;
    }

    .stack-card-img {
        padding: 16px;
    }

    .stack-card-img img {
        width: 90px;
        height: 90px;
    }
    /* Ajustes de tipografía y espaciado para móvil */
    .container .espacios-titulo {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 18px !important;
    }
    .stack-card h2 {
        font-size: 1.3rem !important;
        margin-bottom: 12px !important;
    }
    .stack-card p {
        font-size: 1rem !important;
        line-height: 1.35 !important;
    }
    .stack-card-content {
        min-width: 0 !important;
        padding: 16px !important;
    }
    .stack-card {
        margin-bottom: 18px !important;
        top: 0 !important;
        position: static !important;
        min-height: 320px !important;
    }
    .stack-card-img img {
        border-radius: 12px !important;
    }
}
