/* =========================================
   RESPONSIVE DESIGN - Mobile First Approach
   ========================================= */

/* Extra Small Devices (phones, < 576px) */
@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }

    .header-container {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .logo a {
        font-size: 1.3rem;
    }

    .hero {
        min-height: auto;
        padding: 8rem 1.25rem 4rem;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.15;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }

    .cta-group {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .cta-group .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .content-section {
        padding: 3rem 1rem;
    }

    .service-block {
        padding: 1.75rem 1.25rem;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-md);
    }

    .service-block h2 {
        font-size: 1.3rem;
    }

    .service-block p {
        font-size: 0.95rem;
        line-height: 1.75;
    }

    .footer-container {
        padding: 0 1rem;
        gap: 2rem;
        text-align: center;
    }

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .sitemap-list {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Small Devices (landscape phones, 576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .header-container {
        padding: 0.875rem 1.5rem;
    }

    .hero {
        padding: 8rem 1.5rem 4rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .cta-group {
        flex-direction: column;
        max-width: 350px;
        margin: 0 auto;
    }

    .cta-group .btn {
        width: 100%;
    }

    .content-section {
        padding: 4rem 1.5rem;
    }

    .service-block {
        padding: 2rem 1.5rem;
    }

    .footer-container {
        text-align: center;
    }

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Medium Devices (tablets, 768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .header-container {
        padding: 1rem 2rem;
    }

    .hero {
        padding: 10rem 2rem 5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.15rem;
    }

    .cta-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .content-section {
        padding: 5rem 2rem;
    }

    .service-block {
        padding: 2.5rem;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }

    .sitemap-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-bar {
        gap: 2rem;
    }
}

/* Large Devices (desktops, 992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero h1 {
        font-size: 3.5rem;
    }

    .footer-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .sitemap-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Large Devices (large desktops, >= 1200px) */
@media (min-width: 1200px) {
    .header-container {
        padding: 1rem 3rem;
    }

    .hero {
        padding: 10rem 3rem 6rem;
    }

    .hero h1 {
        font-size: 4.5rem;
        letter-spacing: -2px;
    }

    .hero p {
        font-size: 1.35rem;
    }

    .cta-group .btn {
        padding: 1.2rem 2.5rem;
        font-size: 1rem;
    }

    .content-section {
        padding: 7rem 3rem;
    }

    .service-block {
        padding: 3.5rem;
    }

    .footer-container {
        grid-template-columns: repeat(4, 1fr);
        padding: 0 3rem;
    }

    .sitemap-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =========================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================= */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        min-width: 48px;
    }

    .footer-links a {
        padding: 0.75rem 0;
    }

    .sitemap-list a {
        padding: 1.25rem;
    }

    /* Disable hover effects that don't work well on touch */
    .service-block:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* Active states for touch feedback */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .service-block:active {
        transform: scale(0.99);
    }

    .sitemap-list a:active {
        transform: translateX(3px);
    }
}

/* =========================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
   ========================================= */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 6rem 2rem 3rem;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .cta-group {
        flex-direction: row;
        gap: 0.75rem;
    }

    .cta-group .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    header,
    .whatsapp-float-btn,
    .cta-group,
    .map-section {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    .service-block {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* =========================================
   HIGH CONTRAST MODE / ACCESSIBILITY
   ========================================= */
@media (prefers-contrast: high) {
    :root {
        --primary-red: #CC0000;
        --dark-navy: #000000;
        --medium-gray: #333333;
    }

    .service-block {
        border: 2px solid var(--dark-navy);
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* =========================================
   REDUCED MOTION PREFERENCE
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero::before,
    .hero::after {
        animation: none;
    }

    .whatsapp-float-btn {
        animation: none;
    }

    .fade-in-up {
        opacity: 1;
        transform: none;
    }
}

/* =========================================
   DARK MODE SUPPORT (System Preference)
   ========================================= */
@media (prefers-color-scheme: dark) {
    /* Optional: Auto dark mode based on system
       Currently disabled to maintain brand consistency
       Uncomment if needed */
    
    /*
    :root {
        --off-white: #0F1419;
        --pure-white: #1A1F26;
        --dark-navy: #E2E8F0;
        --dark-slate: #F8FAFC;
        --medium-gray: #A0AEC0;
        --light-gray: #2D3748;
    }
    
    body {
        background-color: var(--off-white);
    }
    
    .service-block {
        background: var(--pure-white);
    }
    
    .service-block:nth-child(even) {
        background: linear-gradient(135deg, #1A1F26 0%, #2D3748 100%);
    }
    */
}

/* =========================================
   SAFE AREA INSETS (Notched Devices)
   ========================================= */
@supports (padding: max(0px)) {
    header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .hero {
        padding-left: max(2rem, env(safe-area-inset-left));
        padding-right: max(2rem, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    .whatsapp-float-btn {
        right: max(20px, env(safe-area-inset-right));
        bottom: max(20px, env(safe-area-inset-bottom));
    }
}
