.mobile-menu-btn,
.mobile-nav {
    display: none;
}

html,
body {
    background: #fafaff;
    max-width: 100%;
    overflow-x: clip;
}

.page-container {
    overflow-x: visible !important;
}

.scroll-reveal {
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.7s ease, filter 0.7s ease;
}

.scroll-reveal.is-visible {
    opacity: 1;
    filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        filter: none;
        transition: none;
    }
}

/* Tablet styles */
@media (max-width: 1024px) {
    /* Hide background images */
    body > div > img:first-child,
    body > div > img:nth-child(2) {
        display: none !important;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Hide background images */
    .page-container > img {
        display: none !important;
    }
    
    /* Page container */
    .page-container {
        min-height: auto !important;
        padding: 0 !important;
    }
    
    /* Main sections - only direct children */
    .page-container > div:not(#mobileNav):not(.mobile-nav):not(#successPopup) {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        width: 90% !important;
        max-width: 100% !important;
        margin: 0 auto 40px auto !important;
        padding: 0 !important;
    }
    
    /* Navbar */
    .page-container > div:first-of-type {
        margin-top: 20px !important;
        margin-bottom: 40px !important;
    }
    
    /* Navbar inner container */
    .page-container > div:first-of-type > div {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* Hide desktop navigation */
    .nav-links-desktop {
        display: none !important;
    }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0 !important;
        margin: 0 !important;
        width: 30px !important;
        height: 30px !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .mobile-menu-btn span {
        width: 25px;
        height: 3px;
        background-color: #414141;
        display: block;
    }
    
    /* Mobile nav overlay */
    .mobile-nav,
    #mobileNav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(250, 250, 255, 0.98) !important;
        z-index: 1000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 30px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .mobile-nav.active,
    #mobileNav.active {
        transform: translateX(0) !important;
    }
    
    /* Close button - X made from lines */
    .mobile-nav-close {
        position: fixed !important;
        top: 20px !important;
        right: 5% !important;
        width: 30px !important;
        height: 30px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        z-index: 1001 !important;
    }
    
    .mobile-nav-close span {
        width: 25px;
        height: 3px;
        background-color: #414141;
        display: block;
        position: absolute;
    }
    
    .mobile-nav-close span:first-child {
        transform: rotate(45deg);
    }
    
    .mobile-nav-close span:last-child {
        transform: rotate(-45deg);
    }
    
    /* Stack all flex containers vertically */
    [class*="flex"][class*="gap-[120px]"],
    [class*="flex"][class*="gap-[60px]"] {
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    /* About Us section */
    #about {
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    /* About Us images - keep overlapping */
    #about > div:first-child {
        position: relative !important;
        width: 100% !important;
        height: 320px !important;
        order: 2 !important;
    }
    
    #about > div:first-child > div {
        width: min(72vw, 300px) !important;
        height: min(72vw, 300px) !important;
        position: absolute !important;
    }

    #about > div:first-child > div:first-child {
        left: 0 !important;
        top: 50px !important;
    }

    #about > div:first-child > div:last-child {
        left: auto !important;
        right: 0 !important;
        top: 0 !important;
    }
    
    #about > div:last-child {
        order: 1 !important;
    }
    
    /* Services section */
    #services {
        margin-top: 60px !important;
    }
    
    #services > div:first-child {
        margin-bottom: 40px !important;
    }
    
    #services img {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Service cards container */
    #services > div:nth-child(2),
    #services > div:nth-child(3) {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    /* Individual service cards */
    #services [class*="flex-[1_0_0]"] {
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* Icon containers - keep 140px */
    #services [class*="size-[140px]"] {
        width: 140px !important;
        height: 140px !important;
    }
    
    /* PPC icon - increase inner icon size for mobile */
    #services [class*="size-[140px]"] img[src*="ppc-icon.svg"]:not([src*="combined"]) {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* All service icons - default behavior */
    #services [class*="size-[140px]"] img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Why Choose Us section */
    #why-choose-us {
        margin-top: 60px !important;
        flex-direction: column !important;
        gap: 30px !important;
    }
    
    #why-choose-us [class*="flex-[1_0_0]"]:last-child {
        position: relative !important;
        width: 100% !important;
        height: 300px !important;
        order: 2 !important;
    }
    
    #why-choose-us [class*="flex-[1_0_0]"]:last-child > div:first-child {
        width: 85% !important;
        height: 85% !important;
        position: absolute !important;
        right: 0 !important;
        top: 50px !important;
    }
    
    #why-choose-us [class*="flex-[1_0_0]"]:first-child {
        order: 1 !important;
    }
    
    /* Contact form specific */
    .page-container > #contact {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
        width: calc(100% - 32px) !important;
        margin: 0 auto 40px auto !important;
        max-width: 500px !important;
        padding: 30px 20px !important;
        border-radius: 32px !important;
        overflow: hidden !important;
    }

    #contact > div {
        box-sizing: border-box !important;
        width: calc(100% - 60px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    
    /* Container widths */
    [class*="w-[1200px]"],
    [class*="w-[564px]"] {
        width: 100% !important;
    }
    
    [class*="w-[840px]"]:not(#contact) {
        width: 90% !important;
        margin: 0 auto !important;
    }

    .page-container > div:not(#mobileNav):not(.mobile-nav):not(#successPopup),
    .page-container > form#contact {
        box-sizing: border-box !important;
        width: calc(100% - 44px) !important;
        max-width: 500px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    #hero {
        gap: 32px !important;
    }

    #hero > div:first-child {
        gap: 24px !important;
        width: 100% !important;
    }
    
    /* Font sizes */
    [class*="text-[48px]"] {
        font-size: 28px !important;
        line-height: 1.2 !important;
    }
    
    [class*="text-[32px]"] {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    
    [class*="text-[24px]"] {
        font-size: 18px !important;
    }
    
    [class*="text-[18px]"] {
        font-size: 16px !important;
    }
    
    [class*="text-[16px]"] {
        font-size: 14px !important;
    }
    
    /* Gaps */
    [class*="gap-[80px]"] {
        gap: 25px !important;
    }
    
    [class*="gap-[40px]"] {
        gap: 20px !important;
    }
    
    /* Padding */
    [class*="p-[40px]"] {
        padding: 20px !important;
    }
    
    /* Logo */
    [class*="w-[190.1px]"] {
        width: 140px !important;
    }
    
    [class*="h-[48px]"] {
        height: 36px !important;
    }
    
    /* Buttons full width */
    button[class*="w-[240px]"],
    a[class*="w-[240px]"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Keep mobile contact fields away from the card edges */
    .page-container > #contact#contact {
        padding: 40px 0 36px !important;
    }

    .page-container > #contact > div {
        width: calc(100% - 60px) !important;
        max-width: calc(100% - 60px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    .page-container > #contact input,
    .page-container > #contact textarea {
        box-sizing: border-box !important;
    }

    .page-container > #contact button {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Footer layout */
    [class*="justify-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    [class*="items-end"] {
        align-items: flex-start !important;
    }
    
    [class*="text-right"] {
        text-align: left !important;
    }
    
    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Small phones */
@media (max-width: 480px) {
    [class*="text-[48px]"] {
        font-size: 24px !important;
    }
    
    [class*="text-[32px]"] {
        font-size: 20px !important;
    }
}
