{% set siteConfig = getSiteConfig() %}
{% set useShop = isShop|default(false) and siteConfig.mainNavbarActiveShop %}
{% set bgColor = useShop ? siteConfig.backgroundColorShop : siteConfig.backgroundColor %}
{% set icon = useShop ? siteConfig.mainNavbarIconShop : siteConfig.mainNavbarIcon %}
{% set link = useShop ? siteConfig.mainNavbarlinkShop : siteConfig.mainNavbarlink %}
{% set disableClosing = useShop ? siteConfig.alwaysFixedShop : siteConfig.alwaysFixed %}
{# important: metabar is only shown if it hasn't been closed yet and the 'message-closed' cookie is not set #}
{% if (useShop or siteConfig.mainNavbarActive) and link and not app.request.cookies.has('message-closed') %}
<section
class="main-navbar-meta js-message bg-{{ bgColor|default('secondary') }} {{ className|default('') }}">
<span class="main-navbar-meta__icon me-4 icon icon-{{ icon }}" aria-hidden="true"></span>
<a href="{{ link.href is defined and link.href|length > 0 ? link.href : '' }}" target="{{ link.target }}" class="main-navbar-meta__link py-2 {{ link.href|length == 0 ? 'pe-none' : '' }}">
{{ link.text }}
</a>
{% if link.href|length > 0 %}
<span class="main-navbar-meta__icon icon icon-arrow-right ms-auto ms-md-80 me-md-0 me-5 ps-2 pe-md-5" aria-hidden="true"></span>
{% endif %}
{% if not disableClosing %}
<button role="button" class="btn btn-no-styling main-navbar-meta__close js-message__close"
aria-label="{{ 'metabar.close'|trans }}" title="{{ 'metabar.close'|trans }}"
>
<span class="main-navbar-meta__icon icon icon-close" aria-hidden="true"></span>
</button>
{% endif %}
</section>
<style>
:root {
--navbar-offset: calc(128rem / 16);
--navbar-offset-xs: calc(144rem / 16);
}
</style>
{% endif %}