.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

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

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Feste Höhe, damit Produktfotos und das Vial-SVG trotz
   unterschiedlicher Seitenverhältnisse gleich hohe Karten ergeben. */
.product-card-media {
  background: var(--color-bg-alt);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 190px;
  overflow: hidden;
}

.product-card-media img {
  max-width: 96px;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-card-tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

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

.product-card-category {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent-dark);
}

.product-card-body h3 {
  font-size: var(--fs-md);
}

.product-card-variants {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  /* Platz für zwei Zeilen freihalten: lange Peptidklassen brechen um und
     würden sonst nur die Rasterzeile strecken, in der sie stehen -
     die Reihen wären dann unterschiedlich hoch. Zeilenhöhe hier fest,
     damit die Reserve nicht von base.css abhängt. */
  line-height: 1.5;
  min-height: 3em;
}

.product-card-purity {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-xs);
  color: var(--color-success);
  font-weight: 600;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Mindestabstand zwischen Preis und Button: space-between allein
     lässt beide bei schmalen Karten aneinanderstoßen. */
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: 0.5rem;
}

.product-card-footer .btn {
  flex-shrink: 0;
}

.product-card-price {
  font-weight: 800;
  font-size: var(--fs-md);
}

.product-card-price span {
  font-weight: 500;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.product-card .btn {
  padding: 0.5rem 1rem;
  font-size: var(--fs-xs);
}

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.filter-pill {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--color-accent);
}

.filter-pill.is-active {
  background: var(--color-text);
  color: var(--color-text-inverse);
  border-color: var(--color-text);
}

.product-card[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------
   Klickbare Produktkarte ("stretched link").

   Der Titel-Link legt sich unsichtbar über die gesamte Karte, damit
   jede Stelle - auch das Foto - zur Produktseite führt. Das bleibt ein
   einziger Link im Accessibility-Baum; verschachtelte <a> wären
   ungültiges HTML. Fußzeile und Badge liegen darüber, damit der
   Warenkorb-Button weiterhin klickt.
   ------------------------------------------------------------------ */
.product-card.is-linked {
  position: relative;
}

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

/* Nur der aktive Warenkorb-Button liegt über dem Link. Alles andere -
   Foto, Text, Preis, auch die Fußzeile ausverkaufter Karten - führt
   damit zur Produktseite. */
.product-card.is-linked .product-card-footer button:not(:disabled) {
  position: relative;
  z-index: 2;
}

/* Fokus sichtbar machen: der Link selbst ist nur der Titeltext, der
   Rahmen soll aber die ganze Karte umfassen. */
.product-card-link:focus-visible {
  outline: none;
}

.product-card.is-linked:focus-within {
  outline: 2px solid var(--color-accent-dark);
  outline-offset: 2px;
}

.product-card.is-linked:hover .product-card-link {
  color: var(--color-accent-dark);
}
