/* PRODUCT CARD AND PRODUCT GRID — ported verbatim from reference/css/components.css (lines 369-428). Global, in the reference order. */
.lm-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60); }
.lm-product-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.lm-product-card { display: flex; flex-direction: column; gap: var(--wp--preset--spacing--40); min-width: 0; }
.lm-product-card[hidden], .lm-pagination[hidden] { display: none; }
.lm-product-card__media {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5;
  background: var(--wp--preset--color--surface); border-radius: var(--wp--custom--radius--sm);
}
.lm-product-card--square .lm-product-card__media { aspect-ratio: 1; }
.lm-product-card__image-link { display: block; width: 100%; height: 100%; }
.lm-product-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform var(--wp--custom--motion--slow) var(--wp--custom--motion--ease); }
.lm-product-card:hover .lm-product-card__image { transform: scale(1.05); }
.lm-product-card__zone { position: absolute; top: var(--wp--preset--spacing--30); left: var(--wp--preset--spacing--30); z-index: var(--wp--custom--z-index--raised); }
.lm-product-card__wish {
  position: absolute; top: var(--wp--preset--spacing--30); right: var(--wp--preset--spacing--30); z-index: var(--wp--custom--z-index--raised);
  width: var(--wp--custom--control--sm); height: var(--wp--custom--control--sm);
  opacity: 0; transition: opacity var(--wp--custom--motion--fast) ease;
}
.lm-product-card__add {
  position: absolute; left: var(--wp--preset--spacing--30); right: var(--wp--preset--spacing--30); bottom: var(--wp--preset--spacing--30); z-index: var(--wp--custom--z-index--raised);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--wp--custom--motion--fast) ease, transform var(--wp--custom--motion--fast) ease;
}
.lm-product-card:hover .lm-product-card__wish, .lm-product-card:focus-within .lm-product-card__wish,
.lm-product-card:hover .lm-product-card__add,  .lm-product-card:focus-within .lm-product-card__add { opacity: 1; transform: none; }
/* Saved state of the heart (decision 54): the declarations of the reference's saved heart on the product page
   (.lm-buy__wish.is-selected, reference/css/pages/single-product.css); the card's own state is not drawn there. */
.lm-product-card__wish.is-selected { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); }
.lm-product-card__wish.is-selected .lm-icon { fill: currentColor; }
.lm-product-card__body { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--wp--preset--spacing--30); }
.lm-product-card__info { min-width: 0; }
.lm-product-card__name {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--medium); font-weight: var(--wp--custom--font-weight--semibold);
  line-height: var(--wp--custom--line-height--snug); letter-spacing: var(--wp--custom--letter-spacing--normal);
  transition: color var(--wp--custom--motion--fast) ease;
}
.lm-product-card:hover .lm-product-card__name { color: var(--wp--preset--color--accent); }
.lm-product-card__meta { margin-top: var(--wp--preset--spacing--10); font-size: var(--wp--preset--font-size--small); line-height: var(--wp--custom--line-height--snug); color: var(--wp--preset--color--muted); }
.lm-product-card__price { font-size: var(--wp--preset--font-size--medium); font-weight: var(--wp--custom--font-weight--bold); line-height: var(--wp--custom--line-height--snug); color: var(--wp--preset--color--accent); white-space: nowrap; }

/* No hover on touch layouts: the wishlist stays visible and "add" becomes a round icon button. */
@media (max-width: 1023px) {
  .lm-product-grid, .lm-product-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lm-product-card__wish { opacity: 1; }
  .lm-product-card__add {
    left: auto; width: var(--wp--custom--control--md); min-height: var(--wp--custom--control--md); padding-inline: 0;
    opacity: 1; transform: none;
  }
  .lm-product-card__add span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 639px) {
  .lm-product-grid, .lm-product-grid--3 { gap: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30); }
  .lm-product-card { gap: var(--wp--preset--spacing--30); }
  .lm-product-card__body { flex-direction: column; gap: var(--wp--preset--spacing--10); }
  .lm-product-card__name { font-size: var(--wp--preset--font-size--body); }
  .lm-product-card__price { font-size: var(--wp--preset--font-size--body); }
  .lm-product-card__zone { top: var(--wp--preset--spacing--20); left: var(--wp--preset--spacing--20); }
  /* Three overlays do not fit on a 170px photo: the wishlist lives on the product page at this size. */
  .lm-product-card__wish { display: none; }
  .lm-product-card__add { width: var(--wp--custom--control--sm); min-height: var(--wp--custom--control--sm); }
  .lm-product-card__add { right: var(--wp--preset--spacing--20); bottom: var(--wp--preset--spacing--20); }
}
/* Product Collection wraps each card in an li of its product template (list layout): the cards must be the grid
   items, as in the reference (front end only: in the editor the li is the block box). */
:where(body:not(.editor-styles-wrapper)) .lm-product-grid > li { display: contents; }
