/* ════════════════════════════════════════════════════════════════
   ASISTENTE TIPO CHAT · /css/asistente-chat.css  (2026-10-05)
   Mismo diseño que el asistente de stickers, con prefijo rs-chat-.
   Lo usa /impresion-canvas-fotos/ (js/asistente-canvas-fotos.js).
   ════════════════════════════════════════════════════════════════ */

/* ── Bloque compacto sobre el cotizador: ayuda opcional ── */
.rs-chat-lz{ display:grid; grid-template-columns:auto minmax(0,1fr) minmax(260px,1.1fr); gap:10px 16px; align-items:center;
  max-width:980px; margin:0 0 clamp(1.6rem,3vw,2.2rem); padding:14px 16px; border:1px solid var(--c-ln,#e6e2d7); border-radius:16px; background:#fff;
  font-family:var(--ff-body,inherit); }
.rs-chat-lz[hidden]{ display:none !important; }
.rs-chat-lz .rs-chat-av{ width:42px; height:42px; }
.rs-chat-lz-txt b{ display:block; font-size:1rem; font-weight:600; color:#1a1814; }
.rs-chat-lz-txt span{ display:block; margin-top:2px; font-size:.86rem; line-height:1.4; color:#5f5b52; }
.rs-chat-lz-in{ display:flex; align-items:center; gap:10px; width:100%; min-height:48px; margin:0; padding:0 6px 0 16px; border:1.5px solid #1a1814; border-radius:999px;
  background:#fff; font:inherit; text-align:left; cursor:text; transition:box-shadow .25s ease; }
.rs-chat-lz-in span{ flex:1 1 auto; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#8d897e; font-size:.92rem; }
.rs-chat-lz-in i{ flex:none; display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#1a1814; color:#bdff06; }
.rs-chat-lz-in:hover, .rs-chat-lz-in:focus-visible{ box-shadow:0 0 0 4px rgba(189,255,6,.45); outline:none; }
/* (2026-10-05) El campo del bloque es real: se escribe aquí y al enviar se abre el chat */
.rs-chat-lz-form{ cursor:text; }
.rs-chat-lz-form:focus-within{ box-shadow:0 0 0 4px rgba(189,255,6,.45); }
.rs-chat-lz-form input{ flex:1 1 auto; min-width:0; height:44px; margin:0; padding:0; border:0; outline:0; background:transparent; font:inherit; font-size:16px; color:#1a1814; }
.rs-chat-lz-form input::placeholder{ color:#8d897e; }
.rs-chat-lz-form button{ flex:none; display:grid; place-items:center; width:36px; height:36px; margin:0; padding:0; border:0; border-radius:50%; background:#1a1814; color:#bdff06; cursor:pointer; }
.rs-chat-lz--col{ grid-template-columns:auto minmax(0,1fr); }
.rs-chat-lz--col .rs-chat-lz-in, .rs-chat-lz--col .rs-chat-lz-rap{ grid-column:1 / -1; }
.rs-chat-sacude{ animation:rsChatSacude .35s ease; }
@keyframes rsChatSacude{ 20%,60%{ transform:translateX(-4px); } 40%,80%{ transform:translateX(4px); } }
.rs-chat-lz-rap{ grid-column:2 / -1; display:flex; flex-wrap:wrap; gap:6px; }
.rs-chat-lz-rap button{ margin:0; padding:6px 12px; border:1px solid #d5d0c3; border-radius:999px; background:#fafaf6; color:#1a1814; font:inherit; font-size:.82rem; cursor:pointer; transition:border-color .2s ease, background .2s ease; }
.rs-chat-lz-rap button:hover{ border-color:#1a1814; background:#f5fbe8; }
html.rs-chat-abierto .rs-chat-lz{ opacity:.4; pointer-events:none; transition:opacity .2s ease; }
@media (max-width:900px){
  .rs-chat-lz{ grid-template-columns:auto minmax(0,1fr); }
  .rs-chat-lz-in, .rs-chat-lz-rap{ grid-column:1 / -1; }
}

/* ── Botón discreto en la barra inferior del cotizador ── */
.cf-bar-btns .cf-bar-chat{ background:transparent; color:#f3f0e7; border:1px solid rgba(243,240,231,.35) !important; }
.cf-bar-btns .cf-bar-chat:hover{ border-color:#bdff06 !important; color:#bdff06; }
.cf-bar-chat[hidden], html.cf-hoja-on .cf-bar-chat{ display:none !important; }
@media (max-width:720px){ .cf-bar-btns .cf-bar-chat{ padding:11px 12px; } .cf-bar-chat span{ display:none; } }

/* ── Enlace en las fichas de la guía de materiales ── */
.rs-ficha__chat{ display:block; margin:.8rem 0 0; padding:0; border:0; background:none; font-family:var(--ff-body,inherit); font-size:.82rem; color:#5a8200; text-align:left; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.rs-ficha__chat:hover{ color:#1a1814; }

/* ── Ventana del chat: panel compacto en escritorio, pantalla completa en el celular ── */
.rs-chat{ position:fixed; right:20px; bottom:20px; z-index:2147482700; display:flex; flex-direction:column; width:420px; max-width:calc(100vw - 32px);
  height:min(640px, calc(100vh - 40px)); border-radius:18px; overflow:hidden; background:#fff; box-shadow:0 24px 70px rgba(20,18,15,.28), 0 0 0 1px rgba(20,18,15,.06);
  font-family:var(--ff-body,inherit); animation:rsChatIn .25s cubic-bezier(.22,.61,.36,1); }
.rs-chat[hidden]{ display:none !important; }
.rs-chat *, .rs-chat *::before, .rs-chat *::after{ box-sizing:border-box; }
@keyframes rsChatIn{ from{ opacity:0; transform:translateY(16px) scale(.98); } to{ opacity:1; transform:none; } }
html.rs-chat-abierto .cf-bar{ visibility:hidden; }
.rs-chat-cab{ display:flex; align-items:center; gap:12px; padding:14px 16px; background:#1a1814; color:#fff; }
.rs-chat-av{ flex:none; display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:#bdff06; color:#1a1814; font-weight:800; font-size:.85rem; }
.rs-chat-cab b{ display:block; font-size:1rem; font-weight:600; }
.rs-chat-cab small{ display:flex; align-items:center; gap:6px; font-size:.76rem; color:rgba(255,255,255,.72); }
.rs-chat-cab small i{ width:8px; height:8px; border-radius:50%; background:#25D366; }
.rs-chat-x{ margin-left:auto; flex:none; width:40px; height:40px; border:0; border-radius:50%; background:rgba(255,255,255,.12); color:#fff; font-size:26px; line-height:40px; cursor:pointer; }
.rs-chat-x:hover{ background:rgba(255,255,255,.22); }
.rs-chat-msgs{ flex:1 1 auto; min-height:0; display:flex; flex-direction:column; gap:8px; overflow-y:auto; padding:16px 14px; background:#f3f2ec; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.rs-chat-m{ display:flex; flex-direction:column; max-width:88%; }
.rs-chat-m.bot{ align-self:flex-start; }
.rs-chat-m.yo{ align-self:flex-end; }
.rs-chat-m .burbuja{ padding:10px 13px; border-radius:16px; font-size:.93rem; line-height:1.45; color:#1a1814; text-align:left; }
.rs-chat-m.bot .burbuja{ background:#fff; border-top-left-radius:4px; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.rs-chat-m.yo .burbuja{ background:#e6f9c4; border-top-right-radius:4px; }
.rs-chat-m .burbuja small{ display:block; margin-top:5px; font-size:.82rem; color:#5f5b52; }
.rs-chat-m .burbuja b{ font-weight:600; }
.rs-chat-foto{ display:block; width:100%; max-width:300px; aspect-ratio:4/3; object-fit:cover; margin:0 0 8px; border-radius:10px; background:#eee; }
/* Imágenes pequeñas: ayudan a reconocer el material sin alargar la conversación */
.rs-chat-ficha{ display:flex; align-items:center; gap:10px; margin:0 0 6px; }
.rs-chat-ficha img{ flex:none; width:56px; height:56px; object-fit:cover; border-radius:8px; background:#eee; }
.rs-chat-ficha span{ display:flex; flex-direction:column; min-width:0; }
.rs-chat-ficha i{ font-style:normal; font-size:.8rem; color:#5a8200; }
.rs-chat-chips button.con-img{ display:inline-flex; align-items:center; gap:7px; padding:4px 12px 4px 4px; }
.rs-chat-chips button img{ flex:none; width:26px; height:26px; object-fit:cover; border-radius:50%; background:#eee; }
.rs-chat-cot > div.ln{ align-items:center; }
.rs-chat-cot > div.ln img{ flex:none; width:34px; height:34px; object-fit:cover; border-radius:6px; background:#eee; }
.rs-chat-cot > div.ln span{ flex:1 1 auto; min-width:0; }
.rs-chat-m.escribiendo .dots{ display:inline-flex; gap:4px; padding:12px 14px; background:#fff; border-radius:16px; border-top-left-radius:4px; }
.rs-chat-m .dots i{ width:7px; height:7px; border-radius:50%; background:#9a968a; animation:rsChatDot 1s infinite ease-in-out; }
.rs-chat-m .dots i:nth-child(2){ animation-delay:.15s; } .rs-chat-m .dots i:nth-child(3){ animation-delay:.3s; }
@keyframes rsChatDot{ 0%,80%,100%{ opacity:.35; transform:none; } 40%{ opacity:1; transform:translateY(-3px); } }
.rs-chat-chips{ display:flex; flex-wrap:wrap; gap:6px; padding:2px 0 4px; }
.rs-chat-chips button{ margin:0; padding:8px 12px; border:1.5px solid #1a1814; border-radius:999px; background:#fff; color:#1a1814; font:inherit; font-size:.85rem; font-weight:500; cursor:pointer; text-align:left; }
.rs-chat-chips button:hover{ background:#f5fbe8; }
.rs-chat-chips button.pri{ background:#bdff06; border-color:#bdff06; }
/* Tarjeta «Tu pedido» */
.rs-chat-m.bot:has(.rs-chat-cot){ width:100%; max-width:440px; }
.rs-chat-cot{ margin-top:8px; padding:12px 14px; border-radius:14px; background:#fff; border:1.5px solid #1a1814; }
.rs-chat-cot .k{ margin:0 0 4px; font-size:.7rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:#8d897e; }
.rs-chat-cot > div{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:6px 0; border-bottom:1px solid #eee; font-size:.88rem; }
.rs-chat-cot > div span{ color:#1a1814; }
.rs-chat-cot > div span em{ display:block; font-style:normal; font-size:.8rem; color:#8d897e; }
.rs-chat-cot > div b{ text-align:right; white-space:nowrap; font-weight:600; }
.rs-chat-cot > div.sm span{ color:#8d897e; }
.rs-chat-cot .tot{ border:0; margin-top:6px; padding:10px 12px; border-radius:10px; background:#1a1814; align-items:center; }
.rs-chat-cot .tot span{ color:rgba(255,255,255,.8); font-size:.76rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.rs-chat-cot .tot b{ color:#bdff06; font-size:1.35rem; }
.rs-chat-cot .acc{ display:grid; grid-template-columns:1fr 1fr; gap:8px; border:0; margin-top:8px; padding:0; }
.rs-chat-cot .acc button{ min-height:44px; margin:0; border-radius:10px; font:inherit; font-size:.88rem; font-weight:600; cursor:pointer; }
.rs-chat-cot .acc .wa{ background:#25D366; color:#fff; border:0; }
.rs-chat-cot .acc .ped{ background:#fff; color:#1a1814; border:1.5px solid #1a1814; }
.rs-chat-cot .nota{ margin:8px 0 0; font-size:.76rem; line-height:1.4; color:#8d897e; }
/* Escribir */
.rs-chat-in{ display:flex; gap:8px; margin:0; padding:10px 12px; background:#fff; border-top:1px solid #e6e2d7; }
.rs-chat-in textarea{ flex:1 1 auto; min-width:0; height:46px; min-height:46px; max-height:120px; margin:0; padding:12px 16px; border:1.5px solid #d5d0c3; border-radius:23px; font:inherit; font-size:16px; line-height:1.3; color:#1a1814; background:#fff; resize:none; overflow-y:auto; }
.rs-chat-in textarea:focus{ outline:none; border-color:#1a1814; }
.rs-chat-in{ align-items:flex-end; }
.rs-chat-in button{ flex:none; width:46px; height:46px; margin:0; border:0; border-radius:50%; background:#1a1814; color:#bdff06; cursor:pointer; display:grid; place-items:center; }
.rs-chat-alt{ display:block; margin:0; padding:8px 8px calc(10px + env(safe-area-inset-bottom,0px)); border:0; background:#fff; color:#5f5b52; font:inherit; font-size:.82rem; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
@media (max-width:720px){
  .rs-chat{ inset:0; right:0; bottom:0; width:100%; max-width:none; height:100%; height:100dvh; border-radius:0; }
  html.rs-chat-abierto, html.rs-chat-abierto body{ overflow:hidden; }
  .rs-chat-msgs{ padding:12px 10px; }
  .rs-chat-m{ max-width:94%; }
  .rs-chat-cot .acc{ grid-template-columns:1fr; }
}
/* Mensajes que llegan con calma */
.rs-chat-m.entra, .rs-chat-chips.entra{ animation:rsChatMsg .35s cubic-bezier(.22,.61,.36,1) both; }
@keyframes rsChatMsg{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
.rs-chat-ficha em{ display:block; font-style:normal; font-size:.86rem; line-height:1.4; color:#5f5b52; margin-top:2px; }
.rs-chat-msgs{ scroll-behavior:smooth; }

/* ── Invitación flotante «¿Necesitas ayuda con tu cotización?» ── */
/* Contenedor del bloque en home y categorías */
.rs-chat-lz-w{ max-width:960px; margin:28px auto; padding:0 16px; box-sizing:border-box; }

/* Tarjetas de producto del asistente general (llevan a la página interna) */
.rs-chat-prods{ display:flex; flex-direction:column; gap:8px; width:100%; max-width:400px; margin-top:6px; }
.rs-chat-prod{ display:flex; align-items:center; gap:12px; padding:8px; border:1.5px solid #e2e4dc; border-radius:14px; background:#fff; color:#1a1814 !important; text-decoration:none !important;
  transition:border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.rs-chat-prod:hover{ border-color:#1a1814; transform:translateY(-1px); box-shadow:0 6px 16px rgba(20,18,15,.10); }
.rs-chat-prod img, .rs-chat-prod-sin{ flex:none; width:64px; height:64px; border-radius:10px; object-fit:cover; background:#f0f1ec; }
.rs-chat-prod-sin{ display:grid; place-items:center; font-weight:800; color:#1a1814; background:#bdff06; }
.rs-chat-prod-t{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.rs-chat-prod-t b{ font-size:.95rem; line-height:1.25; }
.rs-chat-prod-t em{ font-style:normal; font-size:.8rem; color:#4d6a12; font-weight:600; }
.rs-chat-prod-t i{ font-style:normal; font-size:.8rem; font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.rs-chat-m.bot:has(.rs-chat-prods){ width:100%; max-width:420px; }
/* Con el lanzador del asistente, el antiguo botón flotante «Cotiza por WhatsApp» sobra:
   el chat ya termina en WhatsApp con el mensaje escrito. */
html.rs-chat-lanzador-on .btn-whatsapp{ display:none !important; }

/* Botón «Ayúdame a cotizar» en las barras fijas de abajo */
.rs-chat-barbtn{ flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; min-height:44px; margin:0; padding:0 16px; border:1.5px solid #111; border-radius:999px; background:#fff; color:#111;
  font:inherit; font-family:var(--ff-body,inherit); font-size:.88rem; font-weight:700; line-height:1; white-space:nowrap; cursor:pointer; transition:background .2s ease, transform .2s ease; }
.rs-chat-barbtn:hover{ background:#f5fbe8; transform:translateY(-1px); }
.rs-chat-barbtn:focus-visible{ outline:3px solid #9ad900; outline-offset:2px; }
.rs-chat-barbtn svg{ display:block; flex:none; }
@media (max-width:720px){ .rs-chat-barbtn{ width:44px; padding:0; justify-content:center; } .rs-chat-barbtn span{ display:none; } }

/* Lanzador flotante a la DERECHA con aspecto de WhatsApp (es lo que el cliente reconoce).
   Abre el asistente, que termina en WhatsApp con el pedido ya escrito. */
.rs-chat-nudge{ position:fixed; right:20px; bottom:24px; z-index:2147482650; display:flex; align-items:center; gap:6px;
  opacity:0; transform:translateY(14px) scale(.96); transform-origin:right bottom;
  transition:opacity .35s ease, transform .35s cubic-bezier(.22,.61,.36,1), bottom .3s ease; pointer-events:none;
  font-family:var(--ff-body,inherit); }
.rs-chat-nudge[hidden]{ display:none !important; }
.rs-chat-nudge.on{ opacity:1; transform:none; pointer-events:auto; }
html.rs-chat-abierto .rs-chat-nudge, html.stk-chat-abierto .rs-chat-nudge{ display:none !important; }
.rs-chat-nudge-in{ display:flex; align-items:center; gap:10px; margin:0; padding:0; border:0; background:none; color:#111; font:inherit; text-align:left; cursor:pointer; }
.rs-chat-nudge-in:focus-visible{ outline:3px solid #25D366; outline-offset:4px; border-radius:999px; }
.rs-chat-nudge-ico{ position:relative; flex:none; display:grid; place-items:center; width:60px; height:60px; border-radius:50%; background:#25D366; border:3px solid #fff;
  box-shadow:0 10px 26px rgba(0,0,0,.25); transition:transform .2s ease; }
.rs-chat-nudge-in:hover .rs-chat-nudge-ico{ transform:scale(1.06); }
.rs-chat-nudge-ico::before{ content:''; position:absolute; inset:-7px; border-radius:50%; border:2px solid rgba(37,211,102,.55); animation:rsChatPulso 2.6s ease-out 3; }
@keyframes rsChatPulso{ from{ transform:scale(.9); opacity:1; } to{ transform:scale(1.3); opacity:0; } }
.rs-chat-nudge-lbl{ padding:9px 16px; border:2px solid #128C3E; border-radius:999px; background:#fff; color:#111; font-weight:800; font-size:.95rem; white-space:nowrap; box-shadow:0 6px 18px rgba(0,0,0,.14); }
.rs-chat-nudge-txt{ max-width:270px; overflow:hidden; padding:10px 16px; border-radius:18px 18px 4px 18px; background:#1a1814; color:#fff; box-shadow:0 14px 34px rgba(20,18,15,.28);
  transition:max-width .35s ease, opacity .25s ease; }
.rs-chat-nudge-txt b{ display:block; font-size:.92rem; font-weight:600; white-space:nowrap; }
.rs-chat-nudge-txt small{ display:block; font-size:.78rem; color:rgba(255,255,255,.75); white-space:nowrap; }
.rs-chat-nudge-x{ align-self:flex-start; width:24px; height:24px; margin:0; padding:0; border:0; border-radius:50%; background:#fff; color:#1a1814; font-size:16px; line-height:24px; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.18); }
.rs-chat-nudge:not(.mini) .rs-chat-nudge-lbl, .rs-chat-nudge.sobre-barra .rs-chat-nudge-lbl{ display:none; }
.rs-chat-nudge.mini .rs-chat-nudge-txt{ display:none; }
.rs-chat-nudge.mini .rs-chat-nudge-x{ display:none; }
@media (max-width:720px){
  .rs-chat-nudge{ right:12px; bottom:16px; max-width:calc(100vw - 24px); }
  .rs-chat-nudge-ico{ width:56px; height:56px; }
  .rs-chat-nudge-lbl{ display:none; }
  .rs-chat-nudge-txt{ max-width:calc(100vw - 120px); }
  .rs-chat-nudge-txt b{ font-size:.86rem; white-space:normal; }
}

@media (prefers-reduced-motion:reduce){ .rs-chat{ animation:none; } .rs-chat-m .dots i{ animation:none; } .rs-chat-m.entra, .rs-chat-chips.entra{ animation:none; } .rs-chat-nudge{ transition:none; } .rs-chat-nudge-ico::before{ animation:none; display:none; } }
