{{ 'section-product-v5.css' | asset_url | stylesheet_tag }}

<div class='product-v5'>
  <section {% render 'section-attr' %}>
    <xo-container {% render 'section-layout' %}>
      <div class='product-v5__title six-float'>{{ section.settings.title }}</div>
      <div class='product-v5__section-grid'>
        <div class='product-v5__grid'>
          {% for block in section.blocks %}
            <div class='product-v5__col'>
              {% for product in block.settings.collection.products limit: block.settings.limit %}
                <a href='{{ product.url }}' class='product-v5__card'>
                  {%- render 'image', image: product.featured_image -%}
                </a>
              {% endfor %}
            </div>
          {% endfor %}
        </div>
      </div>
    </xo-container>
  </section>
</div>

{% schema %}
{
  "name": "t:sections.product_v5.name",
  "tag": "section",
  "class": "section",
  "settings": [
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.all.width.label",
      "default": "box",
      "options": [
        {
          "value": "box",
          "label": "t:sections.all.width.options__1.label"
        },
        {
          "value": "wide",
          "label": "t:sections.all.width.options__2.label"
        },
        {
          "value": "fullwidth",
          "label": "t:sections.all.width.options__3.label"
        },
        {
          "value": "sidepadding",
          "label": "t:sections.all.width.options__4.label"
        }
      ]
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.product_v5.settings.title.label",
      "default": "Shop the Latest Trends"
    },
    {
      "type": "header",
      "content": "t:sections.all.heading.content"
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.color_scheme.label"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:sections.all.bg_color.label"
    },
    {
      "type": "color_background",
      "id": "background_gradient",
      "label": "t:sections.all.bg_gradient.label"
    },
    {
      "type": "number",
      "id": "padding_top",
      "label": "t:sections.all.padding_top.label",
      "default": 50
    },
    {
      "type": "number",
      "id": "padding_bottom",
      "label": "t:sections.all.padding_bottom.label",
      "default": 50
    }
  ],
  "blocks": [
    {
      "type": "slideshow",
      "name": "t:sections.product_v5.blocks.name",
      "settings": [
        {
          "type": "collection",
          "id": "collection",
          "label": "t:sections.product_v5.blocks.collection.label"
        },
        {
          "type": "range",
          "id": "limit",
          "min": 2,
          "max": 20,
          "step": 1,
          "label": "t:sections.product_v5.blocks.products.label",
          "default": 8
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.product_v5.presets.name"
    }
  ]
}
{% endschema %}
