/* ===================================================
   Fabricación · rediseño interactivo
   - Línea en profundidad: escena fija con las 5 fases en fila
     hacia el fondo; al hacer scroll cada fase avanza al frente.
   - Mapa industrial: galería elástica de 7 matrices.
   - FAQ con título fijo.
   Todo bajo .fx; sin iconos decorativos.
=================================================== */
.fx,
.fx-faq {
  --fx-ink: #000066;
  --fx-night: #00002E;
  --fx-gold: #C8A84B;
  --fx-paper: #F3F4F9;
  --fx-steel: #8A90B8;
  --fx-ease: cubic-bezier(.22, 1, .36, 1);
  --fx-elastic: cubic-bezier(.34, 1.42, .52, 1);
}

.fx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- A. Línea en profundidad ---------- */
.fab-formula-flow.fx {
  overflow: clip;
  padding: clamp(80px, 9vw, 120px) 0 clamp(40px, 5vw, 80px);
  background: var(--fx-night);
  color: #fff;
}

.fx-line {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.fx-stage-wrap {
  position: sticky;
  top: 110px;
}

.fx-stage-wrap h2 {
  margin: 0 0 16px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 3.8vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  color: #fff;
  text-wrap: balance;
}

.fx-stage-wrap > p {
  max-width: 46ch;
  margin: 0 0 20px;
  font-size: 1.04rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, .72);
}

.fx-stage {
  position: relative;
  height: min(50vh, 470px);
  perspective: 1300px;
  perspective-origin: 30% 20%;
}

.fx-shot {
  --d: 0;
  position: absolute;
  inset: 13% 16% 52px 0;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #0B0F5C;
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .8);
  transform: translate3d(calc(var(--d) * 7%), calc(var(--d) * -8%), calc(var(--d) * -120px));
  opacity: calc(1 - var(--d) * .16);
  filter: brightness(calc(1 - var(--d) * .18)) saturate(calc(1 - var(--d) * .25));
  z-index: calc(10 - var(--d));
  transition: transform 1s var(--fx-ease), opacity .7s ease, filter .7s ease;
}

.fx-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fx-shot--doc {
  background: #fff;
}

.fx-shot--doc img {
  object-fit: contain;
  padding: 12%;
}

/* La fase ya superada sale hacia el espectador */
.fx-shot.is-past {
  transform: translate3d(-14%, 6%, 320px);
  opacity: 0;
}

.fx-shot.is-far {
  opacity: 0;
}

.fx-counter {
  position: absolute;
  left: 0;
  bottom: 0;
  font: 500 .86rem/1 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  color: var(--fx-steel);
}

.fx-counter b {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--fx-gold);
  letter-spacing: -.02em;
}

.fx-rail {
  position: absolute;
  left: 92px;
  right: 12%;
  bottom: 8px;
  height: 2px;
  background: rgba(255, 255, 255, .14);
}

.fx-rail i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fx-progress, 20%);
  background: var(--fx-gold);
  transition: width .8s var(--fx-ease);
}

.fx-steps {
  margin: 0;
  padding: 0 0 18vh;
  list-style: none;
}

.fx-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 20px;
  align-content: center;
  min-height: 52vh;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  opacity: .32;
  transition: opacity .5s ease;
}

.fx-step.is-active {
  opacity: 1;
}

.fx-num {
  font: 300 2.6rem/1 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  color: var(--fx-gold);
}

.fx-step h3 {
  margin: 4px 0 12px;
  font: 800 clamp(1.4rem, 2.2vw, 1.9rem)/1.12 'Nunito Sans', sans-serif;
  letter-spacing: -.015em;
  color: #fff;
}

.fx-step p {
  max-width: 40ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .74);
}

.fx-step-img {
  display: none;
}

/* ---------- B. Mapa industrial: galería elástica ---------- */
.fab-guide-section.fx {
  padding: clamp(80px, 9vw, 120px) 0;
  background: var(--fx-paper);
}

.fab-guide-section.fx .fab-guide-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 16px 64px;
  align-items: end;
  max-width: none;
  margin: 0 0 52px;
}

.fab-guide-section.fx .fab-guide-head .label {
  grid-column: 1 / -1;
}

.fab-guide-section.fx .fab-guide-head h2 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.fab-guide-section.fx .fab-guide-head p {
  margin: 0;
  max-width: 46ch;
}

.fx-elastic {
  display: flex;
  gap: 8px;
  height: clamp(560px, 50vw, 660px);
}

.fx-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--fx-night);
  color: #fff;
  cursor: pointer;
  outline: none;
}

.fx-elastic.is-ready .fx-panel {
  transition: flex-grow .9s var(--fx-elastic);
}

.fx-panel.is-active {
  flex-grow: 6;
  cursor: default;
}

.fx-panel > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.3) brightness(.62);
  transform: scale(1.08);
  transition: filter .7s ease, transform 1.2s var(--fx-ease);
}

.fx-panel.is-active > img {
  filter: brightness(.9);
  transform: scale(1);
}

.fx-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 46, .05) 0%, rgba(0, 0, 46, .25) 35%, rgba(0, 0, 46, .94) 100%);
  pointer-events: none;
}

.fx-panel-label {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 1;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  white-space: nowrap;
  font: 700 .92rem/1 'Inter', sans-serif;
  letter-spacing: .04em;
  transition: opacity .35s ease;
}

.fx-panel.is-active .fx-panel-label {
  opacity: 0;
}

.fx-panel-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: clamp(24px, 2.8vw, 40px);
  opacity: 0;
  transform: translateY(18px);
  visibility: hidden;
  transition: opacity .3s ease, transform .5s var(--fx-ease), visibility 0s .3s;
}

.fx-panel.is-active .fx-panel-body {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity .45s ease .28s, transform .6s var(--fx-ease) .28s, visibility 0s;
}

.fx-panel-body h3 {
  margin: 0 0 8px;
  font: 800 clamp(1.6rem, 2.6vw, 2.4rem)/1.05 'Nunito Sans', sans-serif;
  letter-spacing: -.02em;
  color: #fff;
}

.fx-panel-body > p:first-of-type {
  max-width: 52ch;
  margin: 0 0 22px;
  font-size: .98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .82);
}

.fx-panel dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin: 0 0 20px;
}

.fx-panel dl > div {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .22);
}

.fx-panel dt {
  margin: 0 0 6px;
  font: 700 .7rem/1 'Inter', sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fx-gold);
}

.fx-panel dd {
  margin: 0;
  font-size: .86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .7);
}

.fx-panel dd strong {
  display: block;
  margin-bottom: 4px;
  font: 700 1.02rem/1.3 'Inter', sans-serif;
  color: #fff;
}

.fx-formats-l {
  margin: 0 0 8px;
  font: 700 .7rem/1 'Inter', sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fx-steel);
}

.fx-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fx-formats li {
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  font: 600 .78rem/1 'Inter', sans-serif;
  color: #fff;
}

.fx-panel:focus-visible {
  outline: 3px solid var(--fx-gold);
  outline-offset: 3px;
}

/* ---------- C. FAQ ---------- */
.mp-faq.fx-faq .container {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr);
  gap: 40px 72px;
  align-items: start;
}

.mp-faq.fx-faq .mp-faq-head {
  position: sticky;
  top: 120px;
  margin: 0;
  text-align: left;
}

.mp-faq.fx-faq .mp-faq-head h2 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -.025em;
  text-align: left;
}

.mp-faq.fx-faq .mp-faq-list {
  max-width: none;
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .fx-line,
  .fab-guide-section.fx .fab-guide-head,
  .mp-faq.fx-faq .container {
    grid-template-columns: 1fr;
  }

  .fx-stage-wrap,
  .mp-faq.fx-faq .mp-faq-head {
    position: static;
  }

  .fx-stage {
    display: none;
  }

  .fx-stage-wrap > p {
    margin-bottom: 8px;
  }

  .fx-steps {
    padding-bottom: 0;
  }

  .fx-step {
    min-height: 0;
    padding: 28px 0 32px;
    opacity: 1;
  }

  .fx-step-img {
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-top: 14px;
    object-fit: cover;
    border-radius: 4px;
  }

  .fx-step-img--doc {
    object-fit: contain;
    background: #fff;
    padding: 10%;
  }
}

@media (max-width: 820px) {
  .fx-elastic {
    flex-direction: column;
    height: auto;
    gap: 8px;
  }

  .fx-panel {
    flex: none;
    height: 72px;
  }

  .fx-panel.is-active {
    height: auto;
    min-height: 460px;
  }

  .fx-panel-label {
    left: 22px;
    bottom: 50%;
    writing-mode: horizontal-tb;
    transform: translateY(50%);
  }

  .fx-panel-body {
    position: relative;
    padding-top: 180px;
  }

  .fx-panel:not(.is-active) .fx-panel-body {
    display: none;
  }

  .fx-panel dl {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .fx-step {
    grid-template-columns: 52px 1fr;
  }

  .fx-num {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx *,
  .fx *::before,
  .fx *::after {
    transition-duration: .01ms !important;
  }
}
