

{% capture breakpoints %}
  {% if section.settings.limit > 2 %}
    xo-breakpoints='
    {
      768: {
        perView: 2,
      },
      576: {
        perView: 1,
      },
    }
    '
  {% else %}
    xo-breakpoints='
    {
      576: {
        perView: 1,
      },
    }
    '      
  {% endif %}
{% endcapture %}

<section {% render 'section-attr' %}>
  {% render 'section-bg-image' %}
  <xo-container {% render 'section-layout' %}>
    <xo-carousel
      xo-per-view='{{ section.settings.limit }}'
      xo-gap='{{ section.settings.gap }}'
      {{ breakpoints }}
      xo-render-bullet="<span class='policy-v10__bullet'></span>"
    >
      <xo-carousel-inner>
        <xo-carousel-list role='list' aria-label='{{ 'general.slider.name' | t }}'>
          {%- 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='policy-v10__slide'
            >
              <xo-animate xo-cascade class='policy-v10__item'>
                <div class='policy-v10__icon'>
                  {% if block.settings.svg != blank %}
                    {{ block.settings.svg }}
                  {% elsif block.settings.image_svg != blank %}
                    {% render 'image', image: block.settings.image_svg %}
                  {% endif %}
                </div>
                <h3 class='policy-v10__title'>
                  {{ block.settings.title }}
                </h3>
                <div class='policy-v10__subtitle'>{{ block.settings.subtitle }}</div>
              </xo-animate>
            </xo-carousel-slide>
          {%- endfor -%}
        </xo-carousel-list>
      </xo-carousel-inner>
      <xo-carousel-pagination class='policy-v10__bullet-list'></xo-carousel-pagination>
    </xo-carousel>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.policy_v2.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": "range",
      "id": "gap",
      "min": 0,
      "max": 80,
      "step": 1,
      "unit": "px",
      "label": "t:sections.policy_v2.settings.gap.label",
      "default": 30
    },
    {
      "type": "range",
      "id": "limit",
      "min": 1,
      "max": 5,
      "step": 1,
      "label": "t:sections.policy_v2.settings.limit.label",
      "default": 3
    },
    {
      "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": "image_picker",
      "id": "background_image_desktop",
      "label": "t:sections.all.background_image_desktop.label",
      "visible_if": "{{ section.settings.background_type == 'image' }}"
    },
    {
      "type": "image_picker",
      "id": "background_image_mobile",
      "label": "t:sections.all.background_image_mobile.label",
      "visible_if": "{{ section.settings.background_type == 'image' }}"
    },
    {
      "type": "checkbox",
      "id": "use_parallax",
      "label": "t:sections.all.use_parallax.label",
      "default": true,
      "visible_if": "{{ section.settings.background_type == 'image' }}"
    },
    {
      "type": "select",
      "id": "background_image_animation",
      "label": "t:sections.all.animation.label",
      "options": [
        {
          "value": "none",
          "label": "t:sections.all.animation.option__0.label"
        },
        {
          "value": "fade",
          "label": "t:sections.all.animation.option__1.label"
        },
        {
          "value": "fade-up",
          "label": "t:sections.all.animation.option__2.label"
        },
        {
          "value": "fade-down",
          "label": "t:sections.all.animation.option__3.label"
        },
        {
          "value": "fade-left",
          "label": "t:sections.all.animation.option__4.label"
        },
        {
          "value": "fade-right",
          "label": "t:sections.all.animation.option__5.label"
        },
        {
          "value": "zoom-in",
          "label": "t:sections.all.animation.option__6.label"
        },
        {
          "value": "zoom-out",
          "label": "t:sections.all.animation.option__7.label"
        },
        {
          "value": "rotate-left-up",
          "label": "t:sections.all.animation.option__8.label"
        },
        {
          "value": "rotate-right-up",
          "label": "t:sections.all.animation.option__9.label"
        },
        {
          "value": "snake-up",
          "label": "t:sections.all.animation.option__10.label"
        },
        {
          "value": "snake-down",
          "label": "t:sections.all.animation.option__11.label"
        },
        {
          "value": "snake-left",
          "label": "t:sections.all.animation.option__12.label"
        },
        {
          "value": "snake-right",
          "label": "t:sections.all.animation.option__13.label"
        },
        {
          "value": "3d-up",
          "label": "t:sections.all.animation.option__14.label"
        }
      ],
      "default": "none",
      "visible_if": "{{ section.settings.background_type == 'image' }}"
    },
    {
      "type": "textarea",
      "id": "background_video_url",
      "label": "t:sections.all.background_video_url.label",
      "visible_if": "{{ section.settings.background_type == 'video' }}"
    },
    {
      "type": "select",
      "id": "background_video_animation",
      "label": "t:sections.all.animation.label",
      "options": [
        {
          "value": "none",
          "label": "t:sections.all.animation.option__0.label"
        },
        {
          "value": "fade",
          "label": "t:sections.all.animation.option__1.label"
        },
        {
          "value": "fade-up",
          "label": "t:sections.all.animation.option__2.label"
        },
        {
          "value": "fade-down",
          "label": "t:sections.all.animation.option__3.label"
        },
        {
          "value": "fade-left",
          "label": "t:sections.all.animation.option__4.label"
        },
        {
          "value": "fade-right",
          "label": "t:sections.all.animation.option__5.label"
        },
        {
          "value": "zoom-in",
          "label": "t:sections.all.animation.option__6.label"
        },
        {
          "value": "zoom-out",
          "label": "t:sections.all.animation.option__7.label"
        },
        {
          "value": "rotate-left-up",
          "label": "t:sections.all.animation.option__8.label"
        },
        {
          "value": "rotate-right-up",
          "label": "t:sections.all.animation.option__9.label"
        },
        {
          "value": "snake-up",
          "label": "t:sections.all.animation.option__10.label"
        },
        {
          "value": "snake-down",
          "label": "t:sections.all.animation.option__11.label"
        },
        {
          "value": "snake-left",
          "label": "t:sections.all.animation.option__12.label"
        },
        {
          "value": "snake-right",
          "label": "t:sections.all.animation.option__13.label"
        },
        {
          "value": "3d-up",
          "label": "t:sections.all.animation.option__14.label"
        }
      ],
      "default": "none",
      "visible_if": "{{ section.settings.background_type == 'video' }}"
    },
    {
      "type": "color",
      "id": "background_overlay",
      "label": "t:sections.all.background_overlay.label",
      "alpha": true,
      "visible_if": "{{ section.settings.background_type == 'image' or section.settings.background_type == 'video' }}"
    },
    {
      "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": [
    {
      "name": "t:sections.policy_v2.blocks.name",
      "type": "policy",
      "settings": [
        {
          "type": "html",
          "id": "svg",
          "label": "t:sections.policy_v2.blocks.svg.label",
          "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" id=\"Capa_2\" height=\"512\" viewbox=\"0 0 512 512\" width=\"512\"><g><path d=\"m71.858 418.114 48.142 24.067v59.819c0 5.523 4.478 10 10 10h106c5.522 0 10-4.477 10-10v-136.55c0-30.637-22.983-56.045-53.391-59.093-.118-.033-42.3-6.618-61.87-26.189l-22.458-22.448c-7.556-7.558-17.6-11.72-28.281-11.72v-80c0-22.056-17.944-40-40-40s-40 17.944-40 40v135.84c0 49.212 27.798 94.239 71.858 116.274zm-51.858-252.114c0-11.028 8.972-20 20-20s20 8.972 20 20v85.361c-12.196 7.052-20 20.2-20 34.639 0 10.68 4.162 20.723 11.719 28.28l51.21 51.22c3.903 3.905 10.236 3.907 14.142.001 3.905-3.905 3.906-10.236.001-14.142l-51.21-51.221c-3.78-3.779-5.862-8.8-5.862-14.138 0-8.464 5.357-16.044 13.332-18.861.003-.001.006-.003.009-.004h.001c6.896-2.444 15.077-.994 20.799 4.728l22.458 22.449c23.186 23.185 73.843 31.91 73.944 31.938 20.214 2.026 35.457 18.879 35.457 39.2v126.55h-86v-56c0-3.788-2.141-7.251-5.528-8.944l-53.669-26.83c-37.504-18.757-60.803-56.456-60.803-98.386z\"></path><path d=\"m136 246h240c5.522 0 10-4.477 10-10v-226c0-5.523-4.478-10-10-10h-240c-5.522 0-10 4.477-10 10v226c0 5.523 4.478 10 10 10zm90-226h60v53.893l-25.975-12.855c-2.82-1.397-6.136-1.382-8.944.037l-25.081 12.67zm-80 0h60v70c0 3.473 1.802 6.698 4.761 8.518 2.957 1.819 6.649 1.974 9.748.408l35.127-17.745 35.929 17.782c3.046 1.508 6.722 1.389 9.71-.467 2.938-1.825 4.725-5.038 4.725-8.496v-70h60v206h-220z\"></path><path d=\"m336 176h-60c-5.522 0-10 4.477-10 10s4.478 10 10 10h60c5.522 0 10-4.477 10-10s-4.478-10-10-10z\"></path><circle cx=\"459\" cy=\"394\" r=\"10\"></circle><path d=\"m472 126c-22.056 0-40 17.944-40 40v80c-10.681 0-20.725 4.162-28.279 11.717l-22.462 22.452c-12.3 12.301-43.459 24.337-61.128 26.108l-.668.072c-30.48 3.056-53.463 28.464-53.463 59.101v136.55c0 5.523 4.478 10 10 10h106c5.522 0 10-4.477 10-10v-59.819l32.73-16.362c4.939-2.47 6.942-8.476 4.473-13.417-2.469-4.938-8.474-6.942-13.416-4.473l-38.259 19.125c-3.387 1.695-5.528 5.158-5.528 8.946v56h-86v-126.55c0-20.321 15.243-37.174 35.529-39.208l.669-.072c21.691-2.175 57.605-16.262 73.201-31.857l22.462-22.452c5.724-5.724 13.913-7.166 20.797-4.726h.001c.003.001.006.003.009.004 13.771 4.865 17.917 22.551 7.471 33.001l-51.21 51.22c-3.905 3.906-3.904 10.237.001 14.142 3.904 3.904 10.237 3.905 14.142-.001l51.21-51.22c18.487-18.49 14.636-49.669-8.281-62.92v-85.361c0-11.028 8.972-20 20-20s20 8.972 20 20v135.84c0 18.296-4.617 36.46-13.353 52.528-2.639 4.852-.844 10.924 4.009 13.562 4.851 2.636 10.924.843 13.562-4.009 10.324-18.99 15.781-40.458 15.781-62.081v-135.84c0-22.056-17.944-40-40-40z\"></path></g></svg>"
        },
        {
          "type": "image_picker",
          "id": "image_svg",
          "label": "t:sections.policy_v2.blocks.image_svg.label"
        },
        {
          "type": "text",
          "id": "title",
          "label": "t:sections.policy_v2.blocks.title.label",
          "info": "Insert <br> to break the line.",
          "default": "24/7 FRIENDLY SUPPORT"
        },
        {
          "type": "text",
          "id": "subtitle",
          "label": "t:sections.policy_v2.blocks.subtitle.label",
          "default": "Our support team always ready for you to 7 days a week"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.policy_v2.presets.name",
      "blocks": [
        {
          "type": "policy"
        },
        {
          "type": "policy"
        },
        {
          "type": "policy"
        },
        {
          "type": "policy"
        }
      ]
    }
  ]
}
{% endschema %}
