/* Footer Full Width Fix (clean + robust) */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Make footer stick to bottom when content is short */
html, body { height: 100%; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.footer { margin-top: auto; }

/* Keep page from horizontal scrolling due to other elements */
html { overflow-x: hidden; }

/* Footer wrapper should span full width without using 100vw (avoids scrollbar offset) */
.footer {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #0e2a44; /* main footer bg */
    overflow: hidden; /* prevent margin-collapsing from previous section */
    border-top: 1px solid transparent; /* also prevents collapsing */
    isolation: isolate; /* new stacking context so previous section can't overlap */
}

.footer_top {
    width: 100%;
    margin: 0;
    padding: 60px 0 40px 0;
    background-color: #0e2a44; /* matches footer bg */
    overflow: hidden; /* safety against collapsing margins */
}

.copy-right_text {
    width: 100%;
    margin: 0;
    padding: 20px 0;
    background-color: #0a2237; /* slightly darker strip */
}

/* Remove internal element spacing that can create bands */
.footer .footer_border { padding: 0 !important; margin: 0 !important; border: 0 !important; height: 0 !important; }
.footer .copy_right { margin: 0 !important; }

/* Center footer content while keeping background full width */
.footer .container,
.footer .container-fluid {
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Override any existing footer styles */
.footer .container {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin: 0 !important;
}

/* Ensure no gaps around footer content */
/* Normalize grid spacing inside footer */
.footer .row { margin-left: 0; margin-right: 0; }

.footer .col-xl-3,
.footer .col-xl-2,
.footer .col-xl-4,
.footer .col-md-6,
.footer .col-lg-3,
.footer .col-lg-2,
.footer .col-lg-4,
.footer .col-xl-12 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .footer_top { padding: 40px 0 30px 0; }
    .copy-right_text { padding: 15px 0; }
}

/* Remove any unwanted margins from page container */
.main-content,
.page-content,
body > .container,
body > .container-fluid {
    margin-bottom: 0 !important;
}

/* Remove bottom spacing from common page wrappers so footer hugs previous section */
.main-content,
.page-content,
body > .container,
body > .container-fluid { margin-bottom: 0; }

/* Ensure last section before footer does not add extra gap */
.service_area:last-of-type,
.service_area.minus_padding:last-of-type,
.service_area + .footer { margin-bottom: 0; }
.service_area.minus_padding { padding-bottom: 0 !important; margin-bottom: 0 !important; border-bottom: 0 !important; }
.service_area:last-child { margin-bottom: 0 !important; padding-bottom: 0 !important; }
.container:last-of-type { margin-bottom: 0 !important; padding-bottom: 0 !important; }

/* NEW: Kill any residual spacing when a minus_padding block sits directly above the footer */
.service_area.minus_padding + .footer { margin-top: 0 !important; }
.service_area.minus_padding { border-bottom: 0 !important; }

/* Prevent last child margins inside service_area from creating visual gaps */
.service_area.minus_padding > *:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Ensure footer sits above preceding content layers */
.footer { position: relative; z-index: 2; }
.service_area { position: relative; z-index: 1; }

/* Clear any floats inside the last service section so it doesn't overlap the footer */
.service_area::after { content: ""; display: block; clear: both; }
.service_area.minus_padding::after { content: ""; display: block; clear: both; }

/* Guard against negative margins pulling content under the footer */
.service_area, .service_area.minus_padding { margin-bottom: max(0px, var(--service-bottom, 0px)) !important; }

/* Safety: if any element just before footer carries bottom margin, collapse it */
.footer { 
  padding-top: 0; 
}
.footer_top > *:first-child { margin-top: 0 !important; }

/* Extra hardening: remove bottom spacing when common sections are last before footer */
.features_area:last-of-type,
.testimonial_area:last-of-type,
.accordion_area:last-of-type,
.compapy_info:last-of-type,
.bradcam_area:last-of-type,
.slider_area:last-of-type,
.service_area:last-of-type {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}

/* Ensure their last child doesn't introduce spacing either */
.features_area:last-of-type > *:last-child,
.testimonial_area:last-of-type > *:last-child,
.accordion_area:last-of-type > *:last-child,
.compapy_info:last-of-type > *:last-child,
.bradcam_area:last-of-type > *:last-child,
.slider_area:last-of-type > *:last-child,
.service_area:last-of-type > *:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
