#chat-widget { --verde:#0e3b2b; --rojo:#b01030; --oro:#e8b04a; --crema:#fff7ec; font-family: "Outfit", system-ui, sans-serif; }
.chat-burbuja { position: fixed; right: 16px; bottom: 92px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; background: var(--rojo); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.3); display: grid; place-items: center; }
.chat-burbuja:hover { background: #8f0c26; }
.chat-burbuja:focus-visible, .chat-cerrar:focus-visible, .chat-form button:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.chat-burbuja svg { width: 28px; height: 28px; fill: currentColor; }
.chat-panel { position: fixed; z-index: 95; right: 0; bottom: 0; width: 100%; height: 100dvh; max-height: 100dvh; background: var(--crema); display: none; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.chat-panel.abierto { display: flex; }
.chat-cab { background: var(--verde); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 4px solid var(--oro); }
.chat-cab strong { display: block; font-size: 1rem; }
.chat-cab small { color: var(--oro); font-size: .78rem; }
.chat-cerrar { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 4px 10px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 10px 13px; border-radius: 16px; font-size: .95rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg.bot { background: #fff; color: #1d2a24; border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.chat-msg.usuario { background: var(--verde); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-escribiendo { display: none; align-self: flex-start; background: #fff; padding: 12px 14px; border-radius: 16px; gap: 5px; }
.chat-escribiendo.activo { display: flex; }
.chat-escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); opacity: .35; animation: chat-p 1.2s infinite; }
.chat-escribiendo i:nth-child(2) { animation-delay: .2s; } .chat-escribiendo i:nth-child(3) { animation-delay: .4s; }
@keyframes chat-p { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-form { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #eadfc8; }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid #cdbf9f; border-radius: 99px; background: var(--crema); }
.chat-form button { background: var(--rojo); color: #fff; border: 0; border-radius: 99px; padding: 0 18px; font-weight: 800; cursor: pointer; }
.chat-form button:disabled { opacity: .5; cursor: default; }
@media (min-width: 640px) {
  .chat-burbuja { bottom: 24px; right: 24px; }
  .chat-panel { right: 24px; bottom: 96px; width: 380px; height: 540px; max-height: calc(100dvh - 120px); border-radius: 20px; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .chat-escribiendo i { animation: none; opacity: .6; } }
