.c-product-card {
  --product-card-border: #dde4ee;
  --product-card-media-surface: #f5f7fa;
  --product-card-accent: var(--color-error-500);
  --product-card-gold: var(--color-warning-500);
  --product-card-title: #1a1a2e;
  --product-card-feature: #4a5a70;
  --product-card-animal-label: #b0b8c4;
  --product-card-divider: #edf1f5;

  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  background: var(--color-surface-primary);
  border: var(--border-width-default) solid var(--product-card-border);
  border-radius: var(--radius-card);
}

/*
 * A variable product's price range is one unit: it stays on a single line and
 * reads low-to-high right-to-left, while each amount keeps its own LTR run.
 */
.c-price-range {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1);
  direction: rtl;
}

.c-price-range__separator {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-regular);
}

/* Keep every WooCommerce amount and its currency together in shared price UI. */
.c-product-price .woocommerce-Price-amount,
.c-product-price .woocommerce-Price-amount bdi,
.c-product-price ins,
.c-product-price del {
  white-space: nowrap;
}

.c-product-price .woocommerce-Price-amount,
.c-product-price .woocommerce-Price-amount bdi {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.3125rem;
  direction: ltr;
}

.c-product-price .woocommerce-Price-currencySymbol {
  order: -1;
  flex: 0 0 auto;
}

.c-product-price del {
  position: relative;
  text-decoration: none;
}

.c-product-price del::after {
  position: absolute;
  inset-block-start: 50%;
  inset-inline: 0;
  border-block-start: var(--border-width-default) solid currentcolor;
  content: "";
  pointer-events: none;
}

.c-product-card__media {
  position: relative;
  /* Own stacking context so the badge and gradient stay under the card link. */
  z-index: 0;
  display: block;
  height: 9.75rem;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--product-card-media-surface);
}

.c-product-card__media::after {
  position: absolute;
  z-index: 1;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(78.8%, 14.921875rem);
  background: linear-gradient(150.64deg, rgb(0 141 151 / 8%) 0%, rgb(0 0 0 / 0%) 55%);
  content: "";
  pointer-events: none;
}

.c-product-card__media-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.c-product-card__image,
.c-product-card__image-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-product-card__image {
  transition: transform var(--duration-slow) var(--ease-standard);
}

.c-product-card__image-placeholder {
  background: linear-gradient(135deg, var(--color-primary-50), var(--color-surface-secondary));
}

.c-product-card__badge {
  position: absolute;
  z-index: 2;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  min-width: 1.75rem;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-control);
  color: var(--color-text-inverse);
  font-size: var(--type-caption-sm-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--type-caption-sm-line-height);
  text-align: center;
}

.c-product-card__badge--accent {
  background: var(--product-card-accent);
}

.c-product-card__badge--gold {
  background: var(--product-card-gold);
}

.c-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}

.c-product-card__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.c-product-card__title {
  display: flex;
  min-height: 2.875rem;
  overflow: hidden;
  align-items: flex-start;
  margin: 0;
  color: var(--product-card-title);
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.4375rem;
}

.c-product-card__title a {
  display: -webkit-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  overflow-wrap: anywhere;
  text-align: start;
  text-decoration: none;
  white-space: normal;
  word-break: normal;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.c-product-card__title a:hover {
  color: var(--color-brand-hover);
}

/* Stretch the title link over the whole card so any blank area opens the PDP. */
.c-product-card:has(.c-product-card__link) {
  cursor: pointer;
}

.c-product-card__link::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

/* Clicks land on the card link, not on the inert text blocks above it. */
.c-product-card__features,
.c-product-card__meta {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/*
 * The purchase row owns its own links, so it opts out of the card link
 * entirely: clicking the price or the gap between buttons does nothing.
 */
.c-product-card__purchase {
  position: relative;
  z-index: 2;
  cursor: auto;
}

.c-product-card__link:focus-visible::after {
  outline: var(--border-width-thick, 2px) solid var(--color-brand, currentcolor);
  outline-offset: -2px;
}

.c-product-card__features {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  color: var(--product-card-feature);
  font-size: var(--type-body-md-size);
  line-height: var(--type-caption-sm-line-height);
  list-style: none;
}

.c-product-card__features li {
  display: flex;
  min-height: var(--size-icon-sm);
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
}

.c-product-card__features img {
  width: var(--size-icon-sm);
  height: var(--size-icon-sm);
  flex: 0 0 auto;
}

.c-product-card__features span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-product-card__feature--empty {
  visibility: hidden;
}

.c-product-card__meta {
  display: flex;
  min-height: 1.625rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.c-product-card__animal {
  display: inline-flex;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.c-product-card__animal--empty {
  min-height: 1.625rem;
}

.c-product-card__animal-label {
  color: var(--product-card-animal-label);
  font-size: var(--type-caption-sm-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--type-caption-sm-line-height);
}

.c-product-card__animal strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--type-body-md-size);
  font-weight: var(--font-weight-bold);
  line-height: 1.25rem;
  text-overflow: ellipsis;
}

.c-product-card__stock {
  flex: 0 0 auto;
  min-width: 1.75rem;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-control);
  color: var(--color-text-inverse);
  font-size: var(--type-caption-sm-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--type-caption-sm-line-height);
  text-align: center;
}

.c-product-card__stock--success {
  background: var(--color-success-500);
}

.c-product-card__stock--warning {
  background: var(--color-warning-600);
}

.c-product-card__stock--error {
  background: var(--color-error-500);
}

.c-product-card__divider {
  width: 100%;
  height: var(--border-width-default);
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  background: var(--product-card-divider);
}

.c-product-card__purchase {
  display: flex;
  min-height: 5.5rem;
  flex-direction: column;
  gap: var(--space-6);
}

.c-product-card__price {
  display: flex;
  min-height: 1.5rem;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.6875rem;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-tertiary);
  direction: ltr;
  font-size: var(--type-body-md-size);
  line-height: 1.5rem;
  white-space: nowrap;
}

.c-product-card__price .price,
.c-product-card__price del,
.c-product-card__price ins {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
}

.c-product-card__price .price {
  flex-wrap: wrap;
}

.c-product-card__price .woocommerce-Price-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  color: var(--color-text-primary);
  direction: ltr;
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
}

.c-product-card__price ins {
  text-decoration: none;
}

.c-product-card__price del {
  color: var(--color-text-tertiary);
  opacity: 1;
}

.c-product-card__price .woocommerce-Price-amount bdi {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  direction: ltr;
}

.c-product-card__price .woocommerce-Price-currencySymbol {
  order: -1;
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
  font-size: var(--type-body-md-size);
  font-weight: var(--font-weight-regular);
}

.c-product-card__price--inquiry {
  color: var(--color-text-secondary);
  direction: rtl;
  font-size: var(--type-body-md-size);
  font-weight: var(--font-weight-regular);
}

.c-product-card__price--hidden {
  visibility: hidden;
}

.c-product-card__buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.c-product-card__buttons--single {
  grid-template-columns: minmax(0, 1fr);
}

.c-product-card__button {
  min-width: 0;
  min-height: 2.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .c-product-card:hover .c-product-card__image {
    transform: scale(1.04);
  }
}
