{% if nestingLevel is not defined %}
    {% set nestingLevel = 0 %}
{% endif %}

{% if displayMode is not defined %}
    {% set displayMode = 'default' %}
{% endif %}

{% if showRemoveButton is not defined %}
    {% set showRemoveButton = true %}
{% endif %}

{% set lineItemClasses = 'line-item line-item-' ~ lineItem.type ~ ' is-' ~ displayMode %}

{% if displayMode === 'offcanvas' %}
    {% set lineItemClasses = lineItemClasses ~ ' js-cart-item' %}
{% endif %}

{% if not showRemoveButton %}
    {% set lineItemClasses = lineItemClasses ~ ' no-remove-button' %}
{% endif %}

{% block component_line_item_type_container %}
    <div class="{{ lineItemClasses }}">
        <div class="row line-item-row">

            {% block component_line_item_type_container_col_info %}
                <div class="line-item-info">
                    <div class="row line-item-row">

                        {% if nestingLevel < 1 %}
                            {% block component_line_item_type_container_image %}
                                <div class="col-auto line-item-info-img">
                                    <div class="line-item-img-container">
                                        {% block component_line_item_type_container_image_inner %}
                                            {% sw_include '@Storefront/storefront/component/line-item/element/image.html.twig' with {
                                                fallbackIcon: 'bag-product'
                                            } %}
                                        {% endblock %}
                                    </div>
                                </div>
                            {% endblock %}
                        {% endif %}

                        {% block component_line_item_type_container_details %}
                            <div class="line-item-details">
                                <div class="line-item-details-container">
                                    {% block component_line_item_type_container_label %}
                                        {% sw_include '@Storefront/storefront/component/line-item/element/label.html.twig' %}
                                    {% endblock %}
                                </div>
                            </div>
                        {% endblock %}
                    </div>
                </div>
            {% endblock %}

            {% block component_line_item_type_container_col_quantity %}
                <div class="line-item-quantity">
                    {% sw_include '@Storefront/storefront/component/line-item/element/quantity.html.twig' %}
                </div>
            {% endblock %}

            {% if showTaxPrice %}
                {% block component_line_item_type_container_col_tax_price %}
                    <div class="line-item-tax-price">
                        {% if context.salesChannel.taxCalculationType == 'horizontal' %}
                            {% sw_include '@Storefront/storefront/component/line-item/element/tax-price.html.twig' %}
                        {% endif %}
                    </div>
                {% endblock %}
            {% else %}
                {% block component_line_item_type_container_col_unit_price %}
                    <div class="line-item-unit-price">
                        {% sw_include '@Storefront/storefront/component/line-item/element/unit-price.html.twig' %}
                    </div>
                {% endblock %}
            {% endif %}

            {% block component_line_item_type_container_col_total_price %}
                <div class="line-item-total-price">
                    {% sw_include '@Storefront/storefront/component/line-item/element/total-price.html.twig' %}
                </div>
            {% endblock %}

            {% if showRemoveButton %}
                {% block component_line_item_type_container_col_remove %}
                    <div class="line-item-remove">
                        {% if lineItem.removable and nestingLevel < 1 %}
                            {% sw_include '@Storefront/storefront/component/line-item/element/remove.html.twig' %}
                        {% endif %}
                    </div>
                {% endblock %}
            {% endif %}

            {% if lineItem.children.count > 0 %}
                {% block component_line_item_type_container_children %}
                    {% sw_include '@Storefront/storefront/component/line-item/element/children-wrapper.html.twig' %}
                {% endblock %}
            {% endif %}
        </div>
    </div>
{% endblock %}
