/* ============================================================
   PlanIA · responsive.css — v4 Raycast Tech/SaaS
   ============================================================ */

/* ── HAMBURGER BUTTON ─────────────────────────────────────── */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: white;
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .25s, width .25s, background .4s;
  transform-origin: center;
}
.nav:not(.on-dark) .nav-burger span { background: var(--text-primary); }

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV MENU ──────────────────────────────────────── */
.nav-mobile {
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px 28px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .25s cubic-bezier(.16,1,.3,1), transform .3s cubic-bezier(.16,1,.3,1);
  z-index: 99;
  box-shadow: 0 8px 32px rgba(13,10,7,.08);
}
.nav-mobile.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.nav-mobile ul {
  list-style: none;
  margin-bottom: 20px;
}
.nav-mobile ul li { border-bottom: 1px solid var(--border); }
.nav-mobile ul a {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 14px 0;
  transition: color .2s;
}
.nav-mobile ul a:hover,
.nav-mobile ul a:active { color: var(--tierra); }
.btn-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  background: var(--tierra);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  transition: background .3s;
}
.btn-mobile-cta:hover,
.btn-mobile-cta:active { background: var(--tierra-dark); }

/* Ocultar en desktop */
@media (min-width: 901px) {
  .nav-burger { display: none !important; }
  .nav-mobile { display: none !important; }
}

/* Mostrar burger en tablets/mobile */
@media (max-width: 900px) {
  .nav-burger { display: flex; }
  .nav .container { justify-content: flex-start; }
  .nav-cta { margin-left: 8px; }
}

@media (max-width: 1024px) {
  .container { padding: 0 32px; }

  /* Nav */
  .nav-links { gap: 22px; }

  /* Hero */
  .hero { padding: 120px 0 80px; }
  .hero h1 { font-size: clamp(32px, 5vw, 56px); }

  /* Stats */
  .stats-band .container { grid-template-columns: repeat(4, 1fr); }

  /* For Who */
  .for-who .container { grid-template-columns: 1fr 1fr; gap: 16px; }

  /* Features */
  .feat { gap: 48px; }

  /* Workflow */
  .workflow-steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .workflow-steps::before { display: none; }

  /* Pricing */
  .pricing-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .pricing-card.hot { transform: none; }
  .pricing-card.hot:hover { transform: translateY(-8px); }

  /* Trust */
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .trust-grid .trust-card:first-child { grid-column: 1 / -1; }
}

/* Hide nav links on tablets and smaller */
@media (max-width: 900px) {
  .nav-links { display: none; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }

  /* Ocultar saltos de línea forzados en headings (el texto ya wrappea solo) */
  .br-desktop { display: none; }

  /* Nav */
  .nav-cta { padding: 8px 16px; font-size: 13px; }
  .nav.on-dark .nav-cta { padding: 8px 16px; }

  /* Hero */
  .hero { padding: 100px 0 64px; }
  .hero h1 {
    font-size: clamp(32px, 8vw, 44px);
    letter-spacing: -.025em;
  }
  .hero-sub { font-size: 16px; }
  .hero-proof { gap: 10px; flex-direction: column; align-items: center; }
  .hero-proof .dot { display: none; }
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 10px; padding: 0 20px; margin-bottom: 48px; }
  .hero-ctas .btn { justify-content: center; }

  /* Hero screenshot */
  .screenshot-bar { padding: 8px 12px; }
  .screenshot-dots span { width: 8px; height: 8px; }
  .screenshot-url { font-size: 10px; }

  /* Hide performance-heavy elements on mobile */
  .mesh-orb-3 { display: none; }
  .mesh-orb-1 { filter: blur(60px); opacity: .8; }
  .mesh-orb-2 { filter: blur(60px); opacity: .8; }
  .hero-grid-overlay { opacity: .5; }

  /* Stats */
  .stats-band .container { grid-template-columns: repeat(2, 1fr); }
  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 32px 20px;
  }
  .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.05); }
  .stat-item:nth-last-child(-n+2) { border-bottom: none; }
  .stat-num { font-size: 34px; }

  /* For Who */
  .for-who { padding: 72px 0; }
  .for-who .container { grid-template-columns: 1fr; gap: 16px; }
  .for-who-header { margin-bottom: 4px; }
  .fw-card { padding: 28px 24px; }

  /* Features */
  .feat { grid-template-columns: 1fr; gap: 32px; }
  .feat.flip .feat-text { order: unset; }
  .feat.flip .feat-img  { order: unset; }
  .feat-section { padding: 60px 0; }

  /* On mobile, side reveals come from bottom */
  .reveal-left,
  .reveal-right {
    transform: translateY(36px) !important;
  }
  .reveal-left.visible,
  .reveal-right.visible {
    transform: none !important;
  }

  /* Workflow */
  .workflow-section { padding: 72px 0; }
  .workflow-steps {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 440px; margin: 0 auto;
  }
  .workflow-steps::before { display: none; }
  .step {
    display: flex; flex-direction: row; align-items: flex-start;
    gap: 16px; text-align: left; padding: 20px 20px;
  }
  .step-num {
    width: 40px; height: 40px; flex-shrink: 0;
    margin: 0; font-size: 16px;
  }

  /* Pricing */
  .pricing-section { padding: 72px 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.hot { transform: none; }
  .pricing-card.hot:hover { transform: translateY(-6px); }
  .social-strip { flex-direction: column; text-align: center; padding: 24px 20px; }
  .social-strip .btn-verde { width: 100%; }

  /* FAQ */
  .faq-section { padding: 72px 20px; }
  .faq-q { font-size: 15px; padding: 18px 0; }

  /* Trust */
  .trust-section { padding: 60px 0 80px; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid .trust-card:first-child { grid-column: auto; }
  .trust-card { padding: 28px 24px; }
  .trust-badge { max-width: 100%; flex-wrap: wrap; }

  /* CTA band */
  .cta-band { padding: 80px 0; }
  .cta-orb { display: none; }
  .cta-band h2 { font-size: clamp(26px, 7vw, 36px); }

  /* Footer */
  footer {
    flex-direction: column; align-items: center;
    text-align: center; padding: 36px 20px; gap: 20px;
  }
  .f-links { justify-content: center; }
  .f-copy { text-align: center; }

  /* WhatsApp float */
  .wa-float { bottom: 20px; right: 20px; width: 50px; height: 50px; }

  /* Tooltips de pricing: sacar del layout cuando están ocultos para evitar overflow.
     Cuando se muestran (tap/focus) aparecen como panel fijo en la parte inferior. */
  .beta-tooltip,
  .info-tooltip,
  .pricing-card:last-child .beta-tooltip,
  .pricing-card:last-child .info-tooltip {
    display: none;
    position: fixed;
    bottom: 84px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    font-size: 12px;
    border-radius: 12px;
    visibility: visible;
    opacity: 1;
  }
  .beta-badge:focus .beta-tooltip,
  .beta-badge:focus-within .beta-tooltip,
  .beta-badge:hover .beta-tooltip,
  .info-badge:focus .info-tooltip,
  .info-badge:focus-within .info-tooltip,
  .info-badge:hover .info-tooltip {
    display: block;
    pointer-events: auto;
  }
  .beta-tooltip::after,
  .info-tooltip::after { display: none; }

  /* Disable expensive hover effects on touch */
  .fw-card:hover { transform: none; box-shadow: var(--shadow); border-color: rgba(229,221,211,.7); }
  .fw-card:hover::before { opacity: 0; }
  .pricing-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .pricing-card.hot:hover { transform: none; }
  .feat-img-wrap:hover { transform: none; box-shadow: 0 8px 32px rgba(13,10,7,.14), 0 0 0 1px rgba(255,255,255,.06); }
  .feat-img-wrap:hover img { transform: none; }
  .feat-img::after { display: none; } /* hide glow on mobile */
  .trust-card:hover { transform: none; box-shadow: none; }
  .trust-card:hover::before { opacity: 0; }
  .step:hover { transform: none; }
  .step:hover .step-num { transform: none; }
}

/* ── Small phones ── */
@media (max-width: 400px) {
  .hero { padding: 88px 0 52px; }
  .hero-sub { font-size: 15px; }
  .hero-badge { font-size: 10px; padding: 5px 12px; }
  .stats-band .container { grid-template-columns: 1fr; }
  .stat-item { border-right: none; padding: 24px 16px; }
  .stat-item:nth-child(odd) { border-right: none; }
  .stat-item:nth-last-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.05); }
  .stat-item:last-child { border-bottom: none; }
  .btn-lg { padding: 15px 24px; font-size: 15px; }
  .fw-card-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dl-modal { padding: 28px 20px; }
  .pricing-header h2 { font-size: 26px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .mesh-orb,
  .cta-orb,
  .badge-dot {
    animation: none !important;
  }
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-blur {
    transition-duration: .01s !important;
  }
  .hero-screenshot { transition: none !important; }
}
