/* KAFF Build 357.5.3 — estabilidade da grade de produtos no mobile.
 * Aplicado somente em loja, categorias e tags de produto.
 */
@media (max-width: 991px) {
    body.post-type-archive-product .site-main,
    body.tax-product_cat .site-main,
    body.tax-product_tag .site-main,
    body.woocommerce-shop .site-main,
    body.post-type-archive-product .woocommerce,
    body.tax-product_cat .woocommerce,
    body.tax-product_tag .woocommerce,
    body.woocommerce-shop .woocommerce {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body.post-type-archive-product ul.products,
    body.tax-product_cat ul.products,
    body.tax-product_tag ul.products,
    body.woocommerce-shop ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        grid-auto-rows: auto !important;
        align-items: stretch !important;
        align-content: start !important;
        gap: 14px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    body.post-type-archive-product ul.products::before,
    body.post-type-archive-product ul.products::after,
    body.tax-product_cat ul.products::before,
    body.tax-product_cat ul.products::after,
    body.tax-product_tag ul.products::before,
    body.tax-product_tag ul.products::after,
    body.woocommerce-shop ul.products::before,
    body.woocommerce-shop ul.products::after {
        display: none !important;
        content: none !important;
    }

    body.post-type-archive-product ul.products li.product,
    body.tax-product_cat ul.products li.product,
    body.tax-product_tag ul.products li.product,
    body.woocommerce-shop ul.products li.product {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        clear: none !important;
        float: none !important;
        display: flex !important;
        flex-direction: column !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        translate: none !important;
        animation: none !important;
        contain: layout paint !important;
    }

    body.post-type-archive-product ul.products li.product > a,
    body.tax-product_cat ul.products li.product > a,
    body.tax-product_tag ul.products li.product > a,
    body.woocommerce-shop ul.products li.product > a {
        position: relative !important;
        inset: auto !important;
        transform: none !important;
    }

    body.post-type-archive-product ul.products li.product img,
    body.tax-product_cat ul.products li.product img,
    body.tax-product_tag ul.products li.product img,
    body.woocommerce-shop ul.products li.product img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: contain !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        animation: none !important;
        background: #fff;
    }

    /* No mobile, efeitos que dependem de hover e imagens secundárias não devem
       esconder o produto principal. */
    body.post-type-archive-product .product-image-secondary,
    body.tax-product_cat .product-image-secondary,
    body.tax-product_tag .product-image-secondary,
    body.woocommerce-shop .product-image-secondary {
        display: none !important;
    }

    body.post-type-archive-product .product-image-primary,
    body.tax-product_cat .product-image-primary,
    body.tax-product_tag .product-image-primary,
    body.woocommerce-shop .product-image-primary {
        position: relative !important;
        inset: auto !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Proteção contra camadas residuais dos recursos de modal. */
    .kaff-quick-view-modal:not([hidden]),
    .kaff-gallery-lightbox:not([hidden]) {
        display: none !important;
    }

    body.kaff-modal-open,
    body.kaff-lightbox-open {
        overflow-y: auto !important;
        position: static !important;
        height: auto !important;
    }
}

@media (max-width: 420px) {
    body.post-type-archive-product ul.products,
    body.tax-product_cat ul.products,
    body.tax-product_tag ul.products,
    body.woocommerce-shop ul.products {
        gap: 10px !important;
    }
}
