/*
 * Product grid and card (redesign 2026-10-27, owner request): rounded image with hover image swap,
 * discount badge, category label, Outfit title, clear price, size count, compact full-width button.
 * Grids: 4 columns desktop, 3 inside the filtered catalogue, 2 on tablet and phones (1 below 340px).
 */
.product-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px; list-style: none; margin: 0; padding: 0 var(--gutter);
}
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }

/* Image. */
.card__frame { position: relative; margin-bottom: 14px; }
.card__media { position: relative; display: block; aspect-ratio: var(--card-ratio); overflow: hidden; border-radius: 10px; background: #f3f3f4; }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease, transform .6s ease; }
.card__img--hover { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .card:hover .card__img { transform: scale(1.04); }
  .card.has-hover-image:hover .card__img--hover { opacity: 1; }
  .card.has-hover-image:hover .card__img:not(.card__img--hover) { opacity: 0; }
}
.card__image-empty { display: grid; place-items: center; width: 100%; height: 100%; color: #475569; text-align: center; padding: 20px; }
.card__badges { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.card__badge { padding: 5px 10px; border-radius: 6px; font-family: var(--f-display); font-size: 13px; font-weight: 700; line-height: 1; }
.card__badge--sale { background: var(--c-primary-bright-aa); color: #fff; }
.card__badge--soldout { background: rgba(255, 255, 255, .92); color: var(--c-heading-dark); }

/* Text. */
.card__body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.card__cat { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.card__title { margin: 0 0 8px; font-family: var(--f-display); font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--c-heading-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__title a { color: inherit; }
.card__title a:hover { color: var(--c-primary-aa); }
.card .stars { margin: 0 0 8px; }
.card .price { margin: 0; font-family: var(--f-display); font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--c-heading-dark); }
.card .price ins { text-decoration: none; color: var(--c-primary-aa); }
.card .price del { margin-right: 6px; font-size: 14px; font-weight: 400; color: #8a8a8a; }
.card .price .price__suffix { display: inline; margin-left: 4px; font-family: var(--f-text); font-size: 11px; font-weight: 400; color: #8a8a8a; }
.card__meta { margin: 4px 0 0; font-size: 13px; color: #6b7280; }

/* Button: pinned to the bottom so buttons line up across a row. */
.card__button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: auto; padding: 0 14px; min-height: 44px;
  border: 1.5px solid var(--c-heading-dark); border-radius: 8px; background: #fff; color: var(--c-heading-dark);
  font-family: var(--f-display); font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.card__body > :nth-last-child(2) { margin-bottom: 14px; }
.card__button svg { width: 18px; height: 18px; }
.card__button:hover, .card__button:focus-visible { background: var(--c-heading-dark); color: #fff; }
.card__button:focus-visible { outline: 3px solid var(--c-primary-aa); outline-offset: 2px; }
.card__button.loading { opacity: .6; }
.card__button--muted { border-color: #d5d9de; color: #6b7280; }

/* Kept for other templates that still use these. */
.badge-sale {
  position: absolute; top: 20px; left: 20px; z-index: 2; padding: 6px 11px; border-radius: 6px; background: var(--c-primary-bright-aa);
  font-family: var(--f-display); font-size: 13px; line-height: 1; font-weight: 700; color: #fff;
}
.price { margin: 0 0 30px; font-size: 15px; line-height: 1.4; font-weight: 700; }
.price del { margin-right: 4px; font-weight: 400; }
.price ins { text-decoration: none; }
.price__suffix { font-size: 12px; }

@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; } }
@media (max-width: 559px) {
  .product-grid { gap: 28px 12px; }
  .card__title { font-size: 14px; }
  .card__cat { font-size: 11px; }
  .card .price { font-size: 15px; }
  .card .price del { font-size: 12px; }
  .card__button { min-height: 40px; font-size: 13px; padding: 0 8px; }
  .card__button svg { display: none; }
  .card__badge { font-size: 12px; padding: 4px 8px; }
}
@media (max-width: 339px) { .product-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .card__img { transition: none; } }
