.main-footer {
    background-color: #f8f9fa;
    border-top: 2px solid #f17a37;
    margin-top: 50px;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #6c757d;
    font-size: 14px;
    text-decoration: none;
    transition: 0.3s;
}

.footer-links a:hover {
    color: #f17a37;
    padding-left: 5px;
}

.social-links a {
    display: inline-block;
    width: 35px;
    height: 35px;
    background: #e9ecef;
    color: #333;
    text-align: center;
    line-height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    transition: 0.3s;
}

.social-links a:hover {
    background: #f17a37;
    color: #fff;
    transform: translateY(-3px);
}

.btn-orange {
    background-color: #f17a37;
    border: none;
}

.btn-orange:hover {
    background-color: #d6652d;
}

/* =====================================================================
   FOOTER — responsive across phone, tablet (iPad 11), laptop & desktop.
   The footer markup (templates/include/footer.html) uses .footer-section
   with a Bootstrap grid (col-lg-* / col-md-*). The grid handles the column
   reflow; these rules tune spacing, touch targets, fluid type and prevent
   any horizontal overflow at each breakpoint. Mobile-first, additive only.
   ===================================================================== */

/* Never allow the app-store buttons / social row to cause sideways scroll. */
.footer-section {
    overflow-x: hidden;
}

/* Smooth, on-brand hover for the muted footer links (all screen sizes). */
.footer-section a.text-muted {
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-section a.text-muted:hover {
    color: #f17a37 !important;
}

/* Keep the social icons + app-store buttons from shrinking out of shape. */
.footer-section .social-icon {
    flex-shrink: 0;
}

/* ---- Laptop / small desktop (≤1199.98px): tighten the gutters a touch --- */
@media (max-width: 1199.98px) {
    .footer-section .row.g-4 {
        --bs-gutter-x: 1.25rem;
    }
}

/* ---- Tablet / iPad portrait (768–991.98px) ----------------------------- */
/* Below lg the 5 info columns reflow to col-md-6 (two-up), which orphaned the
   5th column. Make the BRAND span the full width as the footer header, so the
   remaining four columns (Company · Our Services · Insights · Contact) sit in a
   clean, balanced 2×2 grid. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .footer-section {
        padding-top: 2.5rem !important;
    }
    .footer-section .row.g-4 > [class*="col-"] {
        margin-bottom: 1.25rem;
    }
    /* Brand column → full width header row. */
    .footer-section .row.g-4 > [class*="col-"]:first-child {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .footer-section .footer-brand img {
        height: 52px !important;
    }
    .footer-section .footer-brand p {
        max-width: 38rem;
    }
}

/* ---- Phones (≤767.98px) ------------------------------------------------ */
/* Every column is full width here. Reduce top padding, scale the brand logo
   and body text fluidly, and make sure long link text wraps cleanly. */
@media (max-width: 767.98px) {
    .footer-section {
        padding-top: 1.75rem !important;
    }
    .footer-section .row.g-4 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }
    .footer-section .footer-brand img {
        height: 46px !important;
    }
    .footer-section h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem !important;
    }
    .footer-section .footer-brand p,
    .footer-section .list-unstyled,
    .footer-section p.small {
        font-size: 0.9rem;
    }
    .footer-section a.text-decoration-none {
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .footer-section .row > .col-12.text-center p {
        font-size: 0.78rem;
        line-height: 1.5;
    }
}

/* ---- Small phones (≤375px): final tightening (iPhone SE / mini) -------- */
@media (max-width: 375px) {
    .footer-section h6 {
        font-size: 0.95rem;
    }
    .footer-section .footer-brand img {
        height: 42px !important;
    }
}
/* ==========================================================
   iPad Portrait - Keep Footer in One Row
   ========================================================== */
@media (min-width:768px) and (max-width:991.98px){

    .footer-section .container{
        max-width:100%;
        padding:0 20px;
    }

    .footer-section .row.g-4{
        flex-wrap:nowrap;
        --bs-gutter-x:1rem;
        align-items:flex-start;
    }

    /* Make every column compact */
    .footer-section .col-lg-3,
    .footer-section .col-lg-2{
        flex:1 1 0;
        max-width:none;
        min-width:0;
    }

    /* Smaller logo */
    .footer-brand img{
        height:48px !important;
    }

    /* Smaller headings */
    .footer-section h6{
        font-size:15px;
        margin-bottom:10px !important;
    }

    /* Smaller text */
    .footer-section p,
    .footer-section li,
    .footer-section a{
        font-size:12px !important;
        line-height:1.45;
    }

    .footer-section li{
        margin-bottom:6px !important;
    }

    /* Contact text wraps */
    .footer-section .small{
        word-break:break-word;
    }

    /* App buttons become narrower */
    .footer-section .d-flex.flex-column.gap-2 a{
        width:120px !important;
        padding:6px 8px !important;
    }

    .footer-section .d-flex.flex-column.gap-2 span:last-child{
        font-size:11px !important;
    }

    /* Smaller social icons */
    .footer-section .social-icon{
        width:32px !important;
        height:32px !important;
    }

    /* Copyright */
    .footer-section .col-12 p{
        font-size:11px !important;
    }
}

/* Brand alignment: center logo and the small description under it */
.footer-section .footer-brand img {
    display: block;
    margin: 0 auto 0.5rem auto;
}
.footer-section .footer-brand p {
    text-align: center;
    margin: 0 auto;
}

/* App download buttons alignment: left on desktop, center on tablet/phone */
.footer-section .d-flex.flex-column.gap-2 {
    align-items: flex-start;
}
@media (max-width: 991.98px) {
    .footer-section .d-flex.flex-column.gap-2 {
        align-items: center !important;
    }
    .footer-section .d-flex.flex-column.gap-2 a {
        margin: 0 auto !important;
        width: 160px !important;
        justify-content: center !important;
    }
    .footer-section .footer-brand p {
        text-align: center !important;
    }
}
/* --- Safety overrides: ensure footer content is visible and wraps correctly --- */
@media (min-width: 768px) {
    /* If any earlier rule accidentally prevented wrapping, force it here */
    .footer-section .row.g-4 {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }
    .footer-section .row.g-4 > [class*="col-"] {
        display: block !important;
        visibility: visible !important;
        max-width: 100% !important;
    }
    /* Allow horizontal overflow if content is wider, but prefer wrapping */
    .footer-section {
        overflow-x: visible !important;
        position: relative !important;
        z-index: 1;
    }
}

/* Ensure footer is not hidden behind the mobile bottom nav — add safe bottom padding */
@media (max-width: 767.98px) {
    .footer-section {
        padding-bottom: 96px !important;
    }
}