{{ 'section-banner-v9.css' | asset_url | stylesheet_tag }}

<div class='banner-v271'>
  <div
    {% render 'section-attr' %}
  >
    {% render 'section-bg-image' %}
    <xo-container
      {% render 'section-layout' %}
    >
      {%- if section.settings.heading or section.settings.subheading -%}
        <div class='banner-v271__header'>
          {%- if section.settings.heading -%}
            <h3 class='banner-v271__heading'>{{ section.settings.heading }}</h3>
          {%- endif -%}
          {%- if section.settings.subheading -%}
            <div class='banner-v271__subheading'>{{ section.settings.subheading }}</div>
          {%- endif -%}
        </div>
      {%- endif -%}

      <div class='banner-v271__wrap'>
        <xo-grid style='--gap:{{ section.settings.gap }}px ;'>
          <div class='banner-v271__item' style='--xs:12;--lg:3'>
            <xo-grid style='--xs:1'>
              {% for block in section.blocks %}
                {%- if block.type == 'box_left' -%}
                  <div class='banner-v271__box'>
                    <div class='banner-v271__icon'>
                      {%- if block.settings.image -%}
                        {% render 'image', image: block.settings.image %}
                      {%- else -%}
                        {{ block.settings.svg }}
                      {%- endif -%}
                    </div>
                    <div class='banner-v271__item-title'>{{ block.settings.title }}</div>
                    <div class='banner-v271__item-description'>{{ block.settings.description }}</div>
                  </div>
                {%- endif -%}
              {% endfor %}
            </xo-grid>
          </div>
          <div class='banner-v271__item' style='--xs:12;--lg:6'>
            <div class='banner-v271__image'>
              {% render 'image', image: section.settings.image %}
            </div>
          </div>
          <div class='banner-v271__item' style='--xs:12;--lg:3'>
            <xo-grid style='--xs:1'>
              {% for block in section.blocks %}
                {%- if block.type == 'box_right' -%}
                  <div class='banner-v271__box'>
                    <div class='banner-v271__icon'>
                      {%- if block.settings.image -%}
                        {% render 'image', image: block.settings.image %}
                      {%- else -%}
                        {{ block.settings.svg }}
                      {%- endif -%}
                    </div>
                    <div class='banner-v271__item-title'>{{ block.settings.title }}</div>
                    <div class='banner-v271__item-description'>{{ block.settings.description }}</div>
                  </div>
                {%- endif -%}
              {% endfor %}
            </xo-grid>
          </div>
        </xo-grid>
      </div>
    </xo-container>
  </div>
</div>

{% schema %}
{
  "name": "t:sections.banner_v9.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": "range",
      "id": "gap",
      "min": 0,
      "max": 100,
      "step": 1,
      "unit": "px",
      "default": 30,
      "label": "Gap"
    },
    {
      "type": "text",
      "id": "heading",
      "label": "Heading"
    },
    {
      "type": "text",
      "id": "subheading",
      "label": "Subheading"
    },
    {
      "type": "image_picker",
      "id": "image",
      "label": "t:sections.banner_v9.settings.image.label"
    },
    {
      "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": "box_left",
      "name": "t:sections.banner_v9.blocks.box_left",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.banner_v9.blocks.image.label"
        },
        {
          "type": "html",
          "id": "svg",
          "label": "t:sections.banner_v9.blocks.svg.label"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "t:sections.banner_v9.blocks.title.label"
        },
        {
          "type": "text",
          "id": "description",
          "label": "t:sections.banner_v9.blocks.description.label"
        }
      ]
    },
    {
      "type": "box_right",
      "name": "t:sections.banner_v9.blocks.box_right",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.banner_v9.blocks.image.label"
        },
        {
          "type": "html",
          "id": "svg",
          "label": "t:sections.banner_v9.blocks.svg.label"
        },
        {
          "type": "text",
          "id": "title",
          "label": "Heading",
          "default": "t:sections.banner_v9.blocks.title.label"
        },
        {
          "type": "text",
          "id": "description",
          "label": "t:sections.banner_v9.blocks.description.label"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_v9.presets.name",
      "blocks": [
        {
          "type": "box_left"
        },
        {
          "type": "box_right"
        }
      ]
    }
  ]
}
{% endschema %}
