/*
 * GalloShop Enterprise 5.4.9
 * Compatibility layer for the approved Premium Header and Premium Footer.
 * The WordPress admin bar never receives 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;
}

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;
    }
}

/* 5.4.9: keep only the GalloShop Premium Footer on public pages. */
body.gshop-premium-footer-active > footer.site-footer:not(.gshop-footer):not(:has(.gshop-footer)),
body.gshop-premium-footer-active > footer#colophon:not(.gshop-footer):not(:has(.gshop-footer)),
body.gshop-premium-footer-active #page > footer.site-footer:not(.gshop-footer):not(:has(.gshop-footer)),
body.gshop-premium-footer-active #page > #colophon:not(.gshop-footer):not(:has(.gshop-footer)),
body.gshop-premium-footer-active .site > footer.site-footer:not(.gshop-footer):not(:has(.gshop-footer)),
body.gshop-premium-footer-active .elementor-location-footer:not(:has(.gshop-footer)),
body.gshop-premium-footer-active [data-elementor-type="footer"]:not(:has(.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)),
body.gshop-premium-footer-active .gshop-theme-footer-placeholder {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
}

body.gshop-premium-footer-active .gshop-footer {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
}

body.gshop-premium-footer-active footer.site-footer:has(.gshop-footer),
body.gshop-premium-footer-active footer#colophon:has(.gshop-footer) {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.gshop-premium-footer-active footer.site-footer:has(.gshop-footer) > :not(.gshop-footer),
body.gshop-premium-footer-active footer#colophon:has(.gshop-footer) > :not(.gshop-footer) {
    display: none !important;
}
