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

<section {% render 'section-attr' %}>
  {% render 'section-bg-image' %}
  <xo-container {% render 'section-layout' %}>
    <xo-grid class='our-store-v2'>
      <div style='--xs: 12; --lg: 4' class='our-store-v2__wrap-text'>
        {% for block in section.blocks %}
          <div>
            <xo-animate xo-cascade class='our-store-v2__title'>
              {{ block.settings.title }}
            </xo-animate>
            <xo-animate xo-cascade class='our-store-v2__content'>
              {{ block.settings.content }}
            </xo-animate>
          </div>
        {% endfor %}
      </div>
      <div
        style='--xs: 12; --lg: 8'
        class='our-store-v2__form'
      >
        {%- form 'contact', id: 'ContactForm', class: 'isolate' -%}
          {% if form.posted_successfully? %}
            {% assign message = 'templates.contact.form.post_success' | t %}
            {% render 'form-success', form: form, message: message %}
          {% else %}
            {% assign message = 'templates.contact.form.error_heading' | t %}
            {% render 'form-error', form: form, message: message %}
          {% endif %}
          <xo-grid class='our-store-v2__wrap-input'>
            <xo-animate xo-cascade style='--xs: 12; --lg: 6;'>
              {%- assign name_placeholder = 'templates.contact.form.your_name' | t -%}
              {% render 'field-input', type: 'text', name: 'contact[name]', value: form.name, placeholder: name_placeholder %}
            </xo-animate>
            <xo-animate xo-cascade style='--xs: 12; --lg: 6;'>
              {%- assign email_placeholder = 'templates.contact.form.your_email' | t -%}
              {% render 'field-input', type: 'email', name: 'contact[email]', value: form.email, placeholder: email_placeholder %}
            </xo-animate>
            <xo-animate xo-cascade style='--xs: 12; --lg: 12;'>
              {%- assign phone_placeholder = 'templates.contact.form.phone' | t -%}
              {% render 'field-input', type: 'text', name: 'contact[phone]', value: form.phone, placeholder: phone_placeholder %}
            </xo-animate>
            <xo-animate xo-cascade style='--xs: 12; --lg: 12;' class='our-store-v2__textarea'>
              {%- assign message_placeholder = 'templates.contact.form.your_message' | t -%}
              {% render 'field-textarea', name: 'contact[comment]', value: form.body, placeholder: message_placeholder %}
            </xo-animate>
            <xo-animate xo-cascade style='--xs: 12; --lg: 12;' class='our-store-v2__btn'>
              {% render 'button',
                class: 'contact-form-v3',
                text: section.settings.button_text,
                mode: section.settings.button_mode,
                type: 'submit',
                style: section.settings.button_style,
                size: section.settings.button_size,
                radius: section.settings.button_radius,
                padding: section.settings.button_padding
              %}
            </xo-animate>
          </xo-grid>
        {%- endform -%}
      </div>
    </xo-grid>
  </xo-container>
</section>

{% schema %}
{
  "name": "t:sections.our_store_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": "header",
      "content": "t:sections.all.button_heading.content"
    },
    {
      "type": "text",
      "id": "button_text",
      "label": "t:sections.all.button_text.label",
      "default": "ALL PRODUCTS"
    },
    {
      "type": "select",
      "id": "button_mode",
      "label": "t:sections.all.button_mode.label",
      "options": [
        {
          "value": "light",
          "label": "t:sections.all.button_mode.option__1.label"
        },
        {
          "value": "dark",
          "label": "t:sections.all.button_mode.option__2.label"
        },
        {
          "value": "accent",
          "label": "t:sections.all.button_mode.option__3.label"
        }
      ],
      "default": "light"
    },
    {
      "type": "select",
      "id": "button_style",
      "label": "t:sections.all.button_style.label",
      "options": [
        {
          "value": "primary",
          "label": "t:sections.all.button_style.option__1.label"
        },
        {
          "value": "secondary",
          "label": "t:sections.all.button_style.option__2.label"
        },
        {
          "value": "tertiary",
          "label": "t:sections.all.button_style.option__3.label"
        },
        {
          "value": "link",
          "label": "t:sections.all.button_style.option__4.label"
        }
      ],
      "default": "secondary"
    },
    {
      "type": "select",
      "id": "button_size",
      "label": "t:sections.all.button_size.label",
      "options": [
        {
          "value": "xs",
          "label": "t:sections.all.button_size.option__0.label"
        },
        {
          "value": "sm",
          "label": "t:sections.all.button_size.option__1.label"
        },
        {
          "value": "md",
          "label": "t:sections.all.button_size.option__2.label"
        },
        {
          "value": "lg",
          "label": "t:sections.all.button_size.option__3.label"
        }
      ],
      "default": "sm"
    },
    {
      "type": "range",
      "id": "button_radius",
      "label": "t:sections.all.button_radius.label",
      "max": 4,
      "min": 0,
      "step": 0.2,
      "unit": "rem",
      "default": 0.8
    },
    {
      "type": "range",
      "id": "button_padding",
      "label": "t:sections.all.button_padding.label",
      "info": "t:sections.all.button_padding.info",
      "max": 10,
      "min": 0,
      "step": 0.2,
      "unit": "rem",
      "default": 1.4
    },
    {
      "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": "info",
      "name": "t:sections.our_store_v2.blocks.name",
      "settings": [
        {
          "type": "text",
          "id": "title",
          "label": "t:sections.our_store_v2.blocks.title.label",
          "default": "Title"
        },
        {
          "type": "text",
          "id": "content",
          "label": "t:sections.our_store_v2.blocks.content.label",
          "info": "t:sections.our_store_v2.blocks.content.info",
          "default": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.our_store_v2.presets.name"
    }
  ]
}
{% endschema %}
