/* =========================================================================
   Best Doors — Hero shim CSS + sitewide Footer
   --------------------------------------------------------------------------
   After the 2026-04-27 hero refactor, the hero is rendered by stock Elementor
   widgets in Theme Builder template 11239. Per-element styling lives in each
   Elementor widget's Style tab, not here.

   This file now contains only:
     1. Old Astra/HFE footer suppression (sitewide safety net)
     2. Page-specific legacy fixes (page 433 in-content cleanup)
     3. CSS hooks for the visibility toggles set by bestdoors-elementor-widgets.php
     4. The :empty rule that hides the subtitle Heading when its dynamic tag
        returns an empty string (Elementor renders an empty <h4> otherwise)
     5. Sitewide Footer styles (Theme Builder template 11241 ships HTML markup
        with no widget controls; styling lives here)
     6. Legacy .bd-page-hero / .bd-btn defaults — kept verbatim for one release
        cycle in case any third party still references them. The new template
        does NOT use these classes.

   v2.0.0 — 2026-04-27 — refactor companion
   ========================================================================= */


/* === 1. Old Astra/HFE footer suppression — sitewide ====================== */
footer#colophon,
footer.site-footer:not(.bd-fb),
.footer-widget-area,
.ast-footer-overlay {
    display: none !important;
}


/* === 2. Page-specific legacy fixes ======================================= */
/* Page 433 (/garage-doors/sectional/) — original glass-effect hero is hidden
   so the new template hero is the only one shown. */
body.page-id-433 .elementor-element-80f818c {
    display: none !important;
}

/* In-page contextual CTA → flush with new footer. The "Get in Touch" container
   on page 433 needs to span viewport width and sit flush against the footer. */
body.page-id-433 .elementor-element-2a66659 {
    --container-max-width: 100% !important;
    --content-width: 100% !important;
    margin: 0 !important;
    padding-top: 60px !important;
    padding-bottom: 60px !important;
}
body.page-id-433 .elementor-element-2a66659,
body.page-id-433 .elementor-element-2a66659 > .e-con-inner,
body.page-id-433 .elementor-element-7ac4150b > .e-con-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.page-id-433 .elementor-element-7ac4150b {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}


/* === 3. Visibility toggles =============================================== */
/* Driven by body classes set in bestdoors-elementor-widgets.php from per-page
   ACF values (page_hero_show, page_hero_secondary_cta_*). */
body.page-hero-hidden .bd-page-hero-section {
    display: none !important;
}

body.page-hero-no-secondary-cta .bd-hero__btn--secondary {
    display: none !important;
}


/* === 4. Empty subtitle hide ============================================== */
/* Elementor's Heading widget renders <h4> even when its bound dynamic tag
   returns nothing. Hide empty subtitles so they don't add stray spacing. */
.bd-page-hero__subtitle h4:empty,
.bd-page-hero__subtitle .elementor-heading-title:empty {
    display: none;
}


/* === 5. Footer (rendered by Theme Builder template 11241 via html widget)
       All styling lives here because the html widget exposes no controls. */
:root {
    --bdpf-red: #ED2027;
    --bdpf-red-dark: #c71c22;
    --bdpf-teal: #3F616F;
    --bdpf-grey: #6b6b6b;
}
.bd-footerwrap { width: 100%; }
.bd-fb,
.bd-footerwrap { margin-top: 0 !important; }

.bd-fb {
    position: relative;
    background-color: #3c464e;
    background-size: cover;
    background-position: center;
    padding: 80px 20px 30px;
    color: #fff;
}
.bd-fb__overlay {
    position: absolute;
    inset: 0;
    background: rgba(60, 70, 78, 0.78);
    pointer-events: none;
}
.bd-fb__inner {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 3rem;
}
.bd-fb__logo a { display: inline-block; }
.bd-fb__logo img {
    width: 130px;
    height: auto;
    margin-bottom: 1.5rem;
}
.bd-fb__desc {
    font-size: .92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .92);
    margin: 0 0 1.5rem;
}
.bd-fb__social { display: flex; gap: .75rem; }
.bd-fb__sicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bdpf-red);
    color: #fff !important;
    text-decoration: none !important;
    transition: transform .2s ease;
}
.bd-fb__sicon:hover { transform: translateY(-2px); }
.bd-fb__h {
    color: #fff !important;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
}
.bd-fb__links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bd-fb__links li { margin: 0 0 .65rem; }
.bd-fb__links a {
    color: rgba(255, 255, 255, .92) !important;
    text-decoration: none !important;
    font-size: .95rem;
    transition: color .2s ease;
}
.bd-fb__links a:hover { color: var(--bdpf-red) !important; }

.bd-fb__bottom {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 3rem auto 0;
    padding: 1.5rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, .15);
    text-align: center;
}
.bd-fb__copy {
    color: rgba(255, 255, 255, .85);
    font-size: .9rem;
    margin: 0 0 .5rem;
}
.bd-fb__legal {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}
.bd-fb__legal a {
    color: rgba(255, 255, 255, .85) !important;
    text-decoration: none !important;
    font-size: .9rem;
}
.bd-fb__legal a:hover { color: var(--bdpf-red) !important; }
.bd-fb__top {
    position: absolute;
    right: 30px;
    bottom: 30px;
    width: 36px;
    height: 36px;
    background: var(--bdpf-red);
    color: #fff !important;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    z-index: 3;
}

@media (max-width: 880px) {
    .bd-fb__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
    .bd-fb__inner { grid-template-columns: 1fr; }
}


/* === 6. Legacy hero defaults (kept verbatim one release cycle) ========== */
/* The new template does NOT use these classes; the old custom widget did.
   Kept so any third-party reference still renders. Safe to delete after
   2026-05-27 if no third-party usage is found. */
.bd-page-hero {
    position: relative;
    width: 100%;
    min-height: 440px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 80px 0;
    margin: 0;
    overflow: hidden;
}
.bd-page-hero--grey {
    background-color: #6b6b6b;
}
.bd-page-hero--image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
}
.bd-page-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}
.bd-page-hero__title {
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.bd-page-hero__subtitle {
    color: #fff;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 1.75rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.bd-page-hero__ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.bd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 18px 32px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
    box-sizing: border-box;
}
.bd-btn:hover {
    transform: translateY(-1px);
}
.bd-btn--primary {
    background: #ED2027;
    color: #fff;
    border-color: #ED2027;
}
.bd-btn--primary:hover {
    background: #c71c22;
    border-color: #c71c22;
    box-shadow: 0 8px 20px rgba(237, 32, 39, 0.32);
}
.bd-btn--secondary {
    background: #fff;
    color: #ED2027;
    border-color: #fff;
}
.bd-btn--secondary:hover {
    background: #ED2027;
    color: #fff;
    border-color: #ED2027;
}


/* === 7. Responsive ===================================================== */
@media (max-width: 540px) {
    .bd-page-hero__ctas {
        flex-direction: column;
        align-items: stretch;
    }
    .bd-btn {
        justify-content: center;
    }
    /* New stock-Elementor-button container on mobile */
    .bd-page-hero-section .e-con-inner > .e-con > .elementor-widget-button {
        width: 100%;
    }
}
