{% if cnilUrl is not defined %}
  {% set cnilUrl = aa_content_path_safe('page', {slugAdmin: 'gdpr'}) %}
{% endif %}
<div class="gdpr-backdrop"></div>
<div class="gdpr-banner">
  <div class="container">
    <div class="gdpr-banner__text">
      <button class="gdpr-deny-all">{{ 'gdpr.deny_all'|trans({}, 'gdpr_banner') }}</button>
      <span class="gdpr-banner__text-title">{{ 'gdpr.title'|trans({}, 'gdpr_banner') }}</span>
      <div>
        {{ 'gdpr.base'|trans({'%cnilUrl%': cnilUrl}, 'gdpr_banner')|raw }}
      </div>
    </div>
    <div class="gdpr-banner__buttons">
      <button class="gdpr-accept-all btn btn-primary">{{ 'gdpr.accept_all'|trans({}, 'gdpr_banner') }}</button>
      <button class="gdpr-configure btn btn-transparent"
              data-bs-toggle="modal"
              data-bs-target="#gdpr-modal"
      >{{ 'gdpr.configure'|trans({}, 'gdpr_banner') }}</button>
    </div>
  </div>
</div>
<button
  class="gdpr-quick-access btn btn-secondary"
  data-bs-toggle="modal"
  data-bs-target="#gdpr-modal"
>
  <span class="gdpr-quick-access-ico" aria-hidden="true"></span>
</button>
<div class="modal gdpr-modal" tabindex="-1" id="gdpr-modal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-body">
        <p class="h2">{{ 'gdpr.modal.title'|trans({}, 'gdpr_banner') }}</p>
        <div class="modal-body-content">
          <div class="row">
            <div class="col">
              {{ 'gdpr.modal.base'|trans({'%cnilUrl%': cnilUrl}, 'gdpr_banner')|raw }}
            </div>
          </div>

          {% set gdprSections = [
            'functional',
            'analytics',
            'marketing',
          ] %}
          {% for section in gdprSections %}
            <div class="row">
              <div class="col">
                <label class="gdpr-control-labels" for="gdpr-control-{{ section }}">
                  <span class="label-title">{{ ('gdpr.sections.'~section~'.title')|trans({}, 'gdpr_banner')|raw }}</span>
                  <span class="label-description">{{ ('gdpr.sections.'~section~'.description')|trans({}, 'gdpr_banner')|raw }}</span>
                </label>
              </div>
              <div class="col gdpr-control-col">
                <label class="checkbox-container">
                  <input
                      id="gdpr-control-{{ section }}"
                      class="custom-checkbox gdpr-control"
                      type="checkbox"
                      data-gdpr-section="{{ section }}"
                      {% if section == 'functional' %} readonly="readonly" disabled="disabled" checked="checked"{% endif %}
                  />
                  <span class="checkmark"></span>
                </label>
              </div>
            </div>
          {% endfor %}
        </div>
        <div class="modal-buttons-container">
          <button class="btn btn-transparent gdpr-save"
                  data-bs-dismiss="modal">{{ ('gdpr.modal.save')|trans({}, 'gdpr_banner') }}</button>
          <button class="btn btn-primary gdpr-accept-all"
                  data-bs-dismiss="modal">{{ ('gdpr.modal.accept-all')|trans({}, 'gdpr_banner') }}</button>
        </div>
      </div>
    </div>
  </div>
</div>
