.product-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 100%;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.product-card:hover {
  border-color: color-mix(in srgb, var(--c-secondary) 50%, var(--c-border));
  box-shadow: var(--shadow-sm);
}

.product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--c-bg-alt);
  overflow: hidden;
  line-height: 0;
}

.product-card__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.product-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--c-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
}

.product-card__badges {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  z-index: 1;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  flex: 1;
  min-width: 0;
}

.product-card__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.product-card__title {
  font-family: var(--ff-base);
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1.35;
  color: var(--c-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--ease);
}

.product-card__title:hover,
.product-card__title:focus-visible {
  color: var(--c-primary);
  text-decoration: none;
}

.product-card__meta {
  font-size: var(--fs-sm);
  color: var(--c-secondary);
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
}

.product-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  font-weight: 700;
  color: var(--c-primary);
  font-size: var(--fs-base);
  line-height: 1.2;
}

.product-card__price-old {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--c-text-muted, #8a8178);
  text-decoration: line-through;
}

.product-card__price-current {
  font-weight: 700;
  color: var(--c-primary);
}

.product-card__cta-form {
  margin: 0;
  flex-shrink: 0;
}

.product-card__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 2.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--ff-base);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.product-card__cta--cart {
  width: 2.5rem;
  padding: 0;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-primary);
}

.product-card__cta--cart:hover:not(:disabled),
.product-card__cta--cart:focus-visible:not(:disabled) {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-text-inverse);
}

.product-card__cta--cart:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.product-card__cta--cart .btn__spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.product-card__cta--cart.htmx-request svg {
  display: none;
}

.product-card__cta--cart.htmx-request .btn__spinner {
  display: inline-block;
}

.product-card__cta--link {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--c-primary);
  background: var(--c-primary);
  color: var(--c-text-inverse);
  text-decoration: none;
}

.product-card__cta--link:hover,
.product-card__cta--link:focus-visible {
  background: #2c1b18;
  border-color: #2c1b18;
  color: var(--c-text-inverse);
}

.product-card--list {
  flex-direction: row;
  align-items: stretch;
}

.product-card--list .product-card__media {
  width: 8rem;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.product-card--list .product-card__body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
}

.product-card--list .product-card__footer {
  margin-top: 0;
  flex-shrink: 0;
}

.product-card--list .product-card__title {
  -webkit-line-clamp: 3;
}

.product-card--home {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.product-card--home:hover {
  box-shadow: none;
  border-color: transparent;
}

.product-card--home .product-card__media {
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card__cta {
    transition: none;
  }
}
