{% block layout_header_actions_cart_widget %}
<div class="flex relative">
<span class="header-cart-icon p-2">
{% sw_icon 'cart' style{'pack': 'theme-icons', 'class': 'w-6 h-6'} %}
</span>
{% if page.cart.lineItems|length > 0 %}
{% set cartCount = 0 %}
{% for lineItem in page.cart.lineItems %}
{% if lineItem.type == 'product' %}
{% set cartCount = cartCount + lineItem.quantity %}
{% endif %}
{% endfor %}
<span class="text-xs absolute w-4 h-4 text-center top-0 right-0 font-bold text-black bg-white rounded-full">{{ cartCount }}</span>
{% endif %}
</div>
{% endblock %}