/* ═══════════════════════════════════════════════════════════════
   CLIMAWISE — RESPONSIVE STYLESHEET (DEFINITIVO)
   Mobile-First: perfeito em qualquer tamanho de tela.
   ═══════════════════════════════════════════════════════════════ */

/* ── Previne overflow horizontal em todos os dispositivos ── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ──────────────────────────────────────────────────
   LARGE DESKTOP (1400px+)
────────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .hero-title { font-size: 76px; }
}

/* ──────────────────────────────────────────────────
   TABLET LANDSCAPE (1024px e abaixo)
────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-content { max-width: 100%; margin: 0 auto; }
  .hero-subtitle { max-width: 580px; margin: 0 auto 28px; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual, .hero-mockup {
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .rain-map-grid { grid-template-columns: 1fr; gap: 36px; }
  .rain-map-card { max-width: 600px; margin: 0 auto; width: 100%; height: 480px; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ──────────────────────────────────────────────────
   NAVEGAÇÃO MOBILE (1080px e abaixo)
────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .navbar { padding: 12px 0; }
  .nav-container {
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }
  .nav-logo { flex-shrink: 0; position: relative; z-index: 1002; }
  .nav-logo-img { width: 30px; height: 30px; }
  .logo-text { font-size: 18px; white-space: nowrap; }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 1002;
  }
  .lang-switcher { padding: 2px 4px; gap: 2px; flex-shrink: 0; }
  .lang-btn { padding: 4px 8px; font-size: 11px; font-weight: 800; }

  .nav-download { display: none !important; }
  .menu-toggle { display: flex; z-index: 1002; margin-left: 4px; flex-shrink: 0; }

  /* Drawer Menu Mobile */
  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 999;
    padding: 80px 24px 40px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 20px; font-weight: 800; color: var(--text); }
}

/* ──────────────────────────────────────────────────
   MOBILE — TUDO (768px e abaixo)
   Regra principal para smartphones.
────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Tipografia Global ── */
  .section-title { font-size: 26px; line-height: 1.2; letter-spacing: -0.5px; }
  .section-subtitle { font-size: 14px; line-height: 1.6; }
  .section-header { margin-bottom: 28px; }

  /* ── Container com padding lateral justo ── */
  .container { padding: 0 16px; }

  /* ── HERO ── */
  .hero { padding: 90px 0 50px; }
  .hero-title { font-size: clamp(26px, 7vw, 38px); letter-spacing: -1px; line-height: 1.1; margin-bottom: 14px; }
  .hero-badge { font-size: 11px; padding: 4px 12px; margin-bottom: 14px; }
  .hero-subtitle { font-size: 14px; line-height: 1.55; margin-bottom: 24px; max-width: 100%; }

  .hero-actions,
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 28px;
  }
  .btn-lg {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
  }

  .hero-stats {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stat-value, .stat-num { font-size: 18px; }
  .stat-label { font-size: 10px; }

  /* Phone mockup — reduzido e centralizado */
  .hero-visual, .hero-mockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    position: relative;
    width: 100%;
  }
  .phone-frame {
    width: 220px;
    height: 440px;
    border-radius: 36px;
    padding: 10px;
  }
  /* Cards flutuantes: escondidos no mobile para não sobrepor */
  .float-card { display: none !important; }

  /* ── FEATURES ── */
  .features { padding: 60px 0; }
  .features-grid { grid-template-columns: 1fr; gap: 14px; }
  .feature-card { padding: 22px 18px; border-radius: 16px; }
  .feature-card h3 { font-size: 17px; }
  .feature-card p { font-size: 13px; }
  .feature-icon-wrap { width: 46px; height: 46px; margin-bottom: 14px; }

  /* ── TESTIMONIALS ── */
  .testimonials { padding: 60px 0; }
  .testimonials-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 28px; }
  .testimonial-card { padding: 22px 18px; border-radius: 16px; }
  .testimonial-text { font-size: 13px; line-height: 1.65; margin-bottom: 16px; }
  .user-avatar { width: 38px; height: 38px; font-size: 14px; }
  .user-info h4 { font-size: 13px; }

  /* ── MID-PAGE CTA ── */
  .mid-page-cta { padding: 20px 0 60px; }
  .mid-cta-card { padding: 36px 18px; border-radius: 20px; }
  .mid-cta-card h2 { font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
  .mid-cta-card p { font-size: 13px; margin-bottom: 24px; }
  .mid-cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-width: 280px;
    margin: 0 auto;
  }
  .mid-cta-buttons .btn { width: 100%; justify-content: center; }

  /* ── RADAR MAP ── */
  .rain-map-section { padding: 60px 0; }
  .rain-map-card { height: 340px; border-radius: 18px; }
  .rm-title { font-size: 24px; line-height: 1.2; margin-bottom: 12px; }
  .rm-description { font-size: 13px; margin-bottom: 20px; }
  .rm-control-pill {
    padding: 6px 10px;
    gap: 6px;
    font-size: 10px;
    max-width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
  }
  .rm-current-time { font-size: 11px; min-width: 30px; }
  .rm-pill-btn { width: 24px; height: 24px; }
  .rm-play-btn { width: 28px; height: 28px; }
  .rm-timeline-bar { width: 48px; }

  .rm-feat-card {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 10px;
  }
  .rm-feat-badge {
    position: static;
    margin-top: 0;
    align-self: center;
    font-size: 9px;
  }
  .rm-feat-card h3 { font-size: 14px; }
  .rm-feat-card p { font-size: 12px; }
  .rm-feat-icon { width: 36px; height: 36px; }

  .rm-store-row { flex-direction: column; gap: 10px; }
  .store-badge-btn { width: 100%; justify-content: center; padding: 12px 16px; }

  /* ── WHY CLIMAWISE: esconde tabela, exibe cards mobile ── */
  .why-climawise { padding: 60px 0; }
  .comparison-table-wrap { display: none !important; }
  .why-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
  }

  /* ── HOW IT WORKS ── */
  .how-it-works { padding: 60px 0; }
  .steps-container { flex-direction: column; align-items: center; gap: 14px; }
  .step { width: 100%; max-width: 100%; padding: 22px 18px; border-radius: 16px; }
  .step h3 { font-size: 17px; }
  .step p { font-size: 13px; }
  .step-icon { width: 44px; height: 44px; }
  .step-connector { width: 2px; height: 20px; margin: 0; }

  /* ── FAQ ── */
  .faq { padding: 60px 0; }
  .faq-accordion { margin-top: 24px; gap: 10px; }
  .faq-item { border-radius: 14px; }
  .faq-question {
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.45;
    gap: 12px;
  }
  .faq-icon-chev {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    flex-shrink: 0 !important;
  }
  .faq-answer { padding: 0 18px 18px; font-size: 13px; line-height: 1.6; }

  /* ── DOWNLOAD CTA ── */
  .download-cta { padding: 60px 0; }
  .cta-content { padding: 36px 18px; border-radius: 20px; }
  .cta-title { font-size: 26px; line-height: 1.2; margin-bottom: 10px; letter-spacing: -0.5px; }
  .cta-subtitle { font-size: 14px; margin-bottom: 24px; }
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
  }
  .store-btn { width: 100%; justify-content: center; padding: 14px 20px; }

  /* ── FOOTER ── */
  .footer { padding: 48px 0 24px; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; margin-bottom: 28px; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; padding-top: 18px; }

  /* ── IOS MODAL ── */
  .modal-overlay { padding: 12px; }
  .modal-box {
    padding: 36px 18px 24px;
    border-radius: 20px;
    width: 100%;
    max-width: 100%;
  }
  .modal-close { top: 12px; right: 12px; width: 30px; height: 30px; font-size: 16px; }
  .ios-form { flex-direction: column; gap: 10px; }
  .ios-input {
    min-width: 0;
    width: 100%;
    font-size: 16px; /* evita zoom no iOS */
    padding: 14px 16px;
  }
  .ios-form .btn { width: 100%; justify-content: center; }

  /* ── PRIVACY PAGE ── */
  .privacy-hero { padding: 90px 0 30px; }
  .privacy-title { font-size: 28px; }
  .privacy-container { padding: 0 16px 60px; gap: 16px; }
  .p-card { padding: 20px 16px; border-radius: 16px; }
  .p-card-header { gap: 12px; margin-bottom: 16px; }
  .p-card-title { font-size: 18px; }
  .p-text { font-size: 13px; line-height: 1.6; }
  .p-banner { padding: 14px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .dpo-card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
  .dpo-email { width: 100%; justify-content: center; font-size: 13px; padding: 12px; }
}

/* ──────────────────────────────────────────────────
   MOBILE PEQUENO (480px e abaixo)
────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 0 14px; }

  .nav-container { padding: 0 12px; gap: 6px; }
  .logo-text { font-size: 16px; }
  .nav-logo-img { width: 26px; height: 26px; }
  .nav-right { gap: 6px; }
  .lang-btn { padding: 3px 6px; font-size: 10px; }

  .hero-title { font-size: 24px; }
  .section-title { font-size: 22px; }

  .phone-frame { width: 200px; height: 400px; }

  .hero-actions { max-width: 260px; }
  .cta-buttons, .mid-cta-buttons { max-width: 260px; }

  .theme-toggle-fab { bottom: 16px; right: 16px; width: 44px; height: 44px; }
}

/* ──────────────────────────────────────────────────
   ULTRA SMALL (360px e abaixo)
────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .nav-container { padding: 0 8px; gap: 4px; }
  .logo-text { font-size: 14px; }
  .lang-btn { padding: 2px 4px; font-size: 9px; }
  .hero-title { font-size: 22px; }
  .section-title { font-size: 20px; }
  .phone-frame { width: 185px; height: 370px; }
  .btn-lg { font-size: 14px; padding: 12px 16px; }
}
