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

<header
  class='
      xo-header-v24 color-{{ section.settings.color_scheme }}
    {% if template contains 'index' or template contains 'home' %}
      {% if section.settings.transparent %}
        xo-header-v24--trans
      {% endif %}
    {% endif %}
  '
>
  <div
    {% if template contains 'index' or template contains 'home' %}
      {% if section.settings.transparent %}
        class='xo-header-v24__transparent'
      {% endif %}
    {% 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 %}
          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 %}
                {% 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>
              <xo-tooltip xo-title='Wishlist' 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>
              <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_v5.name",
  "class": "section-header",
  "settings": [
    {
      "type": "header",
      "content": "Top bar setting"
    },
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.header_v5.settings.width.label",
      "default": "1400",
      "options": [
        {
          "value": "1400",
          "label": "t:sections.header_v5.settings.width.option_1.label"
        },
        {
          "value": "unset",
          "label": "t:sections.header_v5.settings.width.option_2.label"
        }
      ]
    },
    {
      "type": "checkbox",
      "id": "check_topbar",
      "default": true,
      "label": "t:sections.header_v5.settings.check_topbar.label"
    },
    {
      "type": "color",
      "id": "var_background",
      "label": "t:sections.header_v5.settings.var_background.label"
    },
    {
      "type": "color",
      "id": "menu_text",
      "label": "t:sections.header_v5.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_v5.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_v5.settings.button_link1.label"
    },
    {
      "type": "html",
      "id": "icon_gg",
      "label": "t:sections.header_v5.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_v5.settings.button_link2.label"
    },
    {
      "type": "html",
      "id": "icon_tw",
      "label": "t:sections.header_v5.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\"></path></svg>"
    },
    {
      "type": "url",
      "id": "button_link3",
      "label": "t:sections.header_v5.settings.button_link3.label"
    },
    {
      "type": "html",
      "id": "icon_ig",
      "label": "t:sections.header_v5.settings.icon_ig.label",
      "default": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"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_v5.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_v5.settings.country_selector.label"
    },
    {
      "type": "checkbox",
      "id": "language_selector",
      "default": true,
      "label": "t:sections.header_v5.settings.language_selector.label"
    },
    {
      "type": "checkbox",
      "id": "transparent",
      "default": false,
      "label": "t:sections.header_v5.settings.transparent.label"
    },
    {
      "type": "link_list",
      "id": "menu",
      "default": "main-menu",
      "label": "t:sections.header_v5.settings.menu.label"
    },
    {
      "type": "image_picker",
      "id": "logo_desk",
      "label": "t:sections.header_v5.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_v5.settings.logo_desk_width.unit",
      "label": "t:sections.header_v5.settings.logo_desk_width.label"
    },
    {
      "type": "image_picker",
      "id": "logo_mobile",
      "label": "t:sections.header_v5.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_v5.settings.logo_mobile_width.unit",
      "label": "t:sections.header_v5.settings.logo_mobile_width.label"
    },
    {
      "type": "select",
      "id": "menu_type",
      "options": [
        {
          "value": "default",
          "label": "t:sections.header_v5.settings.menu_type.options__1.label"
        },
        {
          "value": "drawer",
          "label": "t:sections.header_v5.settings.menu_type.options__2.label"
        }
      ],
      "default": "default",
      "label": "t:sections.header_v5.settings.menu_type.label"
    },
    {
      "type": "select",
      "id": "hamburger_type",
      "options": [
        {
          "value": "default",
          "label": "t:sections.header_v5.settings.hamburger_type.options__1.label"
        },
        {
          "value": "drawer",
          "label": "t:sections.header_v5.settings.hamburger_type.options__2.label"
        },
        {
          "value": "horizontal",
          "label": "t:sections.header_v5.settings.hamburger_type.options__3.label"
        }
      ],
      "default": "default",
      "label": "t:sections.header_v5.settings.hamburger_type.label"
    },
    {
      "type": "select",
      "id": "sticky_header_type",
      "options": [
        {
          "value": "down",
          "label": "t:sections.header_v5.settings.sticky_header_type.options_1.label"
        },
        {
          "value": "up",
          "label": "t:sections.header_v5.settings.sticky_header_type.options_2.label"
        },
        {
          "value": "none",
          "label": "t:sections.header_v5.settings.sticky_header_type.options_3.label"
        }
      ],
      "default": "down",
      "label": "t:sections.header_v5.settings.sticky_header_type.label"
    },
    {
      "type": "select",
      "id": "event_type",
      "options": [
        {
          "value": "hover",
          "label": "t:sections.header_v5.settings.event_type.options_1.label"
        },
        {
          "value": "click",
          "label": "t:sections.header_v5.settings.event_type.options_2.label"
        }
      ],
      "default": "hover",
      "label": "t:sections.header_v5.settings.event_type.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 %}
