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

<header
  class='
    xo-header-v24 color-{{ section.settings.color_scheme }}
     {% if section.settings.transparent and template contains 'index' or template contains 'home' %}
      xo-header-v24--trans
    {% endif %}
  '
>
  <div
    {% if section.settings.transparent and template contains 'index' or template contains 'home' %}
      class='xo-header-v24__transparent'
    {% endif %}
    {% render 'section-attr' %}
  >
    {% if section.settings.check_topbar %}
      <div class='header-v24-top' style='--background-menu:{{ section.settings.var_background }}; --text-menu:{{ section.settings.menu_text }}'>
        <xo-container class='{% if section.settings.width == 'unset' %} xo-container-width{% endif %} '>
          <xo-grid class='header-v24-top__grid' style='--xs: 2'>
            <div class='header-v24-top__left'>
              {%- if section.settings.notice -%}
                <p>{{ section.settings.notice }}</p>
              {%- endif -%}
            </div>
            <div class='header-v24-top__right'>
              <div class='header-v24-top__menu'>
                {%- if section.settings.menu_top -%}
                  {% for link in section.settings.menu_top.links %}
                    <a href='{{link.url}}' class='v21-top__menu-item'>{{ link.title }}</a>
                  {%- endfor -%}
                {%- endif -%}
              </div>
              <div class='header-v24-top__currency'>
                {% if section.settings.country_selector %}
                  {% render 'currency-select' %}
                {% endif %}
              </div>
              <div class='header-v24-top__language'>
                {% if section.settings.language_selector %}
                  {% render 'language-select' %}
                {% endif %}
              </div>
              <div class='header-v24-top__list-icon'>
                {% if section.settings.button_link1 %}
                  <a href='{{section.settings.button_link1 }}' class='header-v24-top__icon'>{{ section.settings.icon_fb }}</a>
                {% endif %}
                {% if section.settings.button_link2 %}
                  <a href='{{section.settings.button_link2 }}' class='header-v24-top__icon'>{{ section.settings.icon_gg }}</a>
                {% endif %}
                {% if section.settings.button_link3 %}
                  <a href='{{section.settings.button_link3 }}' class='header-v24-top__icon'>{{ section.settings.icon_tw }}</a>
                {% endif %}
                {% if section.settings.button_link4 %}
                  <a href='{{section.settings.button_link4 }}' class='header-v24-top__icon'>{{ section.settings.icon_ig }}</a>
                {% endif %}
              </div>
            </div>
          </xo-grid>
        </xo-container>
      </div>
    {% endif %}
    <xo-sticky
      class='
        xo-header-v24__sticky
        {% if section.settings.transparent and template contains 'index' or template contains 'home' %}
          xo-header-v24__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='
          xo-header-v24__wrapper
          {% if section.settings.transparent %}
            xo-header-v24__wrapper--trans
          {% endif %}
        '
      >
        <xo-container class='xo-header-v24__container {% if section.settings.width == 'unset' %} xo-container-width{% endif %}'>
          <xo-grid class='xo-header-v24__content'>
            <nav
              {% if section.settings.menu_type == 'drawer' %}
                style='--xs: 4; --order-xs: 2;'
              {% else %}
                style='--xs: 8; --order-xs: 2; --xl: 2; --order-xl: 1;'
              {% endif %}
              class='
                xo-header-v24__left {% if section.settings.menu_type == 'drawer' %}
                  xo-header-v24__center--order
                {% endif %}
              '
            >
              <div class='xo-header-v24-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: 'xo-header-v24__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 xo-header-v24__logo-heading-logo'>{{ shop.name }}</span>
                  {%- endif -%}
                </a>
              </div>

              <div class='xo-header-v24-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: 'xo-header-v24__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 xo-header-v24__logo-heading-logo'>{{ shop.name }}</span>
                  {%- endif -%}
                </a>
              </div>
            </nav>

            <div
              {% if section.settings.menu_type == 'drawer' %}
                style='--xs: 4'
              {% else %}
                style='--xs: 2; --order-xs: 1; --xl: 8; --order-xl: 2;'
              {% endif %}
              class='
                xo-header-v24__center {% if section.settings.menu_type == 'drawer' %}
                  xo-header-v24__left--order
                {% endif %}
              '
            >
              <div class='xo-header-v24__desktop {% if section.settings.menu_type == 'drawer' %}xo-header-v17__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='xo-header-v24__mobile'>
                  {% render 'menu-hamburger-style1', menu: section.settings.menu, hamburger_type: section.settings.hamburger_type, menu_type: section.settings.menu_type %}
                </div>
              {% endif %}
            </div>

            <div
              {% if section.settings.menu_type == 'drawer' %}
                style='--xs: 4; --order-xs: 3;'
              {% else %}
                style='--xs: 2; --order-xs: 3; --xl: 2; --order-xl: 3;'
              {% endif %}
              class='xo-header-v24__right'
            >
              <xo-tooltip xo-title='Search' xo-placement='bottom-center'>
                <xo-modal-trigger
                  class='xo-header-v24__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='xo-header-v24__right-item xo-header-v24__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='{{ 'general.wishlist.wishlist' | t }}' xo-placement='bottom-center'>
                  <a href='#' class='xo-header-v24__right-item xo-header-v24__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='xo-header-v24__right-item' href='{{ routes.cart_url }}'>
                    {% render 'icon', name: 'cart', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
                    <div class='xo-header-v24__right-item-number'>
                      <xo-cart-size>{{ cart.item_count }}</xo-cart-size>
                    </div>
                  </a>
                {% else %}
                  <xo-modal-trigger
                    class='xo-header-v24__right-item'
                    xo-name='cart'
                  >
                    {% render 'icon', name: 'cart', icon_size: '24' %}
                    <div class='xo-header-v24__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_v2.name",
  "class": "section-header",
  "settings": [
    {
      "type": "header",
      "content": "Top bar setting"
    },
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.header_v2.settings.width.label",
      "default": "1400",
      "options": [
        {
          "value": "1400",
          "label": "t:sections.header_v2.settings.width.option_1.label"
        },
        {
          "value": "unset",
          "label": "t:sections.header_v2.settings.width.option_2.label"
        }
      ]
    },
    {
      "type": "checkbox",
      "id": "check_topbar",
      "default": true,
      "label": "t:sections.header_v2.settings.check_topbar.label"
    },
    {
      "type": "color",
      "id": "var_background",
      "label": "t:sections.header_v2.settings.var_background.label"
    },
    {
      "type": "color",
      "id": "menu_text",
      "label": "t:sections.header_v2.settings.menu_text.label"
    },
    {
      "type": "text",
      "id": "notice",
      "label": "Notice text",
      "default": "Free worldwide shipping until further notice."
    },
    {
      "type": "link_list",
      "id": "menu_top",
      "label": "Menu top"
    },
    {
      "type": "html",
      "id": "icon_fb",
      "label": "t:sections.header_v2.settings.icon_fb.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"10\" viewbox=\"0 0 320 512\"><path d=\"M80 299.3V512H196V299.3h86.5l18-97.8H196V166.9c0-51.7 20.3-71.5 72.7-71.5c16.3 0 29.4 .4 37 1.2V7.9C291.4 4 256.4 0 236.2 0C129.3 0 80 50.5 80 159.4v42.1H14v97.8H80z\"></path></svg>"
    },
    {
      "type": "url",
      "id": "button_link1",
      "label": "t:sections.header_v2.settings.button_link1.label"
    },
    {
      "type": "html",
      "id": "icon_gg",
      "label": "t:sections.header_v2.settings.icon_gg.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"15.25\" viewbox=\"0 0 488 512\"><path d=\"M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z\"></path></svg>"
    },
    {
      "type": "url",
      "id": "button_link2",
      "label": "t:sections.header_v2.settings.button_link2.label"
    },
    {
      "type": "html",
      "id": "icon_tw",
      "label": "t:sections.header_v2.settings.icon_tw.label",
      "default": "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewbox=\"0 0 150 150\" style=\"enable-background:new 0 0 150 150;\" height=\"1em\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\">\n  <g>\n   <path d=\"M131.95,12.84c-5.03,5.87-10.06,11.74-15.1,17.6c-9.93,11.54-19.88,23.07-29.81,34.6c-0.11,0.12-0.2,0.25-0.37,0.47\n     c16.38,23.8,32.77,47.61,49.27,71.57c-0.51,0.03-0.84,0.07-1.18,0.07c-11.35,0-22.7-0.01-34.06,0.02c-0.78,0-1.22-0.24-1.67-0.89\n     c-10.58-15.41-21.18-30.79-31.78-46.18c-0.25-0.36-0.51-0.71-0.82-1.14c-2.93,3.39-5.79,6.7-8.64,10.01\n     c-10.7,12.42-21.41,24.84-32.09,37.28c-0.59,0.68-1.18,0.94-2.07,0.92c-3.07-0.05-6.15-0.02-9.54-0.02\n     c15.95-18.51,31.74-36.82,47.57-55.19c-2.56-3.72-5.09-7.41-7.63-11.1C40.93,51.86,27.85,32.87,14.78,13.88\n     c-0.22-0.33-0.38-0.7-0.57-1.04c12.08,0,24.16,0,36.25,0c0.08,0.14,0.15,0.28,0.24,0.42c10.22,14.85,20.44,29.71,30.67,44.56\n     c0.13,0.19,0.29,0.36,0.5,0.6c0.35-0.38,0.66-0.68,0.94-1.01c11.76-13.64,23.51-27.27,35.26-40.92c1.02-1.18,1.96-2.43,2.94-3.64\n     C124.65,12.84,128.3,12.84,131.95,12.84z M121.13,129.4c-0.24-0.4-0.34-0.58-0.45-0.74C95.71,93.01,70.74,57.36,45.74,21.73\n     c-0.3-0.43-1.04-0.77-1.58-0.77c-4.78-0.06-9.57-0.04-14.35-0.03c-0.26,0-0.53,0.03-0.99,0.06c0.4,0.59,0.68,1.02,0.97,1.44\n     c8.98,12.82,17.97,25.65,26.95,38.47c15.78,22.53,31.57,45.06,47.33,67.61c0.48,0.68,0.97,0.93,1.78,0.92\n     c4.66-0.04,9.32-0.02,13.99-0.02C120.2,129.4,120.55,129.4,121.13,129.4\"></path>\n  </g>\n</svg>"
    },
    {
      "type": "url",
      "id": "button_link3",
      "label": "t:sections.header_v2.settings.button_link3.label"
    },
    {
      "type": "html",
      "id": "icon_ig",
      "label": "t:sections.header_v2.settings.icon_ig.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"14\" 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_v2.settings.button_link4.label"
    },
    {
      "type": "header",
      "content": "Header setting"
    },
    {
      "type": "header",
      "content": "Topbar setting"
    },
    {
      "type": "checkbox",
      "id": "country_selector",
      "default": true,
      "label": "t:sections.header_v2.settings.country_selector.label"
    },
    {
      "type": "checkbox",
      "id": "language_selector",
      "default": true,
      "label": "t:sections.header_v2.settings.language_selector.label"
    },
    {
      "type": "checkbox",
      "id": "transparent",
      "default": false,
      "label": "t:sections.header_v2.settings.transparent.label"
    },
    {
      "type": "link_list",
      "id": "menu",
      "default": "main-menu",
      "label": "t:sections.header_v2.settings.menu.label"
    },
    {
      "type": "image_picker",
      "id": "logo_desk",
      "label": "t:sections.header_v2.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_v2.settings.logo_desk_width.unit",
      "label": "t:sections.header_v2.settings.logo_desk_width.label"
    },
    {
      "type": "image_picker",
      "id": "logo_mobile",
      "label": "t:sections.header_v2.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_v2.settings.logo_mobile_width.unit",
      "label": "t:sections.header_v2.settings.logo_mobile_width.label"
    },
    {
      "type": "select",
      "id": "menu_type",
      "options": [
        {
          "value": "default",
          "label": "t:sections.header_v2.settings.menu_type.options__1.label"
        },
        {
          "value": "drawer",
          "label": "t:sections.header_v2.settings.menu_type.options__2.label"
        }
      ],
      "default": "default",
      "label": "t:sections.header_v2.settings.menu_type.label"
    },
    {
      "type": "select",
      "id": "hamburger_type",
      "options": [
        {
          "value": "default",
          "label": "t:sections.header_v2.settings.hamburger_type.options__1.label"
        },
        {
          "value": "drawer",
          "label": "t:sections.header_v2.settings.hamburger_type.options__2.label"
        },
        {
          "value": "horizontal",
          "label": "t:sections.header_v2.settings.hamburger_type.options__3.label"
        }
      ],
      "default": "default",
      "label": "t:sections.header_v2.settings.hamburger_type.label"
    },
    {
      "type": "select",
      "id": "sticky_header_type",
      "options": [
        {
          "value": "down",
          "label": "t:sections.header_v2.settings.sticky_header_type.options_1.label"
        },
        {
          "value": "up",
          "label": "t:sections.header_v2.settings.sticky_header_type.options_2.label"
        },
        {
          "value": "none",
          "label": "t:sections.header_v2.settings.sticky_header_type.options_3.label"
        }
      ],
      "default": "down",
      "label": "t:sections.header_v2.settings.sticky_header_type.label"
    },
    {
      "type": "select",
      "id": "event_type",
      "options": [
        {
          "value": "hover",
          "label": "t:sections.header_v2.settings.event_type.options_1.label"
        },
        {
          "value": "click",
          "label": "t:sections.header_v2.settings.event_type.options_2.label"
        }
      ],
      "default": "hover",
      "label": "t:sections.header_v2.settings.event_type.label"
    },
    {
      "type": "color",
      "id": "background_menu",
      "label": "t:sections.header_v2.settings.background_menu.label"
    },
    {
      "type": "color",
      "id": "color_text",
      "label": "t:sections.header_v2.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 %}
