/* =============================================================
   Directrix · tour.css
   Cascarón del tour: cabecera, marco de navegador, foco, globo,
   reproductor y laboratorio. La réplica de la app vive en
   tour-app.css.
   ============================================================= */

/* ===================== Cabecera del tour ===================== */
.tour-hero { padding: 150px 0 48px; }
.tour-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; margin-bottom: 24px;
  border-radius: var(--radius-full);
  background: rgba(8,80,232,0.06);
  border: 1px solid rgba(8,80,232,0.18);
  font-size: 13px; font-weight: 500; color: var(--ink-800);
}
.tour-hero .eyebrow img { width: 22px; height: auto; }
.tour-hero h1 {
  font-size: clamp(38px, 5.6vw, 76px);
  font-weight: 800; line-height: 0.98; letter-spacing: -0.035em;
  color: var(--ink-900); margin-bottom: 22px; text-wrap: balance;
}
.tour-hero h1 .accent { color: var(--accent); font-style: italic; font-weight: 700; }
.tour-hero .lead {
  font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55;
  color: var(--ink-700); max-width: 680px; margin-bottom: 32px; text-wrap: pretty;
}

.sector-picker { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sector-picker .lbl {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-500); margin-right: 6px;
}
.sector-chip {
  padding: 9px 16px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: #fff;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-700);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.sector-chip:hover:not(:disabled) { border-color: var(--action-blue-300); color: var(--accent); }
.sector-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sector-chip:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===================== Escenario ===================== */
.stage { padding-bottom: 80px; }
.stage-inner { position: relative; }

/* Marco de navegador claro, como Chrome */
.browser {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #D5DCE6;
  box-shadow: 0 50px 110px -34px rgba(8,25,70,0.42),
              0 12px 30px -14px rgba(10,21,48,0.22);
}
.browser-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  background: #E9EDF3;
  border-bottom: 1px solid #D5DCE6;
}
.browser-dots { display: flex; gap: 7px; flex-shrink: 0; }
.browser-dots i { width: 11px; height: 11px; border-radius: 50%; background: #C3CBD8; }
.browser-dots i:nth-child(1) { background: #FF6159; }
.browser-dots i:nth-child(2) { background: #FFBD2E; }
.browser-dots i:nth-child(3) { background: #28C941; }
.browser-url {
  flex: 1; max-width: 560px; margin: 0 auto;
  height: 28px; border-radius: 14px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; color: #5B6577; letter-spacing: 0.01em;
}
.browser-url svg { width: 11px; height: 11px; opacity: 0.55; }
.browser-badge {
  flex-shrink: 0; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #047857; padding: 3px 9px; border-radius: var(--radius-full);
  background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3);
}

/* Ventana que escala el lienzo virtual de 1280 px al ancho disponible */
.viewport {
  position: relative; width: 100%;
  height: 600px;                 /* tour.js lo ajusta: 800 × escala */
  overflow: hidden;
  background: #F1F5F9;
}

/* Foco: oscurece todo menos el elemento señalado */
.spot {
  position: absolute; z-index: 60; pointer-events: none;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15,23,42,0.52),
              0 0 0 2px #3B82F6,
              0 0 26px 2px rgba(59,130,246,0.55);
  opacity: 0;
  transition: opacity 320ms var(--ease-out),
              top 520ms var(--ease-out), left 520ms var(--ease-out),
              width 520ms var(--ease-out), height 520ms var(--ease-out);
}
.spot.show { opacity: 1; }

/* Puntero simulado para los clics del tour */
.cursor {
  position: absolute; z-index: 61; width: 22px; height: 22px; pointer-events: none;
  opacity: 0; transition: opacity 200ms, top 600ms cubic-bezier(.4,0,.2,1), left 600ms cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}
.cursor.show { opacity: 1; }
.cursor.press::after {
  content: ''; position: absolute; left: -9px; top: -9px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #3B82F6; animation: cur-press 520ms ease-out;
}
@keyframes cur-press { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* Globo explicativo */
.callout {
  position: absolute; z-index: 70; width: 316px;
  background: #fff; border-radius: 14px; padding: 17px 19px;
  border: 1px solid var(--border);
  box-shadow: 0 26px 60px -16px rgba(5,12,32,0.45);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out),
              top 520ms var(--ease-out), left 520ms var(--ease-out);
}
.callout.show { opacity: 1; transform: none; pointer-events: auto; }
.callout .step-n {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 7px;
  display: flex; justify-content: space-between;
}
.callout .step-n .scr { color: var(--ink-400); letter-spacing: 0.04em; }
.callout h4 {
  font-size: 16px; font-weight: 700; letter-spacing: -0.015em;
  color: var(--ink-900); margin-bottom: 7px; line-height: 1.25;
}
.callout p { font-size: 13px; line-height: 1.55; color: var(--ink-600); }
.callout p strong { color: var(--ink-900); font-weight: 700; }
.callout .tip {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--ink-500); font-style: italic;
}

/* ===================== Reproductor ===================== */
.tour-bar {
  display: flex; align-items: center; gap: 16px;
  margin-top: 18px; padding: 13px 18px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.tour-bar .pbtn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(8,80,232,0.55);
  transition: background var(--dur-fast) var(--ease-out);
}
.tour-bar .pbtn:hover { background: var(--action-blue-600); }
.tour-bar .pbtn svg { width: 15px; height: 15px; color: #fff; }
.tour-bar .pbtn svg[hidden] { display: none; }
.tour-bar .track { flex: 1; min-width: 0; }
.tour-bar .track .meta {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 7px;
}
.tour-bar .track .now { font-size: 13px; font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-bar .track .cnt { font-size: 11.5px; color: var(--ink-500); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pbar { height: 3px; background: var(--ink-200); border-radius: 2px; overflow: hidden; }
.pbar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--action-blue-500), var(--brand-blue-500));
  border-radius: 2px;
}
.tour-bar .steps { display: flex; gap: 5px; flex-shrink: 0; }
.tour-bar .steps b {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-300); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tour-bar .steps b:hover { transform: scale(1.3); }
.tour-bar .steps b.done { background: var(--action-blue-200); }
.tour-bar .steps b.on { background: var(--accent); transform: scale(1.4); }
.skip {
  font-size: 12.5px; font-weight: 600; color: var(--ink-500);
  background: none; border: none; cursor: pointer; font-family: inherit;
  flex-shrink: 0; padding: 6px;
}
.skip:hover { color: var(--accent); }

/* ===================== Laboratorio (Optimizador · detalle de SKU) ===================== */
.lab { background: linear-gradient(180deg, transparent, var(--action-blue-50) 100%); }
.lab-shell {
  background: #fff; border: 1px solid #D5DCE6; border-radius: 28px;
  box-shadow: 0 40px 90px -36px rgba(8,25,70,0.4);
  overflow: hidden;
}
.lab-shell .ai-dlg-head { padding: 22px 28px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lab-shell .ai-dlg-head h3 { font-size: 19px; font-weight: 700; }
.lab-shell .ai-dlg-head p { font-size: 12px; color: #64748B; margin-top: 2px; }
.lab-body { padding: 18px 28px 26px; background: #fff; }
.lab-shell .lab-cd { grid-template-columns: 1.55fr 1fr; }
.lab-shell .ai-inputs { grid-template-columns: repeat(4, 1fr); }
.lab-kslider {
  margin-top: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 12px 16px; border-radius: 16px; background: #F5F3FF; border: 1px solid #DDD6FE;
}
.lab-kslider .lb { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5B21B6; }
.lab-kslider .vl { font-size: 20px; font-weight: 800; color: #5B21B6; font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; }
input[type="range"].k-range {
  width: 100%; height: 5px; border-radius: 3px; appearance: none; -webkit-appearance: none;
  background: linear-gradient(90deg, #7C3AED 0%, #7C3AED var(--pct,40%), #DDD6FE var(--pct,40%), #DDD6FE 100%);
  cursor: pointer; outline: none;
}
input[type="range"].k-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid #7C3AED; cursor: grab;
  box-shadow: 0 2px 8px rgba(124,58,237,.4);
}
input[type="range"].k-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: 3px solid #7C3AED; background: #fff; cursor: grab;
}
input[type="range"].k-range:focus-visible { box-shadow: 0 0 0 3px rgba(124,58,237,.25); }
.lab-verdict {
  margin-top: 12px; padding: 12px 16px; border-radius: 14px;
  background: #F8FAFC; border-left: 3px solid #7C3AED;
  font-size: 13px; line-height: 1.55; color: #475569;
}
.lab-verdict strong { color: #1E293B; }
.lab-resim { font-size: 11.5px; color: #7C3AED; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 200ms; }
.lab-resim.on { opacity: 1; }

/* ===================== Portada y cierre del recorrido ===================== */
.tour-ov {
  position: absolute; inset: 0; z-index: 65; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,21,48,0.5);
  opacity: 0; pointer-events: none; transition: opacity 260ms var(--ease-out);
}
.tour-ov.show { opacity: 1; pointer-events: auto; }
.tour-ov .box {
  background: #fff; border-radius: 20px; padding: 26px 30px 24px; max-width: 460px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  box-shadow: 0 30px 70px -24px rgba(5,12,32,0.55);
}
.tour-ov .box > b { font-size: 18px; font-weight: 700; color: var(--fg); }
.tour-ov .box > span { font-size: 14px; color: var(--fg-muted); line-height: 1.5; }
.tour-ov .go {
  width: 68px; height: 68px; margin-bottom: 6px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; box-shadow: 0 0 0 10px rgba(8,80,232,0.14);
  transition: transform 160ms var(--ease-out), background 160ms;
}
.tour-ov .go:hover { background: var(--action-blue-600); transform: scale(1.05); }
.tour-ov .go svg { width: 26px; height: 26px; margin-left: 3px; }
.tour-ov .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.tour-ov .acts button {
  height: 38px; padding: 0 16px; border-radius: var(--radius-full); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: #fff; color: var(--fg);
}
.tour-ov .acts .btn-p { background: var(--accent); border-color: var(--accent); color: #fff; }
.tour-ov .acts .btn-p:hover { background: var(--action-blue-600); }
.tour-ov .acts .btn-l { border-color: transparent; color: var(--accent); }
/* Durante el recorrido guiado la app no responde al puntero; se habilita en la exploración libre */
.viewport:not(.libre) .aiapp { pointer-events: none; }
.skip[hidden] { display: none; }

/* ===================== Cierre ===================== */
.tour-end .final-cta-inner { text-align: center; }
.tour-end h2 { margin-left: auto; margin-right: auto; }
.tour-end .final-cta-lead { margin-left: auto; margin-right: auto; }
.tour-end .contact-form { margin-left: auto; margin-right: auto; text-align: left; }

/* ===================== Responsive ===================== */
@media (max-width: 1100px) {
  .lab-shell .ai-grid-2 { grid-template-columns: 1fr; }
  .lab-shell .ai-kpis.c4 { grid-template-columns: 1fr 1fr; }
  .lab-shell .ai-inputs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  /* En pantallas angostas la app se ve completa a escala y el globo narra debajo */
  .spot, .cursor { display: none; }
  .callout {
    position: static !important; width: auto;
    margin-top: 14px; opacity: 1; transform: none; pointer-events: auto;
  }
  .tour-bar { flex-wrap: wrap; gap: 12px; }
  .tour-bar .track { order: 3; flex-basis: 100%; }
  .browser-badge { display: none; }
}
@media (max-width: 620px) {
  .tour-hero { padding: 120px 0 36px; }
  .tour-ov { padding: 8px; }
  .tour-ov .box { padding: 14px 16px; gap: 4px; border-radius: 16px; }
  .tour-ov .box > b { font-size: 15px; }
  .tour-ov .box > span { display: none; }
  .tour-ov .go { width: 50px; height: 50px; margin-bottom: 2px; box-shadow: 0 0 0 7px rgba(8,80,232,0.14); }
  .tour-ov .go svg { width: 20px; height: 20px; }
  .tour-ov .acts { margin-top: 6px; gap: 6px; }
  .tour-ov .acts button { height: 32px; padding: 0 12px; font-size: 12.5px; }
  .lab-shell .ai-kpis.c4, .lab-shell .ai-inputs { grid-template-columns: 1fr; }
  .lab-body { padding: 14px 16px 20px; }
  .lab-shell .ai-dlg-head { padding: 18px 16px 0; }
  .lab-kslider { grid-template-columns: 1fr auto; }
  .lab-kslider .lb { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .spot, .callout, .cursor { transition-duration: 1ms !important; }
  .cursor.press::after { animation: none; }
}
