/* Shared tracks align each visible row without clipping names or fixing card heights.
   Older browsers retain the existing flex-card layout. Scoped to BFW listing markup. */
@supports (grid-template-rows: subgrid) {
    .category-products.bfw-aligned-products .products-grid {
        row-gap: 0;
    }
    .category-products.bfw-aligned-products .products-grid > li.item {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: subgrid;
        grid-row: span 6;
        row-gap: 0;
        /* Separate successive rows, including the timer template's individual lists. */
        margin-bottom: 22px !important;
        min-width: 0;
    }
    .category-products.bfw-aligned-products .products-grid .product-image {
        grid-row: 1;
        align-self: start;
        min-width: 0;
    }
    .category-products.bfw-aligned-products .products-grid .product-info {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: subgrid;
        grid-row: 2 / span 5;
        row-gap: 0;
        min-width: 0;
    }
    .category-products.bfw-aligned-products .products-grid .product-name {
        grid-row: 1;
        align-self: start;
        overflow-wrap: anywhere;
    }
    .category-products.bfw-aligned-products .products-grid .bfw-card-summary {
        grid-row: 2;
        min-width: 0;
    }
    .category-products.bfw-aligned-products .products-grid .actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: subgrid;
        grid-row: 3 / span 3;
        row-gap: 0;
        margin-top: 0;
        min-width: 0;
    }
    .category-products.bfw-aligned-products .products-grid .actions > :is(.bfw-card-buy-form, .button, .availability) {
        grid-row: 1;
        align-self: start;
    }
    .category-products.bfw-aligned-products .products-grid .bfw-card-tier-prices {
        grid-row: 2;
        display: flex;
        min-width: 0;
    }
    .category-products.bfw-aligned-products .products-grid .actions > .eu-delivery-restricted-note {
        grid-row: 1;
        align-self: start;
        justify-self: stretch;
        width: 100%;
        margin: 0;
    }
    .category-products.bfw-aligned-products .products-grid .bfw-card-tier-prices:empty {
        display: none;
    }
    .category-products.bfw-aligned-products .products-grid .bfw-card-tier-prices .tier-prices {
        width: 100%;
        box-sizing: border-box;
    }
    .category-products.bfw-aligned-products .products-grid .actions > .add-to-links {
        grid-row: 3;
    }
}

