/* Google rating badge — rendered only when config supplies a real rating (hm_google_rating()). */
.hm-grating {
  --hm-gr-ink: #121213;
  --hm-gr-paper: #fff;
  --hm-gr-sand: #f6f4f1;
  --hm-gr-line: #e7e1d9;
  --hm-gr-purple: #8a5aa5;
  --hm-gr-lime: #c8db4f;
  --hm-gr-gold: #fbbc04;
  font-family: inherit;
  box-sizing: border-box;
}
.hm-grating *, .hm-grating *::before, .hm-grating *::after { box-sizing: inherit; }

.hm-grating-stars {
  position: relative;
  display: inline-block;
  line-height: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.hm-grating-stars__base,
.hm-grating-stars__fill { display: flex; flex-wrap: nowrap; gap: 2px; }
.hm-grating-stars svg {
  display: block;
  flex: none;
  width: var(--hm-gr-star, 18px);
  height: var(--hm-gr-star, 18px);
  margin: 0;
}
.hm-grating-stars__base svg { fill: #d9d3cb; }
.hm-grating-stars__fill {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
}
.hm-grating-stars__fill svg { fill: #fbbc04; }

.hm-grating__g { width: 22px; height: 22px; flex: none; display: block; }

/* ---------- bar ---------- */
.hm-grating--bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-radius: 18px;
  background: var(--hm-gr-paper);
  border: 1px solid var(--hm-gr-line);
  box-shadow: 0 18px 40px -28px rgba(18, 18, 19, .45);
  color: var(--hm-gr-ink);
  position: relative;
  overflow: hidden;
}
.hm-grating--bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--hm-gr-purple), var(--hm-gr-lime));
}
.hm-grating--bar.hm-grating--dark {
  background: var(--hm-gr-ink);
  border-color: #2a2a2d;
  color: #fff;
}
.hm-grating__summary { display: flex; align-items: center; gap: 18px; min-width: 0; }
.hm-grating__mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 50%;
  background: var(--hm-gr-sand);
  border: 1px solid var(--hm-gr-line);
}
.hm-grating--dark .hm-grating__mark { background: #fff; border-color: #fff; }
.hm-grating__mark .hm-grating__g { width: 30px; height: 30px; }
.hm-grating__body { min-width: 0; }
.hm-grating__label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hm-gr-purple);
}
.hm-grating--dark .hm-grating__label { color: var(--hm-gr-lime); }
.hm-grating__line { display: flex; align-items: center; gap: 12px; --hm-gr-star: 24px; }
.hm-grating--bar .hm-grating__score { font-size: 40px; line-height: 1; font-weight: 900; letter-spacing: -.02em; }
.hm-grating--bar .hm-grating__count { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: #55534f; }
.hm-grating--dark .hm-grating__count { color: #cfcac3; }

.hm-grating__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hm-grating__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.hm-grating__btn:hover { transform: translateY(-1px); }
.hm-grating__btn:focus-visible { outline: 3px solid var(--hm-gr-purple); outline-offset: 2px; }
.hm-grating__btn--primary { background: var(--hm-gr-purple); color: #fff; border: 2px solid var(--hm-gr-purple); }
.hm-grating__btn--primary:hover { background: #774b91; border-color: #774b91; color: #fff; }
.hm-grating__btn--ghost { background: transparent; color: var(--hm-gr-ink); border: 2px solid var(--hm-gr-ink); }
.hm-grating__btn--ghost:hover { background: var(--hm-gr-lime); border-color: var(--hm-gr-lime); color: var(--hm-gr-ink); }
.hm-grating--dark .hm-grating__btn--primary { background: var(--hm-gr-lime); border-color: var(--hm-gr-lime); color: var(--hm-gr-ink); }
.hm-grating--dark .hm-grating__btn--primary:hover { background: #d6e76a; border-color: #d6e76a; }
.hm-grating--dark .hm-grating__btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .6); }
.hm-grating--dark .hm-grating__btn--ghost:hover { color: var(--hm-gr-ink); }

@media (max-width: 640px) {
  .hm-grating--bar { padding: 20px 18px 20px 22px; gap: 16px; }
  .hm-grating__summary { gap: 14px; }
  .hm-grating__mark { width: 48px; height: 48px; }
  .hm-grating__mark .hm-grating__g { width: 24px; height: 24px; }
  .hm-grating--bar .hm-grating__score { font-size: 32px; }
  .hm-grating__line { --hm-gr-star: 20px; gap: 10px; }
  .hm-grating__actions { width: 100%; }
  .hm-grating__btn { flex: 1 1 140px; }
}

/* ---------- compact pill / inline ---------- */
.hm-grating--compact,
.hm-grating--inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--hm-gr-ink);
  --hm-gr-star: 15px;
}
.hm-grating--compact {
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--hm-gr-paper);
  border: 1px solid var(--hm-gr-line);
  box-shadow: 0 8px 22px -14px rgba(18, 18, 19, .5);
  font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.hm-grating--compact:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -14px rgba(18, 18, 19, .55); color: var(--hm-gr-ink); }
.hm-grating--compact:focus-visible,
.hm-grating--inline:focus-visible { outline: 3px solid var(--hm-gr-lime); outline-offset: 2px; }
.hm-grating--compact .hm-grating__g,
.hm-grating--inline .hm-grating__g { width: 18px; height: 18px; }
.hm-grating--compact .hm-grating__score,
.hm-grating--inline .hm-grating__score { font-weight: 900; font-size: 15px; }
.hm-grating--compact .hm-grating__count { font-weight: 600; color: #55534f; }
.hm-grating--inline { font-size: 14px; }
.hm-grating--inline .hm-grating__count { text-decoration: underline; text-underline-offset: 3px; }
.hm-grating--inline.hm-grating--dark { color: #fff; }

/* ---------- placements ---------- */
.stwf-hero__rating { margin-top: 18px; }
.stwf-reviews__rating { margin-bottom: 48px; }
.hm-rev-marquee__rating { margin-top: 14px; }
@media (max-width: 640px) {
  .stwf-hero__rating { margin-top: 14px; }
  .stwf-hero__rating .hm-grating--compact { font-size: 13px; }
  .stwf-reviews__rating { margin-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-grating__btn, .hm-grating--compact { transition: none; }
  .hm-grating__btn:hover, .hm-grating--compact:hover { transform: none; }
}
