{{ 'section-lookbook-v1.css' | asset_url | stylesheet_tag }}

<div {% render 'section-attr' %}>
  {% render 'section-bg-image' %}
  <xo-container
    {% render 'section-layout' %}
  >
    <xo-animate>
      <div class='lookbook-v1'>
        <div class='lookbook-v1__heading' style='text-align: {{ section.settings.align }}'>
          <div class="lookbook-v1__subheader">
            <p>
              {{ section.settings.subheader -}}
            </p>
          </div>
          
          <h3 class='lookbook-v1__title'>{{ section.settings.header }}</h3>
          <p class='lookbook-v1__description'>{{ section.settings.description }}</p>
        </div>
        <div class='lookbook-v1__item'>
          {% if section.settings.lookbook_type == 'grid' %}
            <xo-grid style='--xs: 1; --md: 2; --lg: {{ section.settings.limit}}; --xo-grid-col-gap: {{section.settings.gap}}px; --xo-grid-row-gap: {{section.settings.gap}}px;'>
              {% for block in section.blocks %}
                {% case block.type %}
                  {% when 'item' %}
                    {% render 'hotspot-style-1',
                      hotspot_image: block.settings.hotspot_image,
                      media_aspect_ratio: section.settings.media_aspect_ratio,
                      custom_ratio: section.settings.custom_ratio,
                      block: block
                    %}
                {% endcase %}
              {% endfor %}
            </xo-grid>
          {% else -%}
            <xo-carousel
              {% if section.settings.auto_play %}
                xo-autoplay='5000'
              {% endif %}      
              xo-rewind        
              xo-speed='500'
              xo-hover-pause
              xo-per-view='{{ section.settings.limit}}'
              xo-gap='{{ section.settings.gap}}'
              xo-breakpoints='
                {
                  600: {
                    perView: 1,
                    perMove: 1,
                  },
                  1000: {
                    perView: 2,
                    perMove: 2,
                  },
                }
              '
              xo-render-bullet="<span class='lookbook-v1__bullet lookbook-v1__bullet--style'></span>"
            >
              <xo-carousel-inner>
                <xo-carousel-list>
                  {% for block in section.blocks %}
                    {% case block.type %}
                      {% when 'item' %}
                        <xo-carousel-slide>
                          {% render 'hotspot-style-1',
                            hotspot_image: block.settings.hotspot_image,
                            media_aspect_ratio: section.settings.media_aspect_ratio,
                            custom_ratio: section.settings.custom_ratio,
                            block: block
                          %}
                        </xo-carousel-slide>
                    {% endcase %}
                  {% endfor %}
                </xo-carousel-list>
              </xo-carousel-inner>
              <xo-carousel-prev
                style='
                  display: {% if section.settings.show_arrow %}
                    block
                    {% else %}
                      none
                  {% endif %}
                '
                ><button class='lookbook-v1__arrow lookbook-v1__arrow--prev'>{% render 'icon', name: 'chevron-left', size: 2, color: #111 %}</button></xo-carousel-prev
              >
              <xo-carousel-next
                style='
                  display: {% if section.settings.show_arrow %}
                    block
                    {% else %}
                      none
                  {% endif %}
                '
                ><button class='lookbook-v1__arrow lookbook-v1__arrow--next'>{% render 'icon', name: 'chevron-right', size: 2, color: #111 %}</button></xo-carousel-next
              >
              <xo-carousel-pagination class='lookbook-v1__pagination'
                style='
                  justify-content: center;
                  display: {% if section.settings.show_bullet %}
                    flex
                    {% else %}
                      none
                  {% endif %}
                '
              ></xo-carousel-pagination>
            </xo-carousel>
          {% endif %}
        </div>
      </div>
    </xo-animate>
  </xo-container>
</div>

{% schema %}
{
  "name": "t:sections.lookbook_v1.name",
  "tag": "section",
  "class": "section",
  "settings": [
    {
      "type": "header",
      "content": "t:sections.lookbook_v1.settings.container.content"
    },
    {
      "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.lookbook_v1.settings.title.content"
    },
    {
      "type": "text",
      "id": "header",
      "label": "t:sections.lookbook_v1.settings.header.label",
      "default": "Hand-picked"
    },
    {
      "type": "text",
      "id": "subheader",
      "label": "t:sections.lookbook_v1.settings.subheader.label",
      "default": "Subheading"
    },
    {
      "type": "text",
      "id": "description",
      "label": "t:sections.lookbook_v1.settings.description.label",
      "default": "Morbi eget congue lectus. Donec eleifend ultricies urna et euismod."
    },
    {
      "type": "select",
      "id": "align",
      "label": "t:sections.lookbook_v1.settings.align.label",
      "default": "center",
      "options": [
        {
          "label": "t:sections.lookbook_v1.settings.align.option_1.label",
          "value": "left"
        },
        {
          "label": "t:sections.lookbook_v1.settings.align.option_2.label",
          "value": "center"
        },
        {
          "label": "t:sections.lookbook_v1.settings.align.option_3.label",
          "value": "right"
        }
      ]
    },
    {
      "type": "header",
      "content": "t:sections.lookbook_v1.settings.lookbook__action.content"
    },
    {
      "type": "select",
      "id": "trigger_type",
      "label": "t:sections.lookbook_v1.settings.effect.label",
      "default": "hover",
      "options": [
        {
          "label": "t:sections.lookbook_v1.settings.effect.option_1.label",
          "value": "hover"
        },
        {
          "label": "t:sections.lookbook_v1.settings.effect.option_2.label",
          "value": "click"
        }
      ]
    },
    {
      "type": "select",
      "id": "open_as",
      "label": "t:sections.lookbook_v1.settings.open_as.label",
      "default": "popup",
      "info": "t:sections.lookbook_v1.settings.open_as.info",
      "options": [
        {
          "label": "t:sections.lookbook_v1.settings.open_as.option_1.label",
          "value": "popup"
        },
        {
          "label": "t:sections.lookbook_v1.settings.open_as.option_2.label",
          "value": "quickview"
        }
      ]
    },
    {
      "type": "header",
      "content": "t:sections.lookbook_v1.settings.lookbook_settings2.content"
    },
    {
      "type": "select",
      "id": "lookbook_type",
      "label": "t:sections.lookbook_v1.settings.lookbook_type.label",
      "default": "grid",
      "options": [
        {
          "label": "t:sections.lookbook_v1.settings.lookbook_type.option_1.label",
          "value": "grid"
        },
        {
          "label": "t:sections.lookbook_v1.settings.lookbook_type.option_2.label",
          "value": "carousel"
        }
      ]
    },
    {
      "type": "select",
      "id": "dot_style",
      "label": "t:sections.lookbook_v1.settings.dot_style.label",
      "default": "simple",
      "options": [
        {
          "label": "t:sections.lookbook_v1.settings.dot_style.option_1.label",
          "value": "simple"
        },
        {
          "label": "t:sections.lookbook_v1.settings.dot_style.option_2.label",
          "value": "plus"
        },
        {
          "label": "t:sections.lookbook_v1.settings.dot_style.option_3.label",
          "value": "number"
        }
      ]
    },
    {
      "type": "select",
      "id": "button_style",
      "label": "t:sections.lookbook_v1.settings.button_style.label",
      "default": "dark",
      "options": [
        {
          "value": "dark",
          "label": "t:sections.lookbook_v1.settings.button_style.option_1.label"
        },
        {
          "value": "light",
          "label": "t:sections.lookbook_v1.settings.button_style.option_2.label"
        }
      ]
    },
    {
      "type": "checkbox",
      "id": "custom_ratio",
      "label": "t:sections.lookbook_v1.settings.custom_aspect_ratio.label",
      "default": false
    },
    {
      "type": "text",
      "id": "custom_ratio_text",
      "label": "t:sections.lookbook_v1.settings.aspect_ratio_text.label",
      "default": "21/9"
    },
    {
      "type": "range",
      "id": "limit",
      "min": 1,
      "max": 5,
      "step": 1,
      "label": "t:sections.lookbook_v1.settings.limit_column.label",
      "default": 2
    },
    {
      "type": "range",
      "id": "gap",
      "min": 1,
      "max": 60,
      "step": 1,
      "label": "t:sections.lookbook_v1.settings.gap_column.label",
      "default": 2
    },
    {
      "type": "header",
      "content": "t:sections.lookbook_v1.settings.carousel.content"
    },
    {
      "type": "checkbox",
      "id": "auto_play",
      "label": "t:sections.lookbook_v1.settings.auto_play.label",
      "default": true
    },
    {
      "type": "checkbox",
      "id": "show_arrow",
      "label": "t:sections.lookbook_v1.settings.show_arrow.label",
      "default": true
    },
    {
      "type": "checkbox",
      "id": "show_bullet",
      "label": "t:sections.lookbook_v1.settings.show_bullet.label",
      "default": true
    },
    {
      "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": "item",
      "name": "Lookbook item",
      "settings": [
        {
          "type": "image_picker",
          "id": "hotspot_image",
          "label": "t:sections.lookbook_v1.blocks.settings.hotspot_image.label",
          "info": "523 x 414px recommended"
        },
        {
          "type": "header",
          "content": "t:sections.lookbook_v1.blocks.settings.header_1.content"
        },
        {
          "type": "range",
          "id": "top_1",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.top_1.label",
          "default": 20
        },
        {
          "type": "range",
          "id": "left_1",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.left_1.label",
          "default": 20
        },
        {
          "type": "product",
          "id": "product_1",
          "label": "t:sections.lookbook_v1.blocks.settings.product_1.label",
          "info": "Choose a product, when you click to the hotspot, it will be shown"
        },
        {
          "type": "select",
          "id": "placement_1",
          "label": "t:sections.lookbook_v1.blocks.settings.placement_1.label",
          "info": "t:sections.lookbook_v1.blocks.settings.placement_1.info",
          "options": [
            {
              "value": "top-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_1.label"
            },
            {
              "value": "top-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_2.label"
            },
            {
              "value": "top-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_3.label"
            },
            {
              "value": "bottom-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_4.label"
            },
            {
              "value": "bottom-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_5.label"
            },
            {
              "value": "bottom-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_6.label"
            },
            {
              "value": "right-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_7.label"
            },
            {
              "value": "right-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_8.label"
            },
            {
              "value": "right-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_9.label"
            },
            {
              "value": "left-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_10.label"
            },
            {
              "value": "left-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_11.label"
            },
            {
              "value": "left-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_1.option_12.label"
            }
          ],
          "default": "right-center"
        },
        {
          "type": "header",
          "content": "t:sections.lookbook_v1.blocks.settings.header_2.content"
        },
        {
          "type": "range",
          "id": "top_2",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.top_2.label",
          "default": 20
        },
        {
          "type": "range",
          "id": "left_2",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.left_2.label",
          "default": 20
        },
        {
          "type": "product",
          "id": "product_2",
          "label": "t:sections.lookbook_v1.blocks.settings.product_2.label",
          "info": "Choose a product, when you click to the hotspot, it will be shown"
        },
        {
          "type": "select",
          "id": "placement_2",
          "label": "t:sections.lookbook_v1.blocks.settings.placement_2.label",
          "info": "The hotspot content placement depends on the hotspot location",
          "options": [
            {
              "value": "top-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_1.label"
            },
            {
              "value": "top-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_2.label"
            },
            {
              "value": "top-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_3.label"
            },
            {
              "value": "bottom-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_4.label"
            },
            {
              "value": "bottom-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_5.label"
            },
            {
              "value": "bottom-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_6.label"
            },
            {
              "value": "right-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_7.label"
            },
            {
              "value": "right-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_8.label"
            },
            {
              "value": "right-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_9.label"
            },
            {
              "value": "left-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_10.label"
            },
            {
              "value": "left-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_11.label"
            },
            {
              "value": "left-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_2.option_12.label"
            }
          ],
          "default": "right-center"
        },
        {
          "type": "header",
          "content": "t:sections.lookbook_v1.blocks.settings.header_3.content"
        },
        {
          "type": "range",
          "id": "top_3",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.top_3.label",
          "default": 20
        },
        {
          "type": "range",
          "id": "left_3",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.left_3.label",
          "default": 60
        },
        {
          "type": "product",
          "id": "product_3",
          "label": "t:sections.lookbook_v1.blocks.settings.product_3.label",
          "info": "Choose a product, when you click to the hotspot, it will be shown"
        },
        {
          "type": "select",
          "id": "placement_3",
          "label": "t:sections.lookbook_v1.blocks.settings.placement_3.label",
          "info": "The hotspot content placement depends on the hotspot location",
          "options": [
            {
              "value": "top-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_1.label"
            },
            {
              "value": "top-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_2.label"
            },
            {
              "value": "top-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_3.label"
            },
            {
              "value": "bottom-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_4.label"
            },
            {
              "value": "bottom-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_5.label"
            },
            {
              "value": "bottom-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_6.label"
            },
            {
              "value": "right-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_7.label"
            },
            {
              "value": "right-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_8.label"
            },
            {
              "value": "right-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_9.label"
            },
            {
              "value": "left-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_10.label"
            },
            {
              "value": "left-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_11.label"
            },
            {
              "value": "left-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_3.option_12.label"
            }
          ],
          "default": "right-center"
        },
        {
          "type": "header",
          "content": "t:sections.lookbook_v1.blocks.settings.header_4.content"
        },
        {
          "type": "range",
          "id": "top_4",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.top_4.label",
          "default": 40
        },
        {
          "type": "range",
          "id": "left_4",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.left_4.label",
          "default": 40
        },
        {
          "type": "product",
          "id": "product_4",
          "label": "t:sections.lookbook_v1.blocks.settings.product_4.label",
          "info": "Choose a product, when you click to the hotspot, it will be shown"
        },
        {
          "type": "select",
          "id": "placement_4",
          "label": "t:sections.lookbook_v1.blocks.settings.placement_4.label",
          "info": "The hotspot content placement depends on the hotspot location",
          "options": [
            {
              "value": "top-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_1.label"
            },
            {
              "value": "top-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_2.label"
            },
            {
              "value": "top-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_3.label"
            },
            {
              "value": "bottom-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_4.label"
            },
            {
              "value": "bottom-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_5.label"
            },
            {
              "value": "bottom-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_6.label"
            },
            {
              "value": "right-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_7.label"
            },
            {
              "value": "right-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_8.label"
            },
            {
              "value": "right-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_9.label"
            },
            {
              "value": "left-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_10.label"
            },
            {
              "value": "left-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_11.label"
            },
            {
              "value": "left-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_4.option_12.label"
            }
          ],
          "default": "right-center"
        },
        {
          "type": "header",
          "content": "t:sections.lookbook_v1.blocks.settings.header_5.content"
        },
        {
          "type": "range",
          "id": "top_5",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.top_5.label",
          "default": 60
        },
        {
          "type": "range",
          "id": "left_5",
          "unit": "%",
          "min": 1,
          "max": 100,
          "step": 1,
          "label": "t:sections.lookbook_v1.blocks.settings.left_5.label",
          "default": 60
        },
        {
          "type": "product",
          "id": "product_5",
          "label": "t:sections.lookbook_v1.blocks.settings.product_5.label",
          "info": "Choose a product, when you click to the hotspot, it will be shown"
        },
        {
          "type": "select",
          "id": "placement_5",
          "label": "t:sections.lookbook_v1.blocks.settings.placement_5.label",
          "info": "The hotspot content placement depends on the hotspot location",
          "options": [
            {
              "value": "top-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_1.label"
            },
            {
              "value": "top-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_2.label"
            },
            {
              "value": "top-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_3.label"
            },
            {
              "value": "bottom-right",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_4.label"
            },
            {
              "value": "bottom-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_5.label"
            },
            {
              "value": "bottom-left",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_6.label"
            },
            {
              "value": "right-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_7.label"
            },
            {
              "value": "right-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_8.label"
            },
            {
              "value": "right-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_9.label"
            },
            {
              "value": "left-top",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_10.label"
            },
            {
              "value": "left-center",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_11.label"
            },
            {
              "value": "left-bottom",
              "label": "t:sections.lookbook_v1.blocks.settings.placement_5.option_12.label"
            }
          ],
          "default": "right-center"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "t:sections.lookbook_v1.presets.name",
      "category": "Text"
    }
  ]
}
{% endschema %}
