/* ==========================================================================
   SOVYRA LANDING PAGE - ADAPTAÇÃO RESPONSIVA COMPLETA (SKILL 9)
   Header Desktop & Mobile Perfeitos com Zero Interferência
   ========================================================================== */

/* --- Reset Global de Proteção de Estouro --- */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

/* --- Garantia de Exibição Desktop (min-width: 769px) --- */
@media (min-width: 769px) {
  .site-header {
    height: var(--header-height) !important;
    padding-inline: clamp(1.5rem, 4vw, 3.5rem) !important;
  }

  .nav-links-wrapper {
    display: flex !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: auto !important;
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: var(--border-radius-full) !important;
    padding: 0.3rem 0.5rem !important;
    max-width: 660px !important;
    margin-inline: 1rem !important;
    box-shadow: none !important;
    z-index: 1 !important;
  }

  .nav-links {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.25rem !important;
    width: auto !important;
  }

  .nav-link {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    padding: 0.45rem 0.9rem !important;
    border-radius: var(--border-radius-full) !important;
    background: transparent !important;
    display: inline-block !important;
    width: auto !important;
  }

  .nav-link:hover {
    color: #FFFFFF !important;
    background: #0F172A !important;
  }

  /* Oculta ESTREITAMENTE o botão mobile dentro do wrapper no desktop */
  .drawer-mobile-cta {
    display: none !important;
  }

  .nav-actions .btn {
    display: inline-flex !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 3.5rem) !important;
  }
}

/* --- Tablet e Telas Médias (max-width: 1024px) --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-content {
    align-items: center;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-microcopy {
    justify-content: center;
  }

  .hero-seals {
    justify-content: center;
  }

  .hero-mockup-wrapper {
    margin-top: 1.5rem;
  }

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

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

  .alternative-comparison {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .alternative-card.highlighted {
    transform: none;
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .simulator-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

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

  .match-box-grid {
    grid-template-columns: 1fr;
  }

  .brand-tester-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

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

  .plan-card.recommended {
    transform: none;
  }

  .launch-offer-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
}

/* --- Mobile Principal (max-width: 768px) --- */
@media (max-width: 768px) {
  /* Header Bar Limpo no Mobile */
  .site-header {
    padding-inline: 1.25rem !important;
    height: 70px !important;
    background: rgba(255, 255, 255, 0.98) !important;
  }

  .nav-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0 !important;
  }

  .logo {
    font-size: 1.3rem !important;
    gap: 0.5rem !important;
  }

  .site-logo-img {
    height: 36px !important;
  }

  /* Espaçamento da Hero no Mobile */
  .hero-section {
    padding-top: calc(70px + 2.75rem) !important;
    padding-bottom: 3.5rem !important;
  }

  .hero-content .badge {
    margin-inline: auto !important;
    margin-bottom: 1.25rem !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
  }

  /* Oculta os botões do header no desktop quando em modo mobile */
  .nav-actions .btn {
    display: none !important;
  }

  /* Botão Hamburguer visível no mobile */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: var(--border-radius-sm) !important;
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #0F172A !important;
    cursor: pointer !important;
    z-index: 1000 !important;
  }

  /* ESCONDE TOTALMENTE O MENU QUANDO INATIVO NO MOBILE */
  .nav-links-wrapper {
    display: none !important;
  }

  /* EXIBE COMO DRAWER EM TELA CHEIA APENAS QUANDO ATIVO (.active) */
  .nav-links-wrapper.active {
    display: flex !important;
    position: fixed !important;
    top: 70px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: calc(100vh - 70px) !important;
    background: #FFFFFF !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 2.5rem 1.5rem !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
  }

  .nav-links {
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .nav-link {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    padding: 0.9rem 1.5rem !important;
    text-align: center !important;
    width: 100% !important;
    background: #F1F5F9 !important;
    border-radius: var(--border-radius-md) !important;
    display: block !important;
  }

  .nav-link:hover {
    background: #0F172A !important;
    color: #FFFFFF !important;
  }

  /* Exibe o Botão CTA dentro do Drawer Mobile APENAS quando o drawer estiver ativo */
  .drawer-mobile-cta {
    margin-top: 1.5rem;
    width: 100%;
    display: block !important;
  }

  /* Grid Stack Conversions */
  .differentials-grid,
  .pillars-grid,
  .metrics-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  /* Proteção do Card do Simulador */
  .simulator-box {
    padding: 1.25rem !important;
    width: 100% !important;
  }

  .range-slider-wrapper {
    width: 100%;
  }

  .range-slider {
    width: 100%;
  }

  .economy-result-card {
    padding: 1.25rem !important;
  }

  .economy-amount {
    font-size: 1.75rem !important;
    word-break: break-word;
  }

  /* Widget Flutuante do Cronômetro em Mobile */
  .sticky-timer-widget {
    bottom: 0.75rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 1.5rem) !important;
    max-width: 380px !important;
    justify-content: space-between !important;
    padding: 0.4rem 0.65rem 0.4rem 0.85rem !important;
    gap: 0.4rem !important;
    z-index: 999 !important;
  }

  .timer-widget-badge {
    font-size: 0.75rem;
  }

  .timer-widget-time {
    font-size: 0.95rem;
    padding: 0.2rem 0.5rem;
  }

  .timer-widget-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .cookie-banner {
    bottom: 4.5rem;
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }
}

/* --- Celulares Pequenos (max-width: 480px) --- */
@media (max-width: 480px) {
  .section {
    padding-block: 3.25rem;
  }

  .hero-section {
    padding-top: calc(70px + 2.5rem) !important;
  }

  .container {
    padding-inline: 1rem !important;
  }

  .card {
    padding: 1.25rem !important;
  }

  .btn {
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem !important;
    min-height: 46px;
    width: 100% !important;
  }

  .preloader-logo-img {
    height: 72px !important;
  }

  .preloader-logo-text {
    font-size: 2.2rem !important;
  }

  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
  }

  .comparison-table-wrapper {
    margin-inline: -1rem;
    border-radius: 0;
  }

  .comparison-table th, .comparison-table td {
    padding: 0.75rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* --- Celulares Ultra Pequenos (max-width: 360px) --- */
@media (max-width: 360px) {
  h1 {
    font-size: 1.55rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  .btn {
    font-size: 0.82rem !important;
  }

  .timer-widget-badge {
    display: none;
  }
}
