/* PHASE 1: Mobile-First Optimization for Core Web Vitals */

/* Ensure proper viewport handling */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Optimize touch targets for mobile */
@media (max-width: 768px) {
    /* Touch target optimization - minimum 44px */
    .btn-call-main,
    .cta-button,
    .contact-button,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    /* Form optimization */
    input[type="text"],
    input[type="email"], 
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        border-radius: 8px;
        border: 2px solid #ddd;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Navigation optimization */
    .mobile-menu-toggle,
    .menu-toggle {
        min-height: 44px;
        min-width: 44px;
        padding: 10px;
    }
    
    /* Typography optimization for readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 { 
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    h2 { 
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    h3 { 
        font-size: 20px;
        line-height: 1.4;
        margin-bottom: 0.6rem;
    }
    
    /* Image optimization for LCP */
    .hero-section img,
    .hero-section-modern img {
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: cover;
    }
    
    /* CTA button optimization */
    .hero-cta,
    .page-cta {
        width: 100%;
        text-align: center;
        margin: 20px 0;
    }
    
    .hero-cta a,
    .page-cta a {
        display: inline-block;
        width: 100%;
        max-width: 300px;
        padding: 15px 20px;
        font-size: 18px;
        font-weight: 700;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
}

/* Click-to-call optimization */
/* a[href^="tel:"] {
    color: var(--color-primary-red, #f5312e);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 5px;
    background: rgba(245, 49, 46, 0.1);
    transition: all 0.3s ease;
    min-height: 44px;
    line-height: 28px;
}

a[href^="tel:"]:hover,
a[href^="tel:"]:focus {
    background: var(--color-primary-red, #f5312e);
    color: white;
    transform: translateY(-1px);
} */

/* Improve tap target spacing */
.nav-menu li {
    margin: 8px 0;
}

.nav-menu a {
    padding: 12px 16px;
    display: block;
    min-height: 44px;
    line-height: 20px;
}

/* Optimize images for performance */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Core Web Vitals - Prevent layout shift */
.hero-section,
.hero-section-modern {
    min-height: 400px;
    display: flex;
    align-items: center;
    position: relative;
}

/* Optimize for cumulative layout shift */
.content-area {
    min-height: 300px;
}

.sidebar {
    min-height: 200px;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visibility for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
    outline: 2px solid var(--color-primary-red, #f5312e);
    outline-offset: 2px;
}
