/* =============================================================
   Páginas de demo (demos/<nombre>/)
   Usa las variables y botones de style.css y las apps de demos.css
   ============================================================= */

body.demo-page {
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(0,255,20,0.08), transparent 70%),
    var(--bg);
}

/* ---------- Barra superior ---------- */
.dp-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,9,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.dp-top-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dp-back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  min-height: 44px;
}
.dp-back img { height: 42px; width: auto; }
.dp-back span { font-size: 0.85rem; color: var(--muted); transition: color var(--transition); }
.dp-back:hover span { color: var(--neon); }
.dp-nav { display: flex; gap: 0.3rem; margin-left: auto; }
.dp-nav a {
  padding: 0.5rem 0.9rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
}
.dp-nav a:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.dp-nav a[aria-current="page"] { color: #000; background: var(--neon); }
.dp-top .btn-glow { padding: 0.65rem 1.3rem; font-size: 0.82rem; }

/* ---------- Encabezado ---------- */
.dp-wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.dp-hero { padding: 3.2rem 0 2rem; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem 3rem; align-items: end; }
.dp-hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.08; letter-spacing: -0.02em; margin-top: 0.2rem; }
.dp-hero-lead { color: var(--muted); font-size: 1.05rem; margin-top: 1rem; max-width: 60ch; }
.dp-hero-side { display: flex; flex-direction: column; gap: 1rem; }
.dp-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dp-chips li {
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--border-neon);
  background: var(--neon-dim);
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.dp-safe { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.85rem; color: var(--muted); }
.dp-safe svg { flex: none; color: var(--neon); margin-top: 0.15rem; }

/* ---------- Escenario: recorrido + demo + panel del negocio ---------- */
.dp-stage {
  display: grid;
  gap: 1.6rem;
  align-items: start;
  padding-bottom: 4rem;
}
.dp-stage--wide {
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas: "device tour" "device biz";
  grid-template-rows: auto 1fr;
}
.dp-stage--wide .dp-device { grid-area: device; }
.dp-stage--wide .dp-tour-col { grid-area: tour; position: static; }
.dp-stage--wide .dp-biz-col { grid-area: biz; position: static; }
.dp-stage--phone { grid-template-columns: minmax(250px, 320px) minmax(300px, 400px) minmax(260px, 360px); justify-content: center; }

.dp-device .device { max-width: none; }
.dp-device .device--phone { max-width: 400px; margin: 0 auto; }
.dp-device .device--phone .device-screen { height: min(720px, calc(100vh - 140px)); min-height: 600px; }
.dp-device .device--browser .device-screen { height: min(780px, calc(100vh - 130px)); min-height: 620px; }

.dp-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 1rem; }

/* Recorrido */
.dp-tour {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.dp-tour > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.2rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
.dp-tour > summary::-webkit-details-marker { display: none; }
.dp-tour-title { font-weight: 700; font-size: 1rem; }
.dp-tour-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--neon); }
.dp-tour-track { grid-column: 1 / -1; height: 6px; border-radius: 100px; background: rgba(255,255,255,0.08); overflow: hidden; }
.dp-tour-track i { display: block; height: 100%; width: 0; background: var(--neon); box-shadow: 0 0 12px rgba(0,255,20,0.6); transition: width 0.5s var(--ease); }
.dp-tour-list { padding: 0.2rem 1.2rem 1.1rem; display: flex; flex-direction: column; gap: 0.15rem; counter-reset: paso; }
.dp-tour-list li {
  counter-increment: paso;
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 0.15rem 0.7rem;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  transition: background var(--transition);
}
.dp-tour-list li::before {
  content: counter(paso);
  grid-row: 1 / span 2;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.22);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  transition: all var(--transition);
}
.dp-tour-list strong { font-size: 0.9rem; line-height: 1.35; }
.dp-tour-list small { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.dp-tour-list li.is-next { background: rgba(0,255,20,0.06); }
.dp-tour-list li.is-next::before { border-color: var(--neon); color: var(--neon); }
.dp-tour-list li.is-done::before {
  content: '✓';
  background: var(--neon);
  border-color: var(--neon);
  color: #000;
  font-weight: 700;
}
.dp-tour-list li.is-done strong { color: rgba(255,255,255,0.6); }
.dp-tour-list li.is-done small { display: none; }
.dp-tour-done {
  margin: 0 1.2rem 1.2rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-neon);
  background: rgba(0,255,20,0.07);
  text-align: center;
}
.dp-tour-done strong { display: block; font-size: 1rem; margin-bottom: 0.3rem; }
.dp-tour-done p { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.8rem; }
.dp-tour-done .btn-glow { padding: 0.75rem 1.4rem; font-size: 0.85rem; }
.dp-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}
.dp-reset:hover { color: var(--neon); border-color: var(--border-neon); }

/* Panel del negocio (WhatsApp) */
.dp-biz {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b141a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dp-biz.is-ping { animation: bizPing 0.9s var(--ease); }
@keyframes bizPing { 30% { box-shadow: 0 0 0 4px rgba(37,211,102,0.45), 0 0 40px rgba(37,211,102,0.35); } }
.dp-biz-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; background: #1f2c34; }
.dp-biz-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #25D366; color: #062b12; font-weight: 800; }
.dp-biz-head strong { display: block; font-size: 0.92rem; }
.dp-biz-head small { color: #8696a0; font-size: 0.75rem; }
.dp-biz-list {
  min-height: 260px;
  max-height: 460px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.025) 0 2px, transparent 3px) 0 0 / 26px 26px,
    #0b141a;
}
.dp-biz-empty { margin: auto; text-align: center; color: #8696a0; font-size: 0.85rem; max-width: 26ch; }
.dp-bubble {
  align-self: flex-start;
  max-width: 94%;
  padding: 0.6rem 0.75rem 0.4rem;
  border-radius: 0 10px 10px 10px;
  background: #202c33;
  color: #e9edef;
  font-size: 0.8rem;
  line-height: 1.45;
  animation: bubbleIn 0.45s var(--ease);
}
.dp-bubble p { white-space: pre-wrap; max-width: none; overflow-wrap: anywhere; }
.dp-bubble-meta { display: block; text-align: right; font-size: 0.68rem; color: #8696a0; margin-top: 0.2rem; }
.dp-bubble-meta i { color: #53bdeb; font-style: normal; }
.dp-biz-alert {
  align-self: center;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  background: rgba(37,211,102,0.15);
  color: #25D366;
  font-size: 0.72rem;
  font-weight: 700;
}
@keyframes bubbleIn { from { transform: translateY(10px); opacity: 0; } }
.dp-biz-foot { padding: 0.7rem 1rem; font-size: 0.75rem; color: #8696a0; border-top: 1px solid rgba(255,255,255,0.06); }

/* ---------- Secciones de detalle ---------- */
.dp-section { padding: 4.5rem 0; border-top: 1px solid var(--border); }
.dp-section h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; margin-bottom: 0.6rem; }
.dp-section .section-sub { color: var(--muted); max-width: 60ch; margin-bottom: 2.2rem; }

.dp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dp-feature {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color var(--transition);
}
.dp-feature:hover { border-color: var(--border-neon); }
.dp-feature svg { color: var(--neon); margin-bottom: 0.8rem; }
.dp-feature h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.dp-feature p { color: var(--muted); font-size: 0.88rem; }

.dp-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: flujo; }
.dp-flow li {
  counter-increment: flujo;
  position: relative;
  padding: 1.4rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(0,255,20,0.04), transparent 60%), var(--bg-card);
}
.dp-flow li::before {
  content: '0' counter(flujo);
  display: block;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--neon);
  opacity: 0.45;
  margin-bottom: 0.5rem;
}
.dp-flow strong { display: block; margin-bottom: 0.3rem; }
.dp-flow p { color: var(--muted); font-size: 0.86rem; }

.dp-ideal { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dp-ideal li { padding: 0.6rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); font-size: 0.9rem; }

.dp-faq { display: flex; flex-direction: column; gap: 0.7rem; max-width: 860px; }
.dp-faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); }
.dp-faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; min-height: 56px; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.dp-faq summary::-webkit-details-marker { display: none; }
.dp-faq summary::after { content: '+'; color: var(--neon); font-size: 1.3rem; transition: transform var(--transition); }
.dp-faq details[open] summary::after { transform: rotate(45deg); }
.dp-faq details p { padding: 0 1.2rem 1.1rem; color: var(--muted); font-size: 0.92rem; max-width: none; }

.dp-more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dp-more a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--white);
  transition: border-color var(--transition), transform var(--transition);
}
.dp-more a:hover { border-color: var(--border-neon); transform: translateY(-3px); }
.dp-more small { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--neon); }
.dp-more strong { font-size: 1.05rem; }
.dp-more span { color: var(--muted); font-size: 0.86rem; }

.dp-cta {
  margin-top: 1rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border-neon);
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(0,255,20,0.12), transparent 70%), var(--bg-card);
  text-align: center;
}
.dp-cta h2 { margin-bottom: 0.7rem; }
.dp-cta p { color: var(--muted); margin: 0 auto 1.6rem; max-width: 52ch; }
.dp-cta-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.dp-foot { border-top: 1px solid var(--border); padding: 1.6rem 0 2rem; color: var(--muted); font-size: 0.82rem; }
.dp-foot .dp-wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dp-foot a { color: var(--neon); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .dp-stage--phone { grid-template-columns: minmax(0, 400px) minmax(260px, 360px); }
  .dp-stage--phone .dp-tour-col { grid-column: 1 / -1; }
  .dp-nav { display: none; }
  .dp-top .btn-glow { margin-left: auto; }
}
@media (max-width: 1024px) {
  .dp-hero { grid-template-columns: 1fr; padding-top: 2.4rem; }
  .dp-stage--wide, .dp-stage--phone { grid-template-columns: minmax(0, 1fr); }
  .dp-stage--wide { grid-template-areas: "tour" "device" "biz"; grid-template-rows: none; }
  .dp-side { position: static; }
  .dp-features { grid-template-columns: repeat(2, 1fr); }
  .dp-flow { grid-template-columns: repeat(2, 1fr); }
  .dp-more { grid-template-columns: 1fr; }
  .dp-biz-list { max-height: 360px; }
}
@media (max-width: 600px) {
  .dp-back span { display: none; }
  .dp-back img { height: 36px; }
  .dp-top .btn-glow { padding: 0.6rem 1rem; }
  .dp-hero { padding: 1.8rem 0 1.4rem; }
  .dp-hero-lead { font-size: 0.98rem; }
  .dp-device .device--phone .device-screen { height: 620px; min-height: 0; }
  .dp-device .device--browser .device-screen { height: 680px; min-height: 0; }
  .dp-features, .dp-flow { grid-template-columns: 1fr; }
  .dp-section { padding: 3.2rem 0; }
  .dp-cta-actions .btn-glow, .dp-cta-actions .btn-ghost { width: 100%; justify-content: center; }
  .dp-stage { padding-bottom: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dp-biz.is-ping, .dp-bubble { animation: none; }
  .dp-tour-track i { transition: none; }
}

.dp-real { margin-top: 1.4rem; color: var(--muted); }
.dp-real a { color: var(--neon); font-weight: 700; border-bottom: 1px solid var(--border-neon); }

/* Recorrido cerrado (celular): indica que se puede abrir */
.dp-tour-hint { grid-column: 1 / -1; font-size: 0.78rem; color: var(--neon); }
.dp-tour[open] .dp-tour-hint { display: none; }
@media (min-width: 1025px) { .dp-tour-hint { display: none; } }
