{%- comment -%} MW · Trust Bar — row of icon + label trust/benefit badges. {%- endcomment -%}
{%- assign uid = section.id | replace: '_', '' | replace: '-', '' -%}
{% style %}
  #shopify-section-{{ section.id }}{ --tb-bg:{{ section.settings.section_bg }}; --tb-ic:{{ section.settings.icon_color }}; --tb-title:{{ section.settings.title_color }}; --tb-sub:{{ section.settings.sub_color }}; --tb-div:{{ section.settings.divider_color }}; }
  .tb-{{ uid }}{ background:var(--tb-bg); padding:{{ section.settings.padding }}px {{ section.settings.side_padding }}px; }
  .tb-{{ uid }} .tb__row{ max-width:{{ section.settings.max_width }}px; margin:0 auto; display:grid; grid-template-columns:repeat({{ section.blocks.size }},1fr); gap:clamp(12px,2vw,24px); }
  .tb-{{ uid }} .tb__item{ display:flex; align-items:center; gap:12px; justify-content:{{ section.settings.align }}; position:relative; padding:4px 0; }
  {% if section.settings.dividers %}.tb-{{ uid }} .tb__item + .tb__item:before{ content:""; position:absolute; left:calc(-1 * clamp(6px,1vw,12px)); top:10%; bottom:10%; border-left:1px solid var(--tb-div); }{% endif %}
  .tb-{{ uid }} .tb__ic{ width:{{ section.settings.icon_size }}px; height:{{ section.settings.icon_size }}px; color:var(--tb-ic); flex:none; }
  .tb-{{ uid }} .tb__tt{ font-family:{{ section.settings.heading_font.family }},{{ section.settings.heading_font.fallback_families }}; font-weight:600; font-size:14px; color:var(--tb-title); line-height:1.25; }
  .tb-{{ uid }} .tb__sx{ font-family:{{ section.settings.body_font.family }},{{ section.settings.body_font.fallback_families }}; font-size:12px; color:var(--tb-sub); margin-top:2px; }
  @media (max-width:760px){ .tb-{{ uid }} .tb__row{ grid-template-columns:1fr 1fr; gap:18px; } .tb-{{ uid }} .tb__item:before{ display:none; } .tb-{{ uid }} .tb__item{ justify-content:flex-start; } }
  @media (max-width:420px){ .tb-{{ uid }} .tb__row{ grid-template-columns:1fr; } }
{% endstyle %}
<div class="tb-{{ uid }}">
  <div class="tb__row">
    {%- for block in section.blocks -%}
      <div class="tb__item" {{ block.shopify_attributes }}>
        {% render 'mw-icon', name: block.settings.icon, class: 'tb__ic' %}
        <div><div class="tb__tt">{{ block.settings.title | escape }}</div>{%- if block.settings.sub != blank -%}<div class="tb__sx">{{ block.settings.sub | escape }}</div>{%- endif -%}</div>
      </div>
    {%- endfor -%}
  </div>
</div>
{% schema %}
{
  "name": "MW · Trust Bar",
  "tag": "section",
  "class": "mw-section mw-trust-bar",
  "settings": [
    { "type": "range", "id": "max_width", "min": 800, "max": 1400, "step": 20, "unit": "px", "label": "Content width", "default": 1200 },
    { "type": "range", "id": "padding", "min": 12, "max": 80, "step": 4, "unit": "px", "label": "Vertical padding", "default": 28 },
    { "type": "range", "id": "side_padding", "min": 12, "max": 64, "step": 2, "unit": "px", "label": "Side padding", "default": 24 },
    { "type": "range", "id": "icon_size", "min": 20, "max": 44, "step": 2, "unit": "px", "label": "Icon size", "default": 28 },
    { "type": "select", "id": "align", "label": "Item align", "default": "center", "options": [ {"value":"flex-start","label":"Left"}, {"value":"center","label":"Center"} ] },
    { "type": "checkbox", "id": "dividers", "label": "Show dividers", "default": true },
    { "type": "font_picker", "id": "heading_font", "label": "Title font", "default": "poppins_n6" },
    { "type": "font_picker", "id": "body_font", "label": "Sub font", "default": "inter_n4" },
    { "type": "color", "id": "section_bg", "label": "Background", "default": "#FBF8F3" },
    { "type": "color", "id": "icon_color", "label": "Icon", "default": "#B79B6E" },
    { "type": "color", "id": "title_color", "label": "Title", "default": "#241C15" },
    { "type": "color", "id": "sub_color", "label": "Sub", "default": "#7C7266" },
    { "type": "color", "id": "divider_color", "label": "Divider", "default": "#E5DCCB" }
  ],
  "blocks": [
    { "type": "item", "name": "Trust item", "settings": [
      { "type": "select", "id": "icon", "label": "Icon", "default": "truck", "options": [ {"value":"truck","label":"Truck"}, {"value":"swap","label":"Swap"}, {"value":"lock","label":"Lock"}, {"value":"shield","label":"Shield"}, {"value":"refresh","label":"Refresh"}, {"value":"leaf","label":"Leaf"}, {"value":"heart","label":"Heart"}, {"value":"sparkle","label":"Sparkle"}, {"value":"check-circle","label":"Check"} ] },
      { "type": "text", "id": "title", "label": "Title", "default": "Free shipping" },
      { "type": "text", "id": "sub", "label": "Sub (optional)", "default": "On orders over $50" }
    ] }
  ],
  "max_blocks": 6,
  "presets": [ { "name": "MW · Trust Bar", "blocks": [
    { "type": "item", "settings": { "icon": "truck", "title": "Free shipping", "sub": "On orders over $50" } },
    { "type": "item", "settings": { "icon": "swap", "title": "Free size swaps", "sub": "Both ways, on us" } },
    { "type": "item", "settings": { "icon": "refresh", "title": "60-day returns", "sub": "No-fuss guarantee" } },
    { "type": "item", "settings": { "icon": "lock", "title": "Secure checkout", "sub": "Encrypted payments" } }
  ] } ]
}
{% endschema %}
