/* 
 * Critical Optimized CSS - Mobile First
 * Replaces 282KB style.css with optimized 15KB version
 * Performance improvement: 95% reduction in CSS size
 */

/* ========================================
   RESET & BASE STYLES (Essential Only)
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT SYSTEM (Mobile First)
   ======================================== */
.auto-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Content sections need proper spacing */
section {
    padding: 60px 0;
}

/* Ensure cards and content have proper spacing */
.card, .service-card, .feature-card, .testimonial-card {
    margin: 0 15px 30px 15px;
    padding: 25px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Grid layouts for cards */
.features-grid, .services-grid, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 15px;
    margin: 40px 0;
}

/* Content wrapper for proper spacing */
.content-wrapper {
    padding: 0 15px;
    margin: 0 auto;
    max-width: 1200px;
}

/* Common content areas that need spacing */
.content-section, .page-section, .section-inner {
    padding: 0 20px;
    margin: 0 auto;
    max-width: 1200px;
}

/* Fix for common layout classes */
.row {
    margin: 0 -15px;
    display: flex;
    flex-wrap: wrap;
}

.col, .column {
    padding: 0 15px;
    flex: 1;
    min-width: 0;
}

/* Text content spacing */
.text-content, .content-column {
    padding: 0 20px;
    margin: 0 auto;
}

.text-content h1, .text-content h2, .text-content h3 {
    margin-bottom: 20px;
}

.text-content p {
    margin-bottom: 15px;
}

/* Image containers */
.image-column, .image-container {
    padding: 0 15px;
}

.image-column img, .image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-wrapper {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
}

.header-upper {
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-outer {
    flex-shrink: 0;
}

.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-nav-toggle span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Desktop Navigation */
.main-menu {
    display: none;
}

.navigation {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navigation li {
    margin: 0 10px;
}

.navigation a {
    display: block;
    padding: 15px 10px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
}

.navigation a:hover {
    color: #cb3421;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.mobile-menu.open {
    left: 0;
}

.mobile-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    color: #333;
}

.mobile-menu ul {
    list-style: none;
    padding: 60px 0 20px;
    margin: 0;
}

.mobile-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu a:hover {
    background: #f8f9fa;
    color: #cb3421;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

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

/* ========================================
   FORMS (Mobile Optimized)
   ======================================== */
.quote-form, .enquery1 {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    position: relative;
    backdrop-filter: blur(10px);
}

.form-group, .input-item {
    margin-bottom: 15px;
    width: 100%;
}

.form-control, .input-enquery {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px; /* Prevent iOS zoom */
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-height: 44px; /* Touch-friendly */
    font-family: inherit;
}

.form-control:focus, .input-enquery:focus {
    outline: none;
    border-color: #cb3421;
    box-shadow: 0 0 0 3px rgba(203, 52, 33, 0.1);
}

select.form-control, select.input-enquery {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Checkbox Optimization */
.check-box {
    margin: 15px 0;
    position: relative;
}

.check-box input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 44px;
    height: 44px;
    cursor: pointer;
}

.check-box label {
    display: flex;
    align-items: center;
    padding-left: 50px;
    line-height: 1.4;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
    min-height: 44px;
}

.check-box label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.check-box label:after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.check-box input[type="checkbox"]:checked + label:before {
    background: #cb3421;
    border-color: #cb3421;
}

.check-box input[type="checkbox"]:checked + label:after {
    opacity: 1;
}

/* Buttons */
.btn, .theme-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(45deg, #cb3421, #ff6b35);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
    line-height: 1.2;
}

.btn:hover, .theme-btn:hover,
.btn:focus, .theme-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(203, 52, 33, 0.3);
    outline: none;
    color: white;
    text-decoration: none;
}

.btn:active, .theme-btn:active {
    transform: translateY(0);
}

.btn:disabled, .theme-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   HERO SECTION (Mobile First)
   ======================================== */
.main-slider, .hero-section {
    position: relative;
    min-height: 400px;
    background: linear-gradient(120deg, rgba(203,52,33,0.85) 0%, rgba(255,107,53,0.7) 100%);
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.slide-content, .hero-content {
    color: white;
    text-align: center;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.slide-content h1, .slide-content h2,
.hero-content h1, .hero-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.slide-content p, .hero-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.2);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pb-5 { padding-bottom: 3rem; }

/* ========================================
   IMAGES & MEDIA
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading images */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* Aspect ratio for images to prevent layout shift */
img[width][height] {
    aspect-ratio: attr(width) / attr(height);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .auto-container, .container {
        padding: 0 20px;
    }
    
    .content-wrapper {
        padding: 0 15px;
    }
    
    .features-grid, .services-grid, .stats-grid {
        padding: 0 10px;
        gap: 25px;
    }
    
    .header-upper {
        padding: 20px 0;
    }
    
    .logo img {
        max-height: 60px;
    }
    
    .mobile-nav-toggle {
        display: none;
    }
    
    .main-menu {
        display: block;
    }
    
    .quote-form, .enquery1 {
        position: absolute;
        right: 5%;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        max-width: 450px;
    }
    
    .main-slider, .hero-section {
        min-height: 500px;
        padding: 60px 0;
    }
    
    .slide-content h1, .slide-content h2,
    .hero-content h1, .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .slide-content p, .hero-content p {
        font-size: 1.2rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .auto-container, .container {
        padding: 0 30px;
    }
    
    .content-wrapper {
        padding: 0 20px;
    }
    
    .features-grid, .services-grid, .stats-grid {
        padding: 0 15px;
        gap: 30px;
    }
    
    .card, .service-card, .feature-card, .testimonial-card {
        margin: 0 20px 40px 20px;
        padding: 35px;
    }
    
    .quote-form, .enquery1 {
        right: 8%;
        max-width: 500px;
    }
    
    .main-slider, .hero-section {
        min-height: 600px;
        padding: 80px 0;
    }
    
    .slide-content h1, .slide-content h2,
    .hero-content h1, .hero-content h2 {
        font-size: 3rem;
    }
    
    .slide-content p, .hero-content p {
        font-size: 1.3rem;
    }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .auto-container, .container {
        padding: 0 40px;
        max-width: 1600px;
    }
    
    .content-wrapper {
        padding: 0 25px;
    }
    
    .features-grid, .services-grid, .stats-grid {
        padding: 0 20px;
        gap: 35px;
    }
    
    .quote-form, .enquery1 {
        right: 10%;
    }
    
    .navigation a {
        padding: 15px 15px;
    }
    
    /* Extra large screens - prevent content from going too wide */
    @media (min-width: 1600px) {
        .auto-container, .container {
            padding: 0 120px;
        }
        
        .content-wrapper {
            padding: 0 100px;
        }
    }
}

/* ========================================
   ANIMATIONS & TRANSITIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce repaints */
.btn, .theme-btn, .form-control, .mobile-nav-toggle span {
    will-change: transform;
}

/* GPU acceleration for smooth animations */
.mobile-menu, .mobile-menu-overlay {
    transform: translateZ(0);
}

/* Optimize font rendering */
body {
    text-rendering: optimizeSpeed;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus, .theme-btn:focus,
.form-control:focus, .input-enquery:focus,
.navigation a:focus, .mobile-menu a:focus {
    outline: 3px solid rgba(203, 52, 33, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn, .theme-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .mobile-nav-toggle,
    .mobile-menu,
    .quote-form,
    .enquery1 {
        display: none;
    }
    
    .main-header {
        position: static;
        box-shadow: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .auto-container {
        max-width: none;
        padding: 0;
    }
} 