/* ========================================
   PGRS Soluções Lins - Responsividade Premium 2025
   Mobile First + Desktop Excellence
   ======================================== */

/* ========================================
   MOBILE EXTRA SMALL (até 360px)
   ======================================== */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 0 var(--space-4);
    }
    
    .hero-content {
        padding: var(--space-8) var(--space-4);
    }
    
    .cta-btn {
        padding: var(--space-4) var(--space-5);
        font-size: 0.8rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    
    .section-badge {
        font-size: 0.7rem;
        padding: var(--space-2) var(--space-3);
    }
}

/* ========================================
   MOBILE SMALL (361px - 480px)
   ======================================== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--space-4);
    }
    
    /* Header Mobile */
    .header {
        padding: var(--space-3) 0;
    }
    
    .logo {
        gap: var(--space-3);
    }
    
    .logo-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo-text span {
        font-size: 0.6rem;
        letter-spacing: 0.1em;
    }
    
    /* Hero Mobile */
    .hero {
        min-height: 100svh;
    }
    
    .hero-content {
        padding: var(--space-10) var(--space-4);
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.15;
        margin-bottom: var(--space-6);
    }
    
    .hero-description {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: var(--space-8);
    }
    
    /* CTAs Mobile */
    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: var(--space-4);
    }
    
    .cta-btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-5) var(--space-6);
        font-size: 0.85rem;
    }
    
    /* Seções Mobile */
    .seo-section {
        padding: var(--space-16) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-8);
    }
    
    .section-badge {
        font-size: 0.7rem;
        padding: var(--space-2) var(--space-4);
    }
    
    .section-content p {
        font-size: 1rem;
        line-height: 1.8;
        text-align: left;
    }
    
    /* Features Grid Mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    
    .feature-card {
        padding: var(--space-6);
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    /* Info Grid Mobile */
    .info-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    
    .info-card {
        padding: var(--space-6);
    }
    
    /* Bairros Mobile */
    .bairros-section {
        padding: var(--space-16) 0;
    }
    
    .bairros-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .bairro-tag {
        padding: var(--space-3) var(--space-4);
        font-size: 0.9rem;
    }
    
    /* Map Mobile */
    .map-section {
        padding: var(--space-16) 0;
    }
    
    .map-container {
        border-radius: var(--radius-xl);
    }
    
    .map-container iframe {
        height: 300px;
    }
    
    /* CTA Section Mobile */
    .cta-section {
        padding: var(--space-12) 0;
    }
    
    .cta-section h3 {
        font-size: 1.3rem;
    }
    
    /* Footer Mobile */
    .footer {
        padding: var(--space-16) 0 var(--space-6);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-10);
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .contact-item {
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }
    
    .contact-icon {
        margin-bottom: var(--space-2);
    }
    
    /* WhatsApp Mobile */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-btn {
        width: 58px;
        height: 58px;
    }
    
    .whatsapp-btn svg {
        width: 30px;
        height: 30px;
    }
    
    /* Services List Mobile */
    .services-list li {
        padding: var(--space-4);
        font-size: 0.9rem;
    }
    
    .services-list li::before {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* ========================================
   MOBILE MEDIUM (481px - 640px)
   ======================================== */
@media (min-width: 481px) and (max-width: 640px) {
    .container {
        padding: 0 var(--space-5);
    }
    
    .hero {
        min-height: 95svh;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .cta-group {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-btn {
        min-width: 300px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .bairros-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ========================================
   TABLET SMALL (641px - 768px)
   ======================================== */
@media (min-width: 641px) and (max-width: 768px) {
    .hero {
        min-height: 90vh;
    }
    
    .hero-content {
        max-width: 600px;
        padding: var(--space-12) var(--space-6);
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .cta-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cta-btn {
        min-width: auto;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bairros-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
    
    .footer-col h4::after {
        left: 0;
        transform: none;
    }
}

/* ========================================
   TABLET (769px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero {
        min-height: 85vh;
    }
    
    .hero-content {
        max-width: 750px;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bairros-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .map-container iframe {
        height: 400px;
    }
}

/* ========================================
   DESKTOP SMALL (1025px - 1280px)
   ======================================== */
@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        max-width: 1100px;
    }
    
    .hero-content {
        max-width: 850px;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bairros-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   DESKTOP MEDIUM (1281px - 1536px)
   ======================================== */
@media (min-width: 1281px) and (max-width: 1536px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-content {
        max-width: 950px;
    }
    
    .hero h1 {
        font-size: 4rem;
    }
    
    .bairros-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========================================
   DESKTOP LARGE (1537px+)
   ======================================== */
@media (min-width: 1537px) {
    html {
        font-size: 18px;
    }
    
    .container {
        max-width: 1400px;
    }
    
    .hero-content {
        max-width: 1100px;
    }
    
    .hero h1 {
        font-size: 4.5rem;
    }
    
    .bairros-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .features-grid {
        gap: var(--space-10);
    }
    
    .feature-card {
        padding: var(--space-10);
    }
}

/* ========================================
   ULTRA WIDE (2000px+)
   ======================================== */
@media (min-width: 2000px) {
    .container {
        max-width: 1600px;
    }
    
    .hero::before,
    .hero::after {
        opacity: 0.3;
    }
}

/* ========================================
   ALTURA DE TELA - Ajustes
   ======================================== */
@media (max-height: 600px) and (min-width: 768px) {
    .hero {
        min-height: auto;
        padding: var(--space-12) 0;
    }
    
    .hero-content {
        padding: var(--space-8);
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: var(--space-4);
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: var(--space-6);
    }
}

@media (max-height: 700px) and (min-width: 768px) {
    .hero {
        min-height: auto;
        padding: var(--space-16) 0;
    }
}

/* ========================================
   ORIENTAÇÃO LANDSCAPE MOBILE
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-10) 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: var(--space-6);
    }
    
    .cta-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .cta-btn {
        width: auto;
        padding: var(--space-3) var(--space-5);
        font-size: 0.8rem;
    }
}

/* ========================================
   HOVER STATES - Desktop Only
   ======================================== */
@media (hover: hover) and (pointer: fine) {
    .feature-card:hover {
        transform: translateY(-12px) rotateX(5deg);
    }
    
    .bairro-tag:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    .info-card:hover {
        transform: translateY(-8px);
    }
    
    .cta-btn:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    .whatsapp-btn:hover {
        transform: scale(1.15) rotate(-5deg);
    }
    
    .services-list li:hover {
        transform: translateX(8px);
    }
}

/* Touch devices - remove hover effects */
@media (hover: none) {
    .feature-card:hover,
    .bairro-tag:hover,
    .info-card:hover,
    .services-list li:hover {
        transform: none;
    }
    
    .cta-btn:active {
        transform: scale(0.98);
    }
    
    .whatsapp-btn:active {
        transform: scale(0.95);
    }
}

/* ========================================
   PREFERÊNCIAS DO USUÁRIO
   ======================================== */

/* Movimento Reduzido */
@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::after,
    .hero-bg,
    .whatsapp-pulse {
        animation: none !important;
    }
    
    .hero h1,
    .hero-description,
    .cta-group {
        opacity: 1;
        transform: none;
    }
}

/* Alto Contraste */
@media (prefers-contrast: high) {
    :root {
        --emerald-600: #047857;
        --emerald-700: #065f46;
        --slate-600: #374151;
    }
    
    .cta-btn {
        border: 3px solid currentColor;
    }
    
    .feature-card,
    .info-card,
    .bairro-tag {
        border-width: 2px;
    }
    
    .section-content p {
        color: var(--slate-800);
    }
}

/* Modo Escuro do Sistema */
@media (prefers-color-scheme: dark) {
    /* Pode adicionar variações dark mode se necessário */
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .header,
    .whatsapp-float,
    .cta-section,
    .cta-group,
    .cta-btn {
        display: none !important;
    }
    
    .hero {
        min-height: auto !important;
        background: none !important;
        padding: 2cm 0 !important;
    }
    
    .hero-bg,
    .hero::before,
    .hero::after {
        display: none !important;
    }
    
    .hero h1 {
        background: none !important;
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
        font-size: 24pt !important;
    }
    
    .hero-description {
        color: #333 !important;
        font-size: 12pt !important;
    }
    
    .seo-section {
        padding: 1cm 0 !important;
        page-break-inside: avoid;
    }
    
    .section-badge {
        border: 1px solid #000;
        background: none !important;
    }
    
    h2, h3, h4 {
        page-break-after: avoid;
    }
    
    .features-grid,
    .bairros-grid,
    .info-grid {
        display: block !important;
    }
    
    .feature-card,
    .bairro-tag,
    .info-card {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 0.5cm;
        border: 1px solid #ccc;
    }
    
    .footer {
        background: none !important;
    }
    
    .footer * {
        color: #000 !important;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    a[href^="tel:"]::after,
    a[href^="mailto:"]::after,
    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }
}

/* ========================================
   SAFE AREA - iOS Notch Support
   ======================================== */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(var(--space-6), env(safe-area-inset-left));
        padding-right: max(var(--space-6), env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
    }
    
    .whatsapp-float {
        bottom: max(32px, calc(env(safe-area-inset-bottom) + 16px));
        right: max(32px, calc(env(safe-area-inset-right) + 16px));
    }
}

/* ========================================
   CONTAINER QUERIES (Modern Browsers)
   ======================================== */
@supports (container-type: inline-size) {
    .features-grid,
    .info-grid,
    .bairros-grid {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .feature-card {
            padding: var(--space-5);
        }
        
        .feature-icon {
            width: 56px;
            height: 56px;
        }
    }
}
