/* ==========================================================================
   VENTIVA — 07 Shop-Übersicht
   Produktarchiv und Kategorieseiten.

   Kein Amber in den Kacheln. Die Übersicht ist eine Auswahl, keine
   Aufforderung — das Amber kommt erst auf der Produktseite, wo es genau
   einen Kaufbutton gibt.
   ========================================================================== */

.v-shop { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0; }

.v-shop__head {
  max-width: 46ch;
  margin-bottom: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem);
}
.v-shop__title { font-size: var(--fs-h2); }
.v-shop__head .term-description p { color: var(--v-ink-60); margin-bottom: 0; }

/* --- Trefferzahl und Sortierung ------------------------------------------ */
.woocommerce-result-count {
  margin: 0;
  font-family: var(--v-mono);
  font-size: var(--fs-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--v-ink-60);
}
.woocommerce-ordering { margin: 0; }
.woocommerce-ordering select {
  padding: .6rem 2rem .6rem .9rem;
  border: 0;
  border-radius: 999px;
  background: var(--v-paper);
  box-shadow: inset 0 0 0 1px var(--v-line);
  font-family: var(--v-body);
  font-size: var(--fs-sm);
  color: var(--v-ink);
}

/* Beide sitzen in einer Zeile über dem Raster. Woo gibt sie ab Werk mit
   float aus — das hier hebt es auf, sonst rutscht das Raster darunter.
   body davor, damit die Regel unabhängig von der Ladereihenfolge gewinnt. */
.v-shop .woocommerce-result-count,
.v-shop .woocommerce-ordering,
body.woocommerce .v-shop .woocommerce-result-count,
body.woocommerce .v-shop .woocommerce-ordering {
  float: none;
  display: inline-block;
  vertical-align: middle;
}
.v-shop .woocommerce-ordering { margin-left: 1.2rem; }

/* --- Raster --------------------------------------------------------------
   WICHTIG — diese Regeln bitte nicht "aufräumen":

   inc/enqueue.php entfernt woocommerce-layout.css über den Filter
   woocommerce_enqueue_styles. Darauf ist aber kein Verlass: Ein Cache- oder
   Optimierungs-Plugin, das CSS zusammenfasst, kann die Datei wieder
   hereinholen, und nach einem unvollständigen Upload fehlt der Filter ganz.

   Genau das ist auf der Live-Seite passiert. woocommerce-layout.css setzt
   li.product auf float:left und width:22.05%. Die Kachel schrumpfte dadurch
   auf ein Fünftel, und weil ein Float seine Nachbarn nicht verdrängt, lief
   der Preistext quer daneben ins Layout. Nachgemessen: Kachel 92 statt
   416 Pixel, Preis 144 Pixel über den Rand hinaus.

   Deshalb hebt der Block unten die Float-Regeln ausdrücklich auf. Die
   Selektoren mit body davor liegen eine Stelle über Woos Spezifität und
   gewinnen damit unabhängig von der Ladereihenfolge.
   -------------------------------------------------------------------------- */
ul.products,
body.woocommerce ul.products {
  list-style: none;
  margin: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--v-col-gap);
}

/* Woos Float-Layout neutralisieren. */
body.woocommerce ul.products li.product,
ul.products li.product {
  float: none;
  clear: none;
  width: auto;
  margin: 0;
  padding: 0;
}

@media (max-width: 900px) {
  ul.products,
  body.woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  ul.products,
  body.woocommerce ul.products { grid-template-columns: minmax(0, 1fr); }
}

/* --- Kachel --------------------------------------------------------------
   ACHTUNG — hier lag ein Fehler, bitte nicht zurückbauen:

   Die Kachel stand auf display:flex ohne Richtungsangabe, also in einer
   Zeile. Der Kartenrahmen (weisse Fläche, Radius, Schatten) sass auf
   .v-tile__link. Solange der Link das einzige Kind war, fiel das nicht auf.

   content-product.php ruft nach dem schliessenden </a> aber noch
   do_action( 'woocommerce_after_shop_loop_item' ) auf — dort hängen
   Deutschland-Plugins wie Germanized ihren Steuer- und Versandhinweis ein.
   Der wurde damit zum zweiten Flex-Kind NEBEN dem Link: Der Link schrumpfte
   auf ein Fünftel, der Hinweis stellte sich rechts daneben ausserhalb der
   weissen Karte. Genau das war auf der Live-Seite zu sehen.

   Jetzt trägt .v-tile selbst den Kartenrahmen und stapelt in einer Spalte.
   Alles, was ein Plugin hinten anhängt, landet dadurch innerhalb der Karte
   unter dem Inhalt — egal, was es ist und ob wir es kennen.
   -------------------------------------------------------------------------- */
.v-tile {
  display: flex;
  flex-direction: column;
  background: var(--v-paper);
  border-radius: var(--v-radius-lg);
  overflow: hidden;
  box-shadow: var(--v-shadow);
  transition: transform var(--v-fast) var(--v-ease),
              box-shadow var(--v-fast) var(--v-ease);
}
.v-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--v-shadow-lg);
}
@media (prefers-reduced-motion: reduce) {
  .v-tile:hover { transform: none; }
}

/* Kein Kind darf die Kachel aufspreizen. */
.v-tile > * { min-width: 0; max-width: 100%; }

.v-tile__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

/* Was WooCommerce-Plugins hinter dem Link einhängen — Steuerhinweis,
   Versandkosten, Grundpreis. Die Klassennamen unterscheiden sich je nach
   Plugin, deshalb greift zusätzlich der Nachbarschafts-Selektor auf alles,
   was nach dem Link kommt. */
.v-tile > .v-tile__link ~ *,
.v-tile .wc-gzd-additional-info,
.v-tile .woocommerce-de_price_taxrate,
.v-tile .wc-gzd-shipping-costs-info {
  margin: 0;
  padding: 0 clamp(1.1rem, .9rem + 1vw, 1.6rem);
  font-family: var(--v-mono);
  font-size: var(--fs-mono);
  line-height: 1.5;
  letter-spacing: .02em;
  /* 60 statt 40 Prozent: Hier landen der Steuerhinweis und die
     Versandkostenangabe der Plugins — Pflichtangaben nach PAngV, die erkennbar
     sein müssen. Bei 11,5 px kommt --v-ink-40 auf 2,5:1. */
  color: var(--v-ink-60);
  overflow-wrap: anywhere;
}
.v-tile > .v-tile__link ~ *:last-child {
  padding-bottom: clamp(1.1rem, .9rem + 1vw, 1.6rem);
}
.v-tile > .v-tile__link ~ * a { color: inherit; }

.v-tile__media {
  position: relative;
  background: var(--v-mist);
}
.v-tile__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Woos Sale-Fähnchen — ruhig, in Petrol statt in Signalrot. */
.v-tile__media .onsale {
  position: absolute;
  top: .9rem;
  left: .9rem;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: var(--v-deep);
  color: #F2F6F3;
  font-family: var(--v-mono);
  font-size: var(--fs-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.v-tile__body {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: clamp(1.1rem, .9rem + 1vw, 1.6rem);
  flex: 1;
  /* Ohne min-width:0 darf ein Flex-Kind nicht unter seine Inhaltsbreite
     schrumpfen — ein langer Produktname würde die Kachel auseinanderdrücken. */
  min-width: 0;
}

.v-tile__title {
  font-size: var(--fs-lg);
  /* Produktnamen wie "Entlastungkissen Lendenwirbelstütze" sind lang und
     haben keine Trennstelle. anywhere bricht notfalls mitten im Wort, statt
     den Text über den Kachelrand zu schieben. */
  overflow-wrap: anywhere;
  hyphens: auto;
}

.v-tile__text {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--v-ink-60);
  overflow-wrap: anywhere;
}

.v-tile__foot {
  margin-top: auto;
  padding-top: .8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem .9rem;
  min-width: 0;
}
.v-tile__price {
  font-size: var(--fs-lg);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.v-tile__price del {
  color: var(--v-ink-60);
  font-weight: 400;
  margin-right: .4rem;
  /* Ausdrücklich, aus demselben Grund wie auf der Produktseite. */
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
/* Auch hier muss der innere Span mitgemeint sein — siehe 04-product.css. */
.v-tile__price del .woocommerce-Price-amount {
  font-size: inherit;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.v-tile__price ins,
.v-tile__price ins .woocommerce-Price-amount { text-decoration: none; }
.v-tile__price ins { text-decoration: none; }

/* Steuer- und Versandhinweis, den WooCommerce an den Preis hängt.
   Er kommt aus den Woo-Einstellungen und kann lang sein — bei einem
   Kleinunternehmer etwa "Kein Mehrwertsteuerausweis, da Kleinunternehmer
   nach § 19 (1) UStG". Er gehört auf eine eigene Zeile und in Kleinschrift,
   sonst konkurriert er mit dem Preis. */
.v-tile__price .woocommerce-price-suffix,
.v-tile__price small {
  display: block;
  margin-top: .35rem;
  font-family: var(--v-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--v-ink-60);
}
.v-tile__price .woocommerce-price-suffix a { color: inherit; }

.v-tile__rating {
  font-family: var(--v-mono);
  font-size: var(--fs-mono);
  color: var(--v-ink-60);
  letter-spacing: .04em;
}

/* Textueller Hinweis statt Button: Die ganze Kachel ist das Klickziel. */
.v-tile__cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--v-ink-60);
  transition: color var(--v-fast) var(--v-ease);
}
.v-tile__cta::after {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  transition: width var(--v-fast) var(--v-ease);
}
.v-tile__link:hover .v-tile__cta { color: var(--v-ink); }
.v-tile__link:hover .v-tile__cta::after { width: 24px; }

/* --- Blätterung ---------------------------------------------------------- */
.woocommerce-pagination {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  font-family: var(--v-mono);
  font-size: var(--fs-mono);
  letter-spacing: .08em;
}
.woocommerce-pagination ul.page-numbers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: .7rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--v-ink-60);
  box-shadow: inset 0 0 0 1px var(--v-line);
}
.woocommerce-pagination .page-numbers:hover { color: var(--v-ink); background: rgba(18, 58, 52, .06); }
.woocommerce-pagination .page-numbers.current {
  color: var(--v-ink);
  background: var(--v-paper);
  box-shadow: inset 0 0 0 1px var(--v-ink-40);
}
