/*
 * GalloShop Enterprise 5.3.5
 * Suppress only public theme headers while the Premium Header is active.
 * The WordPress admin bar and checkout never receive these selectors.
 */
body.gshop-premium-header-active > header.site-header:not(.gshop-header),
body.gshop-premium-header-active > header#site-header:not(.gshop-header),
body.gshop-premium-header-active #page > header.site-header:not(.gshop-header),
body.gshop-premium-header-active #page > #masthead:not(.gshop-header),
body.gshop-premium-header-active .site > header.site-header:not(.gshop-header),
body.gshop-premium-header-active .wp-site-blocks > header.wp-block-template-part:not(.gshop-header),
body.gshop-premium-header-active .wp-site-blocks > .wp-block-template-part > header:not(.gshop-header),
body.gshop-premium-header-active .header-wrapper > header.site-header:not(.gshop-header),
body.gshop-premium-header-active .site-header-wrapper > header:not(.gshop-header) {
    display: none !important;
}

/* Remove the theme-part wrapper and its adjacent block gap, not only its header. */
body.gshop-premium-header-active .wp-site-blocks > .wp-block-template-part:has(> header:not(.gshop-header)),
body.gshop-premium-header-active .wp-site-blocks > .wp-block-template-part:has(#masthead:not(.gshop-header)),
body.gshop-premium-header-active #page > .site-header-wrapper:has(header:not(.gshop-header)),
body.gshop-premium-header-active #page > .header-wrapper:has(header:not(.gshop-header)) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.gshop-premium-header-active .wp-site-blocks > header.wp-block-template-part:not(.gshop-header) + *,
body.gshop-premium-header-active .wp-site-blocks > .wp-block-template-part:has(> header:not(.gshop-header)) + *,
body.gshop-premium-header-active #masthead:not(.gshop-header) + #content,
body.gshop-premium-header-active header.site-header:not(.gshop-header) + .site-content {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

/* Reset only containers that actually host the GalloShop storefront. */
body.gshop-premium-header-active .wp-site-blocks:has(.gshop-storefront),
body.gshop-premium-header-active main:has(.gshop-storefront),
body.gshop-premium-header-active .site-content:has(.gshop-storefront),
body.gshop-premium-header-active .entry-content:has(> .gshop-storefront) {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

/* Runtime markers cover nested Site Editor, classic-theme and Elementor hosts. */
body.gshop-premium-header-active .gshop-theme-header-placeholder {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
}

body.gshop-premium-header-active .gshop-premium-header-host:not(.gshop-header):not(.gshop-topbar) {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
    padding-block-start: 0 !important;
    row-gap: 0 !important;
    --wp--style--block-gap: 0px;
}

/* Exact wrappers confirmed in the active WordPress/Elementor markup. */
body.gshop-premium-header-active .wp-site-blocks.gshop-premium-header-host,
body.gshop-premium-header-active main.gshop-premium-header-host,
body.gshop-premium-header-active .elementor.gshop-premium-header-host {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.gshop-premium-header-active .wp-site-blocks {
    padding-top: 0 !important;
}

body.gshop-premium-header-active .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Global top-space reset requested for the active GalloShop public header. */
body.gshop-premium-header-active {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html body.gshop-premium-header-active.admin-bar {
    padding-top: 0 !important;
}

body.gshop-premium-header-active .wp-site-blocks,
body.gshop-premium-header-active .site,
body.gshop-premium-header-active .site-main,
body.gshop-premium-header-active main,
body.gshop-premium-header-active .entry-content,
body.gshop-premium-header-active .wp-block-post-content,
body.gshop-premium-header-active .elementor,
body.gshop-premium-header-active .elementor-section-wrap,
body.gshop-premium-header-active .elementor-inner,
body.gshop-premium-header-active .elementor-widget-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.gshop-premium-header-active .wp-block-spacer:first-child,
body.gshop-premium-header-active .wp-block-template-part:first-child,
body.gshop-premium-header-active header.wp-block-template-part,
body.gshop-premium-header-active .site-header {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Never change the authenticated WordPress toolbar. */
body.gshop-premium-header-active #wpadminbar {
    display: block;
}

/* The storefront owns its footer on Home pages; suppress only the theme footer. */
body.gshop-premium-footer-active > footer:not(.gshop-footer),
body.gshop-premium-footer-active footer:not(.gshop-footer),
body.gshop-premium-footer-active #page > footer:not(.gshop-footer),
body.gshop-premium-footer-active .site > footer:not(.gshop-footer),
body.gshop-premium-footer-active footer.site-footer:not(.gshop-footer),
body.gshop-premium-footer-active footer#colophon:not(.gshop-footer),
body.gshop-premium-footer-active .wp-site-blocks > footer.wp-block-template-part:not(.gshop-footer),
body.gshop-premium-footer-active .wp-site-blocks > .wp-block-template-part:has(footer:not(.gshop-footer)) {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 18.22.1: Astra/Elementor can render the legacy footer inside DIV wrappers rather
 * than a semantic <footer>. Hide only known theme-footer hosts while the
 * GalloShop premium footer is active. */
body.gshop-premium-footer-active #colophon:not(.gshop-footer),
body.gshop-premium-footer-active .site-footer:not(.gshop-footer),
body.gshop-premium-footer-active .site-footer-wrapper:not(:has(.gshop-footer)),
body.gshop-premium-footer-active .footer-wrapper:not(:has(.gshop-footer)),
body.gshop-premium-footer-active .ast-footer-overlay,
body.gshop-premium-footer-active .footer-adv,
body.gshop-premium-footer-active .footer-adv-overlay,
body.gshop-premium-footer-active .site-primary-footer-wrap,
body.gshop-premium-footer-active .site-below-footer-wrap,
body.gshop-premium-footer-active [data-section="section-primary-footer-builder"],
body.gshop-premium-footer-active [data-section="section-below-footer-builder"],
body.gshop-premium-footer-active .elementor-location-footer:not(:has(.gshop-footer)) {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

body.gshop-premium-header-active.admin-bar .gshop-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.gshop-premium-header-active.admin-bar .gshop-header {
        top: 46px;
    }
}

/*
 * GalloShop 18.15.1 — native page-title guard
 * GalloShop-managed pages already render their own semantic heading/hero.
 * Hide only the title generated by the active WordPress theme, while leaving
 * the stored post title untouched for SEO, Rank Math, admin and browser title.
 */
body.gshop-native-title-suppressed .entry-header,
body.gshop-native-title-suppressed .ast-page-title,
body.gshop-native-title-suppressed .ast-advanced-headers,
body.gshop-native-title-suppressed .page-header,
body.gshop-native-title-suppressed .wp-block-post-title,
body.gshop-native-title-suppressed .elementor-page-title,
body.gshop-native-title-suppressed .entry-title:not(.product_title) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Remove residual spacing left by Astra/other themes around a suppressed title. */
body.gshop-native-title-suppressed #primary,
body.gshop-native-title-suppressed .site-main,
body.gshop-native-title-suppressed article.page > .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

