{{ 'section-our-store-v1.css' | asset_url | stylesheet_tag }}

{%- assign reverse_layout = section.settings.reverse_layout -%}

<section {% render 'section-attr' %} class='our-store-v3'>
  {% render 'section-bg-image' %}
  <xo-container {% render 'section-layout' %}>
    <xo-grid>
      <div
        class='our-store-v3-info'
        style='
          {%- if reverse_layout -%}
            --xs: 12; --order-xs: 2; --sm: 12; --order-sm: 2; --lg: 4; --order-lg: 2;
          {%- else -%}
          --xs: 12; --order-xs: 1; --sm: 12; --order-sm: 1; --lg: 4; --order-lg: 1;
          {%- endif -%}
        '
      >
        <div class='our-store-v3-info__sub'>
          {{ section.settings.sub }}
        </div>
        <div class='our-store-v3-info__title'>
          {{ section.settings.title }}
        </div>
        {% for block in section.blocks %}
          {% case block.type %}
            {% when 'info' %}
              <div class='our-store-v3-info__content'>
                {{ block.settings.content }}
              </div>
          {% endcase %}
        {% endfor %}
      </div>
      <div
        style='
          {%- if reverse_layout -%}
            --xs: 12; --order-xs: 1; --sm: 12; --order-sm: 1; --lg: 8; --order-lg: 1;
            {%- else -%}
            --xs: 12; --order-xs: 2; --sm: 12; --order-sm: 2; --lg: 8; --order-lg: 2;
          {%- endif -%}
        '
      >
        <xo-grid style='--xs: 1; --sm: 3; --xl: 3'>
          {% for block in section.blocks %}
            {% case block.type %}
              {% when 'image' %}
                <div class='our-store-v3-box'>
                  <div>
                    <div class='our-store-v3-box__image {%render 'hover-style'%}'>
                      {%- render 'image', image: block.settings.image -%}
                    </div>
                    <a href='{{ block.settings.url_link }}' class='our-store-v3-box__router'>
                      <div class='our-store-v3-box__text'>
                        {{ block.settings.text_link }}
                      </div>
                      {% render 'icon', name: 'icon-arrow-right', icon_size: '13', color: 'rgba(var(--color-foreground), 0.8)' %}
                    </a>
                  </div>
                </div>
            {% endcase %}
          {% endfor %}
        </xo-grid>
      </div>
    </xo-grid>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.our_store_v1.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": "checkbox",
      "id": "reverse_layout",
      "label": "t:sections.our_store_v1.settings.reverse_layout.label",
      "default": false
    },
    {
      "type": "text",
      "id": "sub",
      "label": "t:sections.our_store_v1.settings.sub.label",
      "default": "Sub title"
    },
    {
      "type": "text",
      "id": "title",
      "label": "t:sections.our_store_v1.settings.title.label",
      "default": "Title"
    },
    {
      "type": "header",
      "content": "Setting additional"
    },
    {
      "type": "select",
      "id": "hover",
      "label": "t:sections.all.hover.label",
      "default": "hover1",
      "options": [
        {
          "value": "hover1",
          "label": "t:sections.all.hover.option__1.label"
        },
        {
          "value": "hover2",
          "label": "Style 02"
        },
        {
          "value": "hover3",
          "label": "Style 03"
        },
        {
          "value": "hover4",
          "label": "Style 04"
        },
        {
          "value": "hover5",
          "label": "Style 05"
        },
        {
          "value": "hover6",
          "label": "Style 06"
        }
      ]
    },
    {
      "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": "image_picker",
      "id": "background_image_desktop",
      "label": "t:sections.all.background_image_desktop.label"
    },
    {
      "type": "image_picker",
      "id": "background_image_mobile",
      "label": "t:sections.all.background_image_mobile.label"
    },
    {
      "type": "checkbox",
      "id": "use_parallax",
      "label": "t:sections.all.use_parallax.label",
      "default": true
    },
    {
      "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": "image",
      "name": " Image",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.our_store_v1.blocks.settings.image.label"
        },
        {
          "type": "text",
          "id": "text_link",
          "label": "t:sections.our_store_v1.blocks.settings.text_link.label",
          "default": "Text"
        },
        {
          "type": "url",
          "id": "url_link",
          "label": "t:sections.our_store_v1.blocks.settings.url_link.label"
        }
      ]
    },
    {
      "type": "info",
      "name": " Information",
      "settings": [
        {
          "type": "richtext",
          "id": "content",
          "label": "t:sections.our_store_v1.settings.content.label",
          "default": "<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.our_store_v1.presets.name"
    }
  ]
}
{% endschema %}
