.elementor-201 .elementor-element.elementor-element-03c868b{--display:flex;}#elementor-popup-modal-201 .dialog-message{width:640px;height:auto;}#elementor-popup-modal-201{justify-content:center;align-items:center;pointer-events:all;background-color:rgba(0,0,0,.8);}#elementor-popup-modal-201 .dialog-close-button{display:flex;}#elementor-popup-modal-201 .dialog-widget-content{box-shadow:2px 8px 23px 3px rgba(0,0,0,0.2);}/* Start custom CSS for html, class: .elementor-element-9e9ec51 */<script>
(function () {

  function inicializarPopupCompucredito() {

    var popup = document.getElementById('compucredito-aviso');

    if (!popup || popup.dataset.ccInitialized === 'true') {
      return;
    }

    var boton = popup.querySelector('#cc-boton-aceptar');

    if (!boton) {
      return;
    }

    popup.dataset.ccInitialized = 'true';

    boton.addEventListener('click', function (event) {

      event.preventDefault();
      event.stopPropagation();

      // 1. Intentar cerrar mediante Elementor Pro.
      try {
        if (
          window.elementorProFrontend &&
          window.elementorProFrontend.modules &&
          window.elementorProFrontend.modules.popup
        ) {
          window.elementorProFrontend.modules.popup.closePopup(
            {},
            event
          );

          return;
        }
      } catch (error) {
        console.warn('No se pudo cerrar mediante la API de Elementor.');
      }

      // 2. Buscar el botón nativo de cierre del popup.
      var modal = popup.closest('.elementor-popup-modal');

      if (modal) {

        var botonCerrar = modal.querySelector(
          '.dialog-close-button, .dialog-lightbox-close-button'
        );

        if (botonCerrar) {
          botonCerrar.click();
          return;
        }
      }

      // 3. Avisar si ninguna de las opciones anteriores funciona.
      console.error(
        'No se encontró un método de cierre compatible con este popup.'
      );

    });

  }

  // Inicializar cuando el documento esté disponible.
  if (document.readyState === 'loading') {
    document.addEventListener(
      'DOMContentLoaded',
      inicializarPopupCompucredito
    );
  } else {
    inicializarPopupCompucredito();
  }

})();
</script>/* End custom CSS */