/* ============================================
   Mobile Responsiveness Fixes for All Pages
   ============================================ */

/* Base Mobile Optimizations */
@media (max-width: 768px) {
    /* Ensure no horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Typography adjustments */
    h1 {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.2rem !important;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Images - prevent overflow */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Tables - make scrollable */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Forms - full width inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Buttons - larger touch targets */
    .btn,
    button,
    a.btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Navigation - mobile friendly */
    .navbar {
        padding: 0.75rem 0;
    }

    .nav-menu {
        width: 100%;
    }

    /* Hero sections */
    .hero {
        min-height: 60vh;
        padding: 2rem 0;
    }

    .hero-title,
    .hero h1 {
        font-size: 1.8rem !important;
    }

    .hero-subtitle,
    .hero p {
        font-size: 1rem;
    }

    /* Grid layouts - stack on mobile */
    .services-grid,
    .benefits-grid,
    .features-grid,
    .team-grid,
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Two-column grids */
    .two-col-grid,
    .split-content {
        grid-template-columns: 1fr !important;
    }

    /* Cards */
    .card,
    .service-card,
    .benefit-card {
        margin-bottom: 1rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 2rem;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }

    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }

    /* Spacing adjustments */
    section {
        padding: 2.5rem 0 !important;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    /* Gallery grids */
    .gallery-grid,
    .project-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* CTA sections */
    .cta-section {
        padding: 2rem 1rem !important;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Stats/Numbers */
    .stats-grid,
    .numbers-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem;
    }

    /* Process steps */
    .process-steps,
    .steps-grid {
        grid-template-columns: 1fr !important;
    }

    /* Prevent text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Single column for all grids */
    .stats-grid,
    .numbers-grid {
        grid-template-columns: 1fr !important;
    }

    /* Smaller buttons on very small screens */
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Reduce section padding */
    section {
        padding: 2rem 0 !important;
    }

    /* Hero adjustments */
    .hero {
        min-height: 50vh;
        padding: 1.5rem 0;
    }

    .hero-title,
    .hero h1 {
        font-size: 1.5rem !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 80vh;
    }

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

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    a,
    button,
    .btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    *:hover {
        transition: none;
    }
}
