/* Waterways Irrigation - Mobile-First Responsive Styles */

/* Mobile Hero Video - Hide video on mobile, show WebP background */
@media (max-width: 768px) {
    .hero-video-background {
        display: none !important;
    }
    
    .hero {
        background: linear-gradient(135deg, rgba(30,95,140,0.2) 0%, rgba(41,134,204,0.2) 100%), 
                    url('assets/images/hero-bg.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
    }
}

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

/* Hide mobile call button, social, and logo on desktop */
.mobile-call-button,
.mobile-social-media,
.mobile-menu-logo {
    display: none !important;
}

/* Mobile Styles (320px - 768px) */
@media (max-width: 768px) {
    /* Typography Mobile Optimization */
    html {
        font-size: 16px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    
    /* Header Mobile Typography */
    .header-company-info h1 { 
        font-size: 1.4rem; 
    }
    .header-company-info p { 
        font-size: 0.8rem; 
    }
    .header-company-info { 
        margin: 0 1rem; 
    }

    /* Header Mobile */
    header {
        padding: 1rem 0;
    }

    .header-content {
        gap: 15px;
    }

    .logo-section {
        display: flex !important; /* Show on mobile */
    }

    .header-logo {
        height: 140px;
        width: 140px;
    }

    /* Hide company name on mobile to save space */
    .header-company-name {
        display: none !important;
    }

    .phone-link {
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 80px;
    }
    
    /* Ensure desktop navigation maintains 74px height */
    @media (min-width: 769px) {
        nav {
            position: fixed !important;
            top: 100px !important;
            left: 0 !important;
            right: 0 !important;
            width: 100% !important;
            height: 74px !important;
            min-height: 74px !important;
            max-height: 74px !important;
            background: rgba(255, 255, 255, 0.98) !important;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
            padding: 0 !important;
            padding-top: 0 !important;
            overflow: visible !important;
            transition: none !important;
        }
    }

    nav.active {
        left: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    nav a {
        padding: 16px 20px;
        font-size: 1.1rem;
    }

    /* Mobile Dropdown */
    .dropdown > a::after {
        float: right;
        transform: rotate(0);
        transition: transform 0.3s ease;
    }

    .dropdown.active > a::after {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: var(--light-blue);
        padding: 0;
        margin: 0;
        border-radius: 0;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    /* Disable hover on mobile to prevent sticky dropdowns */
    .dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .dropdown.active:hover .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding: 12px 20px 12px 40px;
        font-size: 1rem;
        border-left: none;
    }
    
    /* Mobile Menu Logo - Show on mobile only */
    .mobile-menu-logo {
        display: block !important;
        text-align: center;
        padding: 20px;
        background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
        margin: -80px -20px 20px -20px;
        border-bottom: 2px solid rgba(255,255,255,0.1);
    }
    
    .mobile-menu-logo img {
        height: 60px;
        width: auto;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    }
    /* Mobile Call Button */
    .mobile-call-button {
        display: block !important;
        background: linear-gradient(135deg, var(--accent-green), var(--dark-green));
        color: var(--white);
        text-decoration: none;
        padding: 16px 20px;
        margin: 20px;
        border-radius: var(--border-radius);
        text-align: center;
        font-weight: 600;
        font-size: 1.1rem;
        box-shadow: 0 4px 12px rgba(74,155,94,0.3);
        transition: all 0.3s ease;
    }

    .mobile-call-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(74,155,94,0.4);
    }

    /* Mobile Social Media */
    .mobile-social-media {
        display: block !important;
        padding: 20px;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }

    .mobile-social-title {
        text-align: center;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-gray);
        margin-bottom: 15px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .mobile-social-icons {
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .mobile-social-icons a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 55px;
        height: 55px;
        background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
        border-radius: 50%;
        color: var(--white) !important;
        transition: all 0.3s ease;
        text-decoration: none;
        box-shadow: 0 2px 8px rgba(30,95,140,0.2);
    }

    .mobile-social-icons a:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 4px 12px rgba(30,95,140,0.4);
    }

    .mobile-social-icons svg {
        width: 32px;
        height: 32px;
        fill: currentColor;
    }

    /* Mobile Overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Footer Social Media Mobile */
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-copyright {
        text-align: center;
    }

    .social-media {
        justify-content: center;
        margin-top: 20px;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 40px 20px;
        min-height: 100vh;
    }
    
    .hero-content {
        max-width: 100%;
        padding: 0 10px;
    }

    .hero h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

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

    /* Hide video on mobile for performance */
    .hero-video-background {
        display: none;
    }

    .trust-badges {
        flex-direction: column;
        gap: 15px;
    }

    .badge {
        min-width: 100%;
    }

    .badge-number {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }

    /* Services Grid Mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .service-card {
        padding: 25px;
    }
    
    .service-image {
        object-fit: cover;
        object-position: center;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    /* Features Grid Mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Testimonials Mobile */
    .testimonials-container {
        flex-direction: column;
        gap: 25px;
    }

    .testimonial {
        padding: 25px;
    }

    /* Contact Form Mobile */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-info {
        order: 2;
    }

    .contact-form {
        order: 1;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: left;
    }

    .footer-logo {
        height: 100px;
        width: 100px;
    }

    .footer-bottom {
        text-align: center;
        font-size: 0.9rem;
    }

    /* Service Pages Mobile */
    .hero-service {
        padding: 40px 20px;
        min-height: 100vh;
    }
    
    .hero-service .hero-content {
        max-width: 100%;
        padding: 0 10px;
    }

    .hero-service h1 {
        font-size: 1.8rem;
    }

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

    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    .sidebar {
        position: static;
        order: 2;
    }

    .main-content {
        order: 1;
    }

    /* Blog Mobile */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 15px;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
    }

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

    .blog-image {
        height: 200px;
    }

    .blog-content {
        padding: 20px;
    }

    .blog-card h2 {
        font-size: 1.3rem;
    }

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

    /* Touch Targets - Minimum 44px */
    a, button, input, select, textarea {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Form Fields Mobile */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }

    /* County Badges Mobile */
    .counties {
        flex-direction: column;
        gap: 10px;
    }

    .county-badge {
        width: 100%;
        text-align: center;
    }

    /* Location Badges Mobile */
    .locations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .location-badge {
        padding: 12px;
        font-size: 0.9rem;
    }

    /* CTA Boxes Mobile */
    .cta-box {
        padding: 25px 20px;
    }

    .cta-box h3 {
        font-size: 1.3rem;
    }

    /* Info Boxes Mobile */
    .info-box {
        padding: 20px;
    }

    /* Seasonal Banner Mobile */
    .seasonal-banner {
        padding: 40px 20px;
    }

    .seasonal-banner h2 {
        font-size: 1.6rem;
    }

    /* Service Area Mobile */
    .service-area {
        padding: 40px 20px;
    }

    .service-area h2 {
        font-size: 1.8rem;
    }

    /* Breadcrumb Mobile */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0 15px;
    }

    /* Repair Grid Mobile */
    .repair-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Process Steps Mobile */
    .process-steps {
        padding: 20px;
    }

    .process-step {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    /* FAQ Mobile */
    .faq-item {
        padding: 20px;
    }

    .faq-item h3 {
        font-size: 1.1rem;
    }

    /* Highlight Boxes Mobile */
    .highlight-box,
    .warning-box,
    .success-box,
    .emergency-box {
        padding: 20px;
        margin: 20px 0;
    }

    /* Service Checklist Mobile */
    .service-checklist {
        padding: 20px;
    }

    .service-checklist ul {
        margin-left: 20px;
    }

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

/* Tablet Optimization (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-logo {
        height: 175px;
        width: 175px;
    }

    /* Smaller company name for tablets */
    .header-company-name h1 {
        font-size: 1.6rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .header-logo {
        height: 122px;
        width: 122px;
    }

    .phone-link {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .badge-number {
        font-size: 1.8rem;
    }

    .badge-text {
        font-size: 0.85rem;
    }

    .service-card h3 {
        font-size: 1.3rem;
    }

    .locations-grid {
        grid-template-columns: 1fr;
    }

    .blog-card h2 {
        font-size: 1.2rem;
    }

    .blog-meta {
        flex-direction: column;
        gap: 8px;
    }

    nav {
        width: 100%;
        left: -100%;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 30px 20px;
        min-height: 100vh;
    }

    .hero-service {
        padding: 30px 20px;
        min-height: 100vh;
    }

    nav {
        padding-top: 60px;
    }
    
    /* Ensure desktop navigation height is maintained */
    @media (min-width: 769px) {
        nav {
            height: 74px !important;
            min-height: 74px !important;
            max-height: 74px !important;
            padding-top: 0 !important;
        }
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header-logo,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed in the future */
}

