#product-list > .listads-wrapper {
    display: flex;
    margin-bottom: 2rem;
}

.listads-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid #e6e8e3;
    border-radius: 0.5rem;
    background: #fff;
    color: #1f2328;
    box-shadow: 0 10px 30px rgba(31, 35, 40, 0.08);
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: box-shadow 160ms ease, border-color 160ms ease;
}

a.listads-card:hover,
a.listads-card:focus-visible {
    color: #1f2328;
    text-decoration: none;
    border-color: var(--primary, currentColor);
    box-shadow: 0 16px 38px rgba(31, 35, 40, 0.14);
}

.listads-image-wrapper {
    display: block;
    width: 100%;
}

.listads-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f6f4ef;
}

/* Standard: nur das Galerie-/Kachelbild. */
.listads-image-gallery {
    display: block;
}

.listads-image-list-view {
    display: none;
}

/* Bildwechsel ausschließlich über den Ansichtsmodus. */
#product-list.layout-list
.listads-image-wrapper.listads-has-list-image
.listads-image-gallery {
    display: none;
}

#product-list.layout-list
.listads-image-wrapper.listads-has-list-image
.listads-image-list-view {
    display: block;
}

.listads-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
}

.listads-product-price {
    margin: 0 0 0.65rem;
    color: #1f2328;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.listads-product-card .listads-button::after {
    content: " →";
}

.listads-text {
    margin: 0 0 1rem;
    color: #4c535b;
    font-size: 0.875rem;
    line-height: 1.55;
}

.listads-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: auto;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 700;
}

/*
 * Hintergrundfarbe, Textfarbe, Rahmen, Hover und Fokus werden vollständig
 * von der aktiven Shop-/NOVA-Klasse .btn-primary übernommen.
 */
.listads-button.btn-primary,
a.listads-card:hover .listads-button.btn-primary,
a.listads-card:focus .listads-button.btn-primary,
a.listads-card:focus-visible .listads-button.btn-primary,
a.listads-card:active .listads-button.btn-primary {
    /*
     * Die Werte stammen von einem echten .btn.btn-primary des aktiven
     * NOVA-Themes. !important verhindert, dass mobile Link- oder
     * Kartenstatusfarben in den Button vererbt werden.
     */
    background-color:
        var(--listads-shop-primary-background-color) !important;
    background-image:
        var(--listads-shop-primary-background-image, none) !important;
    color:
        var(--listads-shop-primary-color) !important;
    border-color:
        var(--listads-shop-primary-border-color) !important;
    border-width:
        var(--listads-shop-primary-border-width, 1px) !important;
    border-style:
        var(--listads-shop-primary-border-style, solid) !important;
    border-radius:
        var(--listads-shop-primary-border-radius) !important;
    box-shadow:
        var(--listads-shop-primary-box-shadow, none) !important;
    text-decoration: none !important;
}

.listads-sponsored {
    z-index: 2;
    background: var(--listads-sponsored-background, #1f2328);
    color: var(--listads-sponsored-color, #fff);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.listads-sponsored-badge {
    position: absolute;
    top: 0.65rem;
    padding: 0.45rem 0.58rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(31, 35, 40, 0.18);
}

.listads-sponsored-left {
    left: 0.65rem;
}

.listads-sponsored-right {
    right: 0.65rem;
}

.listads-sponsored-line {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    text-align: center;
}

#product-list.layout-list > .listads-wrapper {
    flex: 0 0 100%;
    max-width: 100%;
    align-items: stretch;
}

@media (min-width: 768px) {
    /*
     * Normalerweise entspricht die Höhe dem benachbarten Listeneintrag.
     * Bei sehr breiten Bildern setzt JavaScript eine flachere Höhe, damit
     * das vollständige Motiv innerhalb von maximal 75 Prozent Breite bleibt.
     */
    #product-list.layout-list > .listads-wrapper {
        height: var(--listads-entry-height, auto);
        min-height: var(--listads-entry-height, 0);
        max-height: var(--listads-entry-height, none);
    }

    #product-list.layout-list .listads-card {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        height: 100%;
        min-height: 0;
        max-height: 100%;
    }

    #product-list.layout-list .listads-image-wrapper {
        flex: 0 0 var(--listads-image-width, 75%);
        width: var(--listads-image-width, 75%);
        max-width: 75%;
        min-width: 0;
        height: 100%;
        overflow: hidden;
        background: #f6f4ef;
    }

    #product-list.layout-list .listads-content {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #product-list.layout-list
    .listads-image-wrapper.listads-has-list-image
    .listads-image-list-view,
    #product-list.layout-list
    .listads-image-wrapper:not(.listads-has-list-image)
    .listads-image-gallery {
        display: block;
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: center;
    }
}

@media (max-width: 767.98px) {
    #product-list > .listads-wrapper {
        margin-bottom: 1rem;
    }

    .listads-card {
        border-radius: 0.35rem;
    }

    .listads-content {
        padding: 0.75rem;
    }
.listads-text {
        display: none;
    }

    .listads-button {
        width: 100%;
        min-height: 34px;
        padding: 0.5rem 0.6rem;
        font-size: 0.78rem;
    }

    .listads-sponsored-badge {
        top: 0.45rem;
        padding: 0.35rem 0.46rem;
        font-size: 0.58rem;
    }

    .listads-sponsored-left {
        left: 0.45rem;
    }

    .listads-sponsored-right {
        right: 0.45rem;
    }

    /*
     * Mobile Listenansicht:
     * Das ausgewählte Listenbild bleibt aktiv, wird aber natürlich und
     * vollständig oberhalb des Inhalts dargestellt. Keine Desktop-Höhen-
     * oder Breitenvorgabe darf in diese Darstellung hineinwirken.
     */
    #product-list.layout-list > .listads-wrapper {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    #product-list.layout-list .listads-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    #product-list.layout-list .listads-image-wrapper {
        display: block;
        flex: none;
        width: 100%;
        max-width: none;
        min-width: 0;
        height: auto;
        overflow: visible;
    }

    #product-list.layout-list
    .listads-image-wrapper.listads-has-list-image
    .listads-image-list-view,
    #product-list.layout-list
    .listads-image-wrapper:not(.listads-has-list-image)
    .listads-image-gallery {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: center;
    }

    #product-list.layout-list .listads-content {
        display: flex;
        flex: none;
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: visible;
        padding: 0.75rem;
    }

    #product-list.layout-list .listads-product-price {
        width: 100%;
    }

    #product-list.layout-list .listads-button {
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .listads-card {
        transition: none;
    }
}
