/* ==========================================================================
   Site chrome — header, fixed bottom CTA bar, floating WhatsApp button
   --------------------------------------------------------------------------
   Loaded after bootstrap-min.css so it can override both Bootstrap's navbar
   and the legacy float/percentage-width rules in style.css.
   Selectors deliberately mirror the specificity used in style.css.
   ========================================================================== */


/* --- Shell ---------------------------------------------------------------- */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    float: none;
    background: #fff;
    z-index: 100;
}

header .header,
header .header > .container-fluid,
header .header .row,
header .header .head-area {
    float: none;
    width: 100%;
    height: 100%;
    margin: 0;
}

header .header > .container-fluid {
    padding: 0;
}

/* Bootstrap clearfixes these with `:before/:after { content:" "; display:table }`.
   Inside a flex container those pseudo-elements become real flex items, so a
   two-child row is actually four items and justify-content distributes space
   around the phantoms. Remove them from every container we flex. */
header .header .container-fluid::before,
header .header .container-fluid::after,
header .header .row::before,
header .header .row::after,
header .header .head-area .navbar::before,
header .header .head-area .navbar::after,
header .header .head-area .navbar-header::before,
header .header .head-area .navbar-header::after,
header .header .head-area .navbar-collapse::before,
header .header .head-area .navbar-collapse::after,
header .header .head-area .nav::before,
header .header .head-area .nav::after {
    display: none;
}

/* The bar itself: one flex row, everything vertically centred. */
header .header .head-area .navbar.navbar-fixed-top.navigation {
    position: static;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 24px;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 40px;
    border: 0;
    border-radius: 0;
    background: transparent;
}


/* --- Logo ----------------------------------------------------------------- */

header .header .head-area .navbar-header {
    display: flex;
    align-items: center;
    float: none;
    flex: 0 0 auto;
}

header .header .head-area a.navbar-brand {
    display: flex;
    align-items: center;
    float: none;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
}

/* 391x150 source — height-driven so the aspect ratio is never squashed. */
header .header .head-area a.navbar-brand img {
    display: block;
    width: auto;
    height: 52px;
    max-width: 100%;
}


/* --- Collapse region (nav + CTAs) ----------------------------------------- */

header .header .head-area .navigation .navbar-collapse {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    gap: 24px;
    height: auto !important;
    max-height: none;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    overflow: visible !important;
}

header .header .head-area .navigation .nav {
    display: flex;
    align-items: center;
    gap: 2px;
    float: none !important;
    width: auto;
    margin: 0 !important;
    padding: 0;
}

header .header .head-area .navigation .nav > li {
    float: none;
}

header .header .head-area .navigation .nav li a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    text-transform: uppercase;
    white-space: nowrap;
    background: none;
}

header .header .head-area .navigation .nav li a:hover,
header .header .head-area .navigation .nav li a:focus {
    background: none;
    color: #000;
}


/* --- Call-to-action cluster ----------------------------------------------- */

header .header .head-area .phone-popup {
    display: flex;
    align-items: center;
    gap: 12px;
    float: none;
    width: auto;
    flex: 0 0 auto;
}

header .header .head-area .phone-popup .schedule-request {
    display: flex;
    align-items: center;
    gap: 10px;
    float: none;
    width: auto;
    margin: 0;
}

/* min-height keeps all three buttons on a shared baseline regardless of
   whether their label wraps to two lines. */
header .header .head-area .phone-popup .schedule-request a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    float: none;
    min-height: 46px;
    margin: 0;
    padding: 5px 14px 5px 38px;
    border: 2px solid #000;
    border-radius: 5px;
    color: #000;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}

/* The label is "<span>Schedule A</span><br>Site visit" — the column flex
   above already stacks the two lines, so the <br> would add a third. */
header .header .head-area .phone-popup .schedule-request a br {
    display: none;
}

header .header .head-area .phone-popup .schedule-request a img {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    float: none;
}

header .header .head-area .phone-popup .phonenumber {
    float: none;
    width: auto;
    margin: 0;
}

header .header .head-area .phone-popup .phonenumber a {
    display: flex;
    align-items: center;
    gap: 6px;
    float: none;
    min-height: 46px;
    padding: 6px 14px;
    border: 2px solid #000;
    border-radius: 5px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}


/* --- Hamburger ------------------------------------------------------------ */

header .header .head-area .navigation .navbar-toggle {
    display: none;
    float: none;
    order: 2;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    background: transparent;
}

/* style.css has a global `.icon-bar { position: fixed; top: 50% }` for what
   used to be the social sidebar — the same class Bootstrap uses for the
   hamburger's three bars. Pin these back down explicitly. */
header .header .head-area .navigation .navbar-toggle span.icon-bar {
    position: static;
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    transform: none;
    -webkit-transform: none;
    -ms-transform: none;
    border-radius: 1px;
    background: #000;
}

header .header .head-area .navigation .navbar-toggle span.icon-bar + span.icon-bar {
    margin-top: 5px;
}


/* --- >=1200: tighten spacing before the nav collapses --------------------- */

@media only screen and (max-width: 1450px) {
    header .header .head-area .navbar.navbar-fixed-top.navigation {
        gap: 16px;
        padding: 0 20px;
    }
    header .header .head-area .navigation .navbar-collapse {
        gap: 16px;
    }
    header .header .head-area .navigation .nav li a {
        padding: 10px 8px;
        font-size: 13px;
    }
    header .header .head-area .phone-popup .schedule-request a,
    header .header .head-area .phone-popup .phonenumber a {
        min-height: 44px;
    }
    header .header .head-area .phone-popup .schedule-request a {
        padding: 5px 11px 5px 32px;
        font-size: 11px;
    }
    header .header .head-area .phone-popup .schedule-request a img {
        left: 9px;
    }
    header .header .head-area .phone-popup .phonenumber a {
        padding: 6px 10px;
        font-size: 15px;
    }
}


/* --- <=1199: collapse into a dropdown ------------------------------------- */
/* The old CSS hid .nav here but Bootstrap only shows the hamburger below
   768px, which left 768-1199px with no navigation at all. */

@media only screen and (max-width: 1199px) {
    header .header .head-area .navbar.navbar-fixed-top.navigation {
        position: relative;
        gap: 12px;
        padding: 0 16px;
    }

    /* The toggle lives inside .navbar-header alongside the logo, so the row
       has to span the bar for the two to push apart. */
    header .header .head-area .navbar-header {
        flex: 1 1 auto;
        justify-content: space-between;
        width: 100%;
    }

    header .header .head-area .navigation .navbar-toggle {
        display: flex;
        flex-direction: column;
    }

    header .header .head-area .navigation .navbar-collapse {
        display: none !important;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 8px 16px 16px;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
        max-height: calc(100vh - 70px);
        overflow-y: auto !important;
    }

    header .header .head-area .navigation .navbar-collapse.in,
    header .header .head-area .navigation .navbar-collapse.collapsing {
        display: flex !important;
    }

    header .header .head-area .navigation .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    header .header .head-area .navigation .nav li a {
        padding: 13px 4px;
        font-size: 14px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    header .header .head-area .phone-popup {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        margin-top: 14px;
    }

    header .header .head-area .phone-popup .schedule-request {
        gap: 10px;
        width: 100%;
    }

    /* min-width:0 lets the two CTAs shrink below their nowrap content width
       instead of overflowing the dropdown. */
    header .header .head-area .phone-popup .schedule-request a {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        align-items: flex-start;
        padding: 8px 12px 8px 38px;
        font-size: 12px;
    }

    header .header .head-area .phone-popup .phonenumber a {
        justify-content: center;
        min-width: 0;
        font-size: 16px;
    }
}


/* --- <=767: compact white bar --------------------------------------------- */

@media only screen and (max-width: 767px) {
    /* style.css turns the bar black below 767px — keep it white throughout. */
    header {
        background: #fff;
    }

    header .header .head-area .navbar.navbar-fixed-top.navigation {
        padding: 0 12px;
        gap: 8px;
    }

    /* style.css forces `width: 83px !important` here, which squashes the
       391x150 logo. Height-driven sizing keeps the aspect ratio. */
    header .header .head-area a.navbar-brand img {
        width: auto !important;
        height: 42px;
        padding: 0;
        float: none;
        margin: 0;
    }

    header .header .head-area .navigation .navbar-toggle span.icon-bar {
        background: #000;
    }

    header .header .head-area .navigation .navbar-collapse {
        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    }

    /* style.css paints this list solid black with `display: block !important`
       for the old dark bar — both have to be undone for the white menu. */
    header .header .head-area .navigation .nav {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        margin: 0 !important;
        background: transparent;
    }

    header .header .head-area .navigation .nav li a {
        color: #000;
        font-size: 14px !important;
        padding: 13px 4px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    header .header .head-area .phone-popup .schedule-request a,
    header .header .head-area .phone-popup .phonenumber a {
        color: #000;
        border-color: #000;
    }
}


/* --- <=480: stack the two CTA buttons ------------------------------------- */
/* Side by side they'd be ~200px each, which clips "Request a call back". */

@media only screen and (max-width: 480px) {
    /* stretch, not center — otherwise the stacked buttons shrink to their
       text width and no longer line up with the phone button below them. */
    header .header .head-area .phone-popup .schedule-request {
        flex-direction: column;
        align-items: stretch;
    }

    /* Centred labels leave the absolutely-positioned 15px icon stranded at
       the far left, so drop it — these two buttons read fine without it. */
    header .header .head-area .phone-popup .schedule-request a {
        align-items: center;
        text-align: center;
        padding-left: 12px;
        padding-right: 12px;
    }

    header .header .head-area .phone-popup .schedule-request a img {
        display: none;
    }
}


/* ==========================================================================
   Fixed bottom CTA bar (.bid-site-visit)
   --------------------------------------------------------------------------
   style.css builds this from floats with `line-height: 0` and asymmetric
   padding (13px 32px 0 0 on one half, 13px 0 0 55px on the other), so the two
   labels never line up. Rebuilt as two equal flex halves.
   ========================================================================== */

.bid-site-visit {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    float: none;
    z-index: 60;
    line-height: normal;
    background: #004387;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.18);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bid-site-visit .btn,
.bid-site-visit .btn.in {
    display: flex;
    align-items: center;
    justify-content: center;
    float: none;
    width: 50%;
    height: 52px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    background: #004387;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.bid-site-visit .btn:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.35);
}

/* Each half contains an empty placeholder <img> and a <br> that would become
   stray flex items. */
.bid-site-visit .btn img,
.bid-site-visit .btn br {
    display: none;
}

.bid-site-visit .call_icn {
    display: none;
}


/* ==========================================================================
   Floating WhatsApp button (.chat-container / .wapp)
   ========================================================================== */

.chat-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 70;
}

.wapp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    background: #25D366;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.wapp .fa-whatsapp {
    font-size: 28px !important;
    line-height: 1;
    color: #fff;
}


/* --- <=767: show the bar, and keep it clear of page content --------------- */
/* style.css hides the bar between 480px and 1600px via two `!important`
   min-width:480px rules, so it only ever appeared under 480px. */

@media only screen and (max-width: 767px) {
    /* home-page.js fades this in past 100px of scroll, but style.css's
       `!important` hide rules beat the inline display jQuery sets, so it only
       ever worked under 480px. Overriding both means the bar is now simply
       always visible on mobile — opacity is pinned too, otherwise fadeOut
       would leave an invisible bar still catching taps. */
    .bid-site-visit {
        display: flex !important;
        opacity: 1 !important;
    }

    /* stop the fixed bar from covering the end of the page */
    body {
        padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    }

    /* lift the WhatsApp button above the bar */
    .chat-container {
        bottom: calc(52px + 16px + env(safe-area-inset-bottom, 0px));
    }
}


/* --- >=768: no bottom bar, so the button sits at the corner --------------- */

@media only screen and (min-width: 768px) {
    .bid-site-visit {
        display: none !important;
    }
}
