/* ===================================
   MOBILE OPTIMIZATION ENHANCEMENTS
   Additional mobile-specific styles
   =================================== */

/* Force Single Column for SPECIFIC Grid Layouts Only */
@media (max-width: 767px) {
    /* ONLY Specific Grid Layouts - Force Single Column */
    .results-grid,
    .testimonials-grid,
    .pricing-grid,
    .features-grid,
    .portfolio-grid,
    .blog-grid,
    .contact-grid,
    .stats-grid,
    .related-posts-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        display: grid !important;
    }
    
    /* REMOVED services-grid - let styles.css handle responsive breakpoints */
    
    /* DO NOT affect inline style grids or homepage specific grids */
    /* Removed: [class*="-grid"], [class*="grid"] - These were breaking homepage */
    
    /* ONLY Specific Flex Layouts - Force Single Column */
    .services-flex,
    .testimonials-flex,
    .portfolio-flex,
    .about-flex,
    .contact-flex {
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    /* DO NOT affect all flex containers - Removed universal selectors */
    
    /* Container Padding */
    .container,
    .blog-container {
        padding: 0 20px !important;
        max-width: 100% !important;
    }
    
    /* DO NOT override all sections - Removed universal section rule */
    /* section { padding: 40px 0 !important; } - This was breaking homepage */
    
    /* Card Optimizations - ONLY specific cards */
    .service-card,
    .result-card,
    .testimonial-card,
    .pricing-card,
    .feature-card,
    .portfolio-card,
    .blog-card,
    .related-post-card {
        padding: 20px 16px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
    }
    
    /* DO NOT affect all cards with universal selector */
    /* Removed: [class*="-card"] - This was breaking homepage */
    
    /* Typography */
    h1 { font-size: 28px !important; line-height: 1.3 !important; margin-bottom: 16px !important; }
    h2 { font-size: 24px !important; line-height: 1.4 !important; margin-bottom: 14px !important; }
    h3 { font-size: 20px !important; line-height: 1.4 !important; margin-bottom: 12px !important; }
    h4 { font-size: 18px !important; line-height: 1.5 !important; margin-bottom: 10px !important; }
    p { font-size: 16px !important; line-height: 1.7 !important; margin-bottom: 16px !important; }
    
    /* Button Optimizations - ONLY specific buttons */
    .btn,
    .blog-btn {
        width: 100% !important;
        max-width: 300px !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        margin: 8px 0 !important;
        display: block !important;
        text-align: center !important;
    }
    
    /* DO NOT affect all buttons with universal selector */
    /* Removed: [class*="btn"] - This was breaking homepage */
    
    /* Image Optimizations */
    img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
    }
    
    /* Form Elements */
    input, textarea, select {
        width: 100% !important;
        margin-bottom: 16px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
    }
    
    /* Navigation */
    .nav-links {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .nav-links a {
        display: block !important;
        width: 100% !important;
        padding: 12px 16px !important;
        text-align: center !important;
    }
}

/* Hero Section Mobile Optimizations */
@media (max-width: 767px) {
    .hero {
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .hero-slider {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero-slide {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero-bg-image {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .hero-overlay {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero-content {
        padding: 100px 20px !important;
        margin: 0 !important;
    }
    
    .hero h1, .hero h2 {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-bottom: 16px !important;
    }
    
    .hero p {
        font-size: 16px !important;
        line-height: 1.6 !important;
        margin-bottom: 20px !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .hero-buttons .btn {
        width: 100% !important;
        max-width: 280px !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
    }
    
    /* About Section Mobile */
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .about-text, .about-image {
        text-align: center !important;
    }
    
    /* Stats Section Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    /* Testimonials Mobile */
    .testimonial-card {
        padding: 24px 20px !important;
        text-align: center !important;
    }
    
    .testimonial-author {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }
    
    /* Pricing Mobile */
    .pricing-card {
        padding: 30px 20px !important;
        text-align: center !important;
    }
    
    .pricing-card .btn {
        width: 100% !important;
    }
    
    /* Contact Form Mobile */
    .contact-form {
        padding: 30px 20px !important;
    }
    
    .contact-form input,
    .contact-form textarea,
    .contact-form select {
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    .contact-form button {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    /* Footer Mobile */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        text-align: center !important;
    }
    
    .footer-col {
        text-align: center !important;
    }
    
    .footer-links {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .social-links {
        justify-content: center !important;
    }
    
    /* WhatsApp Float Button Mobile */
    .whatsapp-float {
        width: 56px !important;
        height: 56px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    /* Prevent Horizontal Scroll */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Extra Small Screens (320px - 480px) */
@media (max-width: 480px) {
    /* Container */
    .container,
    .blog-container {
        padding: 0 15px !important;
    }
    
    /* Typography */
    h1 { font-size: 24px !important; line-height: 1.3 !important; }
    h2 { font-size: 20px !important; line-height: 1.4 !important; }
    h3 { font-size: 18px !important; line-height: 1.4 !important; }
    p { font-size: 15px !important; line-height: 1.6 !important; }
    
    /* Hero */
    .hero {
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .hero-slider {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero-slide {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero-bg-image {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .hero-overlay {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero-content {
        padding: 80px 15px !important;
        margin: 0 !important;
    }
    
    .hero h1, .hero h2 {
        font-size: 22px !important;
        margin-bottom: 12px !important;
    }
    
    .hero p {
        font-size: 15px !important;
        margin-bottom: 16px !important;
    }
    
    /* Buttons */
    .btn,
    .blog-btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
        max-width: 250px !important;
    }
    
    /* Cards */
    .service-card,
    .result-card,
    .testimonial-card,
    .pricing-card,
    .feature-card,
    .portfolio-card,
    .blog-card,
    .related-post-card {
        padding: 16px 12px !important;
        margin-bottom: 12px !important;
    }
    
    /* Blog Specific */
    .blog-article {
        padding: 20px 15px !important;
    }
    
    .blog-article h1 {
        font-size: 24px !important;
    }
    
    .blog-article h2 {
        font-size: 20px !important;
    }
    
    .result-card img {
        height: 120px !important;
    }
    
    .related-post-card img {
        height: 100px !important;
    }
    
    /* Social Share Buttons */
    .social-share-buttons {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .share-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Forms */
    input, textarea, select {
        padding: 10px 14px !important;
        font-size: 15px !important;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Footer */
    .footer-grid {
        gap: 20px !important;
    }
    
    /* WhatsApp Button */
    .whatsapp-float {
        width: 50px !important;
        height: 50px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
}

/* Google Rating Section Mobile Optimization */
@media (max-width: 768px) {
    /* Google Reviews Section */
    .google-reviews-section,
    [style*="background: linear-gradient(135deg, #4285f4"] {
        padding: 40px 20px !important;
        margin: 20px 0 !important;
    }
    
    .google-reviews-section h2,
    .google-reviews-section h3 {
        font-size: 24px !important;
        line-height: 1.4 !important;
        margin-bottom: 16px !important;
    }
    
    .google-reviews-section p {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }
    
    /* Google Rating Cards */
    .rating-card {
        padding: 20px 16px !important;
        margin-bottom: 16px !important;
    }
    
    /* Star Ratings */
    .stars {
        font-size: 20px !important;
        margin: 8px 0 !important;
    }
    
    /* Review Text */
    .review-text {
        font-size: 15px !important;
        line-height: 1.7 !important;
    }
}

/* Enhanced Card Layouts for Mobile */
@media (max-width: 767px) {
    /* Force Single Column for Specific Card Grids Only */
    .services-grid,
    .results-grid,
    .testimonials-grid,
    .pricing-grid,
    .features-grid,
    .portfolio-grid,
    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        display: grid !important;
    }
    
    /* Mobile Menu Enhancements */
    .mobile-menu-toggle {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        padding: 12px !important;
    }
    
    .nav-links {
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-links a {
        -webkit-tap-highlight-color: rgba(0, 86, 210, 0.1);
        touch-action: manipulation;
    }
    
    /* Card Padding and Spacing */
    .service-card,
    .result-card,
    .testimonial-card,
    .pricing-card,
    .feature-card,
    .portfolio-card,
    .blog-card {
        padding: 24px 20px !important;
        margin-bottom: 16px !important;
    }
    
    /* Card Titles */
    .service-card h3,
    .result-card h3,
    .testimonial-card h3,
    .pricing-card h3,
    .feature-card h3 {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
    }
    
    /* Card Descriptions */
    .service-card p,
    .result-card p,
    .testimonial-card p,
    .feature-card p {
        font-size: 16px !important;
        line-height: 1.8 !important;
        margin-bottom: 12px !important;
    }
    
    /* Icons in Cards */
    .service-icon,
    .feature-icon {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 16px !important;
    }
    
    /* Buttons in Cards */
    .service-card .btn,
    .pricing-card .btn,
    .feature-card .btn {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
    }
}

/* Contact Page Mobile Optimization */
@media (max-width: 767px) {
    .contact-container,
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    .contact-info-card {
        position: static !important;
        padding: 24px 20px !important;
    }
    
    .contact-item {
        padding: 20px 16px !important;
        margin-bottom: 12px !important;
    }
    
    .contact-item h4 {
        font-size: 17px !important;
    }
    
    .contact-item p {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }
}

/* Testimonials Page Mobile */
@media (max-width: 767px) {
    .testimonial-author h4 {
        font-size: 17px !important;
    }
    
    .testimonial-author p {
        font-size: 15px !important;
    }
    
    .testimonial-text {
        font-size: 16px !important;
        line-height: 1.8 !important;
    }
}

/* Pricing Cards Mobile */
@media (max-width: 767px) {
    .pricing-card {
        padding: 28px 20px !important;
    }
    
    .pricing-card h3 {
        font-size: 24px !important;
    }
    
    .pricing-card .price {
        font-size: 36px !important;
        margin: 16px 0 !important;
    }
    
    .pricing-card ul li {
        font-size: 15px !important;
        line-height: 1.7 !important;
        padding: 10px 0 !important;
    }
}

/* Section Spacing Mobile */
@media (max-width: 767px) {
    /* REMOVED universal section rule - was breaking homepage */
    /* section {
        padding: 50px 0 !important;
    } */
    
    .section-header {
        margin-bottom: 32px !important;
        padding: 0 16px !important;
    }
    
    .section-label {
        font-size: 12px !important;
        padding: 6px 14px !important;
        margin-bottom: 12px !important;
    }
    
    .section-title {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-bottom: 16px !important;
    }
    
    .section-description {
        font-size: 17px !important;
        line-height: 1.7 !important;
    }
}

/* CTA Section Mobile */
@media (max-width: 767px) {
    .cta-section {
        padding: 50px 20px !important;
    }
    
    .cta-section h2 {
        font-size: 28px !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
    }
    
    .cta-section p {
        font-size: 17px !important;
        line-height: 1.7 !important;
        margin-bottom: 24px !important;
    }
    
    .cta-section .btn {
        width: 100% !important;
        padding: 16px 24px !important;
        font-size: 17px !important;
    }
}

/* About Section Mobile */
@media (max-width: 767px) {
    .about-content h3 {
        font-size: 22px !important;
        margin-bottom: 16px !important;
    }
    
    .about-content p {
        font-size: 16px !important;
        line-height: 1.8 !important;
        margin-bottom: 16px !important;
    }
    
    .about-content ul li {
        font-size: 16px !important;
        line-height: 1.7 !important;
        padding: 8px 0 !important;
    }
}

/* Form Elements Mobile */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
        padding: 14px 16px !important;
        line-height: 1.5 !important;
    }
    
    button[type="submit"],
    input[type="submit"] {
        font-size: 17px !important;
        padding: 16px 24px !important;
        width: 100% !important;
    }
}

/* WhatsApp Float Button Mobile */
@media (max-width: 767px) {
    .whatsapp-float {
        width: 56px !important;
        height: 56px !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .whatsapp-float svg {
        width: 28px !important;
        height: 28px !important;
    }
}

/* Improved Touch Targets */
@media (max-width: 767px) {
    a, button, .btn, input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-links a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Prevent Text Overflow */
@media (max-width: 767px) {
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    h1, h2, h3, h4, h5, h6 {
        word-break: break-word;
    }
}
