/* ============================================
   Bewertungszeile (Sterne + Ø + Anzahl)
   Nur .bh-rating / .product-rating in Shop, Karten, PDP.
   Kein Checkout, kein Mini-Cart, kein overflow-x auf html/body.
   Sterne: schwarz auf grauem Leerraum, wie bisher.
   ============================================ */

.bh-rating {
  display: flex;
  align-items: center;
  min-height: 1.25em;
  margin: 0.15rem 0 0.35rem;
  color: #000;
  overflow: visible;
}

.bh-rating--empty {
  visibility: hidden;
  pointer-events: none;
}

.bh-rating-link,
.bh-rating .rating-link,
.woocommerce ul.products li.product .bh-rating a.bh-rating-link,
.woocommerce ul.products li.product .bh-rating a.rating-link,
.upsell-product .bh-rating a.bh-rating-link,
.bestseller-product .bh-rating a.bh-rating-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem 0.5rem;
  width: auto;
  max-width: 100%;
  color: #000;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.bh-rating-link:hover,
.bh-rating .rating-link:hover {
  opacity: 0.7;
}

.bh-rating .stars {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  line-height: 1;
}

.bh-rating .star {
  position: relative;
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  color: #ddd;
}

.bh-rating .star.filled {
  color: #000;
}

.bh-rating .star.half {
  color: #ddd;
}

.bh-rating .star.half::before {
  content: "★";
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: #000;
  pointer-events: none;
}

.bh-rating-avg {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.bh-rating-count,
.bh-rating .rating-count {
  font-size: 13px;
  font-weight: 400;
  color: #000;
}

.bh-rating--single {
  margin: 0.2rem 0 0.85rem;
}

.bh-rating--single .star {
  font-size: 18px;
}

.bh-rating--single .bh-rating-avg {
  font-size: 16px;
}

.bh-rating--single .bh-rating-count {
  font-size: 14px;
}

/*
 * Abstand wie Startseite-Bestseller: Linie unter dem Namen, Sterne direkt darunter.
 * Die globale .product-title-row hat 1.5rem — das ist der zu große Spalt auf Karten/PDP.
 */
.woocommerce ul.products li.product .product-title-row,
.related.products ul.products li.product .product-title-row,
.product-detail-page .product-info > .product-title-row,
.campaign-buy .product-title-row {
  margin-bottom: 0.15rem;
  padding-bottom: 0.35rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  margin-bottom: 0;
}

.woocommerce ul.products li.product .bh-rating,
.related.products ul.products li.product .bh-rating,
.upsell-product .bh-rating,
.bestseller-product .bh-rating {
  margin-top: 0.2rem;
  margin-bottom: 0.35rem;
}

.woocommerce ul.products li.product .product-actions .bh-rating,
.upsell-product .product-actions .bh-rating {
  display: none;
}

/* Upsell-Karten in style.css mit !important — hier gezielt übersteuern. */
.upsell-product .product-title-row {
  margin-bottom: 0.15rem !important;
  padding-bottom: 0.35rem !important;
}

.upsell-product .bh-rating {
  margin-top: 0.2rem !important;
  margin-bottom: 0.35rem !important;
  font-size: 14px !important;
}

.upsell-product .bh-rating .star {
  font-size: 16px !important;
  color: #ddd !important;
}

.upsell-product .bh-rating .star.filled,
.upsell-product .bh-rating .star.half::before {
  color: #000 !important;
}

@media (max-width: 640px) {
  .bh-rating .star {
    font-size: 15px;
  }
  .bh-rating--single .star {
    font-size: 17px;
  }
}
