/*
 * NosatoMobileFirst 2b catSeoBelow: Text-Blöcke auf dem Handy unter das Produkt-Listing schieben.
 * Bilder, Banner und Überschriften-Blöcke bleiben, wo sie sind. Nur Text-Blöcke wandern nach unten.
 * Einen beliebigen Block mitnehmen: im Erlebniswelten-Layout die CSS-Klasse "nmf-seo" am Block setzen.
 * Nur die Darstellung ändert sich. Der Text bleibt im HTML an derselben Stelle (für SEO unkritisch).
 */
@media (max-width: 767.98px) {
    /* Fall 1: Text und Listing stehen in verschiedenen Sektionen */
    .is-active-route-frontend-navigation-page .cms-sections:has(.cms-block-product-listing) {
        display: flex;
        flex-direction: column;
    }
    .is-active-route-frontend-navigation-page .cms-sections > .cms-section:not(:has(.cms-block-product-listing)):has(
        .cms-block-text, .cms-block-center-text, .cms-block-text-hero,
        .cms-block-text-two-column, .cms-block-text-three-column, .nmf-seo
    ):not(:has(.cms-block-image, .cms-block-image-slider, .cms-block-image-cover, .cms-block-category-heading)) {
        order: 1;
    }

    /* Fall 2: Text und Listing stehen in derselben Sektion (normal oder Seitenleiste) */
    .is-active-route-frontend-navigation-page .cms-section-default:has(> .cms-block-product-listing),
    .is-active-route-frontend-navigation-page .cms-section-sidebar-main-content:has(> .cms-block-product-listing) {
        display: flex;
        flex-direction: column;
    }
    .is-active-route-frontend-navigation-page .cms-section-default:has(> .cms-block-product-listing) > :is(
        .cms-block-text, .cms-block-center-text, .cms-block-text-hero,
        .cms-block-text-two-column, .cms-block-text-three-column, .nmf-seo
    ),
    .is-active-route-frontend-navigation-page .cms-section-sidebar-main-content:has(> .cms-block-product-listing) > :is(
        .cms-block-text, .cms-block-center-text, .cms-block-text-hero,
        .cms-block-text-two-column, .cms-block-text-three-column, .nmf-seo
    ) {
        order: 1;
        margin-top: 1.5rem;
    }
}
