{# Mini-cart preview shown on hover over the navbar cart (Alza-style). Lazy-loaded via htmx from /partials/cart into the hover dropdown panel in base.html. Receives: items[], total, lang. #} {% import "macros/ui.html" as ui %} {% if items | length > 0 %}
{% for item in items %}
{{ item.name }} {% if item.variant_label %}{{ item.variant_label }}{% endif %} {% if item.out_of_stock %}{{ t(key="cart-out-of-stock", lang=lang | default(value='sk')) }} {% else %}

{{ item.quantity }} × {{ item.price }} {{ currency_symbol }}

{% endif %}
{% if item.out_of_stock %}{% else %}{{ item.line_total }} {{ currency_symbol }}{% endif %}
{% endfor %}
{{ t(key="cart-total", lang=lang | default(value='sk')) }} {{ total }} {{ currency_symbol }}
{{ ui::button(href="/cart", variant="outline-primary", label=t(key="cart-title", lang=lang | default(value='sk')), extra="flex-1", attrs='hx-boost="false"') }} {% if has_unavailable %} {{ ui::button(variant="primary", label=t(key="cart-checkout", lang=lang | default(value='sk')), extra="flex-1 opacity-50 cursor-not-allowed pointer-events-none", attrs='disabled aria-disabled="true"') }} {% else %} {{ ui::button(href="/checkout", variant="primary", label=t(key="cart-checkout", lang=lang | default(value='sk')), extra="flex-1", attrs='hx-boost="false"') }} {% endif %}
{% else %}
{{ t(key="cart-empty", lang=lang | default(value='sk')) }}
{% endif %}