{#**
 * Copyright since 2025 InPost S.A.
 *
 * For the full license information, please view the LICENSE file bundled with the module.
 *
 * @author InPost S.A.
 * @copyright since 2025 InPost S.A.
 * @license MIT
 *#}
{% form_theme form '@Modules/inpostinternational/views/templates/admin/form_theme/horizontal_layout.html.twig' %}

<div class="row justify-content-center">
  <div class="col">
    <div class="card mb-0">
      {{ form_start(form) }}

      <div class="card-body card-block row">
        <div class="form-wrapper card-text">
          {{ form_errors(form) }}

          {{ form_row(form.recipient) }}
          {{ form_row(form.service) }}

          <div class="js-inpost-intl-destination-wrapper">
            {{ form_row(form.destination) }}
          </div>

          {{ form_row(form.shippingMethod) }}

          <div class="js-inpost-intl-shipping-options-wrapper">
            {% if form.origin is defined %}
              {{ form_row(form.origin) }}
            {% endif %}
          </div>

          {{ form_row(form.parcel) }}

          <div class="js-inpost-intl-optional-services-wrapper">
            {% if form.insurance is defined %}
              {{ form_row(form.insurance) }}
            {% endif %}
          </div>

          {{ form_rest(form) }}
        </div>
      </div>

      <div class="card-footer clearfix">
        {% block footer_buttons %}
          <div class="float-right">
            {{ form_widget(form.submit) }}
            {{ form_widget(form.submitAndPrintLabel) }}
          </div>
        {% endblock %}
      </div>

      {{ form_end(form) }}
    </div>

    {# TODO: cleanup/refactor #}
    {% embed '@PrestaShop/Admin/Helpers/bootstrap_popup.html.twig' with {
      'id': 'inpost_intl_geowidget_modal',
      'class': 'mw-100 w-75',
      'title': 'Select destination point'|trans({}, 'Modules.Inpostinternational.Shipment'),
      'closable': true
    } %}
      {% block content %}
        <div id="inpost_intl_geowidget" class="modal-body" style="height:75vh;min-width:100%"></div>
      {% endblock %}
    {% endembed %}
  </div>
</div>
