/* ============================================================
   interactions.css — componentes interactivos del home
   (transacciones en vivo · asignador de bolsillos · add to wallet)
   Portados desde los prototipos de /Prototype con prefijo bx.
   ============================================================ */

/* ============ Transacciones en vivo (tarjeta del hero) ============ */
.bink-card__amount { transition: color .25s; }
.bink-card.flash .bink-card__amount { color: #FFD9E6; }
.bink-card__pockets .chip { display: inline-flex; gap: .35rem; align-items: center; transition: background .3s, transform .3s, box-shadow .3s; }
.bink-card__pockets .chip b { font-weight: 700; opacity: 1; }
.bink-card__pockets .chip.active { background: rgba(255,255,255,.38); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }

.bxtx-toast {
  position: absolute; top: 8%; right: -6%;
  display: flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.82); color: var(--text);
  padding: .7rem .9rem; border-radius: 14px; border: 1px solid rgba(255,255,255,.7);
  backdrop-filter: blur(14px) saturate(180%); -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 18px 40px rgba(96,8,64,.18);
  opacity: 0; transform: translateY(-8px) scale(.96);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  pointer-events: none; z-index: 5; min-width: 210px;
}
.bxtx-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.bxtx-toast__check { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--success-200, #31C859); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(49,200,89,.4); }
.bxtx-toast__check svg { width: 16px; height: 16px; stroke: #fff; }
.bxtx-toast__body { line-height: 1.2; display: flex; flex-direction: column; gap: 3px; }
.bxtx-toast__title { font-size: .7rem; color: var(--text-soft); text-transform: none; letter-spacing: .02em; }
.bxtx-toast__merchant { font-size: .92rem; font-weight: 600; }
.bxtx-toast__pocket { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; color: var(--text-soft); }
.bxtx-toast__pocket .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bulgundy-300); }
.bxtx-toast__ico { width: 18px; height: 18px; flex: none; display: block; object-fit: contain; }
.bxtx-toast__amt { font-size: .92rem; font-weight: 700; font-family: var(--font-display); color: var(--bulgundy-300); align-self: flex-start; margin-left: auto; }
@media (max-width: 600px) { .bxtx-toast { right: 0; top: 0; min-width: 0; padding: .55rem .7rem; } }

/* ============ Asignador de bolsillos (sección oscura) ============ */
.bxal {
  max-width: 920px; margin: 0 auto 3.5rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px; padding: 1.6rem 1.8rem 1.9rem;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.bxal__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.bxal__title { font-size: .8rem; font-weight: 600; text-transform: none; letter-spacing: .02em; color: rgba(255,255,255,.6); margin: 0; }
.bxal__total { font-size: 1.05rem; font-weight: 700; font-family: var(--font-display); color: #fff; }

/* Chips para elegir los bolsillos: solo el ícono; al pasar el cursor se agranda y aparece el nombre */
.bxal__chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.1rem; }
.bxal__chip { --c: var(--magenta, #dd034d); display: inline-flex; align-items: center; gap: 0; font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.85); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); padding: .32rem; border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s; }
.bxal__chip > span { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s var(--ease), opacity .25s, margin .3s var(--ease); }
.bxal__chip:hover, .bxal__chip:focus-visible { transform: scale(1.12); border-color: var(--c); color: #fff; box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); outline: none; }
.bxal__chip:hover > span, .bxal__chip:focus-visible > span { max-width: 180px; opacity: 1; margin: 0 .5rem 0 .35rem; }
.bxal__chipic { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; padding: 4px; box-sizing: border-box; background: rgba(255,255,255,.12); flex: none; transition: background .2s; }
.bxal__chip.is-on { color: #fff; background: color-mix(in srgb, var(--c) 22%, transparent); border-color: var(--c); }
.bxal__chip.is-on .bxal__chipic { background: var(--c); }
.bxal__chip.is-nope { animation: bxalNope .4s ease; }
@keyframes bxalNope { 0%,100% { transform: scale(1.12) translateX(0); } 25% { transform: scale(1.12) translateX(-4px); } 75% { transform: scale(1.12) translateX(4px); } }
/* Estado "hover" simulado por la demo: agranda el chip y muestra el nombre */
.bxal__chip.is-demohover { transform: scale(1.12); border-color: var(--c); color: #fff; box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); z-index: 4; }
.bxal__chip.is-demohover > span { max-width: 180px; opacity: 1; margin: 0 .5rem 0 .35rem; }
/* Cursor que se posa sobre el chip al elegirlo en la demo */
.bxal__cursor--chip { top: auto; bottom: -10px; left: auto; right: -4px; margin: 0; }

.bxal__bar { position: relative; height: 56px; border-radius: 14px; overflow: hidden; display: flex; background: rgba(255,255,255,.08); user-select: none; touch-action: none; }
.bxal__seg { position: relative; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: .82rem; overflow: hidden; transition: background .3s; white-space: nowrap; }
.bxal__seg span { padding: 0 .5rem; opacity: .95; text-shadow: 0 1px 2px rgba(0,0,0,.25); pointer-events: none; }
.bxal__handle { position: absolute; top: 0; bottom: 0; width: 22px; transform: translateX(-50%); cursor: ew-resize; display: flex; align-items: center; justify-content: center; z-index: 3; }
.bxal__handle::before { content: ""; width: 4px; height: 60%; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 0 0 1px rgba(0,0,0,.2); transition: height .2s, background .2s; }
.bxal__handle:hover::before, .bxal__handle:focus-visible::before { height: 80%; background: #fff; }
.bxal__handle:focus-visible { outline: none; }
.bxal__handle:focus-visible::after { content: ""; position: absolute; inset: 6px -4px; border: 2px solid var(--rosado); border-radius: 8px; }

/* Cursor de la simulación automática */
.bxal__cursor { position: absolute; top: 50%; left: 0; width: 24px; height: 24px; margin: -4px 0 0 -6px; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease), transform .18s var(--ease); filter: drop-shadow(0 3px 5px rgba(0,0,0,.45)); }
.bxal__cursor.is-show { opacity: 1; }
.bxal__cursor.is-grab { transform: scale(.82); }
.bxal__cursor svg { width: 100%; height: 100%; display: block; }

.bxal__legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem .9rem; margin-top: 1.1rem; }
.bxal__dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .45rem; vertical-align: middle; }
.bxal__name { font-size: .78rem; color: rgba(255,255,255,.7); display: block; }
.bxal__val { font-size: 1.05rem; font-weight: 700; font-family: var(--font-display); letter-spacing: -.01em; color: #fff; }

.bxal__presets { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; }
.bxal__preset { font-size: .8rem; font-weight: 600; border: 1px solid rgba(255,255,255,.22); background: transparent; color: #fff; padding: .45rem .85rem; border-radius: 999px; cursor: pointer; transition: all .2s; }
.bxal__preset:hover { border-color: var(--rosado); color: var(--rosado); }
.bxal__preset[aria-pressed="true"] { background: var(--magenta); border-color: var(--magenta); color: #fff; }

/* ============ Cómo funciona en 2 columnas (celular + pasos) ============ */
.cf2 { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; margin-top: 2.5rem; }
.cf2__media { position: sticky; top: 14vh; align-self: start; display: flex; justify-content: center; }
.cf2__steps { display: flex; flex-direction: column; }
.cf2__step { min-height: 58vh; display: flex; flex-direction: column; justify-content: center; opacity: .32; transform: translateY(10px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.cf2__step.is-active { opacity: 1; transform: none; }
.cf2__n { font-family: var(--font-display); font-size: .82rem; font-weight: 700; letter-spacing: .02em; text-transform: none; color: var(--magenta); }
.cf2__step h3 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -.02em; line-height: 1.1; margin: .6rem 0 .7rem; }
.cf2__step p { color: var(--text-soft); font-size: 1.08rem; line-height: 1.55; max-width: 44ch; }
@media (max-width: 880px) {
  .cf2 { grid-template-columns: 1fr; gap: 2rem; }
  .cf2__media { position: static; margin-bottom: 1rem; }
  /* Se mantiene la animación guiada (dim/activo por scroll) también en pantallas reducidas */
  .cf2__step { min-height: 42vh; margin-bottom: 1rem; }
}

/* ============ Añadir a Apple Wallet (celular) ============ */
.bxw { display: flex; justify-content: center; perspective: 1400px; }
.bxw__realcard { width: 100%; display: block; border-radius: 12px; box-shadow: 0 18px 40px rgba(96,8,64,.35); }
.bxw__phone { position: relative; width: 300px; height: 600px; border-radius: 44px; background: #0b0410; padding: 12px; box-shadow: 0 40px 90px rgba(96,8,64,.28), 0 0 0 2px rgba(0,0,0,.4) inset; }
.bxw__notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background: #0b0410; border-radius: 0 0 16px 16px; z-index: 6; }
.bxw__screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: linear-gradient(180deg, #f6f6f8 0%, #ececed 100%); }
.bxw__ui { position: absolute; inset: 0; padding: 54px 16px 16px; display: flex; flex-direction: column; }
.bxw__title { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #111; margin: 0 0 14px; }
.bxw__stack { position: relative; height: 92px; margin-bottom: 8px; }
.bxw__stack > div { position: absolute; left: 0; right: 0; height: 120px; border-radius: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.bxw__s1 { top: 0; background: linear-gradient(135deg, #3a3a3c, #1c1c1e); }
.bxw__s2 { top: 22px; background: linear-gradient(135deg, #1d6fe0, #0a4bb0); }
.bxw__slot { margin-top: 70px; height: 190px; position: relative; }
.bxw__fly {
  position: absolute; width: 270px; aspect-ratio: 1.6/1; left: 50%; top: 30px;
  transform: translate(-160%, -10px) rotateZ(-18deg) rotateY(24deg) scale(1.04);
  transform-origin: center; will-change: transform, opacity;
  transition: transform 1.1s cubic-bezier(.22,.61,.36,1), opacity .5s; z-index: 4;
}
.bxw__fly.landed { transform: translate(-50%, 0) rotateZ(0) rotateY(0) scale(1); }
.bxw__fly .bink-card { width: 100%; animation: none; transform: none; box-shadow: 0 18px 40px rgba(96,8,64,.35); }

.bxw__btn { margin-top: auto; width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem; background: #000; color: #fff; border: 0; border-radius: 14px; padding: .85rem; font-weight: 600; font-size: .95rem; font-family: inherit; cursor: pointer; transition: background .45s var(--ease), box-shadow .45s var(--ease), transform .25s var(--ease); }
.bxw__btn:active { transform: scale(.98); }
.bxw__ic { position: relative; width: 18px; height: 18px; display: inline-grid; place-items: center; }
.bxw__ic svg { position: absolute; width: 18px; height: 18px; transition: opacity .3s, transform .3s; }
.bxw__ic .ic-check { opacity: 0; transform: scale(.4); }
.bxw__label { transition: opacity .25s; }
.bxw__btn.done { background: var(--success-300); box-shadow: 0 10px 26px rgba(41,167,74,.38); cursor: default; }
.bxw__btn.done .ic-plus { opacity: 0; transform: scale(.4) rotate(90deg); }
.bxw__btn.done .ic-check { opacity: 1; transform: scale(1); stroke-dasharray: 26; stroke-dashoffset: 26; animation: bxwCheck .5s var(--ease) .12s forwards; }
@keyframes bxwCheck { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .bxw__btn.done .ic-check { animation: none; stroke-dashoffset: 0; } }

/* ---- Monto mensual editable del asignador (paginas de industria) ---- */
.bxal__amount { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1.15rem; }
.bxal__amount label { font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.6); }
.bxal__inwrap { position: relative; max-width: 300px; }
.bxal__inwrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.45); font-size: .9rem; font-weight: 600; pointer-events: none; }
.bxal__amount input { width: 100%; box-sizing: border-box; padding: .7rem 1rem .7rem 3.2rem; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; font-family: inherit; font-size: 1.05rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; background: rgba(255,255,255,.06); transition: border-color .2s; }
.bxal__amount input:focus { outline: none; border-color: var(--magenta); }
