/* ============================================================
   PX Sales — Rediseño cinematográfico
   Hero de scroll (300 frames) + secciones reestructuradas.
   Depende de css/styles.css (tokens, botones, cards, etc.)
   ============================================================ */

/* ---------- Hero: preloader minimal ---------- */
#preloader { background: var(--px-navy-900); }
.pre-logo { width: min(120px, 30vw); filter: drop-shadow(0 16px 40px rgba(30,107,255,.35)); animation: preIn .9s var(--e-out) both; }
.pre-txt { letter-spacing: .42em; font-size: .68rem; }

/* ---------- Hero cinematográfico ---------- */
.px-scroll-wrap {
  position: relative;
  height: 500vh;
  background: var(--px-navy-900);
}
.hero-static.px-scroll-wrap { height: auto; }

.px-scroll-sticky {
  position: sticky; top: 0; left: 0; right: 0;
  height: 100vh; min-height: 560px;
  overflow: hidden;
  background: var(--px-navy-900);
}
.hero-static .px-scroll-sticky { position: relative; height: 92vh; min-height: 620px; }

#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }

.hero-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, transparent 45%, var(--bg) 100%);
  opacity: 0;
}
.hero-noscroll-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,11,22,.15) 0%, rgba(6,11,22,.55) 100%);
}

.hero-scenes { position: absolute; inset: 0; z-index: 2; }
.hero-scene {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 0 clamp(1.25rem, 6vw, 3rem);
  opacity: 0; pointer-events: none;
  will-change: opacity, transform, filter;
}
.hero-static .hero-scene { position: relative; opacity: 1 !important; transform: none !important; filter: none !important; pointer-events: auto !important; padding: 2.5rem clamp(1.25rem, 6vw, 3rem); }
.hero-static .hero-scenes { position: static; display: grid; gap: 2rem; }

.hs-eyebrow { margin-bottom: 1.1rem; background: rgba(6,11,22,.55); }
.hs-h1 {
  font-family: var(--font-display); color: #fff; font-weight: 750;
  font-size: clamp(1.7rem, 4.6vw, 3.3rem); line-height: 1.14; letter-spacing: -.025em;
  max-width: 18ch; text-wrap: balance; margin: 0;
  text-shadow: 0 8px 34px rgba(0,0,0,.55);
}
.hs-sub {
  color: rgba(255,255,255,.82); font-size: clamp(1rem, 1.7vw, 1.22rem);
  max-width: 46ch; margin: 1rem auto 0;
  text-shadow: 0 6px 22px rgba(0,0,0,.5);
}
.hs-list {
  margin-top: 1.4rem; display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem .9rem; font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1rem, 1.9vw, 1.3rem); color: #fff;
}
.hs-list i { color: var(--px-orange-500); font-style: normal; opacity: .8; }
.hs-flow {
  margin-top: 1.6rem; display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem .8rem; font-family: var(--font-display); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; font-size: clamp(.78rem, 1.3vw, .95rem);
  color: rgba(255,255,255,.9);
}
.hs-flow span { padding: .4rem .85rem; border-radius: 99px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); backdrop-filter: blur(10px); }
.hs-flow i { color: var(--px-orange-500); font-style: normal; }
.hs-cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.8rem; }
.hs-fine { margin-top: 1rem; font-size: .82rem; color: rgba(255,255,255,.6); }

.hero-scroll-cue {
  position: absolute; z-index: 2; left: 50%; bottom: clamp(1.2rem, 4vh, 2.2rem); transform: translateX(-50%);
  width: 22px; height: 36px; border: 2px solid rgba(255,255,255,.4); border-radius: 99px;
}
.hero-scroll-cue span {
  position: absolute; top: 6px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 99px; background: #fff; animation: cueDrop 1.8s var(--e-io) infinite;
}
@keyframes cueDrop { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 0; transform: translateY(10px); } 100% { opacity: 0; } }
.hero-static .hero-scroll-cue { display: none; }

/* nav sits transparent over the hero, then gains blur+bg on scroll (class reused) */
.nav { background: transparent; }

/* ---------- 1. Problema (editorial) ---------- */
.problem-section { position: relative; }
.problem-grid { display: grid; gap: 2rem; align-items: start; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.problem-head { max-width: 640px; }
.problem-head h2 { font-size: var(--fs-h2); margin: 1rem 0 .9rem; }
.problem-head p { color: var(--fg-muted); font-size: 1.06rem; }
.problem-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.problem-lines li {
  font-family: var(--font-display); font-weight: 650; font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  color: var(--fg-dim); padding: .55rem 0 .55rem 1.1rem; border-left: 3px solid var(--border);
  transition: color var(--t-mid) var(--e-out), border-color var(--t-mid) var(--e-out);
}
.js .problem-lines li[data-reveal].in { color: var(--fg); border-left-color: var(--px-orange-600); }

/* ---------- 2. Solución (flow diagram) ---------- */
.flow-diagram { position: relative; }
.flow-svg { display: none; }
.flow-nodes { display: grid; gap: .85rem; grid-template-columns: repeat(2, 1fr); }
.flow-node {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center;
  padding: 1.3rem .8rem; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--bg-elev); font-family: var(--font-display); font-weight: 650; font-size: .92rem;
  transition: border-color var(--t-mid), transform var(--t-mid) var(--e-out), background var(--t-mid);
}
.flow-node:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.flow-ico { font-size: 1.5rem; }
.js .flow-diagram[data-reveal] .flow-node { transition-delay: calc(var(--fi, 0) * 70ms); }

/* ---------- 3. Product tour (lateral nav) ---------- */
.product-tour { display: grid; gap: 1.5rem; }
.product-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.product-nav button {
  display: flex; align-items: center; gap: .55rem; padding: .75rem 1rem;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--fg-muted); font-size: .88rem; font-weight: 600; text-align: left;
  transition: all var(--t-mid) var(--e-out); min-height: 46px;
}
.product-nav button b { font-family: var(--font-display); color: var(--fg-dim); font-size: .78rem; }
.product-nav button.on { color: #fff; background: linear-gradient(100deg, var(--px-blue-600), var(--px-blue-500)); border-color: transparent; box-shadow: 0 12px 26px -14px rgba(30,107,255,.9); }
.product-nav button.on b { color: rgba(255,255,255,.85); }
.product-stage .frame { transform: none; }
.product-stage .frame-body { aspect-ratio: 16 / 9.6; }
.product-cap { text-align: center; margin-top: 1.2rem; color: var(--fg-muted); font-size: .93rem; }

/* ---------- 4. IA que ejecuta ---------- */
.ai-exec-demo { max-width: 560px; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.ai-exec-demo .bubble { max-width: 100%; font-size: .96rem; padding: 1rem 1.2rem; }
.exec-steps { display: grid; gap: .8rem; max-width: 720px; margin: 0 auto; }
.exec-step { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.exec-step:last-child { border-bottom: 0; }
.exec-step .n { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .85rem; background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--px-blue-400); }
.exec-step b { display: block; font-size: .98rem; }
.exec-step p { color: var(--fg-muted); font-size: .9rem; margin-top: .2rem; }

/* ---------- 5. AI pause button ---------- */
.ai-pause-btn {
  margin-top: 1rem; width: 100%; display: flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1rem; border-radius: var(--r-md); font-weight: 650; font-size: .9rem;
  color: var(--px-orange-500); border: 1.5px dashed rgba(255,106,0,.45); background: rgba(255,106,0,.08);
  transition: all var(--t-mid) var(--e-out);
}
.ai-pause-btn:hover { background: rgba(255,106,0,.16); border-color: rgba(255,106,0,.7); }
.ai-pause-btn svg { width: 16px; height: 16px; }

/* ---------- 6. Seguimiento (track) ---------- */
.follow-track { display: grid; gap: .8rem; position: relative; }
.follow-stage { padding: 1.2rem 1.3rem; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--bg-elev); position: relative; }
.follow-stage .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--fg-dim); margin-bottom: .6rem; }
.follow-stage b { display: block; font-family: var(--font-display); font-size: 1rem; margin-bottom: .25rem; }
.follow-stage p { color: var(--fg-muted); font-size: .88rem; }
.follow-stage.warn .dot { background: var(--px-orange-500); }
.follow-stage.warn { border-color: rgba(255,138,31,.35); background: rgba(255,138,31,.06); }
.follow-stage.win .dot { background: var(--px-green); }
.follow-stage.win { border-color: rgba(37,211,102,.35); background: rgba(37,211,102,.07); }

/* ---------- 7. Automatizaciones ---------- */
.automation-builder { display: grid; gap: 1.5rem; }
.autom-col { display: grid; gap: .6rem; align-content: start; }
.autom-label { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-dim); }
.autom-node {
  padding: 1rem 1.1rem; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--bg-elev); font-weight: 600; font-size: .92rem; position: relative;
}
.autom-col:nth-child(1) .autom-node { border-color: rgba(30,107,255,.35); }
.autom-col:nth-child(2) .autom-node { border-color: rgba(255,138,31,.35); }
.autom-col:nth-child(3) .autom-node { border-color: rgba(37,211,102,.3); }

/* ---------- 10. Pricing (generated) ---------- */
.price-badge-wrap { position: relative; }

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
  .flow-nodes { grid-template-columns: repeat(3, 1fr); }
  .problem-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .flow-nodes { grid-template-columns: repeat(6, 1fr); }
  .flow-svg { display: block; position: absolute; left: 0; right: 0; top: 34px; width: 100%; height: 20px; z-index: 0; opacity: .35; }
  .flow-line { fill: none; stroke: var(--px-blue-500); stroke-width: 2; stroke-dasharray: 6 8; }
  .automation-builder { grid-template-columns: 1fr 1fr 1.4fr; }
}
@media (min-width: 1024px) {
  .product-tour { grid-template-columns: 260px 1fr; align-items: start; }
  .product-nav { flex-direction: column; }
  .follow-track { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 767px) {
  .px-scroll-wrap { height: 380vh; }
  .hs-h1 { max-width: 16ch; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue { display: none; }
  .hs-h1, .hs-sub { text-wrap: initial; }
}
