/* Stars, reviews on the product page, and the review form */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* a row of five stars filled to --v (0 to 5, decimals allowed) */
.stars { --v: 0; display: inline-block; font-size: 1.05rem; line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.stars::before { content: "★★★★★"; background: linear-gradient(90deg, #f5a623 calc(var(--v) / 5 * 100%), #d5d8de 0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.stars.lg { font-size: 1.5rem; }

.rating-line { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: .92rem; font-weight: 600; color: var(--muted, #5b6270); }
.rating-line:hover { color: var(--magenta, #e5188b); }

/* product page section */
.reviews { margin: 56px 0 8px; padding-top: 36px; border-top: 1px solid var(--line, #e3e5ea); }
.reviews > h2 { margin: 0 0 22px; font-size: 1.6rem; }
.reviews-top { display: grid; grid-template-columns: auto minmax(0, 380px); gap: 20px 48px; align-items: center; margin-bottom: 28px; }
.reviews-score b { display: block; font-size: 3rem; line-height: 1; font-weight: 900; }
.reviews-score span { color: var(--muted, #5b6270); font-size: .92rem; }
.reviews-bars { display: grid; gap: 6px; }
.reviews-bars div { display: grid; grid-template-columns: 34px minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted, #5b6270); }
.reviews-bars i { display: block; height: 8px; border-radius: 99px; background: #e8eaee; overflow: hidden; }
.reviews-bars i::after { content: ""; display: block; width: var(--w, 0%); height: 100%; background: #f5a623; border-radius: 99px; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.review-card { padding: 20px 0; border-top: 1px solid var(--line, #e3e5ea); }
.review-card:first-child { border-top: 0; padding-top: 0; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.review-head b { font-size: 1rem; }
.review-meta { color: var(--muted, #5b6270); font-size: .85rem; }
.review-verified { padding: 1px 9px; border-radius: 99px; background: #e1f5ee; color: #136a53; font-size: .72rem; font-weight: 700; }
.review-title { margin: 6px 0 2px; font-weight: 700; }
.review-text { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; color: #2b2d35; }
.reviews-more { margin-top: 18px; text-align: center; }
.reviews-empty { color: var(--muted, #5b6270); }

/* the review form */
.review-wrap { max-width: 720px; }
.review-form { display: grid; gap: 18px; }
.review-item { margin: 0; padding: 22px; border: 1px solid var(--line, #e3e5ea); display: grid; gap: 14px; }
.review-item.has-error { border-color: #d92d20; }
.review-product { display: flex; align-items: center; gap: 14px; }
.review-product img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--bg-soft, #f4f5f7); }
.star-input { position: relative; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; width: fit-content; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { padding: 2px 3px; cursor: pointer; line-height: 1; }
.star-input label::before { content: "★"; font-size: 2.4rem; color: #d5d8de; transition: color .12s, transform .12s; display: block; }
.star-input input:checked ~ label::before, .star-input label:hover::before, .star-input label:hover ~ label::before { color: #f5a623; }
.star-input label:hover::before { transform: scale(1.12); }
.star-input input:focus-visible + label { outline: 3px solid var(--magenta, #e5188b); outline-offset: 2px; border-radius: 6px; }
.review-field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.review-field small { font-weight: 400; color: var(--muted, #5b6270); }
.review-field input, .review-field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line, #d5d8de); border-radius: 8px; font: inherit; font-weight: 400; }
.review-field input:focus, .review-field textarea:focus { outline: 2px solid var(--magenta, #e5188b); border-color: transparent; }
.review-error { margin: 0; color: #b42318; font-weight: 600; }
.review-note { padding: 28px; }
.review-thanks { display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 20px; background: #e7f7f1; border: 1px solid #b6e4d3; }
.review-thanks h2 { margin: 0 0 2px; font-size: 1.15rem; }
.review-thanks p { margin: 0; }
.thanks-check { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--green, #1aa179); color: #fff; font-size: 1.4rem; font-weight: 800; }

@media (max-width: 640px) {
  .reviews-top { grid-template-columns: 1fr; }
  .review-item { padding: 16px; }
  .star-input label::before { font-size: 2.1rem; }
}
