body.woocommerce-shop ul.products,
body.post-type-archive-product ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products,
body.search ul.products {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: clamp(1.05rem, 1vw, 1.5rem);
}

body.woocommerce-shop ul.products li.product,
body.post-type-archive-product ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product,
body.search ul.products li.product,
body.single-product section.related ul.products li.product {
  float: none;
  width: auto;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 100%;
  padding: clamp(1.08rem, 1rem + 0.4vw, 1.35rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(255, 255, 255, 0.042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.042) 1px, transparent 1px),
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 98%, transparent), color-mix(in srgb, var(--color-bg-elevated) 92%, transparent)),
    color-mix(in srgb, var(--color-surface) 96%, transparent);
  background-size: 24px 24px, 24px 24px, auto;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    filter var(--transition-fast);
}

html[data-theme="light"] body.woocommerce-shop ul.products li.product,
html[data-theme="light"] body.post-type-archive-product ul.products li.product,
html[data-theme="light"] body.tax-product_cat ul.products li.product,
html[data-theme="light"] body.tax-product_tag ul.products li.product,
html[data-theme="light"] body.single-product section.related ul.products li.product {
  background:
    linear-gradient(rgba(15, 23, 42, 0.046) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.046) 1px, transparent 1px),
    radial-gradient(circle at top right, rgba(217, 119, 31, 0.045), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.98));
  background-size: 20px 20px, 20px 20px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    var(--shadow-sm);
}

/* Einzelprodukt · Ähnliche Produkte: Dark/Auto – gleiche Raster- + Radial-Karte wie .fv-product-shell (Light bleibt Block oben). */
html:not([data-theme="light"]) body.single-product section.related ul.products li.product {
  background:
    linear-gradient(rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 98%, transparent), color-mix(in srgb, var(--color-bg-elevated) 92%, transparent));
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: var(--shadow-sm);
}

body.woocommerce-shop ul.products li.product:hover,
body.woocommerce-shop ul.products li.product:focus-within,
body.post-type-archive-product ul.products li.product:hover,
body.post-type-archive-product ul.products li.product:focus-within,
body.tax-product_cat ul.products li.product:hover,
body.tax-product_cat ul.products li.product:focus-within,
body.tax-product_tag ul.products li.product:hover,
body.tax-product_tag ul.products li.product:focus-within,
body.single-product section.related ul.products li.product:hover,
body.single-product section.related ul.products li.product:focus-within {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  filter: saturate(1.02);
}

body.woocommerce-shop ul.products li.product a img,
body.post-type-archive-product ul.products li.product a img,
body.tax-product_cat ul.products li.product a img,
body.tax-product_tag ul.products li.product a img,
body.single-product section.related ul.products li.product a img {
  display: block;
  margin: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  border-radius: calc(var(--radius-lg) - 0.35rem);
  background: color-mix(in srgb, var(--color-surface-soft) 96%, transparent);
}

body.woocommerce-shop ul.products li.product .woocommerce-loop-product__link,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__link,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__link,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__link,
body.single-product section.related ul.products li.product .woocommerce-loop-product__link {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.78rem;
  min-width: 0;
  height: 100%;
  color: inherit;
}

/* Produktkatalog: Link füllt die Kartenhöhe, Abstände/ Sterne-Slot per Variable (siehe Block unten). */
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__link,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__link,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__link,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__link {
  position: relative;
  min-height: 0;
  height: auto;
  --fv-plp-link-gap: 0.78rem;
  --fv-plp-rating-slot: 1.35rem;
  gap: var(--fv-plp-link-gap);
}

/* Flex-Spacer: Freiraum oberhalb des Warenkorb-Buttons (wie „Ähnliche Produkte“). */
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__link::after,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__link::after,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__link::after,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__link::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
}

body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__title,
body.single-product section.related ul.products li.product .woocommerce-loop-product__title {
  color: var(--color-text);
  margin: 0;
  font-size: 1.03rem;
  font-weight: 650;
  line-height: 1.36;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: pretty;
}

body.woocommerce-shop ul.products li.product .price,
body.post-type-archive-product ul.products li.product .price,
body.tax-product_cat ul.products li.product .price,
body.tax-product_tag ul.products li.product .price,
body.single-product section.related ul.products li.product .price,
body.single-product.fv-product-layout-active .fv-product-summary-inner .price {
  color: var(--color-text);
  font-weight: 700;
}

/* Produktkatalog (Shop, Kategorien, …): gleich hohe Karten im Grid, Titel/Preis/Sterne-Button-Fläche bündig. */
body.woocommerce-shop ul.products li.product,
body.post-type-archive-product ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product {
  min-height: 0;
}

body.woocommerce-shop ul.products li.product .price,
body.post-type-archive-product ul.products li.product .price,
body.tax-product_cat ul.products li.product .price,
body.tax-product_tag ul.products li.product .price {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  font-size: 1.02rem;
  line-height: 1.32;
  min-height: calc(1.02rem * 1.32 * 2);
}

body.woocommerce-shop ul.products li.product .star-rating,
body.post-type-archive-product ul.products li.product .star-rating,
body.tax-product_cat ul.products li.product .star-rating,
body.tax-product_tag ul.products li.product .star-rating {
  flex: 0 0 auto;
  margin: 0;
  min-height: var(--fv-plp-rating-slot, 1.35rem);
  box-sizing: border-box;
}

body.woocommerce-shop
  ul.products
  li.product
  .woocommerce-loop-product__link:not(:has(.star-rating))
  .price,
body.post-type-archive-product
  ul.products
  li.product
  .woocommerce-loop-product__link:not(:has(.star-rating))
  .price,
body.tax-product_cat
  ul.products
  li.product
  .woocommerce-loop-product__link:not(:has(.star-rating))
  .price,
body.tax-product_tag
  ul.products
  li.product
  .woocommerce-loop-product__link:not(:has(.star-rating))
  .price {
  padding-top: calc(var(--fv-plp-link-gap, 0.78rem) + var(--fv-plp-rating-slot, 1.35rem));
}

body.woocommerce-shop ul.products li.product .button,
body.post-type-archive-product ul.products li.product .button,
body.tax-product_cat ul.products li.product .button,
body.tax-product_tag ul.products li.product .button,
body.single-product section.related ul.products li.product .button {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  min-height: 3.12rem;
  margin-top: 0.95rem;
  padding: 0.84rem 1.22rem;
  border: 1px solid color-mix(in srgb, var(--color-accent-strong) 58%, transparent);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, white 8%, var(--color-accent)), color-mix(in srgb, var(--color-accent-strong) 90%, black));
  box-shadow:
    inset 0 1px 0 var(--fv-highlight-inset),
    0 16px 30px color-mix(in srgb, var(--color-accent) 20%, transparent);
  color: var(--fv-text-on-accent);
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    color var(--transition-fast);
}

body.woocommerce-shop ul.products li.product .button:hover,
body.woocommerce-shop ul.products li.product .button:focus-visible,
body.post-type-archive-product ul.products li.product .button:hover,
body.post-type-archive-product ul.products li.product .button:focus-visible,
body.tax-product_cat ul.products li.product .button:hover,
body.tax-product_cat ul.products li.product .button:focus-visible,
body.tax-product_tag ul.products li.product .button:hover,
body.tax-product_tag ul.products li.product .button:focus-visible,
body.single-product section.related ul.products li.product .button:hover,
body.single-product section.related ul.products li.product .button:focus-visible {
  border-color: color-mix(in srgb, var(--color-accent) 68%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 20px 38px color-mix(in srgb, var(--color-accent) 24%, transparent);
  color: var(--fv-text-on-accent);
  filter: saturate(1.05) brightness(1.02);
}

body.woocommerce-shop ul.products li.product .added_to_cart,
body.post-type-archive-product ul.products li.product .added_to_cart,
body.tax-product_cat ul.products li.product .added_to_cart,
body.tax-product_tag ul.products li.product .added_to_cart,
body.single-product section.related ul.products li.product .added_to_cart {
  flex: 0 0 auto;
  margin-top: 0.7rem;
}

/* Einzelprodukt · Ähnliche Produkte: ~30 % kompakter, nochmals ~10 % kleiner; Kartenhöhe + ausgerichtete Titel/Preis/Button. */
body.single-product section.related ul.products li.product {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: clamp(0.68rem, 0.63rem + 0.25vw, 0.86rem);
  gap: 0.57rem;
}

body.single-product section.related ul.products li.product .woocommerce-loop-product__link {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  --fv-related-link-gap: 0.5rem;
  --fv-related-rating-slot: 1.35rem;
  gap: var(--fv-related-link-gap);
}

/* Flex-Spacer: freier Rest unter Titel+Preis, Button sitzt bündig am unteren Kartenrand. */
body.single-product section.related ul.products li.product .woocommerce-loop-product__link::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
}

/* Shop-Grid-Regel (margin-top: auto auf .price) würde Preis ziehen — hier: festes Raster mit Zeilen. */
body.single-product section.related ul.products li.product .price {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  font-size: 0.81rem;
  line-height: 1.28;
  min-height: calc(0.81rem * 1.28 * 2);
}

body.single-product section.related ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.855rem;
  line-height: 1.3;
}

body.single-product section.related ul.products li.product .star-rating {
  flex: 0 0 auto;
  margin: 0;
  min-height: var(--fv-related-rating-slot, 1.35rem);
  box-sizing: border-box;
}

/* Kein Rating: gleiche vertikale Position der Preiszeile wie bei Karten mit Sternen (Gap + Sternen-Zeile). */
body.single-product
  section.related
  ul.products
  li.product
  .woocommerce-loop-product__link:not(:has(.star-rating))
  .price {
  padding-top: calc(var(--fv-related-link-gap, 0.5rem) + var(--fv-related-rating-slot, 1.35rem));
}

body.single-product section.related ul.products li.product .button {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 1.98rem;
  margin-top: 0.58rem;
  padding: 0.52rem 0.79rem;
  border-radius: 18px; /* mit PDP-CTA-Geometrie: gleiche Eckenform wie Warenkorb (nicht 999px) */
}

body.single-product section.related ul.products li.product .added_to_cart {
  flex: 0 0 auto;
  margin-top: 0.45rem;
}

body.woocommerce-shop .woocommerce-products-header,
body.post-type-archive-product .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header,
body.tax-product_tag .woocommerce-products-header {
  display: grid;
  gap: 0.65rem;
}

body.woocommerce-shop .woocommerce-products-header__title,
body.post-type-archive-product .woocommerce-products-header__title,
body.tax-product_cat .woocommerce-products-header__title,
body.tax-product_tag .woocommerce-products-header__title {
  margin-bottom: 0;
}

body.woocommerce-shop .woocommerce-ordering,
body.post-type-archive-product .woocommerce-ordering,
body.tax-product_cat .woocommerce-ordering,
body.tax-product_tag .woocommerce-ordering,
body.woocommerce-shop .woocommerce-result-count,
body.post-type-archive-product .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count,
body.tax-product_tag .woocommerce-result-count {
  margin: 0;
}

body.woocommerce-shop .woocommerce-ordering,
body.post-type-archive-product .woocommerce-ordering,
body.tax-product_cat .woocommerce-ordering,
body.tax-product_tag .woocommerce-ordering {
  justify-self: start;
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface-soft) 96%, transparent);
}

body.woocommerce-shop .woocommerce-result-count,
body.post-type-archive-product .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count,
body.tax-product_tag .woocommerce-result-count {
  font-size: 0.92rem;
}

body.woocommerce-shop .woocommerce-result-count.fv-result-count,
body.post-type-archive-product .woocommerce-result-count.fv-result-count,
body.tax-product_cat .woocommerce-result-count.fv-result-count,
body.tax-product_tag .woocommerce-result-count.fv-result-count {
  display: block;
  line-height: 1.45;
}

body.woocommerce-shop .fv-result-count .fv-result-count-top,
body.post-type-archive-product .fv-result-count .fv-result-count-top,
body.tax-product_cat .fv-result-count .fv-result-count-top,
body.tax-product_tag .fv-result-count .fv-result-count-top {
  font-weight: 600;
}

body.woocommerce-shop .fv-result-count .fv-result-count-bottom,
body.post-type-archive-product .fv-result-count .fv-result-count-bottom,
body.tax-product_cat .fv-result-count .fv-result-count-bottom,
body.tax-product_tag .fv-result-count .fv-result-count-bottom {
  color: var(--color-text-muted);
  font-size: 0.9em;
  font-weight: 500;
}

body.woocommerce-shop nav.woocommerce-pagination,
body.post-type-archive-product nav.woocommerce-pagination,
body.tax-product_cat nav.woocommerce-pagination,
body.tax-product_tag nav.woocommerce-pagination {
  margin-top: clamp(0.5rem, 0.8vw, 1rem);
}

body.woocommerce-shop span.onsale,
body.post-type-archive-product span.onsale,
body.tax-product_cat span.onsale,
body.tax-product_tag span.onsale,
body.single-product span.onsale {
  min-height: auto;
  min-width: auto;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-warm), color-mix(in srgb, var(--color-warm) 72%, white));
  color: #1d1000;
  font-weight: 700;
  line-height: 1;
}

body.fv-product-layout-active .fv-product-media .woocommerce-product-gallery__wrapper,
body.fv-product-layout-active .fv-product-media .flex-control-thumbs li img {
  border-radius: var(--radius-md);
}

body.fv-product-layout-active .fv-product-media .woocommerce-product-gallery {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-surface) 96%, transparent);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 1rem + 0.8vw, 1.5rem);
}

body.single-product .site-main > .product,
body.single-product .site-main .ast-woocommerce-container > .product,
body.single-product .site-main .woocommerce div.product {
  padding: clamp(1.2rem, 1rem + 0.9vw, 1.9rem);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-lg) + 0.2rem);
  background:
    linear-gradient(rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 98%, transparent), color-mix(in srgb, var(--color-bg-elevated) 94%, transparent));
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] body.single-product .site-main > .product,
html[data-theme="light"] body.single-product .site-main .ast-woocommerce-container > .product,
html[data-theme="light"] body.single-product .site-main .woocommerce div.product {
  background:
    linear-gradient(rgba(15, 23, 42, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.038) 1px, transparent 1px),
    radial-gradient(circle at top right, rgba(217, 119, 31, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.98));
  background-size: 22px 22px, 22px 22px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    var(--shadow-sm);
}

@media (max-width: 768px) {
  body.single-product .site-main > .product,
  body.single-product .site-main .ast-woocommerce-container > .product,
  body.single-product .site-main .woocommerce div.product {
    padding: 1rem;
  }

  body.fv-product-layout-active .site-main > .product,
  body.fv-product-layout-active .site-main .ast-woocommerce-container > .product,
  body.fv-product-layout-active .site-main .woocommerce div.product {
    padding: 0;
  }
}

/* Formavis Single-Product-Layout: äußere „Produktkarte“-Rahmung im Shell, nicht am WC-#product-Wrapper. */
body.fv-product-layout-active .site-main > .product,
body.fv-product-layout-active .site-main .ast-woocommerce-container > .product,
body.fv-product-layout-active .site-main .woocommerce div.product {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

html[data-theme="light"] body.fv-product-layout-active .site-main > .product,
html[data-theme="light"] body.fv-product-layout-active .site-main .ast-woocommerce-container > .product,
html[data-theme="light"] body.fv-product-layout-active .site-main .woocommerce div.product {
  background: none !important;
  background-image: none !important;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  padding: 0;
}

@media (max-width: 768px) {
  body.woocommerce-shop .woocommerce-ordering,
  body.post-type-archive-product .woocommerce-ordering,
  body.tax-product_cat .woocommerce-ordering,
  body.tax-product_tag .woocommerce-ordering {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products,
  body.search ul.products {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  body.woocommerce-shop ul.products li.product,
  body.post-type-archive-product ul.products li.product,
  body.tax-product_cat ul.products li.product,
  body.tax-product_tag ul.products li.product,
  body.search ul.products li.product {
    padding: 1rem;
  }
}

@media (min-width: 1024px) {
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products,
  body.search ul.products {
    gap: 1.35rem;
  }
}

/* PLP: kontrolliertes „Weitere Produkte laden“ (AJAX) */
.fv-plp-ajax {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.fv-plp-load-more[hidden] {
  display: none !important;
}

.fv-plp-load-more.fv-plp-is-loading {
  cursor: wait;
  opacity: 0.88;
}

.fv-plp-load-more.fv-plp-exhausted {
  cursor: default;
  opacity: 0.92;
}

.fv-plp-auto-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}

/* Option 1: keine doppelte Steuerung — auf Seite 1 nur Load-More; Pag. ab Seite 2 / per ?paged= */
body.fv-plp-no-classic-pag nav.woocommerce-pagination,
body.fv-plp-no-classic-pag .woocommerce nav.woocommerce-pagination {
  display: none !important;
}
