/* ============================================
   MOBILE OPTIMIZATION FIXES
   ============================================ */

/* 1. Fix horizontal scroll issues */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

* {
    box-sizing: border-box;
}

/* 2. Fix 100vh issues on mobile (address bar) */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available; /* iOS fix */
        min-height: 100dvh; /* Dynamic viewport height */
        padding-top: 70px; /* Account for navbar */
    }

    .nav-menu {
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px); /* Dynamic viewport */
    }
}

/* 3. Fix hero video on mobile */
@media (max-width: 768px) {
    .hero-video-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    .hero-video {
        object-position: center center;
    }

    /* Hide video on very small screens to improve performance */
    @media (max-width: 480px) {
        .hero-video-wrapper {
            display: none;
        }

        .hero {
            background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
        }
    }
}

/* 4. Fix mobile menu z-index issues */
.nav-menu {
    z-index: 9999 !important;
}

.mobile-menu-btn {
    z-index: 10000 !important;
}

/* 5. Fix button touch targets */
@media (max-width: 768px) {
    .btn {
        min-height: 48px; /* Minimum touch target */
        padding: 14px 24px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    .nav-cta {
        padding: 10px 20px;
        min-height: 44px;
    }
}

/* 6. Fix card animations on mobile */
@media (max-width: 768px) {
    .feature-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .feature-card-inner {
        height: auto !important;
    }

    .card-image {
        height: 250px !important; /* Smaller on mobile */
    }

    .card-content {
        padding: 1.5rem !important;
    }
}

/* 7. Fix text sizing */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
    }

    .section-title {
        font-size: 2rem !important;
    }

    p {
        font-size: 16px !important; /* Prevent small text */
    }
}

/* 8. Fix testimonial carousel */
@media (max-width: 768px) {
    .testimonial-text {
        font-size: 1.2rem !important;
        padding: 0 1rem;
    }

    .testimonial-showcase {
        padding: 3rem 1rem;
    }
}

/* 9. Fix FAQ section */
@media (max-width: 768px) {
    .faq-question {
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    .faq-answer p {
        padding: 1rem 1.5rem !important;
        font-size: 0.95rem !important;
    }
}

/* 10. Fix footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 2rem;
    }

    .footer-links a,
    .footer-social a {
        padding: 0.5rem;
        display: inline-block;
    }
}

/* 11. Fix package cards */
@media (max-width: 768px) {
    .package-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem;
    }

    .package-price {
        font-size: 2rem !important;
    }
}

/* 12. Fix method cards */
@media (max-width: 768px) {
    .method-card {
        padding: 1.5rem !important;
    }

    .method-timeline {
        gap: 1rem !important;
    }
}

/* 13. Fix service tabs */
@media (max-width: 768px) {
    .services-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 10px;
    }

    .tab-button {
        min-width: 120px;
        white-space: nowrap;
    }
}

/* 14. Fix ticker on mobile */
@media (max-width: 768px) {
    .ticker-content {
        animation-duration: 10s !important; /* Faster on mobile */
    }

    .ticker-item {
        padding: 0 1rem !important;
        font-size: 0.85rem !important;
    }
}

/* 15. Keep parallax on mobile - removed disable */
/* Parallax will continue to work on mobile devices */

/* 16. Fix container padding */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    section {
        padding: 3rem 0 !important;
    }
}

/* 17. Fix form inputs on mobile */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* 18. Performance optimizations */
@media (max-width: 768px) {
    /* Disable expensive animations */
    * {
        animation-duration: 0.3s !important;
    }

    /* Disable will-change */
    * {
        will-change: auto !important;
    }

    /* Simplify shadows */
    .feature-card,
    .package-card,
    .method-card {
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
    }
}

/* 19. Fix image sizing */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .about-image img {
        border-radius: 10px;
    }
}

/* 20. Ensure touch scrolling works */
.nav-menu {
    -webkit-overflow-scrolling: touch;
}

/* 21. Fix z-index stacking */
.navbar {
    z-index: 1000;
}

.mobile-menu-btn.active {
    position: fixed;
    right: 20px;
}

/* 22. Prevent text selection on buttons */
.btn, .tab-button, .nav-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}