/* Caia para visitantes (módulo atencion). Todo bajo .caia-pub para no chocar con el tema. */
.caia-pub { --caia-color: #39AAEF; position: fixed; bottom: 20px; z-index: 99990; font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: #1d2327; }
.caia-pub--right { right: 20px; }
.caia-pub--left { left: 20px; }
.caia-pub *, .caia-pub *::before, .caia-pub *::after { box-sizing: border-box; }

.caia-pub__fab { width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; background: var(--caia-color); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s; }
.caia-pub__fab:hover { transform: scale(1.06); }
.caia-pub__fab:focus-visible, .caia-pub button:focus-visible, .caia-pub a:focus-visible, .caia-pub textarea:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
.caia-pub.is-open .caia-pub__fab { display: none; }

.caia-pub__panel { position: absolute; bottom: 0; width: 370px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 40px); background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; }
.caia-pub--right .caia-pub__panel { right: 0; }
.caia-pub--left .caia-pub__panel { left: 0; }
.caia-pub__panel[hidden] { display: none; }

.caia-pub__head { background: var(--caia-color); color: #fff; padding: 12px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.caia-pub__head div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.caia-pub__title { font-size: 16px; }
.caia-pub__sub { opacity: .9; font-size: 12px; }
.caia-pub__wa { color: #fff; font-size: 12px; text-decoration: underline; margin-top: 2px; }
.caia-pub__close { background: rgba(0,0,0,.18); color: #fff; border: 0; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; flex-shrink: 0; }
.caia-pub__tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.caia-pub__new { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; background: rgba(0,0,0,.18); color: #fff; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; }
.caia-pub__new[hidden] { display: none; }
.caia-pub__new:hover, .caia-pub__close:hover { background: rgba(0,0,0,.3); }

.caia-pub__msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f6f7f9; overscroll-behavior: contain; }
.caia-pub__msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; }
.caia-pub__msg p { margin: 0 0 6px; }
.caia-pub__msg p:last-child { margin-bottom: 0; }
.caia-pub__msg ul { margin: 4px 0; padding-left: 18px; }
.caia-pub__msg a { color: inherit; text-decoration: underline; }
.caia-pub__msg--bot { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.caia-pub__msg--user { background: var(--caia-color); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.caia-pub__links a { font-weight: 600; }

.caia-pub__cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.caia-pub__card { background: #fff; border-radius: 10px; padding: 6px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.08); font-size: 13px; }
.caia-pub__card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #eee; }
.caia-pub__card-name { font-weight: 600; line-height: 1.25; }
.caia-pub__card-price { color: #444; }

.caia-pub__cart { align-self: flex-start; background: #fff; border: 2px solid var(--caia-color); color: #1d2327; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 14px; }
.caia-pub__cart:disabled { opacity: .7; cursor: default; }

.caia-pub__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e6e8eb; background: #fff; }
.caia-pub__form textarea { flex: 1; resize: none; border: 1px solid #cfd4da; border-radius: 12px; padding: 9px 12px; font: inherit; max-height: 110px; color: #1d2327; background: #fff; }
.caia-pub__form button { width: 42px; border: 0; border-radius: 12px; background: var(--caia-color); color: #fff; cursor: pointer; font-size: 16px; }
.caia-pub__legal { margin: 0; padding: 0 12px 8px; font-size: 11px; color: #6b7280; background: #fff; }
.caia-pub__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.caia-pub__typing { display: flex; gap: 4px; padding: 3px 0; }
.caia-pub__typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa1a9; animation: caiaPub 1.2s infinite; }
.caia-pub__typing span:nth-child(2) { animation-delay: .15s; }
.caia-pub__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes caiaPub { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .caia-pub__typing span { animation: none; } .caia-pub__fab { transition: none; } }

@media (max-width: 480px) {
	.caia-pub { bottom: 14px; }
	.caia-pub--right { right: 14px; }
	.caia-pub--left { left: 14px; }
	.caia-pub.is-open { inset: 0; }
	.caia-pub.is-open .caia-pub__panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
}
