/* =====================================================
   RESPONSIVE DESIGN - Mobile First Approach
   ===================================================== */

/* --- EXTRA SMALL DEVICES (Phones, less than 576px) --- */
@media (max-width: 575.98px) {
  :root {
    font-size: 14px;
  }

  .container {
    padding: 0 15px;
  }

  /* Navbar */
  nav {
    padding: 12px 0;
    min-height: 60px;
  }

  .logo {
    font-size: 1.3rem;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu {
    display: block;
    top: 60px;
    height: calc(100vh - 60px);
  }

  /* Hero */
  .hero {
    padding-top: 60px;
    min-height: calc(100vh - 60px);
  }

  .hero-content {
    padding: var(--spacing-md);
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-content > p {
    font-size: 0.95rem;
  }

  .btn-hero {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
    width: 100%;
  }

  .stat-item {
    padding: var(--spacing-sm);
    background: rgba(var(--color-primary-rgb), 0.05);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 200px;
    text-align: center;
  }

  .scroll-indicator {
    display: none;
  }

  /* Services */
  .services {
    padding: var(--spacing-xl) 0;
  }

  .section-header {
    margin-bottom: var(--spacing-lg);
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .service-card {
    padding: var(--spacing-md);
  }

  .service-icon {
    font-size: 2rem;
  }

  .service-card h3 {
    font-size: 1.2rem;
  }

  .btn-primary-action {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* Process */
  .process {
    padding: var(--spacing-xl) 0;
  }

  .process-grid {
    flex-direction: column;
    align-items: center;
  }

  .process-step {
    max-width: 100%;
    width: 100%;
  }

  .process-connector {
    display: none;
  }

  /* CTA */
  .cta {
    padding: var(--spacing-xl) 0;
  }

  .cta h2 {
    font-size: 1.5rem;
  }

  .btn-final {
    padding: 14px 28px;
    font-size: 0.95rem;
  }

  /* Footer */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand {
    margin-bottom: var(--spacing-md);
  }

  /* WhatsApp Float */
  .whatsapp-float {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
    font-size: 1.5rem;
  }
}

/* --- SMALL DEVICES (Landscape phones, 576px and up) --- */
@media (min-width: 576px) and (max-width: 767.98px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu {
    display: block;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .stat-item {
    flex: 0 0 auto;
    min-width: 150px;
    text-align: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .process-grid {
    flex-direction: column;
    align-items: center;
  }

  .process-connector {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }
}

/* --- MEDIUM DEVICES (Tablets, 768px and up) --- */
@media (min-width: 768px) and (max-width: 991.98px) {
  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .btn-contact {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Center the last card if odd number */
  .services-grid .service-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 450px;
    margin: 0 auto;
  }

  .process-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--spacing-md);
    -webkit-overflow-scrolling: touch;
  }

  .process-step {
    min-width: 220px;
    flex-shrink: 0;
  }

  .process-connector {
    min-width: 30px;
  }
}

/* --- LARGE DEVICES (Desktops, 992px and up) --- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Make 5 cards layout better */
  .services-grid .service-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
  }
}

/* --- EXTRA LARGE DEVICES (Large desktops, 1200px and up) --- */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Make 5 cards look good in 3-column layout */
  .services-grid .service-card:nth-child(4),
  .services-grid .service-card:nth-child(5) {
    max-width: 450px;
  }

  .services-grid .service-card:nth-child(4) {
    justify-self: end;
  }

  .services-grid .service-card:nth-child(5) {
    justify-self: start;
  }
}

/* --- ULTRA WIDE SCREENS (1400px and up) --- */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .hero-content h1 {
    font-size: 4rem;
  }

  .blob-1 {
    width: 600px;
    height: 600px;
  }

  .blob-2 {
    width: 500px;
    height: 500px;
  }
}

/* --- LANDSCAPE MODE ON MOBILE --- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(70px + var(--spacing-lg)) 0 var(--spacing-lg);
  }

  .hero-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .scroll-indicator {
    display: none;
  }
}

/* --- HIGH DPI SCREENS / RETINA --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo,
  .service-icon,
  .process-icon {
    -webkit-font-smoothing: antialiased;
  }
}

/* --- 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;
  }

  html {
    scroll-behavior: auto;
  }

  .blob-1,
  .blob-2 {
    animation: none;
  }

  .whatsapp-float {
    animation: none;
  }
}

/* --- DARK MODE SUPPORT (já é dark, mas para sistemas que forçam light) --- */
@media (prefers-color-scheme: light) {
  /* Mantém o design escuro mesmo em sistemas claros */
  :root {
    color-scheme: dark;
  }
}

/* --- PRINT STYLES --- */
@media print {
  header,
  .hero-bg-effects,
  .scroll-indicator,
  .whatsapp-float,
  .mobile-menu,
  .mobile-menu-toggle,
  .btn-primary-action,
  .btn-secondary-action,
  .btn-contact,
  .btn-final {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .hero,
  .services,
  .process,
  .cta {
    padding: 20px 0;
    background: white;
  }

  .service-card,
  .process-step {
    border: 1px solid #ccc;
    background: white;
    page-break-inside: avoid;
  }

  .highlight {
    color: #0066cc;
  }
}

/* --- TOUCH DEVICE OPTIMIZATIONS --- */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .service-card:hover {
    transform: none;
  }

  .btn-primary-action:hover,
  .btn-secondary-action:hover,
  .btn-contact:hover,
  .btn-final:hover {
    transform: none;
  }

  /* Add active states instead */
  .btn-primary-action:active,
  .btn-secondary-action:active,
  .btn-contact:active,
  .btn-final:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  /* Larger touch targets */
  .nav-links a,
  .mobile-nav-links a {
    padding: 12px;
  }

  .footer-social a {
    width: 50px;
    height: 50px;
  }
}

/* --- SAFE AREA INSETS (iPhone X+, notch devices) --- */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(var(--spacing-md), env(safe-area-inset-left));
    padding-right: max(var(--spacing-md), env(safe-area-inset-right));
  }

  .whatsapp-float {
    bottom: max(25px, env(safe-area-inset-bottom));
    right: max(25px, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
  }
}
