

<section {% render 'section-attr' %}>
  <xo-container {% render 'section-layout' %}>
    <div class='collection-v3'>
      <div class='collection-v3__header'>
        <div class='collection-v3__left'>
          <div class='collection-v3__sub'>{{ section.settings.sub }}</div>
          <div class='collection-v3__title'>{{ section.settings.title }}</div>
        </div>
        <div class='collection-v3__right'>
          <div class='collection-v3__btn'>
            <a href='{{ section.settings.button_url }}' class='collection-v3__url'>
              {{ section.settings.btn_text }}
            </a>
            <div class='collection-v3__icon'>
              <svg xmlns='http://www.w3.org/2000/svg' width='20px' height='20px' viewBox='0 0 24 24' fill='none'>
                <path d="M4 12H20M20 12L16 8M20 12L16 16" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
              </svg>
            </div>
          </div>
        </div>
      </div>
      <xo-carousel
        xo-per-view='3'
        class='collection-v3__embla'
        xo-breakpoints='
          {
            576: {
             perView: 1,
            },
            768: {
              perView: 2,
            },
            992: {
              perView: 3,
            },
          }
        '
      >
        <xo-carousel-inner class='collection-v3__embla__viewport'>
          <xo-carousel-list role='list' aria-label='{{ 'general.slider.name' | t }}' class='collection-v3__embla__container'>
            {%- for block in section.blocks -%}
              <xo-carousel-slide aria-roledescription='{{ 'sections.slideshow.slide' | t }}' aria-label='{{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}' class='collection-v3__embla__slide' data-slide-index='{{ forloop.index0 }}'>
                <div class='collection-v3__embla__slide__img'>
                  {%- render 'image', image: block.settings.image -%}
                </div>
                <div class='collection-v3__embla__slide__text'>
                  <div class='collection-v3__embla__slide__sub'>{{ block.settings.sub }}</div>
                  <div class='collection-v3__embla__slide__title'>{{ block.settings.title }}</div>
                </div>
                <div class='collection-v3__embla__slide__btn'>
                  <a href='{{ block.settings.url }}' class='collection-v3__embla__slide__btn__url'>
                    {{ block.settings.btn_text }}
                  </a>
                  <div class='collection-v3__embla__slide__btn__icon'>
                    <svg xmlns='http://www.w3.org/2000/svg' width='20px' height='20px' viewBox='0 0 24 24' fill='none'>
                      <path d="M4 12H20M20 12L16 8M20 12L16 16" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                    </svg>
                  </div>
                </div>
              </xo-carousel-slide>
            {%- endfor -%}
          </xo-carousel-list>
        </xo-carousel-inner>
      </xo-carousel>
    </div>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.collection_v3.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"
        }
      ]
    },
    {
      "type": "number",
      "id": "fullwidth_margin",
      "label": "t:sections.all.fullwidth_margin.label",
      "default": 0,
      "visible_if": "{{ section.settings.width == 'fullwidth' }}"
    },
    {
      "type": "text",
      "id": "sub",
      "label": "t:sections.collection_v3.settings.sub.label",
      "default": "sub"
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.collection_v3.settings.title.label",
      "default": "title"
    },
    {
      "type": "text",
      "id": "btn_text",
      "label": "t:sections.collection_v3.settings.btn_text.label",
      "default": "shop all"
    },
    {
      "type": "url",
      "id": "url",
      "label": "t:sections.collection_v3.settings.url.label",
      "default": "/collections/all"
    },
    {
      "type": "header",
      "content": "t:sections.all.heading.content"
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.color_scheme.label"
    },
    {
      "type": "select",
      "id": "background_type",
      "label": "t:sections.all.background_type.label",
      "options": [
        {
          "value": "color",
          "label": "t:sections.all.background_type.option__1.label"
        },
        {
          "value": "gradient",
          "label": "t:sections.all.background_type.option__2.label"
        },
        {
          "value": "image",
          "label": "t:sections.all.background_type.option__3.label"
        },
        {
          "value": "video",
          "label": "t:sections.all.background_type.option__4.label"
        }
      ],
      "default": "color"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:sections.all.background_color.label",
      "alpha": true,
      "visible_if": "{{ section.settings.background_type == 'color' }}"
    },
    {
      "type": "color_background",
      "id": "background_gradient",
      "label": "t:sections.all.background_gradient.label",
      "visible_if": "{{ section.settings.background_type == 'gradient' }}"
    },
    {
      "type": "number",
      "id": "background_margin",
      "label": "t:sections.all.background_margin.label",
      "default": 0
    },
    {
      "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": "collection",
      "name": "t:sections.collection_v3.blocks.name",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.collection_v3.blocks.image.info"
        },
        {
          "type": "text",
          "id": "sub",
          "label": "t:sections.collection_v3.blocks.sub.label",
          "default": "sub"
        },
        {
          "type": "text",
          "id": "title",
          "label": "t:sections.collection_v3.blocks.title.label",
          "default": "title"
        },
        {
          "type": "text",
          "id": "btn_text",
          "label": "t:sections.collection_v3.blocks.btn_text.label",
          "default": "shop all"
        },
        {
          "type": "url",
          "id": "url",
          "label": "t:sections.collection_v3.blocks.url.label",
          "default": "/collections/all"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.collection_v3.presets.name"
    }
  ]
}
{% endschema %}
