/* ==========================================================================
   Products Page
   Product Card variant builds on the base .card from card.css.
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface-secondary);
  color: var(--color-text-muted);
}

.product-card--out-of-stock .product-card-thumb {
  opacity: 0.5;
}

.product-card-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.product-card-category {
  font-size: var(--font-size-caption);
  color: var(--color-text-secondary);
}

.product-card-name {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-1);
}

.product-card-price {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

.stock-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.stock-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.stock-indicator--healthy {
  color: var(--color-success);
}

.stock-indicator--low {
  color: var(--color-warning);
}

.stock-indicator--out {
  color: var(--color-danger);
}
