{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}

{% if cart.empty == false %}
    <div class="rollover-container">
        <div class="rollover-wrapper rollover-items">
            <div class="items" data-simplebar data-simplebar-auto-hide="false">
                {% for item in cart.items %}
                    <div class="item">
                        <div class="item-name">
                            <strong>{{ item.product }}</strong>
                            {% if item.variant.optionValues is not null %}
                                <div class="item-options">
                                    {% for optionValue in item.variant.optionValues %}
                                        <em>{{ optionValue.value }}</em>
                                    {% endfor %}
                                </div>
                            {% endif %}
                        </div>

                        <div class="item-price-wrapper">
                            <span class="item-qty">x {{ item.quantity }}</span>

                            <span class="item-price">
                                {{ money.convertAndFormat(item.unitPrice) }}
                            </span>
                        </div>
                    </div>
                {% endfor %}
            </div>
            <div class="item total">
                <strong>{{ 'sylius.ui.subtotal'|trans }}</strong>
                <span class="price-sm">{{ money.convertAndFormat(cart.itemsTotal) }}</span>
            </div>

            <div class="btn-wrapper">
                <a href="{{ path('sylius_shop_cart_summary') }}" class="btn btn-sm btn-outline-secondary">{{ 'sylius.ui.view_and_edit_cart'|trans }}</a>
                <a href="{{ path('sylius_shop_checkout_start') }}" class="btn btn-sm btn-primary">{{ 'sylius.ui.checkout'|trans }}</a>
            </div>
        </div>
    </div>
{% endif %}
