<div class="cm-topbar">
  <div class="cm-container cm-topbar-inner">
    <nav class="cm-topbar-nav" aria-label="Сервісне меню">
      <a class="cm-topbar-link" href="/about">Про нас</a>
      <a class="cm-topbar-link" href="/blog">Блог і поради</a>
      <a class="cm-topbar-link" href="/loyalty">Бонусна програма</a>
      <a class="cm-topbar-link" href="/business">Для бізнесу</a>
      <a class="cm-topbar-link" href="/contacts">Контакти</a>
    </nav>
    <div class="cm-topbar-meta">
      <a class="cm-topbar-link cm-topbar-link--icon" href="tel:0800000000" aria-label="Телефон">
        {icon name="phone" size="14"}
        <span>0 800 000 000</span>
      </a>
      <button type="button" class="cm-topbar-link cm-topbar-link--icon" data-cm-lang>
        {icon name="globe" size="14"}
        <span>UA</span>
        {icon name="chevron_down" size="10"}
      </button>
    </div>
  </div>
</div>

<header class="cm-header">
  <div class="cm-container cm-header-inner">
    <a href="/" class="cm-logo" aria-label="{site.name}">
      <span class="cm-logo-text">{site.name}</span>
    </a>

    <button type="button" class="cm-catalog-btn" data-cm-catalog-toggle aria-expanded="false" aria-controls="cm-catalog-panel">
      {icon name="menu" size="18"}
      <span>Каталог</span>
    </button>

    <form class="cm-search" action="/search" method="get" role="search">
      <input class="cm-search-input" type="search" name="q" placeholder="Що шукаємо?" autocomplete="off">
      <button type="submit" class="cm-search-submit" aria-label="Знайти">
        {icon name="search" size="18"}
      </button>
    </form>

    <nav class="cm-header-nav" aria-label="Користувацькі дії">
      <a href="/account" class="cm-icon-link">
        <span class="cm-icon-link__ico">{icon name="profile" size="22"}</span>
        <span class="cm-icon-link__label">[if {account.is_guest}="1"]Увійти[else]Кабінет[/if]</span>
      </a>
      <a href="/favorites" class="cm-icon-link" data-cm-counter="favorites">
        <span class="cm-icon-link__ico">
          {icon name="heart" size="22"}
          <span class="cm-icon-link__badge" data-cm-counter-value="favorites" hidden>0</span>
        </span>
        <span class="cm-icon-link__label">Обране</span>
      </a>
      [if {shop.enabled}="1"]
        <div class="cm-cart-mini" data-cm-cart-mini>
          <a href="/cart" class="cm-icon-link cm-icon-link--cart" data-cm-counter="cart">
            <span class="cm-icon-link__ico">
              {icon name="cart" size="22"}
              <span class="cm-icon-link__badge cm-icon-link__badge--accent" data-cm-counter-value="cart" hidden>0</span>
            </span>
            <span class="cm-icon-link__label">Кошик</span>
            <span class="cm-icon-link__total" data-cm-cart-total hidden>0 ₴</span>
          </a>
          <div class="cm-cart-mini__pop" data-cm-cart-mini-pop hidden></div>
        </div>
      [else]
        <a href="/cart" class="cm-icon-link cm-icon-link--cart">
          <span class="cm-icon-link__ico">{icon name="cart" size="22"}</span>
          <span class="cm-icon-link__label">Кошик</span>
        </a>
      [/if]
    </nav>
  </div>

  <div id="cm-catalog-panel" class="cm-catalog-panel" data-cm-catalog-panel hidden>
    <div class="cm-container cm-catalog-panel__inner">
      <ul class="cm-catalog-panel__list">
        [categories entity="shop_product" limit="24" sort="title" order="asc" as="cat"]
          <li><a href="/category/{cat.slug}">{cat.title}</a></li>
        [/categories]
      </ul>
    </div>
  </div>
</header>
