/**
 * V5.0-UPDATES.CSS
 * Correções e adições da versão 5.0
 *
 * Inclui:
 * - Correção de overflow mobile / "site se mexendo sozinho"
 * - Parallax otimizado (desativado no mobile)
 * - Seção de vídeo responsiva (formato vertical 9:16)
 * - Seção "Como funciona" (3 passos)
 * - Seção "O que está incluso" (grid de cards)
 * - CTA fixo mobile
 * - Hero urgency text
 * - Hero CTA secundário
 * - prefers-reduced-motion
 */

/* ============================================================
   1. CORREÇÕES GLOBAIS DE OVERFLOW / LAYOUT SHIFT
   ============================================================ */

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Evitar que qualquer elemento cause scroll horizontal */
.container,
.section,
.hero,
.hero-content,
.parallax-bg {
  max-width: 100%;
  overflow-x: hidden;
}

/* Garantir que imagens não causem overflow */
img, iframe, video {
  max-width: 100%;
  height: auto;
}

/* Evitar width: 100vw em elementos internos */
.urgency-banner,
.header,
.footer {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

/* ============================================================
   2. PARALLAX — OTIMIZADO
   ============================================================ */

/* Desktop: parallax sutil apenas em fundos decorativos */
.parallax-bg {
  will-change: transform;
  contain: layout;
}

/* Mobile: desativar parallax completamente */
@media (max-width: 768px) {
  .parallax-bg {
    transform: none !important;
    will-change: auto;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  /* Garantir que o hero não se mova */
  .hero {
    overflow: hidden;
  }

  /* Desativar parallax em textos e formulários */
  [data-parallax] {
    transform: none !important;
  }
}

/* Respeitar preferência de redução de movimento */
@media (prefers-reduced-motion: reduce) {
  .parallax-bg,
  [data-parallax],
  .reveal,
  .slide-in-up,
  .slide-in-left,
  .slide-in-right,
  .slide-in-down,
  .fade-in,
  .btn-pulse {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ============================================================
   3. HERO — URGENCY TEXT E CTA SECUNDÁRIO
   ============================================================ */

.hero-urgency {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--color-primary, #D4AF8F);
  padding: 0.6rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 0.75rem 0 0;
  max-width: 520px;
}

.hero-urgency strong {
  color: #fff;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-cta-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  font-size: 0.95rem;
}

.hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta-secondary {
    text-align: center;
  }
  .hero-urgency {
    font-size: 0.875rem;
  }
}

/* ============================================================
   4. SEÇÃO DE VÍDEO
   ============================================================ */

.section-video {
  background: var(--color-bg, #FDFCFB);
  text-align: center;
}

.video-section-header {
  max-width: 640px;
  margin: 0 auto 2rem;
}

.video-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Vídeo vertical 9:16 — máximo 360px de largura */
.video-responsive {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  background: #000;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 480px) {
  .video-responsive {
    max-width: 100%;
    border-radius: 12px;
  }
}

/* ============================================================
   5. SEÇÃO "COMO FUNCIONA"
   ============================================================ */

.section-how-it-works {
  background: linear-gradient(135deg, #F8F4F0 0%, #F0EAE3 100%);
  text-align: center;
}

.how-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 2rem 0;
  text-align: left;
}

.how-step {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: relative;
}

.how-step-number {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary, #D4AF8F), var(--color-accent, #C89F7A));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.how-step-text {
  color: var(--color-text, #2C2C2C);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

.how-cta {
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .how-steps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ============================================================
   6. SEÇÃO "O QUE ESTÁ INCLUSO"
   ============================================================ */

.section-incluso {
  background: var(--color-bg, #FDFCFB);
  text-align: center;
}

.incluso-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
  text-align: left;
}

.incluso-card {
  background: #fff;
  border: 1px solid rgba(212, 175, 143, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.incluso-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.incluso-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.incluso-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text, #2C2C2C);
}

.incluso-footer {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--color-text-light, #6B6B6B);
  font-style: italic;
  padding: 1rem 1.5rem;
  background: rgba(212, 175, 143, 0.1);
  border-radius: 10px;
  border-left: 3px solid var(--color-primary, #D4AF8F);
}

@media (max-width: 900px) {
  .incluso-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .incluso-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* ============================================================
   7. CTA FIXO MOBILE
   ============================================================ */

.mobile-cta-fixed {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  min-height: 52px;
}

/* Mostrar apenas no mobile */
@media (max-width: 768px) {
  .mobile-cta-fixed {
    display: block;
  }

  /* Espaço para o CTA fixo não cobrir conteúdo */
  body {
    padding-bottom: 80px;
  }
}

/* Ocultar quando o usuário está no formulário ou na tela final */
.mobile-cta-fixed.hidden {
  display: none !important;
}

/* ============================================================
   8. CORREÇÕES DE IMAGEM NAS TRANSFORMAÇÕES
   ============================================================ */

.transformation-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

/* ============================================================
   9. AJUSTES GERAIS DE MOBILE
   ============================================================ */

@media (max-width: 768px) {
  /* Garantir que nenhuma seção cause scroll horizontal */
  .section-video,
  .section-how-it-works,
  .section-incluso,
  .section-transformations,
  .section-testimonials {
    overflow: hidden;
  }

  /* Formulário não deve se mover durante preenchimento */
  .form-progressive {
    position: relative;
    transform: none !important;
  }

  /* Animações de entrada mais suaves no mobile */
  .reveal {
    transition-duration: 0.4s;
  }
}
