/* ==========================================================================
   PRODUCTION RESPONSIVE & MOBILE NAV ENGINE
   ========================================================================== */

@media (max-width: 991px) {
    /* 1. Hide CTA Header Button on Mobile */
    .call-now-btn {
        display: none !important;
    }

    /* 2. Main Mobile Menu Panel - Closed by Default + Scrollable */
    .main-navigation .nav-menu,
    .nav-menu,
    #primary-menu {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        padding: 20px 0 40px 0 !important;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18) !important;
        z-index: 99999 !important;
        margin: 0 !important;
        list-style: none !important;
        text-align: center !important;
        
        /* SCROLLING FIX WHEN EXPANDED */
        max-height: calc(100vh - 90px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* 3. Reveal Main Mobile Menu ON TOGGLE */
    .nav-menu.active,
    .nav-menu.is-open,
    #primary-menu.active,
    #primary-menu.is-open {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .nav-menu li {
        width: 100% !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-menu li a {
        display: inline-block !important;
        padding: 10px 20px !important;
        color: #111111 !important;
        font-weight: 700 !important;
        font-size: 1.1rem !important;
        text-decoration: none !important;
    }

    /* 4. SERVICES SUB-MENU - INLINE STACKED ACCORDION */
    .nav-menu .dropdown-menu,
    #primary-menu .dropdown-menu,
    .dropdown-menu {
        display: none !important;
        position: static !important;
        float: none !important;
        width: 90% !important;
        margin: 10px auto !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        padding: 10px 0 !important;
        list-style: none !important;
    }

    /* 5. REVEAL SERVICES INLINE WHEN TAPPED */
    #primary-menu .dropdown.mobile-dropdown-open > .dropdown-menu,
    .dropdown.mobile-dropdown-open > .dropdown-menu,
    #servicesDropdown.mobile-dropdown-open > .dropdown-menu {
        display: block !important;
    }

    .nav-menu .dropdown-menu li,
    #primary-menu .dropdown-menu li {
        width: 100% !important;
    }

    .nav-menu .dropdown-menu li a,
    #primary-menu .dropdown-menu li a {
        display: block !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        color: #334155 !important;
        padding: 8px 15px !important;
        text-align: center !important;
    }

    /* 6. HAMBURGER BUTTON & ICON */
    .mobile-menu-toggle {
        display: block !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 10px !important;
    }

    .hamburger {
        display: block;
        width: 26px;
        height: 3px;
        background: #111111;
        position: relative;
        transition: background 0.3s ease;
    }

    .hamburger::before, 
    .hamburger::after {
        content: '';
        position: absolute;
        width: 26px;
        height: 3px;
        background: #111111;
        left: 0;
        transition: transform 0.3s ease, top 0.3s ease;
    }

    .hamburger::before { top: -8px; }
    .hamburger::after { top: 8px; }

    /* ANIMATE TO 'X' WHEN OPEN */
    .mobile-menu-toggle[aria-expanded="true"] .hamburger {
        background: transparent !important;
    }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
        transform: rotate(-45deg);
        top: 0;
    }

    .dropdown-arrow {
        display: inline-block;
        transition: transform 0.3s ease;
    }

    .dropdown.mobile-dropdown-open .dropdown-arrow {
        transform: rotate(180deg);
    }
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}
@media (max-width: 991px) {

    /* ==========================================================================
       CONTAINER & PADDING FIX FOR MOBILE SERVICE PAGES
       ========================================================================== */

    /* 1. Add horizontal padding to the main container so content doesn't hit edge */
    main .container,
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
    }

    /* 2. Force grid elements into a clean vertical stack with internal breathing room */
    main .container > div,
    .grid-2-col,
    .grid-3-col,
    .grid-container,
    [class*="grid"],
    [class*="layout"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 25px !important;
        box-sizing: border-box !important;
    }

    /* 3. Style images into rounded, framed cards */
    .service-featured-img,
    main img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        border-radius: 12px !important; /* Soft corners for framed look */
        object-fit: cover !important;
    }

    /* 4. Ensure headings fit nicely inside the container padding */
    h1, h2, h3, h4 {
        word-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
    }
}
/* ==========================================================================
   MOBILE TOP BAR STACK & CENTER OVERRIDE
   ========================================================================== */
@media (max-width: 768px) {
    .top-emergency-bar .top-emergency-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .top-emergency-bar .top-bar-right {
        margin-top: 4px !important;
        text-align: center !important;
    }

    .top-emergency-bar .top-bar-call-link {
        display: block !important;
        text-align: center !important;
        white-space: normal !important; /* Allows long sentence to wrap cleanly if needed */
    }
}
/* Disable auto-hyphenation across headings */
h1, h2, h3, h4, .section-title {
    hyphens: manual !important;
    -webkit-hyphens: manual !important;
    -ms-hyphens: manual !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Fluidly scale main section headings so words fit on smaller mobile screens */
@media (max-width: 576px) {
    h1, .section-title, h2 {
        font-size: 1.75rem !important; /* Prevents text overflow without needing hyphens */
        line-height: 1.25 !important;
    }
}
/* ==========================================================================
   FORCE DISABLE HYPHENATION FOR MOBILE SAFARI (iOS)
   ========================================================================== */

/* 1. Explicitly kill all WebKit auto-hyphenation engines */
html, body, h1, h2, h3, h4, h5, h6, 
.section-title, .hero-title, p, span, a {
    -webkit-hyphens: none !important;
    -moz-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    word-break: keep-all !important;     /* Prevents breaking words mid-string */
    overflow-wrap: break-word !important; /* Only breaks if a single word is longer than the screen */
}

/* 2. Responsive scaling for Mobile Safari (iPhone 14 / Mobile View) */
@media (max-width: 768px) {
    h1, h2, .section-title {
        font-size: 1.65rem !important; /* Slightly scales down text so "Services" fits on one line */
        line-height: 1.25 !important;
        text-align: center !important;
    }
    
    h3 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
    }
}
/* ==========================================
   FLEXBOX MOBILE CONTAINER BOUNDING FIX
   ========================================== */
@media (max-width: 991px) {
    /* Prevents flex children from expanding past screen width */
    main .container,
    .service-layout-grid,
    .service-layout-grid > div,
    .grid-2-col > div {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Keeps image strictly bounded inside wrapper */
    .service-featured-image-wrapper {
        height: auto !important;
        max-height: 280px !important;
        width: 100% !important;
    }
}
/* ==========================================
   MOBILE WELCOME IMAGE BADGE SPACING FIX
   ========================================== */
@media (max-width: 991px) {
    /* 1. Ensure the floated image wrapper unfloats and takes natural height */
    .float-welcome-img {
        float: none !important;
        width: 100% !important;
        margin-bottom: 40px !important; /* Creates breathing room before the text */
    }

    /* 2. Give the pill badge space above and below it on mobile */
    .about-image-badge {
        margin-top: 20px !important;
        margin-bottom: 20px !important;
        display: inline-block !important;
        text-align: center !important;
        width: auto !important;
    }
}