/* Customer reviews (product page): star ratings, summary, list and the write-a-review form. Uses the shop's theme colours. */
.rv { --rv-star: #f2a900; --rv-star-off: #ddd6c4; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--c-border); scroll-margin-top: 110px; }
.rv > h2 { margin-bottom: var(--space-2); }

/* ---- stars (pure CSS: the filled layer is cut to the rating with rv-w0 .. rv-w10) ---- */
.rv-stars { position: relative; display: inline-block; line-height: 0; white-space: nowrap; vertical-align: middle; --s: 16px; }
.rv-stars svg { width: var(--s); height: var(--s); display: inline-block; flex: none; }
.rv-stars-bg svg { fill: var(--rv-star-off, #ddd6c4); }
.rv-stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; }
.rv-stars-fg svg { fill: var(--rv-star, #f2a900); }
.rv-stars-lg { --s: 22px; }
.rv-w0 { width: 0; } .rv-w1 { width: 10%; } .rv-w2 { width: 20%; } .rv-w3 { width: 30%; } .rv-w4 { width: 40%; } .rv-w5 { width: 50%; }
.rv-w6 { width: 60%; } .rv-w7 { width: 70%; } .rv-w8 { width: 80%; } .rv-w9 { width: 90%; } .rv-w10 { width: 100%; }

/* ---- the line under the product name ---- */
.rv-badge { margin: 0 0 .6rem; font-size: .92rem; }
.rv-badge a { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--c-muted); }
.rv-badge a:hover span { text-decoration: underline; text-decoration-color: var(--c-gold-deep); }
.rv-badge strong { color: var(--c-text); }

/* ---- summary ---- */
.rv-top { display: grid; gap: var(--space-3); align-items: center; padding: var(--space-3); background: var(--c-bg-alt); border: 1px solid var(--c-border); border-radius: 12px; margin-bottom: var(--space-3); }
.rv-score { text-align: center; }
.rv-avg { margin: 0; font-family: var(--font-heading); font-size: 3rem; line-height: 1; font-weight: 600; }
.rv-avg span { font-size: 1rem; font-weight: 400; color: var(--c-muted); }
.rv-avg-empty { font-size: 1.35rem; line-height: 1.3; margin-bottom: .4rem; }
.rv-score .rv-stars { margin: .5rem 0 .25rem; }
.rv-count { margin: 0; color: var(--c-muted); font-size: .9rem; }
.rv-bars { display: grid; gap: .4rem; max-width: 420px; width: 100%; margin: 0 auto; }
.rv-bars li { display: grid; grid-template-columns: 4.2rem 1fr 2rem; align-items: center; gap: .6rem; font-size: .85rem; color: var(--c-muted); }
.rv-bar-n { text-align: right; }
.rv-bar { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--rv-star-off); overflow: hidden; }
.rv-bar::-webkit-progress-bar { background: var(--rv-star-off); border-radius: 99px; }
.rv-bar::-webkit-progress-value { background: var(--rv-star); border-radius: 99px; }
.rv-bar::-moz-progress-bar { background: var(--rv-star); border-radius: 99px; }
.rv-cta { text-align: center; }
.rv-write-btn { min-height: 46px; padding-inline: 1.6rem; }
.rv-cta-note { margin: .6rem auto 0; font-size: .85rem; color: var(--c-muted); }
@media (min-width: 820px) {
  .rv-top { grid-template-columns: 200px 1fr auto; gap: var(--space-4); }
  .rv-top:not(:has(.rv-bars)) { grid-template-columns: 1fr auto; }
  .rv-cta { text-align: right; }
}

/* ---- the form ---- */
.rv-write { margin-bottom: var(--space-3); }
.rv-write > summary { list-style: none; cursor: pointer; display: inline-flex; justify-content: center; min-height: 46px; padding-inline: 1.6rem; }
.rv-write[open] > summary, .rv.is-js .rv-write > summary { display: none; }
.rv-write > summary::-webkit-details-marker { display: none; }
.rv-write:not([open]) > .rv-form { display: none; }
.rv-form { display: grid; gap: .9rem; padding: var(--space-3); background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.05); }
.rv-form-title { margin: 0; font-size: 1.2rem; }
.rv-grid { display: grid; gap: .9rem; }
@media (min-width: 640px) { .rv-grid { grid-template-columns: 1fr 1fr; } }
.rv-field { display: grid; gap: .3rem; }
.rv-field label, .rv-rate legend { font-size: .88rem; font-weight: 600; padding: 0; }
.rv-field label small { font-weight: 400; color: var(--c-muted); }
.rv-field input, .rv-field textarea { width: 100%; min-height: 46px; padding: .6rem .8rem; font: inherit; color: var(--c-text); background: #fff; border: 1px solid var(--c-border); border-radius: 8px; }
.rv-field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.rv-field input:focus-visible, .rv-field textarea:focus-visible { outline: 2px solid var(--c-gold-deep); outline-offset: 1px; }
.rv-field input[aria-invalid="true"], .rv-field textarea[aria-invalid="true"] { border-color: #c8161d; }
.rv-hint { margin: 0; font-size: .78rem; color: var(--c-muted); text-align: right; }
.rv-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rv-rate { border: 0; margin: 0; padding: 0; min-width: 0; }
.rv-rate legend { margin-bottom: .35rem; }
.rv-rate-row { position: relative; display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.rv-rate-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rv-rate-row label { cursor: pointer; line-height: 0; padding: .15rem; border-radius: 6px; }
.rv-rate-row label svg { width: 34px; height: 34px; fill: var(--rv-star-off); transition: fill .12s, transform .12s; }
.rv-rate-row label:hover svg, .rv-rate-row label:hover ~ label svg, .rv-rate-row input:checked ~ label svg { fill: var(--rv-star); }
.rv-rate-row label:hover svg { transform: scale(1.08); }
.rv-rate-row input:focus-visible + label { outline: 2px solid var(--c-text); outline-offset: 2px; }
.rv-rate.is-invalid .rv-rate-row { outline: 2px solid #c8161d; outline-offset: 4px; border-radius: 6px; }
.rv-actions { display: grid; gap: .5rem; }
.rv-submit { min-height: 48px; justify-self: start; padding-inline: 2rem; }
.rv-submit[disabled] { opacity: .65; cursor: wait; }
.rv-fine { margin: 0; font-size: .8rem; color: var(--c-muted); }
.rv-msg { margin: 0; padding: .65rem .8rem; border-radius: 8px; font-size: .92rem; line-height: 1.45; }
.rv-msg.is-ok { background: #e8f6ec; color: #17602d; border: 1px solid #bfe3c9; }
.rv-msg.is-err { background: #fdecea; color: #9b1c14; border: 1px solid #f3c2bd; }
.rv-form.is-done > :not(.rv-msg):not(.rv-form-title) { display: none; }

/* ---- the list ---- */
.rv-listbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: var(--space-3) 0 .5rem; }
.rv-listcount { margin: 0; }
.rv-sort { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--c-muted); }
.rv-sort select { font: inherit; color: var(--c-text); padding: .4rem 1.8rem .4rem .7rem; min-height: 40px; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; }
.rv-list { display: grid; gap: var(--space-2); grid-template-columns: minmax(0, 1fr); align-items: start; }
.rv-item { padding: 1.25rem 1.4rem 1.35rem; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.rv-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .8rem; align-items: center; margin-bottom: .85rem; padding-bottom: .85rem; border-bottom: 1px solid var(--c-border); }
.rv-avatar { grid-row: 1 / span 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 1.1rem; color: var(--c-text); background: var(--c-bg-alt); border: 1px solid var(--c-border); }
.rv-who { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .6rem; }
.rv-head .rv-stars { grid-column: 2; grid-row: 2; justify-self: start; margin: 0; --s: 17px; }
.rv-name { margin: 0; font-weight: 600; line-height: 1.3; max-width: none; overflow-wrap: anywhere; }
.rv-date { margin: 0; font-size: .8rem; color: var(--c-muted); }
.rv-verified { display: inline-flex; align-items: center; gap: .25rem; margin-left: .35rem; padding: .1rem .5rem; font-size: .72rem; font-weight: 600; color: #17602d; background: #e8f6ec; border-radius: 99px; white-space: nowrap; }
.rv-verified svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rv-title { margin: 0 0 .35rem; font-size: 1.05rem; line-height: 1.35; font-family: var(--font-body); font-weight: 600; }
.rv-body { margin: 0; color: var(--c-text); line-height: 1.7; max-width: none; overflow-wrap: anywhere; }
.rv-reply { margin: 1rem 0 0; padding: .75rem 1rem; background: var(--c-bg-alt); border-left: 3px solid var(--c-gold-deep); border-radius: 0 8px 8px 0; font-size: .92rem; }
.rv-reply p { margin: 0; max-width: none; }
.rv-reply-by { font-weight: 600; font-size: .75rem; margin-bottom: .2rem !important; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
@media (min-width: 900px) { .rv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rv-more { text-align: center; margin: var(--space-2) 0 0; }

@media (prefers-reduced-motion: reduce) { .rv-rate-row label svg { transition: none; } }
