/* --- WooCommerce Produkt-Listen --- */
ul.products li.product figure {
  position: relative;
  overflow: visible;
}

/* Allgemeiner Badge-Stil im Blocksy-Stil */
.custom-product-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: absolute;
  top: var(--badge-top, 15px);
  inset-inline-start: var(--badge-left, 15px);
  height: var(--badge-height, 28px);
  min-width: var(--badge-min-width, 55px);
  border-radius: var(--badge-radius, 0px);
  padding: var(--badge-padding, 5px 10px);
  text-align: center;
  color: var(--badge-text-color, #fff);
  background-color: var(--badge-background-color, var(--theme-palette-color-2));
  font-size: var(--badge-font-size, 12px);
  font-weight: 600;
  text-transform: uppercase;
  pointer-events: none;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Farbvarianten */
.custom-product-badge.pfand {
  --badge-background-color: #2b9e4b; /* grün */
}

.custom-product-badge.neu {
  --badge-background-color: #e63946; /* rot */
}

/* --- Automatisches vertikales Stapeln in Produktlisten --- */
figure .custom-product-badge:nth-of-type(1) {
  top: var(--badge-top, 15px);
}
figure .custom-product-badge:nth-of-type(2) {
  top: calc(var(--badge-top, 15px) + 35px);
}
figure .custom-product-badge:nth-of-type(3) {
  top: calc(var(--badge-top, 15px) + 70px);
}

/* Wenn gleichzeitig "AUSVERKAUFT"-Badge existiert → Abstand nach unten */
figure .out-of-stock-badge + .custom-product-badge {
  top: calc(var(--badge-top, 15px) + 35px);
}

/* --- Badges auf der Single Product Seite --- */
.single-product .woocommerce-product-gallery,
.single-product .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery__image {
  position: relative;
}

/* Basisstil bleibt konsistent */
.single-product .custom-product-badge {
  position: absolute;
  left: 15px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: var(--badge-radius, 0px);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background-color: var(--theme-palette-color-1, #00a651);
}

/* --- Vertikales Stapeln auch auf der Einzelproduktseite --- */
.single-product .custom-product-badge:nth-of-type(1) {
  top: 15px;
}
.single-product .custom-product-badge:nth-of-type(2) {
  top: 50px;
}
.single-product .custom-product-badge:nth-of-type(3) {
  top: 85px;
}

/* --- 🔧 Sicherstellen, dass das Mehrweg-Badge über dem Bild liegt --- */
.single-product figure.ct-media-container img {
  position: relative !important;
  z-index: 5 !important;
}

.single-product .mehrweg-badge {
  position: absolute !important;
  bottom: 15px !important;
  right: 15px !important;
  z-index: 50 !important; /* deutlich über dem Bild */
  width: 80px !important;
  height: auto !important;
  display: block !important;
  pointer-events: none !important;
}

.single-product .mehrweg-badge img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
}
