:root {
    --product-card-columns: 5;
    --product-card-min-width: 175px;
    --product-card-gap: 6px;
}

/* These containers reserve space for a sidebar, or for the analogs modal. */
.content-block,
.cont-holder,
.select-analog-form {
    --product-card-columns: 4;
}

.products-list:has(.slide.manager-view),
.view-slider:has(.slide.manager-view) {
    --product-card-min-width: 178px;
}

.last-views .product-title {
    height: auto;
    overflow-y: visible;
}

@media (min-width: 769px) {
    .last-views .image.product-preview {
        width: 100%;
        max-width: none;
        height: auto;
        aspect-ratio: 7 / 6;
    }

    .last-views .image.product-preview .overlay.free-delivery .overlay-btn,
    .last-views .image.product-preview .overlay.delivery-1-2-h .overlay-btn {
        margin-right: 0;
    }

    .last-views .image.product-preview .overlay.moll-original {
        position: absolute;
        right: 5px;
        bottom: 5px;
        width: 77px;
    }

    .last-views .image.product-preview .overlay.moll-original .overlay-content {
        position: static;
        width: auto;
    }

    .products-list,
    .products-list > .row {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(max(
            var(--product-card-min-width),
            calc((100% - (var(--product-card-columns) - 1) * var(--product-card-gap)) / var(--product-card-columns))
        ), 1fr));
        gap: 15px var(--product-card-gap);
    }

    /* Legacy brand groups contain their own row of product cards. */
    .products-list > .row {
        width: 100%;
        margin: 0;
    }

    .products-list > :not(.slide):not(.show-more),
    .products-list > .row > :not(.slide):not(.show-more) {
        grid-column: 1 / -1;
    }

    .products-list .slide,
    .products-list .slide.manager-view,
    .products-list .show-more {
        width: auto;
        max-width: none;
        min-width: 0;
        margin: 0;
        float: none;
    }
}
