{%- comment -%} MW · Customer Stories — big-image testimonial carousel with quote cards. {%- endcomment -%}
{%- assign uid = section.id | replace: '_', '' | replace: '-', '' -%}
{% style %}
  #shopify-section-{{ section.id }}{ --cs-bg:{{ section.settings.section_bg }}; --cs-head:{{ section.settings.heading_color }}; --cs-accent:{{ section.settings.accent_color }}; --cs-sub:{{ section.settings.sub_color }}; --cs-card:{{ section.settings.card_bg }}; --cs-qt:{{ section.settings.quote_color }}; --cs-name:{{ section.settings.name_color }}; --cs-pill:{{ section.settings.pill_bg }}; }
  .cs-{{ uid }}{ background:var(--cs-bg); padding:{{ section.settings.padding_top }}px 0 {{ section.settings.padding_bottom }}px; }
  .cs-{{ uid }} .cs__head{ text-align:center; max-width:640px; margin:0 auto clamp(24px,3vw,40px); padding:0 24px; }
  .cs-{{ uid }} .cs__rating{ display:inline-flex; align-items:center; gap:8px; background:var(--cs-pill); border-radius:999px; padding:7px 14px; font-family:{{ section.settings.body_font.family }},{{ section.settings.body_font.fallback_families }}; font-size:13px; color:var(--cs-name); margin-bottom:16px; }
  .cs-{{ uid }} .cs__rating .st{ display:inline-flex; gap:1px; color:var(--mw-star,#E8B04B); } .cs-{{ uid }} .cs__rating svg{ width:14px; height:14px; }
  .cs-{{ uid }} .cs__h{ font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:700; font-size:clamp(24px,2.8vw,34px); line-height:1.12; color:var(--cs-head); margin:0; }
  .cs-{{ uid }} .cs__h .ac{ color:var(--cs-accent); background:linear-gradient(99deg,var(--cs-accent) 0%,color-mix(in srgb,var(--cs-accent),#fff 32%) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent; }
  .cs-{{ uid }} .cs__sub{ font-family:{{ section.settings.body_font.family }},{{ section.settings.body_font.fallback_families }}; font-size:14px; color:var(--cs-sub); margin:10px 0 0; }
  .cs-{{ uid }} .cs__track{ display:flex; gap:{{ section.settings.gap }}px; overflow-x:auto; scroll-snap-type:x mandatory; padding:6px {{ section.settings.side_padding }}px; scrollbar-width:none; }
  .cs-{{ uid }} .cs__track::-webkit-scrollbar{ display:none; }
  .cs-{{ uid }} .cs__card{ flex:0 0 {{ section.settings.card_width }}px; max-width:84vw; scroll-snap-align:center; }
  .cs-{{ uid }} .cs__img{ width:100%; aspect-ratio:{{ section.settings.image_ratio }}; border-radius:{{ section.settings.card_radius }}px; overflow:hidden; }
  .cs-{{ uid }} .cs__img img{ width:100%; height:100%; object-fit:cover; display:block; }
  .cs-{{ uid }} .cs__quote{ background:var(--cs-card); border-radius:10px; padding:16px 18px; margin-top:14px; font-family:{{ section.settings.body_font.family }},{{ section.settings.body_font.fallback_families }}; font-size:13.5px; line-height:1.6; color:var(--cs-qt); box-shadow:var(--mw-shadow-sm,0 1px 3px rgba(58,48,39,.08)); }
  .cs-{{ uid }} .cs__nm{ display:block; margin-top:10px; font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:600; font-size:12.5px; color:var(--cs-name); }
  .cs-{{ uid }} .cs__ctrls{ display:flex; justify-content:center; gap:10px; margin-top:22px; }
  .cs-{{ uid }} .cs__ctrls button{ width:38px; height:38px; border-radius:50%; background:#fff; border:1px solid var(--mw-line,#E5DCCB); cursor:pointer; color:var(--cs-head); display:flex; align-items:center; justify-content:center; }
  .cs-{{ uid }} .cs__ctrls svg{ width:18px; height:18px; }
{% endstyle %}
<div class="cs-{{ uid }}" id="cs-{{ uid }}">
  <div class="cs__head">
    {%- if section.settings.rating_text != blank -%}<div class="cs__rating"><span class="st">{% for i in (1..5) %}{% render 'mw-icon', name: 'star' %}{% endfor %}</span>{{ section.settings.rating_text | escape }}</div>{%- endif -%}
    {%- if section.settings.heading != blank -%}<h2 class="cs__h">{{ section.settings.heading }}</h2>{%- endif -%}
    {%- if section.settings.sub != blank -%}<p class="cs__sub">{{ section.settings.sub | escape }}</p>{%- endif -%}
  </div>
  <div class="cs__track" data-track>
    {%- for block in section.blocks -%}
      <div class="cs__card" {{ block.shopify_attributes }}>
        <div class="cs__img">{% render 'mw-image', image: block.settings.image, url: block.settings.image_url, alt: block.settings.name, width: 700 %}</div>
        <div class="cs__quote">{{ block.settings.quote | escape }}<span class="cs__nm">{{ block.settings.name | escape }}</span></div>
      </div>
    {%- endfor -%}
  </div>
  <div class="cs__ctrls"><button data-prev aria-label="Previous">{% render 'mw-icon', name: 'arrow-left' %}</button><button data-next aria-label="Next">{% render 'mw-icon', name: 'arrow-right' %}</button></div>
</div>
<script>
(function(){var r=document.getElementById('cs-{{ uid }}');if(!r)return;var t=r.querySelector('[data-track]');
function step(d){var c=t.querySelector('.cs__card');var g=parseInt(getComputedStyle(t).columnGap)||20;var w=c?c.offsetWidth+g:360;t.scrollBy({left:d*w,behavior:'smooth'});}
r.querySelector('[data-prev]').addEventListener('click',function(){step(-1)});r.querySelector('[data-next]').addEventListener('click',function(){step(1)});})();
</script>
{% schema %}
{
  "name": "MW · Customer Stories",
  "tag": "section",
  "class": "mw-section mw-customer-stories",
  "settings": [
    { "type": "text", "id": "rating_text", "label": "Rating pill text", "default": "4.9 out of 5 from 4,000+ dresses" },
    { "type": "html", "id": "heading", "label": "Heading", "info": "Use <span class=\"ac\">…</span> for the accent.", "default": "Bought once, <span class=\"ac\">worn all season</span>" },
    { "type": "text", "id": "sub", "label": "Sub", "default": "A few months of real wear later." },
    { "type": "range", "id": "card_width", "min": 260, "max": 460, "step": 10, "unit": "px", "label": "Card width", "default": 360 },
    { "type": "select", "id": "image_ratio", "label": "Image ratio", "default": "3/4", "options": [ {"value":"3/4","label":"3:4"}, {"value":"4/5","label":"4:5"}, {"value":"1/1","label":"1:1"} ] },
    { "type": "range", "id": "card_radius", "min": 0, "max": 20, "step": 1, "unit": "px", "label": "Image radius", "default": 4 },
    { "type": "range", "id": "gap", "min": 12, "max": 44, "step": 2, "unit": "px", "label": "Gap", "default": 24 },
    { "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": 80, "step": 2, "unit": "px", "label": "Side padding", "default": 40 },
    { "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": "accent_color", "label": "Accent", "default": "#B79B6E" },
    { "type": "color", "id": "sub_color", "label": "Sub", "default": "#7C7266" },
    { "type": "color", "id": "card_bg", "label": "Quote card", "default": "#FFFFFF" },
    { "type": "color", "id": "quote_color", "label": "Quote", "default": "#5C5449" },
    { "type": "color", "id": "name_color", "label": "Name", "default": "#241C15" },
    { "type": "color", "id": "pill_bg", "label": "Rating pill", "default": "#FFFFFF" }
  ],
  "blocks": [
    { "type": "story", "name": "Story", "settings": [
      { "type": "image_picker", "id": "image", "label": "Photo" },
      { "type": "text", "id": "image_url", "label": "…or photo URL" },
      { "type": "textarea", "id": "quote", "label": "Quote", "default": "I bought this for one wedding and it has since done a birthday, two dinners and an ordinary Thursday at the office under a cardigan." },
      { "type": "text", "id": "name", "label": "Name", "default": "Nora H." }
    ] }
  ],
  "max_blocks": 12,
  "presets": [ { "name": "MW · Customer Stories", "blocks": [
    { "type": "story", "settings": { "quote": "I bought this for one wedding and it has since done a birthday, two dinners and an ordinary Thursday at the office under a cardigan. The lining is the detail nobody mentions.", "name": "Nora H." } },
    { "type": "story", "settings": { "quote": "Every other sequin dress I own scratches. This one is soft against the skin because the sequins are part of the knit rather than sewn on top.", "name": "Juliet M." } },
    { "type": "story", "settings": { "quote": "Getting used to take an hour. Now it is this dress, earrings and out. It looks considered without any effort.", "name": "Elin K." } }
  ] } ]
}
{% endschema %}
