{#
  Read-only star rating with fractional fill.
  Params: value (Alpine expression → number 0–5), size (px), class, active_class, inactive_class.
  Each star = outline in the inactive colour + a clipped filled star; no SVG ids, so any
  number of instances can coexist and RTL clips from the correct edge.
#}
{% set size = size|default(18) %}
{% set gap = gap|default('rvx-gap-[2px]') %}
<div class="rvx-stars rvx-flex rvx-items-center {{ gap }} {{ class|default('') }}" role="img" :aria-label="`${Number({{ value }}).toFixed(1)} / 5`">
  <template x-for="star in 5" :key="star">
    <span class="rvx-stars__star rvx-relative rvx-block rvx-leading-none" :style="{ width: '{{ size }}px', height: '{{ size }}px' }">
      {% include 'storefront/ui/icon.twig' with { name: 'star', size: size, class: 'rvx-absolute rvx-inset-0 rvx-text-line-strong ' ~ inactive_class|default('rvx-reviewer__star-inactive') } %}
      <span class="rvx-absolute rvx-inset-y-0 rvx-start-0 rvx-overflow-hidden" :style="{ width: (starFill(star, {{ value }}) * 100) + '%' }">
        {% include 'storefront/ui/icon.twig' with { name: 'star', size: size, class: 'rvx-text-merchant-star ' ~ active_class|default('rvx-reviewer__star-active') } %}
      </span>
    </span>
  </template>
</div>
