/* =========================================================
   iPayed™ GLOBAL EARLY-LOAD SAFEGUARDS
   Purpose:
   - prevent Astra/legacy header flashes
   - prevent old iPayed ID® floating-element flashes
   - prevent Astra footer/page-title flashes
   - establish a clean initial page background
   - prevent horizontal loading overflow

   The individual page code remains responsible for
   the actual iPayed™ page layout and responsive design.
   ========================================================= */


/* Clean initial render */
html,
body {
    margin: 0;
    background: #ffffff !important;
    overflow-x: hidden !important;
}


/* ---------------------------------------------------------
   Hide Astra / legacy site header before custom iPayed header
   --------------------------------------------------------- */

body #masthead,
body .site-header:not(.ip-header),
body .ast-primary-header-bar,
body .main-header-bar,
body .ast-mobile-header-wrap,
body .ast-above-header-wrap,
body .ast-below-header-wrap {
    display: none !important;
}


/* ---------------------------------------------------------
   Hide Astra / WordPress page-title/banner elements
   before each custom iPayed page renders
   --------------------------------------------------------- */

body.page .entry-header,
body.page .page-header,
body.page .ast-page-title-bar,
body.page .ast-title-bar-wrap,
body.page .ast-single-entry-banner,
body.page .ast-advanced-headers-wrap,
body.page .ast-inside-advanced-header-content {
    display: none !important;
}


/* ---------------------------------------------------------
   Hide legacy Astra footer before custom iPayed footer renders
   --------------------------------------------------------- */

body #colophon,
body .site-footer,
body .ast-builder-footer,
body .ast-footer-copyright,
body .footer-adv-overlay,
body .site-below-footer-wrap,
body .site-primary-footer-wrap,
body .site-above-footer-wrap,
body [data-section*="section-footer"] {
    display: none !important;
}


/* ---------------------------------------------------------
   Hide legacy floating iPayed ID® elements immediately
   --------------------------------------------------------- */

body .floating-id,
body .floating-id-button,
body .ipayed-id-float,
body .ipayed-id-floating,
body .ipayed-floating-id,
body .floating-ipayed-id,
body [class*="ipayed"][class*="float"],
body [id*="ipayed"][id*="float"] {
    display: none !important;
}


/* ---------------------------------------------------------
   Hide Astra / legacy back-to-top controls
   Our custom .ip-top-floating remains untouched
   --------------------------------------------------------- */

#ast-scroll-top,
.ast-scroll-top-icon,
.ast-scroll-to-top-right,
.ast-scroll-to-top-left,
.scroll-to-top:not(.ip-top-floating),
.back-to-top:not(.ip-top-floating),
#back-to-top:not(.ip-top-floating),
a[href="#top"].scroll-top,
button.scroll-top:not(.ip-top-floating) {
    display: none !important;
}