/* public/css/asistente.css — ventana del asistente web (MISMO archivo en Mega y DECORO; el color llega en --as-b). */
.as-root { --as-b: #793879; --as-bs: color-mix(in srgb, var(--as-b) 12%, white); --as-line: #e8e2ea; font-family: inherit; }
.as-root *, .as-root *::before, .as-root *::after { box-sizing: border-box; }
.as-fab { position: fixed; right: 16px; bottom: calc(var(--am-nav, 0px) + 16px + env(safe-area-inset-bottom)); z-index: 2147483000; background: var(--as-b); color: #fff; border: 0; border-radius: 28px; padding: 12px 18px; font-weight: 700; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.3); cursor: pointer; min-height: 48px; }
.as-fab.as-hide { display: none; }
.as-panel { position: fixed; right: 14px; bottom: 14px; top: 14px; width: 392px; max-width: calc(100% - 28px); background: #fff; color: #1f1722; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35); z-index: 2147483001; display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--as-line); }
.as-panel.as-open { display: flex; }
@media (max-width: 767px) { .as-panel { inset: 0; width: auto; max-width: none; border-radius: 0; height: 100dvh; } }
.as-head { background: var(--as-b); color: #fff; padding: 11px 14px; display: flex; align-items: center; gap: 10px; padding-top: calc(11px + env(safe-area-inset-top)); }
.as-av { width: 34px; height: 34px; border-radius: 50%; background: #fff3; display: grid; place-items: center; font-size: 18px; }
.as-tt { flex: 1; line-height: 1.15; } .as-tt b { display: block; font-size: 15px; } .as-tt small { opacity: .88; font-size: 11px; }
.as-cl { background: #fff2; border: 0; color: #fff; border-radius: 8px; width: 44px; height: 44px; font-size: 16px; cursor: pointer; }
.as-msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 9px; background: #faf8fb; overscroll-behavior: contain; }
/* scroll con los colores del tema de cada tienda (solo aparece si hay mucha conversación) */
.as-msgs, .as-root * { scrollbar-width: thin; scrollbar-color: var(--as-b) var(--as-bs); }
.as-msgs::-webkit-scrollbar { width: 7px; } .as-msgs::-webkit-scrollbar-track { background: var(--as-bs); border-radius: 8px; } .as-msgs::-webkit-scrollbar-thumb { background: var(--as-b); border-radius: 8px; }
.as-m { max-width: 90%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.35; word-wrap: break-word; white-space: pre-wrap; }
.as-u { align-self: flex-end; background: var(--as-b); color: #fff; border-bottom-right-radius: 4px; }
.as-b { align-self: flex-start; background: #fff; border: 1px solid var(--as-line); border-bottom-left-radius: 4px; }
.as-sys { align-self: center; background: #f0eaf2; color: #6b5a72; font-size: 12px; border-radius: 12px; padding: 4px 10px; }
.as-src { display: block; font-size: 10px; margin-top: 5px; color: #6b6270; }
.as-cards { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.as-pc { display: flex; gap: 9px; align-items: center; border: 1px solid var(--as-line); border-radius: 10px; padding: 7px; background: #fff; }
.as-im, .as-th { width: 48px; height: 48px; border-radius: 9px; display: grid; place-items: center; background: #f4eff5; flex: none; overflow: hidden; font-size: 22px; }
.as-im img, .as-th img { width: 100%; height: 100%; object-fit: cover; }
.as-tx { flex: 1; font-size: 12.5px; line-height: 1.25; } .as-tx b { font-size: 13px; }
.as-pr { font-weight: 800; color: var(--as-b); white-space: nowrap; font-size: 13px; }
.as-res { margin-top: 8px; border: 1px solid var(--as-line); border-radius: 10px; overflow: hidden; font-size: 12px; background: #fff; }
.as-r { display: grid; grid-template-columns: 48px 1fr auto 32px; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #f1ecf3; align-items: center; }
.as-r small { color: #8b8190; } .as-x { border: 0; background: none; color: #8b8190; font-size: 14px; min-height: 32px; cursor: pointer; }
.as-tot { padding: 8px; display: flex; justify-content: space-between; font-weight: 800; background: var(--as-bs); }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.as-chip { border: 1.5px solid var(--as-b); background: #fff; color: var(--as-b); border-radius: 18px; padding: 9px 13px; font-size: 13px; font-weight: 600; min-height: 44px; cursor: pointer; text-align: left; }
.as-chip.as-pri { background: var(--as-b); color: #fff; }
.as-ho { margin-top: 8px; border: 1.5px solid #25a244; border-radius: 10px; padding: 9px; background: #f1fbf4; font-size: 12.5px; }
.as-rs { margin: 6px 0; padding: 6px 8px; background: #fff; border-radius: 8px; font-size: 12px; color: #444; }
.as-wa { display: block; text-align: center; background: #25a244; color: #fff; border-radius: 9px; padding: 11px; font-weight: 700; text-decoration: none; min-height: 44px; }
.as-note { font-size: 11.5px; color: #6b5a72; margin-top: 6px; }
.as-lnk { display: inline-block; margin: 6px 8px 0 0; color: var(--as-b); font-size: 12.5px; font-weight: 600; }
.as-foot { border-top: 1px solid var(--as-line); padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); background: #fff; position: relative; }
.as-row { display: flex; gap: 6px; align-items: flex-end; }
.as-in { flex: 1; border: 1.5px solid var(--as-line); border-radius: 18px; padding: 10px 14px; font: inherit; font-size: 16px; resize: none; max-height: 96px; min-height: 44px; }
.as-in:focus { outline: 2px solid var(--as-b); border-color: transparent; }
.as-clip, .as-send { width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 18px; cursor: pointer; flex: none; }
.as-clip { background: var(--as-bs); } .as-send { background: var(--as-b); color: #fff; }
.as-menu { position: absolute; left: 8px; bottom: calc(60px + env(safe-area-inset-bottom)); background: #fff; border: 1px solid var(--as-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 6px; display: none; flex-direction: column; min-width: 240px; }
.as-menu.as-open { display: flex; } .as-menu button { border: 0; background: none; text-align: left; padding: 11px 10px; border-radius: 8px; font-size: 14px; min-height: 44px; cursor: pointer; }
.as-menu button:hover { background: var(--as-bs); }
.as-busy .as-send { opacity: .5; }

/* mientras el asistente está abierto en celular, la página de atrás no se mueve */
html.as-lock, html.as-lock body { overflow: hidden !important; overscroll-behavior: none; }

/* ligas con clic, negritas e imágenes dentro de los mensajes */
.as-b a.as-a { color: var(--as-b); font-weight: 600; text-decoration: underline; word-break: break-word; }
.as-b b { font-weight: 700; }
.as-m img.as-img { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 6px 0; }
.as-m { line-height: 1.45; }

/* foto del cliente en la conversación */
.as-u img.as-ph { display: block; max-width: 100%; max-height: 260px; width: auto; border-radius: 10px; margin: 0 0 4px; }
.as-sys a.as-new { color: inherit; font-weight: 600; text-decoration: underline; }

/* ---- acciones en un toque ---- */
.as-btns { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.as-b a.as-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--as-b); background: #fff; color: var(--as-b); font-weight: 700; font-size: 14px; text-decoration: none; box-sizing: border-box; }
.as-b a.as-btn.as-pri { background: var(--as-b); color: #fff; }
.as-b a.as-btn.as-t-wa { background: #25d366; border-color: #25d366; color: #fff; }
.as-b a.as-btn:active { transform: scale(.98); }
.as-bi { font-size: 18px; line-height: 1; }
.as-b a.as-tel { white-space: nowrap; }
.as-pc .as-pl { display: contents; color: inherit; text-decoration: none; }
.as-pc small.as-ver { display: block; color: var(--as-b); font-weight: 600; margin-top: 2px; }
