/* ==========================================================================
   BANCO DE DEMOSTRACIÓN (demo-stage)
   Concepto: un "banco de pruebas" de taller. Banda oscura con malla de
   precisión y marcas de corte en las esquinas; el dispositivo flota sobre un
   resplandor cálido y a su lado va una guía numerada de qué tocar.
   Se reutiliza en meseros, cocina, domicilios y panel.
   ========================================================================== */
.demo-stage {
  --ds-bg: #07090E;
  --ds-ink: #F2F5F9;
  --ds-mute: #A3AFC2;
  --ds-line: rgba(255, 255, 255, .10);
  --ds-accent: #FF6B35;
  --ds-ok: #34D399;
  position: relative;
  isolation: isolate;
  background: var(--ds-bg);
  color: var(--ds-ink);
  padding: clamp(48px, 7vw, 96px) 0;
  margin: 0 0 clamp(40px, 6vw, 72px);
  overflow: hidden;
}
.demo-stage::before {            /* malla de precisión */
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(var(--ds-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ds-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 62% 50%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 62% 50%, #000 20%, transparent 78%);
}
.demo-stage::after {             /* resplandor cálido + grano */
  content: "";
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 420px at 64% 52%, rgba(255, 107, 53, .20), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.07'/></svg>");
}
.demo-stage--flip::after { background-position: -30% 0, 0 0; }

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.demo-stage--flip .demo-copy { order: 2; }
.demo-stage--wide .demo-grid { grid-template-columns: 1fr; gap: 36px; }
.demo-stage--wide .demo-copy {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px clamp(24px, 5vw, 64px); align-items: start;
}
.demo-stage--wide .demo-copy > .demo-head { grid-column: 1; }
.demo-stage--wide .demo-copy > .demo-steps { grid-column: 2; grid-row: 1 / span 3; margin-top: 4px; }
.demo-stage--wide .demo-copy > .demo-actions,
.demo-stage--wide .demo-copy > .demo-note { grid-column: 1; }

/* ---------- Texto ---------- */
.demo-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 .72rem/1 var(--font-body);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ds-mute);
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--ds-line); border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}
.demo-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ds-ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: ds-pulse 2s ease-out infinite;
}
@keyframes ds-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  100% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
}
.demo-stage h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem);
  line-height: 1.04; letter-spacing: -.02em;
  color: var(--ds-ink); margin: 18px 0 14px;
  text-wrap: balance;
}
.demo-stage h2 em { font-style: normal; color: var(--ds-accent); }
.demo-lead { color: var(--ds-mute); font-size: 1.05rem; line-height: 1.65; max-width: 52ch; margin: 0 0 26px; }

.demo-steps { list-style: none; margin: 0 0 28px; padding: 0; counter-reset: ds; display: grid; gap: 4px; }
.demo-steps li {
  counter-increment: ds;
  display: grid; grid-template-columns: 40px 1fr; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--ds-line);
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
}
.demo-steps li:last-child { border-bottom: 1px solid var(--ds-line); }
.demo-steps li::before {
  content: counter(ds, decimal-leading-zero);
  font: 700 .85rem/40px "IBM Plex Mono", ui-monospace, monospace;
  width: 40px; height: 40px; text-align: center;
  color: var(--ds-accent);
  border: 1px solid rgba(255, 107, 53, .45); border-radius: 12px;
  background: rgba(255, 107, 53, .08);
}
.demo-steps b { display: block; font-size: 1rem; color: var(--ds-ink); margin-bottom: 2px; }
.demo-steps span { color: var(--ds-mute); font-size: .92rem; line-height: 1.5; }
.demo-in .demo-steps li { opacity: 1; transform: none; }
.demo-in .demo-steps li:nth-child(2) { transition-delay: .09s; }
.demo-in .demo-steps li:nth-child(3) { transition-delay: .18s; }
.demo-in .demo-steps li:nth-child(4) { transition-delay: .27s; }

.demo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.demo-btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 20px;
  font: 700 .92rem/1 var(--font-body);
  color: #1A0B04; background: var(--ds-accent);
  border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 -3px 0 rgba(0, 0, 0, .22) inset, 0 12px 26px -10px rgba(255, 107, 53, .7);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.demo-btn:hover { transform: translateY(-2px); background: #FF7C4A; }
.demo-btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3) inset; }
.demo-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.demo-btn svg { width: 18px; height: 18px; }
.demo-btn--ghost {
  color: var(--ds-ink); background: rgba(255, 255, 255, .05);
  box-shadow: 0 0 0 1px var(--ds-line) inset;
}
.demo-btn--ghost:hover { background: rgba(255, 255, 255, .1); }
.demo-note { font-size: .82rem; color: var(--ds-mute); margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.demo-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--ds-ok); }

/* ---------- Dispositivo ---------- */
.demo-device { position: relative; justify-self: center; width: 100%; }
.demo-device--phone { max-width: 400px; }
.demo-device--wide { max-width: 1180px; }
.demo-viewport {
  position: relative; width: 100%;
  aspect-ratio: var(--vw) / var(--vh);
  overflow: hidden; border-radius: 28px;
  background: #0A0D14;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px var(--ds-line);
}
.demo-device--wide .demo-viewport { border-radius: 22px; }
.demo-viewport iframe {
  position: absolute; top: 0; left: 0; border: 0; display: block;
  width: calc(var(--vw) * 1px); height: calc(var(--vh) * 1px);
  transform-origin: top left; background: #0A0D14;
}
.demo-device::before, .demo-device::after {      /* marcas de corte */
  content: ""; position: absolute; width: 26px; height: 26px; pointer-events: none;
  border: 2px solid var(--ds-accent); opacity: .85;
}
.demo-device::before { top: -12px; left: -12px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.demo-device::after  { bottom: -12px; right: -12px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.demo-hint {                                      /* "toque aquí" hasta la primera interacción */
  position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  font: 700 .8rem/1 var(--font-body); color: #1A0B04; background: #FFB596;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .7);
  pointer-events: none; z-index: 3;
  animation: ds-float 2.4s ease-in-out infinite;
  transition: opacity .35s ease;
}
.demo-hint svg { width: 16px; height: 16px; }
.demo-touched .demo-hint { opacity: 0; visibility: hidden; }
@keyframes ds-float { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }

.demo-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--ds-mute); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
}
.demo-loaded .demo-loading { display: none; }

/* ---------- Adaptación ---------- */
@media (max-width: 960px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-stage--flip .demo-copy { order: 0; }
  .demo-stage--wide .demo-copy { grid-template-columns: 1fr; }
  .demo-stage--wide .demo-copy > .demo-steps { grid-column: 1; grid-row: auto; }
  .demo-device--phone { max-width: 360px; }
  .demo-stage::before { mask-image: radial-gradient(ellipse 90% 60% at 50% 70%, #000 20%, transparent 80%); -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 70%, #000 20%, transparent 80%); }
}
@media (max-width: 480px) {
  .demo-actions .demo-btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-live, .demo-hint { animation: none; }
  .demo-steps li { opacity: 1; transform: none; transition: none; }
}

/* ---------- Tamaño de las demostraciones en pantalla de escritorio ----------
   El simulador del panel y los dispositivos anchos ocupan cerca del 70 % de la pantalla para que el
   visitante los vea completos sin recorrer la página; «Pantalla completa» los abre a todo el tamaño. */
@media (min-width: 992px) {
  .panel-simulator-wrapper { width: 70vw; max-width: 1180px; min-width: 820px; margin-inline: auto; }
  .demo-device--wide { max-width: min(70vw, 1000px); }
}

/* ---------- Simulador del panel en teléfonos: vista de PC reducida + pantalla completa con zoom ---------- */
.psfs-tap { display: none; }
@media (max-width: 991px) {
  .panel-simulator-scale-box { position: relative; }
  .psfs-tap {
    position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center;
    padding: 0 0 10px; background: transparent; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .psfs-tap span {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
    font: 800 .95rem/1 var(--font-body); color: #1A0B04; background: #FF8A4C;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 -3px 0 rgba(0, 0, 0, .2) inset, 0 12px 24px -8px rgba(0, 0, 0, .7);
  }
  .psfs-tap:focus-visible span { outline: 3px solid #fff; outline-offset: 2px; }
  .btn-panel-fullscreen { min-height: 44px; }
}
.psv-abierto, .psv-abierto body { overflow: hidden !important; }
.psv { position: fixed; inset: 0; z-index: 2147483000; background: #050608; color: #fff; }
.psv-scroll {
  position: absolute; inset: 0; display: flex; overflow: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom;
}
.psv-box { position: relative; flex: none; margin: auto; }
.psv-sheet { position: absolute; left: 0; top: 0; width: 1440px; height: 810px; transform-origin: 0 0; }
.psv-sheet iframe { display: block; width: 1440px; height: 810px; border: 0; background: #0E0C0B; }
.psv-x {
  position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 4;
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(15, 15, 18, .85); border: 1.5px solid rgba(255, 255, 255, .45);
}
.psv-x:focus-visible, .psv-barra button:focus-visible { outline: 3px solid #FF8A4C; outline-offset: 2px; }
.psv-barra {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(15, 15, 18, .9); border: 1.5px solid rgba(255, 255, 255, .3); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .8);
}
.psv-barra button {
  min-width: 48px; height: 48px; display: grid; place-items: center; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .1); font: 800 .95rem/1 var(--font-body);
}
.psv-barra button:disabled { opacity: .35; cursor: default; }
.psv-barra .psv-ajustar { white-space: nowrap; padding: 0 18px; color: #1A0B04; background: #FF8A4C; }
.psv-aviso {
  position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 3;
  max-width: calc(100vw - 150px); padding: 10px 16px; border-radius: 999px; text-align: center; pointer-events: none;
  font: 700 .88rem/1.25 var(--font-body); color: #1A0B04; background: rgba(255, 138, 76, .95); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .7);
  transition: opacity .5s ease;
}
.psv-aviso.psv-oculto { opacity: 0; }
.psv-horizontal .psv-aviso, .psv-horizontal .psv-barra { display: none; }
@media (prefers-reduced-motion: reduce) { .psv-aviso { transition: none; } }
