/* Equal-height product cards on the four storefront catalog pages only.
   The .equal-height-product-cards class is intentionally set on their grids. */
.equal-height-product-cards > [class*="col-"] {
    display: flex;
    min-width: 0;
}

.equal-height-product-cards > [class*="col-"] > a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Override the global .product-card-modern { height:auto !important; } rule. */
.equal-height-product-cards .product-card-modern {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100% !important;
}

.equal-height-product-cards .product-card-media {
    flex: 0 0 auto;
}

.equal-height-product-cards .product-card-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

/* Always reserve exactly two lines for product names. Longer names are
   visually truncated, while the complete product name remains in the DOM. */
.equal-height-product-cards .product-card-modern .product-card-title,
.equal-height-product-cards .product-card-modern .product-card-heading,
.equal-height-product-cards .product-card-modern .product-card-content > h6 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    height: 2.8em;
    min-height: 2.8em;
    max-height: 2.8em;
    line-height: 1.4;
    overflow: hidden;
    overflow-wrap: anywhere;
    flex: 0 0 auto;
}

/* Prices share a consistent lower baseline, including special-sale prices. */
.equal-height-product-cards .product-card-price-row {
    margin-top: auto;
    min-height: 2.8em;
    align-content: center;
    align-items: center;
    flex: 0 0 auto;
}
