<div class="dropdown d-grid">
  <button type="button" data-bs-toggle="dropdown" class="btn btn-lg btn-dark d-block dropdown-toggle"><i class="fa-solid fa-cart-shopping"></i> {{ text_items }}</button>
  <ul class="dropdown-menu dropdown-menu-end p-2">
    {% if products %}
      <li>
        <table class="table table-striped mb-2">
          {% for product in products %}
            <tr>
              <td class="text-center w-25">{% if product.thumb %}<a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-thumbnail"/></a>{% endif %}</td>
              <td><a href="{{ product.href }}">{{ product.name }}</a>
                <ul class="list-unstyled mb-0">
                  <li>
                    <small> - {{ text_model }}: {{ product.model }}</small>
                  </li>
                  {% for option in product.option %}
                    <li>
                      <small> - {{ option.name }}: {{ option.value }}</small>
                    </li>
                  {% endfor %}
                  {% if product.subscription %}
                    <li>
                      <small> - {{ text_subscription }}: {{ product.subscription }}</small>
                    </li>
                  {% endif %}
                  {% if product.reward %}
                    <li>
                      <small> - {{ text_points }}: {{ product.reward }}</small>
                    </li>
                  {% endif %}
                </ul>
              </td>
              <td class="text-end text-nowrap">x {{ product.quantity }}</td>
              <td class="text-end">{{ product.total }}</td>
              <td class="text-end">
                <form action="{{ remove }}" method="post" data-oc-toggle="ajax" data-oc-load="{{ list }}" data-oc-target="#cart">
                  <input type="hidden" name="key" value="{{ product.cart_id }}">
                  <button type="submit" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa-solid fa-circle-xmark"></i></button>
                </form>
              </td>
            </tr>
          {% endfor %}
        </table>
        <div>
          <table class="table table-sm table-bordered mb-2">
            {% for total in totals %}
              <tr>
                <td class="text-end"><strong>{{ total.title }}</strong></td>
                <td class="text-end">{{ total.text }}</td>
              </tr>
            {% endfor %}
          </table>
          <p class="text-end"><a href="{{ cart }}"><strong><i class="fa-solid fa-cart-shopping"></i> {{ text_cart }}</strong></a>&nbsp;&nbsp;&nbsp;<a href="{{ checkout }}"><strong><i class="fa-solid fa-share"></i> {{ text_checkout }}</strong></a></p>
        </div>
      </li>
    {% else %}
      <li class="text-center p-4">{{ text_no_results }}</li>
    {% endif %}
  </ul>
</div>