@inherits ViewModelTemplate<OrderViewModel>
@using Dynamicweb.Frontend
@using Dynamicweb.Rendering
@using Dynamicweb.Ecommerce.Frontend
@using Dynamicweb.Ecommerce.Orders
@using Dynamicweb.Ecommerce.ProductCatalog

<div class="modal fade" id="deleteCartModal" tabindex="-1" aria-labelledby="DeleteCart" aria-hidden="true" 
  hx-on::load="bootstrap.Modal.getOrCreateInstance(this).show();"
  x-on:hide-bs-modal.dot="
    const el = document.activeElement;
    if (el && $el.contains(el)) el.blur();
  "
  x-on:hidden-bs-modal.dot="
    bootstrap.Modal.getOrCreateInstance($el).dispose();
    $el.remove();
  "
  >
  <div class="modal-dialog pt-8">
    <form method="post" class="modal-content">
      <input type="hidden" name="Cartid" id="CartId" value='@Model.Id' />

      <div class="modal-header">
          <h5 class="modal-title">@Translate("Delete cart")</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="@Translate("Cancel")"></button>
      </div>
      <div class="modal-body">
        <p class="text-muted">@Translate("Are you sure you want to delete cart") <span class="fw-bold text-body">@Model.DisplayName @Model.Id</span> @Translate("and its content?")</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal" data-dw-button>@Translate("Cancel")</button>
        <button type="submit" class="btn btn-primary btn-sm" name="CartCmd" value="emptycart" data-dw-button>@Translate("Delete cart")</button>
      </div>
    </form>
  </div>
</div>