{# Adapted from the vendored Penguin UI component (penguinui-components/card/ecommerce-product-card.html): wired to our product data + i18n + htmx add-to-cart + toast. The demo rating stars, hardcoded title/price/description/image and the `max-w-sm` (which fights the shop grid) are dropped; the whole card links to the product page. #}
{% if product.image %} {{ product.name }} {% endif %}

{{ product.name }}

{% if product.on_sale %} {{ product.regular_price }} {{ product.currency }} Price{% if product.has_options %}{{ t(key="from-price", price=product.price, lang=lang | default(value='sk')) }}{% else %}{{ product.price }}{% endif %} {{ product.currency }} {% else %} Price{% if product.has_options %}{{ t(key="from-price", price=product.price, lang=lang | default(value='sk')) }}{% else %}{{ product.price }}{% endif %} {{ product.currency }} {% endif %}
{% if product.has_options %} {# Multiple variants: customer must pick on the product page. #} {{ ui::button(label=t(key="choose-option", lang=lang | default(value='sk')), href="/shop/" ~ product.slug, extra="w-full") }} {% elif product.stock > 0 %}

{{ t(key="in-stock", lang=lang | default(value='sk')) }}: {{ product.stock }}

{{ ui::button(label=t(key="add-to-cart", lang=lang | default(value='sk')), type="submit", extra="w-full", icon='') }}
{% else %}

{{ t(key="out-of-stock", lang=lang | default(value='sk')) }}

{% endif %}