/* Dinámicas de closecr.com (ver efectos.js) */

/* ============ 1) Comparador antes / después ============ */
.xp-ba {
  background: var(--panel, #0e1613);
  border: 1px solid var(--line, rgba(244,244,240,0.12));
  border-radius: 20px;
  padding: 16px 16px 14px;
  width: 100%;
  position: relative;
}
.ba-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 4px 12px; }
.ba-title { font: 700 11.5px 'Poppins', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--gold, #d4af59); }
.ba-ill { font: 500 11px 'Inter', sans-serif; color: rgba(244,244,240,.5); }
.ba-stage { position: relative; --p: 50%; border-radius: 14px; overflow: hidden; background: #0b0f0d; user-select: none; touch-action: pan-y; }
.ba-pane { padding: 16px 16px 14px; min-height: 330px; display: flex; flex-direction: column; gap: 8px; }
.ba-after { background: linear-gradient(160deg, #0f2b21 0%, #0c1f18 100%); }
.ba-before { position: absolute; inset: 0; background: #161a19; clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.ba-tag { align-self: flex-start; font: 700 10.5px 'Poppins', sans-serif; letter-spacing: .16em; padding: 5px 11px; border-radius: 999px; }
.ba-before .ba-tag { background: rgba(244,244,240,.1); color: rgba(244,244,240,.7); }
.ba-after .ba-tag { background: rgba(0,163,108,.2); color: #34d399; border: 1px solid rgba(0,163,108,.45); }
.ba-after .ba-tag { align-self: flex-end; }
.ba-row { display: grid; grid-template-columns: 62px 1fr auto 86px; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 10px; font: 500 12.5px 'Inter', sans-serif; white-space: nowrap; }
.ba-before .ba-row { background: rgba(244,244,240,.05); color: rgba(244,244,240,.55); border: 1px dashed rgba(244,244,240,.14); }
.ba-after .ba-row { background: rgba(0,163,108,.1); color: rgba(244,244,240,.9); border: 1px solid rgba(0,163,108,.25); }
.ba-row b { font-weight: 600; }
.ba-st { font: 600 11px 'Poppins', sans-serif; text-align: right; }
.ba-before .ba-st { color: rgba(244,244,240,.45); }
.ba-before .ba-bad { color: #f87171; }
.ba-before .ba-row.bad { border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.08); }
.ba-after .ba-st { color: #34d399; }
.ba-time { margin-top: auto; padding: 4px 4px 0; font: 800 38px/1 'Poppins', sans-serif; letter-spacing: -.01em; }
.ba-time small { font: 600 12px 'Poppins', sans-serif; letter-spacing: .06em; text-transform: uppercase; margin-left: 8px; opacity: .7; }
.ba-before .ba-time { color: rgba(244,244,240,.5); }
.ba-after .ba-time { color: #34d399; text-align: right; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; background: var(--cream, #f4f4f0); box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.ba-handle span { position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: var(--cream, #f4f4f0); box-shadow: 0 6px 18px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.ba-handle span::before, .ba-handle span::after { content: ""; border: solid #0a0c0b; border-width: 0 2.5px 2.5px 0; width: 7px; height: 7px; display: inline-block; }
.ba-handle span::before { transform: rotate(135deg); margin-right: 5px; }
.ba-handle span::after { transform: rotate(-45deg); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.ba-foot { margin: 10px 4px 0; font: 500 12px 'Inter', sans-serif; color: rgba(244,244,240,.55); text-align: center; }
@media (max-width: 520px) {
  .ba-row { grid-template-columns: 1fr auto 74px; }
  .ba-row > :first-child { display: none; }
  .ba-time { font-size: 30px; }
}

/* ============ 2) Subrayado dibujado a mano ============ */
.xp-hw { position: relative; display: inline-block; }
.xp-hand { position: absolute; left: -2%; bottom: -.14em; width: 104%; height: .34em; overflow: visible; pointer-events: none; }
.xp-hand path { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 420; }
.xp-hw.draw .xp-hand path { animation: xpDraw 1.1s cubic-bezier(.6,.1,.2,1) .35s forwards; }
.xp-hw .xp-hand.gold { color: var(--gold, #d4af59); }
.xp-hw .xp-hand.cream { color: rgba(244,244,240,.9); }
@keyframes xpDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .xp-hand path { stroke-dashoffset: 0; animation: none !important; } }

/* ============ 3) Polaroids ============ */
.xp-pol { position: absolute; right: 0; top: 0; width: 470px; height: 230px; z-index: 3; display: none; }
@media (min-width: 1180px) { .xp-pol { display: block; } }
.pol { position: absolute; display: block; width: 140px; padding: 8px 8px 30px; background: #f6f3ec; border-radius: 3px; box-shadow: 0 14px 28px rgba(0,0,0,.5); text-decoration: none; color: #1a1a1a; transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s; }
.pol img { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #ddd; }
.pol .cap { position: absolute; left: 8px; right: 8px; bottom: 5px; text-align: center; font: 600 15px/1 'Caveat', 'Segoe Script', cursive; color: #2b2b2b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pol::before { content: ""; position: absolute; top: -9px; left: 50%; width: 50px; height: 16px; margin-left: -25px; background: rgba(212,175,89,.55); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.pol:hover { box-shadow: 0 20px 36px rgba(0,0,0,.6); z-index: 5; }
.pol-1 { left: 0; top: 24px; transform: rotate(-7deg); }
.pol-2 { left: 150px; top: 0; transform: rotate(3deg); z-index: 2; width: 160px; }
.pol-3 { left: 318px; top: 28px; transform: rotate(-3deg); }
.pol-1:hover { transform: rotate(-3deg) translateY(-6px) scale(1.04); }
.pol-2:hover { transform: rotate(0deg) translateY(-6px) scale(1.04); }
.pol-3:hover { transform: rotate(0deg) translateY(-6px) scale(1.04); }
.pol-ig img { aspect-ratio: 4/5; }
.pol-ig .cap { font-size: 13px; }

/* ============ 4) Chat de ejemplo ============ */
.xp-chat { margin: 26px 0 8px; }
.xp-chat h3 { margin: 0 0 4px; }
.xp-chat .chat-sub { font-size: 14px; color: rgba(244,244,240,.6); margin-bottom: 14px; }
.chat { max-width: 420px; background: #0b1410; border: 1px solid var(--line, rgba(244,244,240,.14)); border-radius: 22px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #10211a; border-bottom: 1px solid rgba(244,244,240,.08); }
.chat-av { width: 34px; height: 34px; border-radius: 50%; background: var(--green, #00a36c); color: #fff; display: flex; align-items: center; justify-content: center; font: 700 14px 'Poppins', sans-serif; }
.chat-nm { font: 600 13.5px 'Poppins', sans-serif; line-height: 1.2; }
.chat-nm small { display: block; font: 500 11px 'Inter', sans-serif; color: #34d399; }
.chat-msgs { height: 300px; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; background: radial-gradient(circle at 20% 0%, rgba(0,163,108,.07), transparent 60%); }
.cm { max-width: 82%; padding: 8px 12px; border-radius: 14px; font: 500 13.5px/1.4 'Inter', sans-serif; animation: cmIn .3s ease both; }
.cm.bot { align-self: flex-start; background: #17261f; border-top-left-radius: 4px; color: rgba(244,244,240,.92); }
.cm.me { align-self: flex-end; background: #0b6b4b; border-top-right-radius: 4px; color: #fff; }
.cm.note { align-self: center; max-width: 94%; background: transparent; border: 1px dashed rgba(212,175,89,.45); color: var(--gold, #d4af59); font-size: 12px; text-align: center; border-radius: 10px; }
.cm.typing { display: inline-flex; gap: 4px; align-items: center; }
.cm.typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(244,244,240,.55); animation: cmDot 1s infinite; }
.cm.typing i:nth-child(2) { animation-delay: .15s; } .cm.typing i:nth-child(3) { animation-delay: .3s; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid rgba(244,244,240,.08); background: #0d1812; min-height: 58px; }
.chip { font: 600 12.5px 'Inter', sans-serif; color: var(--cream, #f4f4f0); background: transparent; border: 1px solid rgba(0,163,108,.55); border-radius: 999px; padding: 7px 13px; cursor: pointer; transition: background .2s, transform .2s; }
.chip:hover { background: rgba(0,163,108,.18); transform: translateY(-1px); }
.chat-reset { margin-left: auto; font: 500 11.5px 'Inter', sans-serif; color: rgba(244,244,240,.5); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@keyframes cmIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cmDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ============ 5) Mapa de herramientas conectadas ============ */
.xp-map { margin: 26px 0 8px; }
.xp-map h2 { margin-top: 36px; }
.map-box { background: var(--panel, #0e1613); border: 1px solid var(--line, rgba(244,244,240,.12)); border-radius: 20px; padding: 10px; }
.map-box svg { width: 100%; height: auto; display: block; }
.map-box .ln { stroke: rgba(0,163,108,.55); stroke-width: 1.6; stroke-dasharray: 5 7; animation: mapFlow 2.6s linear infinite; }
.map-box .nd { fill: #101c17; stroke: rgba(244,244,240,.18); stroke-width: 1.2; }
.map-box .nt { fill: #f4f4f0; font: 600 13px 'Poppins', sans-serif; text-anchor: middle; }
.map-box .ns { fill: rgba(244,244,240,.55); font: 500 10.5px 'Inter', sans-serif; text-anchor: middle; }
.map-box .hub { fill: #0f2b21; stroke: #00a36c; stroke-width: 1.6; }
.map-box .hubt { fill: #f4f4f0; font: 800 15px 'Poppins', sans-serif; text-anchor: middle; letter-spacing: .06em; }
.map-box .ic { fill: none; stroke: #34d399; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes mapFlow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .map-box .ln { animation: none; } }
