/* ===== COMPREHENSIVE MOBILE ENHANCEMENTS FOR PJ SIGNS ===== */
/* This file provides additional mobile optimizations for 100% mobile-friendly experience */

/* ===== GLOBAL MOBILE OPTIMIZATIONS ===== */
@media only screen and (max-width: 1140px) {
    
    /* Prevent horizontal scrolling */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Smooth scrolling for mobile */
    html {
        scroll-behavior: smooth !important;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
    }
    
    /* Mobile-optimized body */
    body {
        font-size: 16px !important; /* Prevents zoom on iOS */
        line-height: 1.6 !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        text-rendering: optimizeLegibility !important;
    }
    
    /* Mobile Container Optimizations - REMOVE PADDING FOR FULL WIDTH */
    .container,
    .gdlr-core-pbf-wrapper-container,
    .pjsigns-page-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile Typography Scale */
    h1, .h1 {
        font-size: clamp(24px, 6vw, 42px) !important;
        line-height: 1.2 !important;
        margin-bottom: clamp(15px, 4vw, 25px) !important;
        word-wrap: break-word !important;
    }
    
    h2, .h2 {
        font-size: clamp(20px, 5vw, 32px) !important;
        line-height: 1.3 !important;
        margin-bottom: clamp(12px, 3vw, 20px) !important;
        word-wrap: break-word !important;
    }
    
    h3, .h3 {
        font-size: clamp(18px, 4.5vw, 28px) !important;
        line-height: 1.3 !important;
        margin-bottom: clamp(10px, 2.5vw, 18px) !important;
        word-wrap: break-word !important;
    }
    
    h4, .h4 {
        font-size: clamp(16px, 4vw, 24px) !important;
        line-height: 1.4 !important;
        margin-bottom: clamp(8px, 2vw, 15px) !important;
        word-wrap: break-word !important;
    }
    
    p, .p {
        font-size: clamp(14px, 3.5vw, 18px) !important;
        line-height: 1.6 !important;
        margin-bottom: clamp(12px, 3vw, 20px) !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    /* Mobile Button Optimizations */
    .btn, .btn-primary, .btn-secondary, .btn-enquiry, button {
        font-size: clamp(14px, 3.5vw, 18px) !important;
        padding: clamp(12px, 3vw, 18px) clamp(20px, 5vw, 30px) !important;
        border-radius: clamp(6px, 1.5vw, 10px) !important;
        margin: clamp(10px, 2.5vw, 15px) 0 !important;
        min-height: 44px !important;
        min-width: 120px !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
        cursor: pointer !important;
        border: none !important;
        outline: none !important;
        transition: all 0.3s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile Form Elements */
    input, textarea, select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: clamp(12px, 3vw, 16px) !important;
        border-radius: clamp(6px, 1.5vw, 8px) !important;
        min-height: 44px !important;
        touch-action: manipulation !important;
        border: 2px solid #ddd !important;
        outline: none !important;
        transition: border-color 0.3s ease !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    input:focus, textarea:focus, select:focus {
        border-color: #0f4392 !important;
        box-shadow: 0 0 0 3px rgba(15, 67, 146, 0.1) !important;
    }
    
    /* Mobile Image Optimizations */
    img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: clamp(4px, 1vw, 8px) !important;
        image-rendering: optimizeQuality !important;
        image-rendering: -webkit-optimize-contrast !important;
    }
    
    /* Mobile Link Optimizations */
    a {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        word-wrap: break-word !important;
    }
    
    /* Mobile Section Spacing */
    section, .section {
        padding: clamp(30px, 8vw, 60px) 0 !important;
        margin-bottom: clamp(20px, 5vw, 40px) !important;
    }
    
    /* Mobile Grid Layouts */
    .grid, .row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: clamp(15px, 4vw, 25px) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile Flexbox Layouts */
    .flex, .d-flex {
        display: flex !important;
        flex-direction: column !important;
        gap: clamp(15px, 4vw, 20px) !important;
        align-items: stretch !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile Card Layouts */
    .card, .product-card, .service-card {
        padding: clamp(15px, 4vw, 25px) !important;
        margin-bottom: clamp(15px, 4vw, 20px) !important;
        border-radius: clamp(8px, 2vw, 12px) !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        background: #ffffff !important;
        border: 1px solid #e0e0e0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Mobile Performance Optimizations */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
        will-change: auto !important;
    }
    
    /* Mobile Scroll Performance */
    .scrollable {
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        overscroll-behavior: contain !important;
    }
}

/* ===== TABLET SPECIFIC OPTIMIZATIONS ===== */
@media only screen and (min-width: 769px) and (max-width: 1140px) {
    
    /* Tablet Grid Layouts */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }
    
    /* Tablet Typography */
    h1, .h1 {
        font-size: clamp(32px, 5vw, 42px) !important;
    }
    
    h2, .h2 {
        font-size: clamp(26px, 4vw, 32px) !important;
    }
    
    /* Tablet Button Sizing */
    .btn, .btn-primary, .btn-secondary, .btn-enquiry {
        font-size: 16px !important;
        padding: 14px 24px !important;
    }
}

/* ===== SMALL MOBILE OPTIMIZATIONS ===== */
@media only screen and (max-width: 480px) {
    
    /* Small Mobile Typography */
    h1, .h1 {
        font-size: clamp(20px, 5vw, 28px) !important;
        line-height: 1.1 !important;
    }
    
    h2, .h2 {
        font-size: clamp(18px, 4.5vw, 24px) !important;
        line-height: 1.2 !important;
    }
    
    h3, .h3 {
        font-size: clamp(16px, 4vw, 20px) !important;
        line-height: 1.3 !important;
    }
    
    p, .p {
        font-size: clamp(14px, 3.5vw, 16px) !important;
        line-height: 1.5 !important;
    }
    
    /* Small Mobile Buttons */
    .btn, .btn-primary, .btn-secondary, .btn-enquiry {
        font-size: 14px !important;
        padding: 12px 20px !important;
        min-width: 100px !important;
    }
    
    /* Small Mobile Spacing */
    section, .section {
        padding: clamp(20px, 6vw, 40px) 0 !important;
    }
    
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
}

/* ===== EXTRA SMALL MOBILE OPTIMIZATIONS ===== */
@media only screen and (max-width: 360px) {
    
    /* Extra Small Mobile Container */
    .container,
    .gdlr-core-pbf-wrapper-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Extra Small Mobile Typography */
    h1, .h1 {
        font-size: 20px !important;
        line-height: 1.1 !important;
    }
    
    h2, .h2 {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }
    
    p, .p {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    /* Extra Small Mobile Buttons */
    .btn, .btn-primary, .btn-secondary, .btn-enquiry {
        font-size: 13px !important;
        padding: 10px 16px !important;
        min-width: 90px !important;
    }
    
    /* Extra Small Mobile Spacing */
    section, .section {
        padding: 20px 0 !important;
    }
}

/* ===== MOBILE ACCESSIBILITY ENHANCEMENTS ===== */
@media only screen and (max-width: 1140px) {
    
    /* Larger Touch Targets */
    a, button, input, select, textarea, .clickable {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: clamp(8px, 2vw, 12px) !important;
    }
    
    /* Better Focus Indicators */
    a:focus, button:focus, input:focus, select:focus, textarea:focus {
        outline: 3px solid #0f4392 !important;
        outline-offset: 2px !important;
        box-shadow: 0 0 0 2px rgba(15, 67, 146, 0.3) !important;
    }
    
    /* High Contrast Support */
    @media (prefers-contrast: high) {
        .btn, .btn-primary, .btn-secondary, .btn-enquiry {
            border: 2px solid #000000 !important;
        }
        
        a {
            text-decoration: underline !important;
        }
    }
    
    /* Reduced Motion Support */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation: none !important;
            transition: none !important;
        }
        
        html {
            scroll-behavior: auto !important;
        }
    }
    
    /* Dark Mode Support */
    @media (prefers-color-scheme: dark) {
        .card, .product-card, .service-card {
            background: #1a1a1a !important;
            color: #ffffff !important;
            border-color: #333333 !important;
        }
    }
}

/* ===== MOBILE PERFORMANCE OPTIMIZATIONS ===== */
@media only screen and (max-width: 1140px) {
    
    /* GPU Acceleration for Smooth Animations */
    .btn, .card, .thumbnail-container, .product-main-image {
        transform: translateZ(0) !important;
        backface-visibility: hidden !important;
        perspective: 1000px !important;
    }
    
    /* Optimize Repaints */
    .mobile-optimized {
        contain: layout style paint !important;
        will-change: transform !important;
    }
    
    /* Reduce Layout Thrashing */
    .fixed-height {
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Optimize Images for Mobile */
    img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: optimizeQuality !important;
        transform: translateZ(0) !important;
    }
}

/* ===== MOBILE UTILITY CLASSES ===== */
@media only screen and (max-width: 1140px) {
    
    /* Mobile Visibility */
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-visible {
        display: block !important;
    }
    
    /* Mobile Text Alignment */
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-text-left {
        text-align: left !important;
    }
    
    /* Mobile Spacing */
    .mobile-mt-0 { margin-top: 0 !important; }
    .mobile-mb-0 { margin-bottom: 0 !important; }
    .mobile-pt-0 { padding-top: 0 !important; }
    .mobile-pb-0 { padding-bottom: 0 !important; }
    
    .mobile-mt-1 { margin-top: 10px !important; }
    .mobile-mb-1 { margin-bottom: 10px !important; }
    .mobile-pt-1 { padding-top: 10px !important; }
    .mobile-pb-1 { padding-bottom: 10px !important; }
    
    .mobile-mt-2 { margin-top: 20px !important; }
    .mobile-mb-2 { margin-bottom: 20px !important; }
    .mobile-pt-2 { padding-top: 20px !important; }
    .mobile-pb-2 { padding-bottom: 20px !important; }
    
    /* Mobile Width */
    .mobile-w-100 { width: 100% !important; }
    .mobile-w-auto { width: auto !important; }
    
    /* Mobile Display */
    .mobile-d-block { display: block !important; }
    .mobile-d-flex { display: flex !important; }
    .mobile-d-grid { display: grid !important; }
    .mobile-d-none { display: none !important; }
}

/* ===== MOBILE PRINT STYLES ===== */
@media print {
    .mobile-header-wrap,
    .mobile-menu,
    .btn,
    .mobile-whatsapp-icon,
    .mobile-contact-btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid !important;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid !important;
    }
}
