.product-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-bg);
}

.product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 8px 12px;
  text-decoration: none;
  color: inherit;
}

.product-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 8px;
  overflow: hidden;
}

.product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-card__discount {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: calc(1.4em + 4px);
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-price);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.product-card__discount:empty {
  visibility: hidden;
}

.product-card__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.product-card__price {
  color: var(--color-price);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.product-card__old-price {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: line-through;
}

.product-card__stock {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--color-stock);
  font-size: 13px;
  line-height: 1.3;
}

.product-card__stock--out {
  color: var(--color-muted);
}

.product-card__stock-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.product-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
  margin: 8px 0 0;
  height: calc(1.35em * 2);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.product-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 8px;
  border-radius: 0 0 16px 16px;
  background: var(--color-search-bg);
  transition: opacity 0.15s ease;
}

.product-card__action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}

.product-card__action[hidden] {
  display: none !important;
}

.product-card__action-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-badge);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.product-card__action:hover {
  background: var(--color-hover);
}

.product-card__action--active {
  color: var(--color-price);
}

.product-card:hover,
.product-card:focus-within {
  box-shadow: 0 8px 28px var(--color-card-shadow);
}

@media (min-width: 768px) {
  .product-card__link {
    padding: 10px 12px 14px;
  }

  .product-card__price {
    font-size: 20px;
  }

  .product-card__title {
    font-size: 14px;
  }

  .product-card__action {
    width: 40px;
    height: 40px;
  }
}
