{% set customerTypeId = app.request.session.get('customerTypeId') %}
{% set domainId = app.request.session.get('domainId') %}
{% set isAdminLogin = app.request.session.get('isAdminLogin') %}
{% set locale = app.request.locale %}
{% set defaultLocale = app.request.session.get('defaultLocale') %}
{% if app.request.attributes.get('_route') not in ['cart_show', 'checkout_customer', 'checkout_address', 'checkout_shipping_and_payment', 'checkout_review', 'checkout_success'] %}
{% for nanobar in nanobars %}
<div id="nanobar-item" class="nanobar py-1" style="background-color:{{ nanobar.color }};">
<div class="container">
{{- nanobar.message | raw -}}
</div>
</div>
{% endfor %}
{% endif %}
{% if mode == 'standard' %}
<header class="header smart-scroll">
<div class="header-top">
<div class="container">
{% if isBazaarPage %}
<span class="web-description">{{ 'bazaar header top web description'|trans }}</span>
{% else %}
<span class="web-description">{{ 'header top web description'|trans }}</span>
{% endif %}
<div class="page-list">
{% for page in headerPageList %}
<a href="{{ page.link }}">{{ page.title }}</a>
{% endfor %}
</div>
</div>
</div>
<div class="header-bottom{% if customerTypeId == 2 %} partner{% endif %}">
<div class="container px-1 px-lg-3">
<div class="row align-items-center row-no-padding">
<div class="col menu-and-logo col-md-auto">
<button id="nav-icon" class="toggle-sidebar toggle-button toggle-sidebar">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/hamburger.svg') }}">
</button>
{% set logoPartnerSuffix = '' %}
{% if customerTypeId == 2 %}
{% set logoPartnerSuffix = '-partner' %}
{% endif %}
{%- set logoSrc = isAdminLogin ? 'theme/images/furbify-logo-admin-login.svg' : 'theme/images/furbify-logo.svg' -%}
<a href="{{ path('homepage') }}" class="logo"><img loading="lazy" decoding="async" src="{{ asset(logoSrc) }}" alt="{{ 'Furbify premium renewed, used electronics' | trans }}" width="143" height="37" /></a>
{% if customerTypeId == 2 %}
<div class="logo-vertical-line"></div>
<img loading="lazy" decoding="async" src="{{ asset('theme/images/partner-dashboard.svg') }}" alt="Partner dashboard" width="100" class="partner-dashboard-logo" />
{% endif %}
</div>
<div class="col flex-md-grow-1 text-end px-0">
<a href="#widget-search" class="dropdown-toggle search-dropdown-toggle ms-auto ms-xl-0" role="button" aria-expanded="false" aria-controls="widget-search" data-bs-toggle="collapse">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-mobile-search.svg') }}" width="15" height="18" />
</a>
<div id="widget-search" class="d-flex justify-content-around collapse pe-0 pe-xl-5">
<div class="search-bar m-auto">
<form method="get" action="{{ path('product_search') }}" class="input-group search-form justify-content-center" id="searchbox">
<input type="text" id="ajax_search" name="fs" placeholder="{{ 'keyword...' |trans }}" class="form-control mb-0 col col-2" value="{{ filterSearch }}" aria-label="{{ 'keyword...' | trans }}" aria-describedby="button-submit-widget-search">
<button id="button-clear-widget-search" type="button" class="input-group-text border-right col col-auto d-none"></button>
<button id="button-arrow-submit-widget-search" type="submit" class="input-group-text border-radius col col-auto d-none"></button>
<button id="button-submit-widget-search" type="submit" class="input-group-text border-radius col col-auto event-log-view-all-results">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-search.svg') }}" height="16" width="auto" class="m-auto" alt="{{ 'Search' | trans }}" />
</button>
<div id="widget-search-results" data-no-matches="{{ 'No results' | trans }}" data-view-all="{{ 'View all results' | trans }}" data-action="{{ path('product_live_search') }}" data-url="{{ path('product_search') }}" data-loading="{{ 'Loading' | trans }}" data-try="{{ 'Try this' |trans }}" data-featured="{{ 'Featured products' |trans }}" data-popular="{{ 'Popular categories' |trans }}" data-log="{{ path('product_log_search') }}" class="text-start d-none"></div>
</form>
</div>
<a href="tel:{{ phone_support }}" class="support-link d-none d-xl-flex flex-row align-items-center me-0 ms-0">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-telephone.svg') }}" width="32" height="32" alt="{{ 'header-top call us'|trans }}"/>
<div class="ms-2 text-elements d-flex flex-column text-start">
<span>{{ 'header-top call us'|trans }}</span>
<strong>{{ phone_support }}</strong>
</div>
</a>
</div>
</div>
<div class="col text-end icons col-md-auto flex-grow-0 col-sm-auto">
<div class="account-dropdown dropdown dropleft">
<button class="dropdown-toggle account-dropdown-toggle d-none d-md-block" type="button" id="dropdownAccountButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-profile.svg') }}" alt="{{ 'Account' | trans }}">
<div class="d-none d-xl-block">
{% if isLoggedIn() and customer.firstName is defined and customer.lastName is defined %}
{% if defaultLocale == 'hu' %}
<span>{{ customer.lastName ~ ' ' ~ customer.firstName |slice(0, 1) ~ '.' }}</span>
{% else %}
<span>{{ customer.firstName |slice(0, 1) ~ '. ' ~ customer.lastName }}</span>
{% endif %}
{% else %}
<span>{{ 'Account' | trans }}</span>
{% endif %}
</div>
</button>
<a href="{{ path('customer_login') }}" class="account-dropdown-toggle d-flex d-md-none">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-profile.svg') }}">
</a>
<div class="dropdown-menu" aria-labelledby="dropdownAccountButton">
{% if isLoggedIn() %}
<a class="dropdown-item" href="{{ path('customer_account') }}">{{ 'Account' | trans }}</a>
<a class="dropdown-item" href="{{ path('customer_orders') }}">{{ 'Orders' | trans }}</a>
<a class="dropdown-item log-out" href="{{ path('customer_logout') }}">{{ 'Log out' | trans }}</a>
{% else %}
<a class="dropdown-item" href="{{ path('customer_login') }}">{{ 'Log in' | trans }}</a>
<a class="dropdown-item" href="{{ path('customer_registration') }}">{{ 'Sign up' | trans }}</a>
{% endif %}
</div>
</div>
{%- if cart -%}
{{- include(template_from_string(cart)) -}}
{%- else -%}
<div id="cart" class="cart-dropdown dropdown">
<button class="dropdown-toggle" type="button" id="dropdownCartButton" data-bs-toggle="dropdown">
<i class="fas fa-shopping-cart"></i>
<div class="d-none d-lg-block">
<span>{{ 'Cart' | trans }}</span>
</div>
{%- if cartItemsCount > 0 -%}
<div class="shopping-cart-item">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/icon/header-cart-item-count.svg') }}" class="m-0 p-0" alt="{{ 'Cart'|trans }}">
<span>{{ cartItemsCount }}</span>
</div>
{%- endif -%}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownCartButton"></div>
</div>
{%- endif -%}
<div class="dropdown dropdown-store-switcher">
<button class="btn" type="button" id="dropdown-store-switcher" data-bs-toggle="modal" data-bs-target="#modal-language-store" aria-haspopup="true" aria-expanded="false">
<img loading="lazy" decoding="async" src="{{ asset('theme/images/flag/' ~ locale ~ '.svg') }}" alt="{{ (locale ~ ' icon alt') | trans }}">
<div class="d-md-block">{{ locale |upper }}</div>
</button>
</div>
</div>
</div>
</div>
</div>
</header>
<nav class="main-nav {{ customerType }}">
{% if menu.push is defined and menu.push |length %}
<ul class="main-menu container m-auto has-push-menu">
{% else %}
<ul class="main-menu container m-auto">
{% endif %}
{% if menu.product is defined %}
<li>
<a aria-label="{{ menu.product.name |trans }}">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 19" xml:space="preserve"><g><rect x="3.4" y="3.5" class="st0" width="18" height="2"/><rect x="3.4" y="8.5" class="st0" width="18" height="2"/><rect x="3.4" y="13.5" class="st0" width="18" height="2"/></g></svg>
{{ menu.product.name |trans }}
</a>
<div class="sub-menu">
<div class="container">
<ul>
{% for mainMenuItem in menu.product.children %}
<li>
<a href="{{ mainMenuItem.href }}" aria-label="{{ mainMenuItem.name }}">
{% if mainMenuItem.icon %}
<span class="icon">{{ mainMenuItem.icon |raw }}</span>
{% else %}
<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg></span>
{% endif %}
{{ mainMenuItem.name }}
{% if mainMenuItem.children %}
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/></svg>
{% endif %}
</a>
{% if mainMenuItem.children %}
<div class="sub-menu-block">
<div class="d-flex flex-wrap flex-column h-100">
{% for group in mainMenuItem.children %}
<div class="sub-menu-group">
{% if group.name %}
<strong>{{ group.name }}:</strong><br>
{% endif %}
<ul class="sub-menu-list">
{% for item in group.children %}
<li>
<a href="{{ item.href }}">{{ item.title }}</a>
{% if item.subTitle %}
({{ item.subTitle }})
{% endif %}
{%- if item.label -%}
<span>{{ item.label | trans }}!</span>
{%- endif -%}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
</li>
{% endif %}
{% if menu.standard is defined and menu.standard |length %}
{% for mainMenuItem in menu.standard %}
<li
{% if mainMenuItem.name == 'BLACK FRIDAY' %}
class="black-friday-menu-link"
{% elseif mainMenuItem.name == 'The Zone akció' or mainMenuItem.name in ['Kiárusítás', 'Výpredaj', 'Výprodej', 'Sale', 'Bestseller'] %}
class="the-zone-menu-link"
{% elseif mainMenuItem.name == 'Valentínska akcia' or mainMenuItem.name == 'Valentýnská akce'%}
class="valentine-menu-link"
{% endif %}
{% if domainId in [1,2,3,4,9,5] %}
{% if loop.length - loop.index0 == 2 %} class="ms-auto"{% endif %}
{% else %}
{% if loop.last %} class="ms-auto"{% endif %}
{% endif %}
>
<a href="{{ mainMenuItem.href }}" aria-label="{{ mainMenuItem.name }}">
<span class="visually-hidden">{{- mainMenuItem.name -}}</span>
<div class="nav-standard-item">
{%- if mainMenuItem.icon is defined and mainMenuItem.icon is not null -%}
<div class="icon me-1">{{ mainMenuItem.icon |raw }}</div>
{%- endif -%}
<span>{{- mainMenuItem.name -}}</span>
</div>
</a>
</li>
{% endfor %}
{% endif %}
{% if menu.push is defined and menu.push |length %}
{% for mainMenuItem in menu.push %}
{% if loop.first %}
<li style="margin-left: auto">
{% else %}
<li>
{% endif %}
<a href="{{ mainMenuItem.href }}">{{ mainMenuItem.name }}</a>
</li>
{% endfor %}
{% endif %}
</ul>
</nav>
{% elseif mode == 'minimal' %}
<header class="header minimal">
<div class="container">
<div class="row my-4">
{%- set logoSrc = isAdminLogin ? 'theme/images/furbify-logo-admin-login.svg' : 'theme/images/furbify-logo.svg' -%}
<div class="col-6" style="border-right: 1px solid #e9e9e9">
<a href="{{ path('homepage') }}" class="logo" style="float: right;"><img loading="lazy" decoding="async" src="{{ asset(logoSrc) }}" alt="Furbify" width="135" height="35" /></a>
</div>
<div class="col-6 d-flex">
<div style="margin: auto auto auto 0; font-style: italic;">{{ 'secure checkout' | trans }}</div>
</div>
</div>
</div>
</header>
{% endif %}