/* Category cards only: preserve homepage carousels and the table view. */
body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 16px;
    margin: 0 0 30px;
    padding: 0;
    width: 100%;
}

body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel)::before,
body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel)::after {
    display: none;
}

body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) > li.product {
    display: flex;
    float: none;
    clear: none;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0;
}

body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) > li.product .container-inner,
body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) > li.product .product-block-inner {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .image-block {
    box-sizing: border-box;
    aspect-ratio: 1;
    width: 100%;
    flex: none;
    float: none;
    margin: 0;
    overflow: hidden;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .image-block > a {
    display: block;
    height: 100%;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .image-block > a:empty {
    display: none;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .image-block img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    margin: 0;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .product-detail-wrapper {
    box-sizing: border-box;
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: auto !important;
    padding: 12px;
    text-align: left;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .product-detail-wrapper > a {
    margin-top: auto;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .product-name {
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    margin: 12px 0;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .shop_attributes {
    table-layout: fixed;
    width: 100%;
    margin-bottom: 12px;
}

body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .shop_attributes th,
body.tax-product_cat.grid-view #content ul.products:not(.list) > li.type-product .shop_attributes td {
    padding: 10px 8px;
    overflow-wrap: anywhere;
}

@media (max-width: 1199px) {
    body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    body.tax-product_cat.grid-view #content ul.products:not(.list):not(.owl-carousel) {
        grid-template-columns: minmax(0, 1fr);
    }
}
