/* ==========================================================================
   Mr. Making — páginas de producto (crm / erp / wagent / callagent)
   Usa los tokens y componentes de site.css.
   ========================================================================== */

/* ---------- Bienvenida ---------- */
.pw-hero { min-height: calc(100svh - 40px); display: grid; align-items: center; padding: 140px 0 80px; position: relative; }
.pw-hero__copy { max-width: 860px; }
.pw-hero .display { margin: 18px 0 20px; }
.pw-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pw-hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; font-size: 14px; color: var(--ink-2); }
.pw-hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.pw-scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.pw-scroll i { width: 22px; height: 34px; border-radius: 12px; border: 1.5px solid var(--hairline-strong); position: relative; }
.pw-scroll i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--ink-2); animation: pw-wheel 1.8s var(--ease) infinite; }
@keyframes pw-wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
.pw-login { position: fixed; top: 22px; right: clamp(16px, 4vw, 40px); z-index: 60; }

/* ---------- Vista previa (bucle) ---------- */
.pw-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.pw-points { display: grid; gap: 14px; margin-top: 28px; }
.pw-point { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.pw-point h3 { font-size: 16px; font-weight: 600; margin: 2px 0 4px; }
.pw-point p { font-size: 15px; color: var(--ink-2); margin: 0; }
.pw-stage { padding: 22px; border-radius: var(--r-xl); min-height: 460px; position: relative; overflow: hidden; }
.pw-stage__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 16px; }
.pw-stage__title { font-size: 14px; font-weight: 600; }

/* elementos que aparecen en la línea de tiempo */
.pw-anim [data-t] { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }
.pw-anim [data-t].is-on { opacity: 1; transform: none; }

/* --- WhatsApp --- */
.wa-phone { max-width: 360px; margin: 0 auto; border-radius: 34px; background: #EFE7DD; padding: 0 0 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 30px 60px -30px rgba(0,0,0,.35); overflow: hidden; }
.wa-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #1F2C33; color: #fff; }
.wa-top b { font-size: 14px; display: block; } .wa-top small { font-size: 11px; opacity: .7; }
.wa-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3D2B3D, #8B9070); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.wa-body { display: grid; gap: 8px; padding: 14px; min-height: 330px; align-content: start; }
.wa-msg { max-width: 82%; padding: 8px 11px 6px; border-radius: 10px; font-size: 13.5px; line-height: 1.35; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); justify-self: start; color: #111; }
.wa-msg--me { justify-self: end; background: #D9FDD3; }
.wa-msg small { display: block; text-align: right; font-size: 10px; color: #667781; margin-top: 2px; }
.wa-typing { justify-self: start; background: #fff; border-radius: 10px; padding: 10px 12px; display: inline-flex; gap: 4px; }
.wa-typing i { width: 6px; height: 6px; border-radius: 50%; background: #999; animation: pw-dot 1s infinite; }
.wa-typing i:nth-child(2) { animation-delay: .15s; } .wa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pw-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.pw-badge { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; }

/* --- Llamada --- */
.call { display: grid; gap: 16px; }
.call__card { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; background: rgba(255,255,255,.55); box-shadow: inset 0 1px 0 #fff; }
.call__orb { width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #8B9070, #3D2B3D); box-shadow: 0 0 0 0 rgba(61,43,61,.35); animation: pw-orb 2s var(--ease) infinite; }
@keyframes pw-orb { 0%, 100% { box-shadow: 0 0 0 0 rgba(61,43,61,.35); } 50% { box-shadow: 0 0 0 12px rgba(61,43,61,0); } }
.call__timer { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.wave { display: flex; align-items: center; gap: 4px; height: 46px; padding: 0 8px; }
.wave i { flex: 1; border-radius: 3px; background: var(--ink); opacity: .75; height: 20%; animation: pw-wave 1.1s var(--ease) infinite; }
.wave i:nth-child(3n) { animation-delay: .2s; } .wave i:nth-child(3n+1) { animation-delay: .45s; } .wave i:nth-child(4n) { animation-delay: .7s; }
@keyframes pw-wave { 0%, 100% { height: 18%; } 50% { height: 92%; } }
.wave.is-quiet i { animation-play-state: paused; height: 14%; }
.tr { display: grid; gap: 8px; }
.tr p { margin: 0; padding: 10px 14px; border-radius: 16px; font-size: 14px; background: rgba(255,255,255,.55); }
.tr p b { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 2px; }
.tr p.is-ai { background: var(--ink); color: #fff; } .tr p.is-ai b { color: rgba(255,255,255,.6); }

/* --- CRM (kanban) --- */
.kb { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kb__col { background: rgba(255,255,255,.38); border-radius: 18px; padding: 10px; min-height: 230px; display: grid; gap: 8px; align-content: start; transition: background var(--t-fast) var(--ease); }
.kb__col.is-over { background: rgba(255,255,255,.75); }
.kb__head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 2px 4px 4px; }
.kb__card { background: #fff; border-radius: 12px; padding: 10px; font-size: 13px; box-shadow: 0 2px 8px -4px rgba(0,0,0,.2); display: grid; gap: 2px; transition: transform 500ms var(--ease-out), box-shadow var(--t-fast); }
.kb__card b { font-weight: 600; } .kb__card small { color: var(--ink-3); font-size: 12px; }
.kb__card .kb__val { font-family: var(--font-mono); font-size: 11.5px; }
.kb__card.is-hot { box-shadow: 0 0 0 2px var(--ink), 0 10px 20px -10px rgba(0,0,0,.4); }
.kb__card[draggable="true"] { cursor: grab; }
.kb__card select { margin-top: 6px; font: inherit; font-size: 12px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--hairline-strong); background: #fafafa; }
.ai-line { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 10px 14px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 13.5px; }
.ai-line .icon { flex: none; }

/* --- ERP --- */
.erp { display: grid; gap: 12px; }
.erp__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.erp__kpi { background: rgba(255,255,255,.55); border-radius: 16px; padding: 12px 14px; }
.erp__kpi small { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.erp__kpi strong { display: block; font-size: 24px; letter-spacing: -.02em; margin-top: 4px; }
.erp__table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: rgba(255,255,255,.5); border-radius: 16px; overflow: hidden; }
.erp__table th, .erp__table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--hairline); }
.erp__table th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.erp__table tr:last-child td { border-bottom: 0; }
.stock { display: flex; align-items: center; gap: 8px; }
.stock__bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(0,0,0,.08); overflow: hidden; min-width: 50px; }
.stock__bar i { display: block; height: 100%; background: var(--mm-olive, #8B9070); transition: width 700ms var(--ease-out); }
.stock.is-low .stock__bar i { background: #B4453A; }
.tag-low { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #F6DEDA; color: #8E2E25; }

/* ---------- Demo (#probar) ---------- */
.pw-demo { padding: clamp(20px, 3vw, 36px); border-radius: var(--r-xl); }
.pw-demo__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.pw-left { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { font: inherit; font-size: 14px; padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: rgba(255,255,255,.6); cursor: pointer; transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.chip-btn:hover { background: #fff; transform: translateY(-1px); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pw-input { display: flex; gap: 8px; margin-top: 12px; }
.pw-input input, .pw-input select { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 12px 16px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: rgba(255,255,255,.85); }
.pw-input input:focus, .pw-input select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.pw-hint { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.pw-sugs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pw-sugs button { font: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px dashed var(--hairline-strong); background: transparent; cursor: pointer; color: var(--ink-2); }
.pw-sugs button:hover { background: rgba(255,255,255,.7); color: var(--ink); }

/* chat de la demo de WhatsApp */
.pw-chat .wa-phone { max-width: 420px; }
.pw-chat .wa-body { height: 400px; overflow-y: auto; min-height: 0; }
.pw-chat .wa-msg { opacity: 1; transform: none; white-space: pre-wrap; }
.wa-compose { display: flex; gap: 8px; padding: 8px 12px 0; }
.wa-compose input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 10px 14px; border-radius: 999px; border: 0; background: #fff; }
.wa-compose button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #00A884; color: #fff; display: grid; place-items: center; cursor: pointer; }
.wa-compose button:disabled, .wa-compose input:disabled { opacity: .5; cursor: not-allowed; }

/* llamada real */
.pw-call { display: grid; gap: 16px; max-width: 560px; margin: 0 auto; text-align: center; }
.pw-call .call__card { text-align: left; }
.pw-call .tr { text-align: left; max-height: 280px; overflow-y: auto; }
.pw-call .call__orb { animation-play-state: paused; }
.pw-call.is-live .call__orb { animation-play-state: running; }

/* final de la demo */
.pw-end { display: none; margin-top: 22px; padding: 22px; border-radius: var(--r-lg); text-align: center; }
.pw-end.is-visible { display: block; animation: pw-pop 500ms var(--ease-out); }
.pw-end h3 { font-size: 22px; letter-spacing: -.01em; margin: 0 0 6px; }
.pw-end p { color: var(--ink-inverse-2); margin: 0 0 16px; }
.pw-end .hero__actions, .pw-end .pw-hero__actions { justify-content: center; margin-top: 0; }
@keyframes pw-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.pw-error { color: #8E2E25; font-size: 14px; margin-top: 10px; }

@media (max-width: 900px) {
  .pw-preview { grid-template-columns: minmax(0, 1fr); }
  .kb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pw-login { top: auto; bottom: 18px; right: 18px; }
}
@media (max-width: 560px) {
  .erp__kpis { grid-template-columns: minmax(0, 1fr); }
  .erp__table .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pw-anim [data-t] { opacity: 1; transform: none; transition: none; }
  .wave i, .call__orb, .pw-scroll i::after, .wa-typing i { animation: none; }
}

/* elementos que se reemplazan en la línea de tiempo: no ocupan espacio mientras están ocultos */
.pw-anim [data-off]:not(.is-on), .pw-anim .swap:not(.is-on) { display: none; }
.pw-anim [data-off].is-on, .pw-anim .swap.is-on { animation: pw-pop 420ms var(--ease-out); }
.pw-stage .ai-line { margin-top: 12px; }
.pw-stage .kb { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pw-stage .kb__col { min-height: 300px; }
@media (max-width: 560px) { .pw-stage .kb { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
[hidden] { display: none !important; }
.nav__actions .pw-login-nav { margin-right: 8px; }
@media (max-width: 560px) { .nav__actions .pw-login-nav { padding-inline: 12px; } }
