

// Safe Colorbox init — bypass for page builders and only run if Colorbox is present
jQuery(document).ready(function ($) {
  const isPageBuilder = window.Bricks ||
    window.bricksIsFrontend ||
    window.elementorFrontend ||
    window.wpb ||
    document.body.classList.contains('bricks-is-editing');

  if (isPageBuilder || typeof $.colorbox !== 'function') {
    return;
  }

  const selectors = [
    '.dacdb-modal-trigger--large',
    '.dacdb-modal-trigger--xlarge',
    '.dacdb-modal-trigger--fixed'
  ];

  const anyFound = selectors.some(sel => $(sel).length > 0);
  if (!anyFound) return;

  $(selectors[0]).colorbox({ iframe: true, width: "80%", height: "80%" });
  $(selectors[1]).colorbox({ iframe: true, width: "90%", height: "90%" });
  $(selectors[2]).colorbox({ iframe: true, width: "700px", height: "560px" });
});


// Google Maps initialization
function initMap() {
  // Your map initialization code here
  if (typeof google === 'undefined') {
    console.warn('Google Maps not loaded');
    return;
  }

  // Initialize your map here when needed
}
// Make sure initMap is globally available
window.initMap = initMap;