/* Sitewide mobile layout fixes — service pages and shared header (max-width: 768px) */
@import url('desktop-layout.css');

/* Clip horizontal bleed on the viewport only — never overflow:hidden on body (breaks sticky header). */
html {
    overflow-x: clip;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    width: 100%;
    max-width: 100vw;
}

body {
    width: 100%;
}

@media (max-width: 768px) {
    body {
        max-width: 100vw;
    }
}

.site-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
}

img,
video,
iframe,
svg,
table,
pre {
    max-width: 100%;
    box-sizing: border-box;
}

.site-header,
nav,
.top-bar,
main,
section,
.container,
.hero-container,
.hero-image-container,
.hero-content,
.hero-content-wrapper,
.page-nav-wrapper,
.logo-slider-container,
.advice-grid-container,
.main-content-grid {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    /* Hero titles — prevent overlap with nav / content below */
    .hero-content h1,
    .hero-text h1,
    .content-left h1 {
        font-size: clamp(1.45rem, 5.5vw, 1.95rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        max-width: 100%;
    }

    .hero-content p,
    .hero-text p {
        font-size: clamp(1rem, 3.8vw, 1.2rem) !important;
        line-height: 1.35 !important;
        margin-bottom: 1.25rem !important;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .hero-content,
    .hero-text {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-sizing: border-box;
    }

    .page-title {
        font-size: clamp(1.6rem, 5vw, 2.1rem) !important;
        line-height: 1.2 !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        max-width: 100%;
        flex: 1 1 100%;
    }

    /* Hero sections — stack CTA in document flow (no absolute overlap) */
    .hero-image-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        min-height: 50vh;
        padding: 2.5rem 1rem 2rem !important;
        gap: 1rem;
    }

    .hero-image-container .hero-content {
        position: relative;
        width: 100%;
        max-width: 100%;
        padding: 0 0.5rem !important;
        text-align: center;
    }

    .hero-image-container .hero-content h1,
    .hero-image-container .hero-content p {
        text-align: center;
    }

    .hero-container {
        height: auto !important;
        min-height: 50vh;
        padding: 2.5rem 1rem 2rem !important;
        box-sizing: border-box;
    }

    .hero-container .hero-content {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 1rem !important;
        gap: 1rem;
    }

    .hero-container .hero-text {
        text-align: center !important;
        width: 100%;
        max-width: 100%;
    }

    .hero-container .hero-text h1 {
        text-align: center !important;
    }

    .hero-container.hero-layout-stacked .hero-content {
        flex-direction: column !important;
        align-items: center !important;
        padding: 1.5rem 1rem !important;
        gap: 1rem !important;
    }

    .hero-container.hero-layout-stacked .hero-text,
    .hero-container.hero-layout-stacked .hero-text h1 {
        text-align: center !important;
    }

    .hero-cta-button {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        margin: 1rem auto 0 !important;
        align-self: center !important;
        max-width: calc(100vw - 2rem) !important;
        box-sizing: border-box;
        white-space: nowrap !important;
        font-size: clamp(0.5rem, 2.4vw, 0.78rem) !important;
        padding: 10px 12px !important;
        letter-spacing: 0.3px !important;
        line-height: 1.2 !important;
    }

    .hero-container.hero-layout-stacked .hero-cta-button {
        align-self: center !important;
    }

    /* Navigation — hide desktop links; hamburger only until menu opens */
    nav {
        padding: 0 !important;
        min-height: 3.5rem;
        position: relative;
    }

    .nav-links {
        display: none !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #f0f0f0;
        padding: 1rem 0;
        z-index: 1100;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-item {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .nav-item > a {
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .dropdown-menu,
    .mega-menu {
        display: none !important;
    }

    /* Hamburger — 44×44px minimum touch target */
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        padding: 6px;
        font-size: 2rem;
        line-height: 1;
        z-index: 1200;
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    /* Request Technical Site Survey — uniform single-line button */
    .top-bar-right a.site-survey-cta,
    .top-bar-right a[href*="calendly.com/gthinkltd/30min"] {
        white-space: nowrap !important;
        font-size: clamp(0.58rem, 2.6vw, 0.82rem) !important;
        padding: 0.45rem 0.65rem !important;
        letter-spacing: 0.3px !important;
        line-height: 1.2 !important;
        max-width: calc(100vw - 2rem) !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .top-bar {
        padding: 14px 12px !important;
        max-width: 100vw;
        overflow: hidden;
        box-sizing: border-box;
    }

    .site-title-text {
        font-size: clamp(1.45rem, 6vw, 1.95rem) !important;
        white-space: nowrap;
        max-width: 100%;
    }

    /* Overflowing flex / grid children */
    .image-pair {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
        gap: 0.75rem;
    }

    .image-pair img {
        max-width: 100%;
        width: min(250px, 100%);
        height: auto;
    }

    .page-nav {
        flex-wrap: wrap;
        max-width: calc(100vw - 2rem);
        box-sizing: border-box;
    }

    .logo-slider-track {
        max-width: none;
    }

    .manufacturer-logo-slider::before,
    .manufacturer-logo-slider::after {
        width: 40px;
    }

    /* Value & pricing CTA — wrap to two lines on narrow screens */
    .pricing-button-container {
        padding: 0 1rem;
        margin-top: 2rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    .pricing-button {
        white-space: normal !important;
        max-width: calc(100vw - 2.5rem) !important;
        width: auto;
        font-size: clamp(0.95rem, 3.6vw, 1.2rem) !important;
        padding: 0.75rem 1.15rem !important;
        line-height: 1.3 !important;
        border-width: 3px;
        box-sizing: border-box;
        text-align: center;
        hyphens: none;
    }

    /* Process detail blocks (#how-we-do-it) — stack sidebar + steps */
    #how-we-do-it,
    #how-we-do-it .container {
        max-width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }

    .main-content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        width: 100%;
        min-width: 0;
    }

    .service-menu-col {
        position: static !important;
        top: auto !important;
        width: 100%;
        margin-bottom: 1rem;
        min-width: 0;
    }

    .service-menu-col ul li a {
        overflow-wrap: break-word;
        word-wrap: break-word;
        font-size: 1rem;
    }

    .service-content-area {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .service-row,
    .service-row:nth-child(odd),
    .service-row:nth-child(even) {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        padding: 1.25rem 1rem !important;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .service-row:nth-child(even) .image-frame {
        order: 0 !important;
    }

    .service-description,
    .service-description h3,
    .service-description p {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .service-row h3 {
        font-size: clamp(1.3rem, 4.5vw, 1.6rem) !important;
        line-height: 1.25;
    }

    .service-row p {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Mobile typography — +1 step for readability (header CTA buttons unchanged) */
    .intro-paragraph,
    .service-description p,
    .process-step-description,
    .advice-text p,
    .faq-item p,
    .testimonial-card p,
    .why-us-card p,
    .quality-item-text p,
    .expertise-content p,
    .tip-item p,
    .process-step-content p,
    .review-item p,
    .qa-item div,
    .info-column p,
    .promise p,
    .intro p,
    .primary-service-content p,
    .form-group label,
    .gallery-overlay p,
    .project-caption p {
        font-size: 1rem !important;
    }

    .breadcrumb-strip {
        font-size: 1rem !important;
    }

    .breadcrumb-strip a,
    .breadcrumb-strip .current {
        font-size: 0.95rem !important;
    }

    .breadcrumb-strip .separator {
        font-size: 0.9rem !important;
    }

    .footer-copyright,
    .location-links,
    .location-links a,
    .footer-column ul li a {
        font-size: 0.9rem !important;
    }

    .footer-column .contact-info-item span {
        font-size: 1rem !important;
    }

    .services h2,
    .projects h2,
    .expertise-section h2,
    .info-hub-section h2,
    .faq-section h2,
    .founder-section h2,
    .promise h2,
    .intro h2,
    .why-us-section h2,
    .process-section h2,
    .testimonials-section h2 {
        font-size: clamp(1.65rem, 5.5vw, 2rem) !important;
    }

    .quality-item-text h4,
    .tip-item h4,
    .process-step-content h4,
    .advice-text h3,
    .faq-item summary {
        font-size: clamp(1.05rem, 3.5vw, 1.2rem) !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem !important;
    }

    .image-frame {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    main > section {
        max-width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .top-bar-right a.site-survey-cta,
    .top-bar-right a[href*="calendly.com/gthinkltd/30min"] {
        font-size: clamp(0.52rem, 2.4vw, 0.72rem) !important;
        padding: 0.4rem 0.5rem !important;
        letter-spacing: 0.2px !important;
    }

    .hero-content h1,
    .hero-text h1,
    .content-left h1 {
        font-size: clamp(1.3rem, 5vw, 1.65rem) !important;
    }

    .hero-content p,
    .hero-text p,
    .content-left p {
        font-size: 1rem !important;
    }

    .pricing-button {
        font-size: clamp(0.9rem, 3.4vw, 1.05rem) !important;
        padding: 0.65rem 0.9rem !important;
    }

    .service-row h3 {
        font-size: clamp(1.2rem, 4.2vw, 1.45rem) !important;
    }

    .page-title {
        font-size: clamp(1.45rem, 5vw, 1.85rem) !important;
    }
}

/* Sidebar section menu — stable layout when switching active page (no border/weight shift) */
.service-menu-col {
    min-width: 0;
}

.service-menu-col ul li a {
    border-left: 4px solid transparent !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
    font-weight: 600 !important;
}

.service-menu-col ul li a.current-page-side {
    color: #1F2A44 !important;
    font-weight: 600 !important;
    background-color: #f9f9f9 !important;
    border-left-color: #1F2A44 !important;
}

.dropdown-menu a {
    font-weight: 600 !important;
}

.dropdown-menu a.current-page-dropdown {
    font-weight: 600 !important;
}
