/* JR — Report Modal Mobile Z-Index Fix v1.0.1 */

/* Mobile only */
@media (max-width: 768px) {

  /*
    IMPORTANT:
    We do NOT change size/position (no inset:0, no full-screen forcing).
    We only ensure the modal + its backdrop sit above BuddyPress/Kadence headers/menus.
  */

  /* Push the modal container above everything */
  #jrReportModal,
  .jr-report-modal {
    z-index: 2147483647 !important;
    opacity: 1 !important;
  }

  /* If your markup uses an inner dialog/card wrapper, also boost it */
  #jrReportModal .jr-report-dialog,
  #jrReportModal .jr-report-modal__dialog,
  #jrReportModal .jr-report-modal-inner,
  #jrReportModal .jr-report-modal-content,
  #jrReportModal .jr-report-content,
  .jr-report-modal .jr-report-dialog,
  .jr-report-modal .jr-report-modal__dialog,
  .jr-report-modal .jr-report-modal-inner,
  .jr-report-modal .jr-report-modal-content,
  .jr-report-modal .jr-report-content {
    z-index: 2147483647 !important;
    opacity: 1 !important;
  }

  /* If there is an overlay/backdrop element, bring it just under the dialog */
  #jrReportModal .jr-report-backdrop,
  #jrReportModal .jr-report-overlay,
  #jrReportModal .modal-backdrop,
  #jrReportModal .backdrop,
  .jr-report-modal .jr-report-backdrop,
  .jr-report-modal .jr-report-overlay,
  .jr-report-modal .modal-backdrop,
  .jr-report-modal .backdrop {
    z-index: 2147483646 !important;
    opacity: 1 !important;
  }

  /* Ensure any fixed headers/menus can't sit above the modal */
  #wpadminbar,
  header,
  .site-header,
  .mobile-header,
  .kadence-header,
  .kadence-sticky-header-wrap,
  .kadence-mobile-navigation,
  .kadence-sticky-header,
  .bp-navs,
  .bp-subnavs,
  .buddypress-wrap .bp-subnavs {
    z-index: 1 !important;
  }

  /* If some element creates a stacking context above, neutralize common culprits */
  .kadence-sticky-header,
  .kadence-sticky-header-wrap,
  .kadence-mobile-navigation,
  .site-header,
  .mobile-header {
    transform: none !important;
    filter: none !important;
    will-change: auto !important;
  }
}
