{%- comment -%} MW · Reviews — aggregate rating header + written-review list. {%- endcomment -%}
{%- assign uid = section.id | replace: '_', '' | replace: '-', '' -%}
{% style %}
  #shopify-section-{{ section.id }}{ --rv-bg:{{ section.settings.section_bg }}; --rv-head:{{ section.settings.heading_color }}; --rv-sub:{{ section.settings.sub_color }}; --rv-card:{{ section.settings.card_bg }}; --rv-text:{{ section.settings.text_color }}; --rv-name:{{ section.settings.name_color }}; --rv-line:{{ section.settings.divider_color }}; }
  .rv-{{ uid }}{ background:var(--rv-bg); padding:{{ section.settings.padding_top }}px {{ section.settings.side_padding }}px {{ section.settings.padding_bottom }}px; }
  .rv-{{ uid }} .rv__wrap{ max-width:{{ section.settings.max_width }}px; margin:0 auto; }
  .rv-{{ uid }} .rv__top{ display:flex; align-items:center; gap:clamp(16px,3vw,40px); flex-wrap:wrap; padding-bottom:20px; border-bottom:1px solid var(--rv-line); margin-bottom:24px; }
  .rv-{{ uid }} .rv__avg{ font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:700; font-size:clamp(38px,4vw,52px); line-height:1; color:var(--rv-head); }
  .rv-{{ uid }} .rv__of{ font-size:14px; color:var(--rv-sub); }
  .rv-{{ uid }} .rv__stars{ display:inline-flex; gap:2px; color:var(--mw-star,#E8B04B); } .rv-{{ uid }} .rv__stars svg{ width:17px; height:17px; }
  .rv-{{ uid }} .rv__count{ font-family:{{ section.settings.body_font.family }},{{ section.settings.body_font.fallback_families }}; font-size:13px; color:var(--rv-sub); margin-top:4px; }
  .rv-{{ uid }} .rv__title{ font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:700; font-size:clamp(20px,2vw,26px); color:var(--rv-head); margin:0 0 4px; }
  .rv-{{ uid }} .rv__grid{ display:grid; grid-template-columns:repeat({{ section.settings.columns }},1fr); gap:16px; }
  .rv-{{ uid }} .rv__card{ background:var(--rv-card); border:1px solid var(--rv-line); border-radius:12px; padding:18px 20px; }
  .rv-{{ uid }} .rv__cs{ display:inline-flex; gap:1px; color:var(--mw-star,#E8B04B); margin-bottom:8px; } .rv-{{ uid }} .rv__cs svg{ width:14px; height:14px; }
  .rv-{{ uid }} .rv__ct{ font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:600; font-size:14px; color:var(--rv-name); margin:0 0 6px; }
  .rv-{{ uid }} .rv__cx{ font-family:{{ section.settings.body_font.family }},{{ section.settings.body_font.fallback_families }}; font-size:13.5px; line-height:1.6; color:var(--rv-text); margin:0 0 12px; }
  .rv-{{ uid }} .rv__meta{ display:flex; align-items:center; gap:6px; font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:600; font-size:12.5px; color:var(--rv-name); }
  .rv-{{ uid }} .rv__meta svg{ width:14px; height:14px; color:var(--mw-verify,#2E7D32); }
  .rv-{{ uid }} .rv__meta .d{ font-weight:400; color:var(--rv-sub); margin-left:auto; }
  @media (max-width:760px){ .rv-{{ uid }} .rv__grid{ grid-template-columns:1fr; } }
{% endstyle %}
<div class="rv-{{ uid }}">
  <div class="rv__wrap">
    <div class="rv__top">
      <div class="rv__avg">{{ section.settings.average | escape }}</div>
      <div>
        <span class="rv__stars">{% for i in (1..5) %}{% render 'mw-icon', name: 'star' %}{% endfor %}</span>
        <div class="rv__count">{{ section.settings.count_text | escape }}</div>
      </div>
      {%- if section.settings.heading != blank -%}<div style="margin-left:auto"><h2 class="rv__title">{{ section.settings.heading | escape }}</h2></div>{%- endif -%}
    </div>
    <div class="rv__grid">
      {%- for block in section.blocks -%}
        <article class="rv__card" {{ block.shopify_attributes }}>
          <span class="rv__cs">{% for i in (1..5) %}{% render 'mw-icon', name: 'star' %}{% endfor %}</span>
          {%- if block.settings.title != blank -%}<p class="rv__ct">{{ block.settings.title | escape }}</p>{%- endif -%}
          <p class="rv__cx">{{ block.settings.text | escape }}</p>
          <div class="rv__meta">{% if block.settings.verified %}{% render 'mw-icon', name: 'verified' %}{% endif %}{{ block.settings.name | escape }}<span class="d">{{ block.settings.date | escape }}</span></div>
        </article>
      {%- endfor -%}
    </div>
  </div>
</div>
{% schema %}
{
  "name": "MW · Reviews",
  "tag": "section",
  "class": "mw-section mw-reviews",
  "settings": [
    { "type": "text", "id": "average", "label": "Average rating", "default": "4.9" },
    { "type": "text", "id": "count_text", "label": "Count text", "default": "Based on 4,000+ verified reviews" },
    { "type": "text", "id": "heading", "label": "Heading (right)", "default": "What people say" },
    { "type": "range", "id": "columns", "min": 1, "max": 4, "step": 1, "label": "Columns", "default": 2 },
    { "type": "range", "id": "max_width", "min": 800, "max": 1300, "step": 10, "unit": "px", "label": "Content width", "default": 1120 },
    { "type": "range", "id": "padding_top", "min": 0, "max": 160, "step": 4, "unit": "px", "label": "Padding top", "default": 64 },
    { "type": "range", "id": "padding_bottom", "min": 0, "max": 160, "step": 4, "unit": "px", "label": "Padding bottom", "default": 64 },
    { "type": "range", "id": "side_padding", "min": 12, "max": 64, "step": 2, "unit": "px", "label": "Side padding", "default": 24 },
    { "type": "font_picker", "id": "heading_font", "label": "Heading font", "default": "poppins_n7" },
    { "type": "font_picker", "id": "body_font", "label": "Body font", "default": "inter_n4" },
    { "type": "color", "id": "section_bg", "label": "Background", "default": "#EDE4DC" },
    { "type": "color", "id": "heading_color", "label": "Heading", "default": "#1A1A1A" },
    { "type": "color", "id": "sub_color", "label": "Sub", "default": "#7C7266" },
    { "type": "color", "id": "card_bg", "label": "Card", "default": "#FBF8F3" },
    { "type": "color", "id": "text_color", "label": "Review text", "default": "#5C5449" },
    { "type": "color", "id": "name_color", "label": "Name", "default": "#241C15" },
    { "type": "color", "id": "divider_color", "label": "Divider / border", "default": "#DCD1BE" }
  ],
  "blocks": [
    { "type": "review", "name": "Review", "settings": [
      { "type": "text", "id": "title", "label": "Title", "default": "Exactly as described" },
      { "type": "textarea", "id": "text", "label": "Text", "default": "Soft, well made and the fit is true to size. Have already ordered a second colour." },
      { "type": "text", "id": "name", "label": "Name", "default": "Nora H." },
      { "type": "checkbox", "id": "verified", "label": "Verified", "default": true },
      { "type": "text", "id": "date", "label": "Date", "default": "2 weeks ago" }
    ] }
  ],
  "max_blocks": 12,
  "presets": [ { "name": "MW · Reviews", "blocks": [
    { "type": "review", "settings": { "title": "The lining makes it", "text": "No slip needed and no itch. It skims instead of clinging and it has survived three washes with no shedding.", "name": "Nora H.", "date": "2 weeks ago" } },
    { "type": "review", "settings": { "title": "Day to night, genuinely", "text": "Wore it to the office under a cardigan, took the cardigan off for dinner. One dress, two rooms.", "name": "Juliet M.", "date": "1 month ago" } },
    { "type": "review", "settings": { "title": "True to size", "text": "Ordered my usual and it fit first time. The size guide is accurate and the hem length is perfect.", "name": "Sofie L.", "date": "3 weeks ago" } },
    { "type": "review", "settings": { "title": "Bought a second", "text": "Came back for the onyx within a week. Says everything really.", "name": "Elin K.", "date": "5 days ago" } }
  ] } ]
}
{% endschema %}
