/* Astra owns the column count, image crop and palette. Complete titles remain in the DOM. */
body.ac-shop-aligned-cards { --ac-catalog-title-lines: 2; }
body.ac-shop-aligned-cards ul.products { align-items: stretch; }
body.ac-shop-aligned-cards ul.products > li.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: stretch;
}
body.ac-shop-aligned-cards .astra-shop-thumbnail-wrap { flex: 0 0 auto; min-width: 0; }
body.ac-shop-aligned-cards .astra-shop-thumbnail-wrap a > img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ac-catalog-image-ratio, auto);
  object-fit: contain;
}
body.ac-shop-aligned-cards .astra-shop-summary-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}
body.ac-shop-aligned-cards ul.products .woocommerce-loop-product__title,
body.ac-shop-aligned-cards .wc-block-product-template .wp-block-post-title,
body.ac-shop-aligned-cards .wc-block-grid__product-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--ac-catalog-title-lines);
  line-height: 1.3;
  min-height: calc(var(--ac-catalog-title-lines) * 1.3em);
  max-height: calc(var(--ac-catalog-title-lines) * 1.3em);
  overflow: hidden;
  overflow-wrap: anywhere;
}
body.ac-shop-aligned-cards ul.products .ast-woo-product-category {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: 2.8em;
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: anywhere;
}
body.ac-shop-aligned-cards .astra-shop-summary-wrap .price {
  margin-top: auto;
  min-height: 2.8em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
body.ac-shop-aligned-cards ul.products > li.product .button,
body.ac-shop-aligned-cards .wc-block-product-template .wp-block-button__link,
body.ac-shop-aligned-cards .wc-block-grid__product .wp-block-button__link {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
  padding: .75em clamp(.45rem, 1.4vw, 1rem);
  font-size: clamp(.875rem, .8rem + .2vw, 1rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
  min-height: 44px;
}
body.ac-shop-aligned-cards ul.products > li.product > .button { margin-top: auto; }
/* Native Woo product blocks keep their own responsive column count. */
body.ac-shop-aligned-cards .wc-block-product-template { align-items: stretch; }
body.ac-shop-aligned-cards .wc-block-product-template > .wc-block-product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: stretch;
}
body.ac-shop-aligned-cards .wc-block-product-template .wp-block-woocommerce-product-button { margin-top: auto; }
body.ac-shop-aligned-cards .wc-block-product-template .wp-block-woocommerce-product-price {
  min-height: 2.8em;
  overflow-wrap: anywhere;
}
body.ac-shop-aligned-cards .wc-block-product-template .wc-block-components-product-image img,
body.ac-shop-aligned-cards .wc-block-grid__product-image img {
  aspect-ratio: var(--ac-catalog-image-ratio, auto);
  object-fit: contain;
}
body.ac-shop-aligned-cards .wc-block-grid__products { align-items: stretch; }
body.ac-shop-aligned-cards .wc-block-grid__product { display: flex; flex-direction: column; min-width: 0; }
body.ac-shop-aligned-cards .wc-block-grid__product .wc-block-grid__product-add-to-cart { margin-top: auto; }
@media (max-width: 544px) {
  body.ac-shop-aligned-cards { --ac-catalog-title-lines: 3; }
}
