{{ 'section-header-v3.css' | asset_url | stylesheet_tag }}

<header
  class='
    header-v19 color-{{ section.settings.color_scheme }}
     {% if section.settings.transparent and template contains 'index' or template contains 'home' %}
      header-v19--trans
    {% endif %}
  '
>
  <div
    {% if section.settings.transparent and template contains 'index' or template contains 'home' %}
      class='header-v19__transparent'
    {% endif %}
    {% render 'section-attr' %}
  >
    <xo-sticky
      class='
        header-v19__sticky
        {% if section.settings.transparent and template contains 'index' or template contains 'home' %}
          header-v19__sticky--trans
        {% endif %}
      '
      xo-direction='{{ section.settings.sticky_header_type }}'
      {% if section.settings.sticky_header_type == 'none' %}
        xo-disabled
      {% endif %}
      style='z-index: 10000'
    >
      <div
        class='
          header-v19__wrapper
          {% if section.settings.transparent %}
            header-v19__wrapper--trans
          {% endif %}
        '
      >
        <xo-container class='header-v19__container {% if section.settings.width == 'unset' %} xo-container-width{% endif %}'>
          <xo-grid class='header-v19__content'>
            <div
              {% if section.settings.menu_type == 'drawer' %}
                style='--xs: 4'
              {% else %}
                style='--xs: 4;--oreder-xs: 1; --xl: 8; --order-xl: 1;'
              {% endif %}
              class='
                header-v19__center {% if section.settings.menu_type == 'drawer' %}
                  header-v19__left--order
                {% endif %}
              '
            >
              {% if section.settings.menu_type == 'default' %}
                <div class='header-v19__center--logo'>
                  <a href='/'>
                    {%- if section.settings.logo_desk != blank -%}
                      {%- assign logo_alt = section.settings.logo_desk.alt | default: shop.name | escape -%}
                      {%- assign logo_height = section.settings.logo_desk_width | divided_by: section.settings.logo_desk.aspect_ratio -%}
                      {{
                        section.settings.logo_desk
                        | image_url: width: section.settings.logo_desk_width
                        | image_tag:
                          class: 'header-v19__logo-img',
                          widths: '50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250',
                          height: logo_height,
                          width: section.settings.logo_desk_width,
                          alt: logo_alt
                      }}
                    {%- else -%}
                      <span class='h4 header-v19__logo-heading-logo'>{{ shop.name }}</span>
                    {%- endif -%}
                  </a>
                </div>
              {% endif %}
              <div class='header-v19__desktop {% if section.settings.menu_type == 'drawer' %}xo-header-v19__desktop--only{% endif %}'>
                {% if section.settings.menu_type == 'default' %}
                  {% render 'menu-horizontal-v1',
                    menu: section.settings.menu,
                    event_type: section.settings.event_type,
                    image: section.settings.logo,
                    color_text: section.settings.color_text,
                    background_menu: section.settings.background_menu
                  %}
                {% else %}
                  {% render 'menu-hamburger-style1', menu: section.settings.menu, hamburger_type: section.settings.hamburger_type, menu_type: section.settings.menu_type %}
                {% endif %}
              </div>
              {% if section.settings.menu_type == 'default' %}
                <div class='header-v19__mobile'>
                  {% render 'menu-hamburger-style1', menu: section.settings.menu, hamburger_type: section.settings.hamburger_type, menu_type: section.settings.menu_type %}
                </div>
              {% endif %}
            </div>

            <nav
              {% if section.settings.menu_type == 'drawer' %}
                style='--xs: 4'
              {% else %}
                style='--xs: 4;--oreder-xs: 2; --xl: 4; --order-xl: 1;'
              {% endif %}
              class='
                header-v19__left {% if section.settings.menu_type == 'drawer' %}
                  header-v19__center--order
                {% endif %}
              '
            >
              <div class='header-v19-logo__desktop'>
                <a href='/'>
                  {%- if section.settings.logo_desk != blank -%}
                    {%- assign logo_alt = section.settings.logo_desk.alt | default: shop.name | escape -%}
                    {%- assign logo_height = section.settings.logo_desk_width | divided_by: section.settings.logo_desk.aspect_ratio -%}
                    {{
                      section.settings.logo_desk
                      | image_url: width: section.settings.logo_desk_width
                      | image_tag:
                        class: 'header-v19__logo-img',
                        widths: '50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250',
                        height: logo_height,
                        width: section.settings.logo_desk_width,
                        alt: logo_alt
                    }}
                  {%- else -%}
                    <span class='h4 header-v19__logo-heading-logo'>{{ shop.name }}</span>
                  {%- endif -%}
                </a>
              </div>

              <div class='header-v19-logo__mobile'>
                <a href='/'>
                  {%- if section.settings.logo_mobile != blank -%}
                    {%- assign logo_alt = section.settings.logo_mobile.alt | default: shop.name | escape -%}
                    {%- assign logo_height = section.settings.logo_mobile_width | divided_by: section.settings.logo_mobile.aspect_ratio -%}
                    {{
                      section.settings.logo_mobile
                      | image_url: width: section.settings.logo_mobile_width
                      | image_tag:
                        class: 'header-v19__logo-img',
                        widths: '50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250',
                        height: logo_height,
                        width: section.settings.logo_mobile_width,
                        alt: logo_alt
                    }}
                  {%- else -%}
                    <span class='h4 header-v19__logo-heading-logo'>{{ shop.name }}</span>
                  {%- endif -%}
                </a>
              </div>
            </nav>

            {% if section.settings.menu_type == 'drawer' %}
              <div class='header-v19__logo--flex' style='--xs: 4'>
                <a href='/'>
                  {%- if section.settings.logo_desk != blank -%}
                    {%- assign logo_alt = section.settings.logo_desk.alt | default: shop.name | escape -%}
                    {%- assign logo_height = section.settings.logo_desk_width | divided_by: section.settings.logo_desk.aspect_ratio -%}
                    {{
                      section.settings.logo_desk
                      | image_url: width: section.settings.logo_desk_width
                      | image_tag:
                        class: 'header-v19__logo-img',
                        widths: '50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250',
                        height: logo_height,
                        width: section.settings.logo_desk_width,
                        alt: logo_alt
                    }}
                  {%- else -%}
                    <span class='h4 header-v19__logo-heading-logo'>{{ shop.name }}</span>
                  {%- endif -%}
                </a>
              </div>
            {% endif %}

            <div
              {% if section.settings.menu_type == 'drawer' %}
                style='--xs: 4'
              {% else %}
                style='--xs: 4;--oreder-xs: 3; --xl: 4; --order-xl: 2;'
              {% endif %}
              class='header-v19__right'
            >
              {% if section.settings.menu_type == 'default' %}
                <div class='header-v19__list-icon'>
                  {% if section.settings.button_link1 %}
                    <a href='{{section.settings.button_link1 }}' class='header-v19__icon'>{{ section.settings.icon_tw }}</a>
                  {% endif %}
                  {% if section.settings.button_link2 %}
                    <a href='{{section.settings.button_link2 }}' class='header-v19__icon'>{{ section.settings.icon_dr }}</a>
                  {% endif %}
                  {% if section.settings.button_link3 %}
                    <a href='{{section.settings.button_link3 }}' class='header-v19__icon'>{{ section.settings.icon_bh }}</a>
                  {% endif %}
                  {% if section.settings.button_link4 %}
                    <a href='{{section.settings.button_link4 }}' class='header-v19__icon'>{{ section.settings.icon_ig }}</a>
                  {% endif %}
                </div>
              {% endif %}
              <xo-tooltip xo-title='Search' xo-placement='bottom-center'>
                <xo-modal-trigger
                  class='header-v19__right-item'
                  xo-name='search'
                >
                  {% render 'icon', name: 'search', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
                </xo-modal-trigger>
              </xo-tooltip>
              <xo-tooltip
                xo-title='{%- if customer -%}{{ 'customer.account.title' | t }}{%- else -%}{{ 'customer.login_page.title' | t }}{%- endif -%}'
                xo-placement='bottom-center'
              >
                <a
                  href='{%- if customer -%}{{ routes.account_url }}{%- else -%}{{ routes.account_login_url }}{%- endif -%}'
                  class='header-v19__right-item header-v19__right-item--account'
                >
                  {% render 'icon', name: 'account1', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
                </a>
              </xo-tooltip>
              <xb-wishlist-header class='xb-wishlist__header'>
                <xo-tooltip xo-title='Wishlist' xo-placement='bottom-center'>
                  <a href='#' class='header-v19__right-item header-v19__right-item--heart'>
                    {% render 'icon', name: 'heart', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
                  </a>
                </xo-tooltip>
              </xb-wishlist-header>
              <xo-tooltip xo-title='Cart' xo-placement='bottom-center'>
                {% if settings.cart_type == 'page' %}
                  <a class='header-v19__right-item' href='{{ routes.cart_url }}'>
                    {% render 'icon', name: 'cart', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
                    <div class='header-v19__right-item-number'>
                      <xo-cart-size>{{ cart.item_count }}</xo-cart-size>
                    </div>
                  </a>
                {% else %}
                  <xo-modal-trigger
                    class='header-v19__right-item'
                    xo-name='cart'
                  >
                    {% render 'icon', name: 'cart', icon_size: '24' %}
                    <div class='header-v19__right-item-number'>
                      <xo-cart-size>{{ cart.item_count }}</xo-cart-size>
                    </div>
                  </xo-modal-trigger>
                {% endif %}
              </xo-tooltip>
            </div>
          </xo-grid>
        </xo-container>
      </div>
    </xo-sticky>
  </div>
</header>

{% render 'header-ld-json' %}

{% schema %}
{
  "name": "t:sections.header_v3.name",
  "class": "section-header",
  "settings": [
    {
      "type": "header",
      "content": "Header setting"
    },
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.header_v3.settings.width.label",
      "default": "1400",
      "options": [
        {
          "value": "1400",
          "label": "t:sections.header_v3.settings.width.option_1.label"
        },
        {
          "value": "unset",
          "label": "t:sections.header_v3.settings.width.option_2.label"
        }
      ]
    },
    {
      "type": "checkbox",
      "id": "transparent",
      "default": false,
      "label": "t:sections.header_v3.settings.transparent.label"
    },
    {
      "type": "image_picker",
      "id": "logo_desk",
      "label": "t:sections.header_v3.settings.logo_desk.label",
      "info": "Support jpg, jpeg, png, svg"
    },
    {
      "type": "range",
      "id": "logo_desk_width",
      "min": 50,
      "max": 250,
      "step": 10,
      "default": 100,
      "unit": "t:sections.header_v3.settings.logo_desk_width.unit",
      "label": "t:sections.header_v3.settings.logo_desk_width.label"
    },
    {
      "type": "image_picker",
      "id": "logo_mobile",
      "label": "t:sections.header_v3.settings.logo_mobile.label",
      "info": "Support jpg, jpeg, png, svg"
    },
    {
      "type": "range",
      "id": "logo_mobile_width",
      "min": 50,
      "max": 250,
      "step": 10,
      "default": 100,
      "unit": "t:sections.header_v3.settings.logo_mobile_width.unit",
      "label": "t:sections.header_v3.settings.logo_mobile_width.label"
    },
    {
      "type": "link_list",
      "id": "menu",
      "default": "main-menu",
      "label": "t:sections.header_v3.settings.menu.label"
    },
    {
      "type": "html",
      "id": "icon_tw",
      "label": "t:sections.header_v3.settings.icon_tw.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"16\" viewBox=\"0 0 512 512\"><path d=\"M459.4 151.7c.3 4.5 .3 9.1 .3 13.6 0 138.7-105.6 298.6-298.6 298.6-59.5 0-114.7-17.2-161.1-47.1 8.4 1 16.6 1.3 25.3 1.3 49.1 0 94.2-16.6 130.3-44.8-46.1-1-84.8-31.2-98.1-72.8 6.5 1 13 1.6 19.8 1.6 9.4 0 18.8-1.3 27.6-3.6-48.1-9.7-84.1-52-84.1-103v-1.3c14 7.8 30.2 12.7 47.4 13.3-28.3-18.8-46.8-51-46.8-87.4 0-19.5 5.2-37.4 14.3-53 51.7 63.7 129.3 105.3 216.4 109.8-1.6-7.8-2.6-15.9-2.6-24 0-57.8 46.8-104.9 104.9-104.9 30.2 0 57.5 12.7 76.7 33.1 23.7-4.5 46.5-13.3 66.6-25.3-7.8 24.4-24.4 44.8-46.1 57.8 21.1-2.3 41.6-8.1 60.4-16.2-14.3 20.8-32.2 39.3-52.6 54.3z\"/></svg>"
    },
    {
      "type": "url",
      "id": "button_link1",
      "label": "t:sections.header_v3.settings.button_link1.label",
      "default": "/collections/all"
    },
    {
      "type": "html",
      "id": "icon_dr",
      "label": "t:sections.header_v3.settings.icon_dr.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"16\" viewBox=\"0 0 512 512\"><path d=\"M256 8C119.3 8 8 119.3 8 256s111.3 248 248 248 248-111.3 248-248S392.7 8 256 8zm164 114.4c29.5 36 47.4 82 47.8 132-7-1.5-77-15.7-147.5-6.8-5.8-14-11.2-26.4-18.6-41.6 78.3-32 113.8-77.5 118.3-83.5zM396.4 97.9c-3.8 5.4-35.7 48.3-111 76.5-34.7-63.8-73.2-116.2-79-124 67.2-16.2 138 1.3 190.1 47.5zm-230.5-33.3c5.6 7.7 43.4 60.1 78.5 122.5-99.1 26.3-186.4 25.9-195.8 25.8C62.4 147.2 106.7 92.6 165.9 64.6zM44.2 256.3c0-2.2 0-4.3 .1-6.5 9.3 .2 111.9 1.5 217.7-30.1 6.1 11.9 11.9 23.9 17.2 35.9-76.6 21.6-146.2 83.5-180.5 142.3C64.8 360.4 44.2 310.7 44.2 256.3zm81.8 167.1c22.1-45.2 82.2-103.6 167.6-132.8 29.7 77.3 42 142.1 45.2 160.6-68.1 29-150 21.1-212.8-27.9zm248.4 8.5c-2.2-12.9-13.4-74.9-41.2-151 66.4-10.6 124.7 6.8 131.9 9.1-9.4 58.9-43.3 109.8-90.8 142z\"/></svg>"
    },
    {
      "type": "url",
      "id": "button_link2",
      "label": "t:sections.header_v3.settings.button_link2.label",
      "default": "/collections/all"
    },
    {
      "type": "html",
      "id": "icon_bh",
      "label": "t:sections.header_v3.settings.icon_bh.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"18\" viewBox=\"0 0 576 512\"><path d=\"M232 237.2c31.8-15.2 48.4-38.2 48.4-74 0-70.6-52.6-87.8-113.3-87.8H0v354.4h171.8c64.4 0 124.9-30.9 124.9-102.9 0-44.5-21.1-77.4-64.7-89.7zM77.9 135.9H151c28.1 0 53.4 7.9 53.4 40.5 0 30.1-19.7 42.2-47.5 42.2h-79v-82.7zm83.3 233.7H77.9V272h84.9c34.3 0 56 14.3 56 50.6 0 35.8-25.9 47-57.6 47zm358.5-240.7H376V94h143.7v34.9zM576 305.2c0-75.9-44.4-139.2-124.9-139.2-78.2 0-131.3 58.8-131.3 135.8 0 79.9 50.3 134.7 131.3 134.7 61.3 0 101-27.6 120.1-86.3H509c-6.7 21.9-34.3 33.5-55.7 33.5-41.3 0-63-24.2-63-65.3h185.1c.3-4.2 .6-8.7 .6-13.2zM390.4 274c2.3-33.7 24.7-54.8 58.5-54.8 35.4 0 53.2 20.8 56.2 54.8H390.4z\"/></svg>"
    },
    {
      "type": "url",
      "id": "button_link3",
      "label": "t:sections.header_v3.settings.button_link3.label",
      "default": "/collections/all"
    },
    {
      "type": "html",
      "id": "icon_ig",
      "label": "t:sections.header_v3.settings.icon_ig.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" viewbox=\"0 0 448 512\"><path d=\"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z \"></path></svg>"
    },
    {
      "type": "url",
      "id": "button_link4",
      "label": "t:sections.header_v3.settings.button_link4.label",
      "default": "/collections/all"
    },
    {
      "type": "select",
      "id": "menu_type",
      "options": [
        {
          "value": "default",
          "label": "t:sections.header_v3.settings.menu_type.options__1.label"
        },
        {
          "value": "drawer",
          "label": "t:sections.header_v3.settings.menu_type.options__2.label"
        }
      ],
      "default": "default",
      "label": "t:sections.header_v3.settings.menu_type.label"
    },
    {
      "type": "select",
      "id": "hamburger_type",
      "options": [
        {
          "value": "default",
          "label": "t:sections.header_v3.settings.hamburger_type.options__1.label"
        },
        {
          "value": "drawer",
          "label": "t:sections.header_v3.settings.hamburger_type.options__2.label"
        },
        {
          "value": "horizontal",
          "label": "t:sections.header_v3.settings.hamburger_type.options__3.label"
        }
      ],
      "default": "default",
      "label": "t:sections.header_v3.settings.hamburger_type.label"
    },
    {
      "type": "select",
      "id": "sticky_header_type",
      "options": [
        {
          "value": "down",
          "label": "t:sections.header_v3.settings.sticky_header_type.options_1.label"
        },
        {
          "value": "up",
          "label": "t:sections.header_v3.settings.sticky_header_type.options_2.label"
        },
        {
          "value": "none",
          "label": "t:sections.header_v3.settings.sticky_header_type.options_3.label"
        }
      ],
      "default": "down",
      "label": "t:sections.header_v3.settings.sticky_header_type.label"
    },
    {
      "type": "select",
      "id": "event_type",
      "options": [
        {
          "value": "hover",
          "label": "t:sections.header_v3.settings.event_type.options_1.label"
        },
        {
          "value": "click",
          "label": "t:sections.header_v3.settings.event_type.options_2.label"
        }
      ],
      "default": "hover",
      "label": "t:sections.header_v3.settings.event_type.label"
    },
    {
      "type": "color",
      "id": "background_menu",
      "label": "t:sections.header_v3.settings.background_menu.label"
    },
    {
      "type": "color",
      "id": "color_text",
      "label": "t:sections.header_v3.settings.color_text.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": "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
    }
  ]
}
{% endschema %}
