/**
 * AsanWP WooCommerce rating component.
 * Loaded only on requests that can render WooCommerce products/reviews.
 */

/* ===== Rating component ===== */
/**
 * AsanWP Rating component
 *
 * Canonical styling for WooCommerce read-only ratings and the interactive
 * product-review rating control. Star geometry, colors and RTL behavior must
 * live here only; feature/widget styles should not redefine these mechanics.
 */

/* Read-only WooCommerce rating used by product cards, widgets and reviews. */
.star-rating {
  --awp-rating-size: .75rem;
  --awp-rating-empty: var(--color-gray300, #d1d5db);
  --awp-rating-fill: var(--color-yellow600, #f5a900);
  --awp-rating-spacing: .125rem;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 6.25em;
  height: 1.25em;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: var(--awp-rating-size);
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.star-rating::before,
.star-rating>span::before {
  content: "";
  display: block;
  width: max-content;
  height: 1.25em;
  margin: 0;
  padding: 0;
  font-family: "AsanWPIcons-interface";
  font-size: 1em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: var(--awp-rating-spacing);
  line-height: 1.25;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.star-rating::before {
  color: var(--awp-rating-empty);
}

.star-rating>span {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  display: block;
  height: 1.25em;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: inherit;
  line-height: 1.25;
  white-space: nowrap;
}

.star-rating>span::before {
  color: var(--awp-rating-fill);
}

.star-rating .rating {
  display: none;
}

body[data-theme=dark] .star-rating,
body[data-color=custom][data-theme=dark] .star-rating {
  --awp-rating-empty: var(--color-gray500, #6b7280);
}

.single-product-wrapper .product-meta .product-rating .star-rating,
.product-detail .star-rating,
.awp-quickview-product .star-rating {
  --awp-rating-size: .875rem;
}

.single-product-wrapper .woocommerce-Reviews .reviews-slot .product-rating .star-rating {
  --awp-rating-size: 1rem;
}

.single-product-wrapper .woocommerce-Reviews #comments .commentlist .star-rating,
.single-product-wrapper .awp-review-rating .star-rating {
  --awp-rating-size: .875rem;
}

/* Interactive WooCommerce review stars. WooCommerce outputs p.stars > span > a. */
p.stars {
  margin: .2rem 0 0;
  padding: 0;
  font-size: 0;
  line-height: 1;
}

p.stars>span {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem;
  width: auto;
  margin: 0;
  padding: 0;
  direction: rtl;
  line-height: 1;
  vertical-align: middle;
}

p.stars a,
.woocommerce-page p.stars a {
  position: relative;
  display: inline-flex;
  flex: 0 0 1.6rem;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-family: inherit;
  font-size: 0;
  line-height: 1;
  text-indent: -9999px;
  text-decoration: none;
}

p.stars a::before,
.woocommerce-page p.stars a::before {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  padding: 0;
  color: var(--color-gray300, #d1d5db);
  font-family: "AsanWPIcons-interface";
  font-size: 1.3rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-indent: 0;
  transition: color .15s ease, transform .15s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p.stars a::after,
.woocommerce-page p.stars a::after {
  content: none;
}

/* Hover/focus preview. :has() lets an RTL row fill from one star through N. */
p.stars:has(.star-1:hover) .star-1::before,
p.stars:has(.star-1:focus-visible) .star-1::before,
p.stars:has(.star-2:hover) :is(.star-1, .star-2)::before,
p.stars:has(.star-2:focus-visible) :is(.star-1, .star-2)::before,
p.stars:has(.star-3:hover) :is(.star-1, .star-2, .star-3)::before,
p.stars:has(.star-3:focus-visible) :is(.star-1, .star-2, .star-3)::before,
p.stars:has(.star-4:hover) :is(.star-1, .star-2, .star-3, .star-4)::before,
p.stars:has(.star-4:focus-visible) :is(.star-1, .star-2, .star-3, .star-4)::before,
p.stars:has(.star-5:hover) a::before,
p.stars:has(.star-5:focus-visible) a::before,
p.stars.selected:has(.star-1.active) .star-1::before,
p.stars.selected:has(.star-2.active) :is(.star-1, .star-2)::before,
p.stars.selected:has(.star-3.active) :is(.star-1, .star-2, .star-3)::before,
p.stars.selected:has(.star-4.active) :is(.star-1, .star-2, .star-3, .star-4)::before,
p.stars.selected:has(.star-5.active) a::before {
  color: var(--color-yellow600, #f5a900);
}

p.stars a:hover::before,
p.stars a:focus-visible::before {
  transform: scale(1.08);
}

body[data-theme=dark] p.stars a::before,
body[data-color=custom][data-theme=dark] p.stars a::before {
  color: var(--color-gray500, #6b7280);
}

body[data-theme=dark] p.stars:has(.star-1:hover) .star-1::before,
body[data-theme=dark] p.stars:has(.star-2:hover) :is(.star-1, .star-2)::before,
body[data-theme=dark] p.stars:has(.star-3:hover) :is(.star-1, .star-2, .star-3)::before,
body[data-theme=dark] p.stars:has(.star-4:hover) :is(.star-1, .star-2, .star-3, .star-4)::before,
body[data-theme=dark] p.stars:has(.star-5:hover) a::before,
body[data-color=custom][data-theme=dark] p.stars:has(.star-1:hover) .star-1::before,
body[data-color=custom][data-theme=dark] p.stars:has(.star-2:hover) :is(.star-1, .star-2)::before,
body[data-color=custom][data-theme=dark] p.stars:has(.star-3:hover) :is(.star-1, .star-2, .star-3)::before,
body[data-color=custom][data-theme=dark] p.stars:has(.star-4:hover) :is(.star-1, .star-2, .star-3, .star-4)::before,
body[data-color=custom][data-theme=dark] p.stars:has(.star-5:hover) a::before {
  color: var(--color-yellow600, #f5a900);
}

/* Shared GDPR/mobile-bottom offset used by both GDPR layouts. */
@media screen and (max-width: 64rem) {
  .site-gdpr.mobile-menu-active {
    bottom: 74px;
  }
}