/* 5 STEPS - 3 + 2 LAYOUT */

.cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
> .cubaWaveItem {
    grid-column: span 2;
}

.cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
> .cubaWaveItem:nth-child(4) {
    grid-column: 2 / span 2;
}

.cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
> .cubaWaveItem:nth-child(5) {
    grid-column: 4 / span 2;
}

/* TABLET */

@media (max-width: 991px) {
    .cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
    > .cubaWaveItem {
        grid-column: auto;
    }

    .cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
    > .cubaWaveItem:last-child {
        grid-column: 1 / -1;
    }
}

/* MOBILE */

@media (max-width: 575px) {
    .cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child) {
        grid-template-columns: 1fr;
    }

    .cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
    > .cubaWaveItem,
    .cubaWaveGrid:has(> .cubaWaveItem:nth-child(5):last-child)
    > .cubaWaveItem:last-child {
        grid-column: auto;
    }
}