.chat-launcher{position:fixed;right:20px;bottom:20px;z-index:900;background:#0b4ea2;color:white!important;border:0;border-radius:28px;padding:14px 20px;box-shadow:0 4px 18px #0003;font:600 15px Arial,sans-serif;text-decoration:none;cursor:pointer}.chat-window{position:fixed;right:20px;bottom:82px;width:min(390px,calc(100vw - 24px));max-height:calc(100dvh - 110px);background:white;color:#182537;border:1px solid #cbd5e1;border-radius:14px;box-shadow:0 8px 35px #0003;z-index:901;overflow:auto;font:14px/1.45 Arial,sans-serif}.chat-window[hidden],.chat-window [hidden]{display:none!important}.chat-heading{display:flex;align-items:center;justify-content:space-between;background:#131921;color:white;padding:12px 16px;position:sticky;top:0;z-index:1}.chat-heading button{border:0;background:transparent;color:white;font-size:26px;cursor:pointer}.chat-notice,.chat-status{padding:8px 14px;margin:0}.chat-status{color:#8d3600}.chat-window>button,.chat-login{margin:8px 14px}.chat-window button{cursor:pointer}.chat-messages{max-height:280px;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:10px;background:#f3f6fa}.chat-message{max-width:92%;padding:10px 12px;border-radius:10px;background:white;border:1px solid #dce3eb;overflow-wrap:anywhere;white-space:pre-wrap}.chat-message.cliente{align-self:flex-end;background:#dcecff}.chat-message small{display:block;color:#526174;margin-bottom:5px}.chat-message p{margin:0}.chat-message img{display:block;max-width:100%;max-height:220px;border-radius:6px;margin-top:8px}.chat-form{padding:12px;display:flex;flex-direction:column;gap:8px}.chat-form textarea{width:100%;box-sizing:border-box;padding:10px;resize:vertical;min-height:65px;font:inherit}.chat-form input[type=file]{max-width:100%;font-size:12px}.chat-check{display:flex;gap:8px;align-items:flex-start;font-size:12px}.chat-check input{flex:none;margin-top:3px}.chat-form button[type=submit]{padding:12px;background:#0b4ea2;color:white;border:0;border-radius:7px;font:600 14px Arial,sans-serif}.chat-privacy{font-size:11px;color:#59677a;margin:0}.chat-avisos{padding:0 12px;font-size:12px}.chat-avisos p{border-bottom:1px solid #ddd;padding-bottom:6px}.chat-window button:disabled{opacity:.55;cursor:wait}.chat-login{display:inline-block}.admin-chat-layout{display:grid;grid-template-columns:minmax(210px,1fr) minmax(300px,2fr);gap:20px}.admin-chat-list a{display:block;padding:12px;border-bottom:1px solid #ddd;text-decoration:none;color:inherit}.admin-chat-list a[aria-current]{background:#e2f0e8}.admin-chat-view .chat-messages{max-height:460px;min-height:200px}.admin-chat-view .chat-form{padding:12px 0}.admin-chat-view .chat-check{font-size:13px}@media(max-width:700px){.chat-window{right:12px;bottom:76px;max-height:calc(100dvh - 90px)}.chat-launcher{right:12px;bottom:14px}.admin-chat-layout{grid-template-columns:1fr}}
.chat-window{width:min(460px,calc(100vw - 24px))}.chat-window .chat-messages{max-height:min(42dvh,420px)}.chat-message:has(.chat-product){width:100%;max-width:100%;box-sizing:border-box}.chat-products{white-space:normal;display:grid;gap:12px;margin-top:10px}.chat-products:empty{display:none}.chat-product{padding:12px;border:1px solid #d5deeb;border-radius:10px;background:#fff;display:flex;flex-direction:column;gap:9px}.chat-product>img{width:100%;height:145px;object-fit:contain;background:white}.chat-product h3{margin:0;font-size:15px;line-height:1.4}.chat-product-price{font-size:19px;color:#0b4ea2}.chat-product-stock{font-size:12px;color:#32583d}.chat-product button{border:1px solid #c4d1e0;border-radius:7px;padding:9px;background:#eff5fd;color:#123d70;font:inherit}.chat-product button:disabled{opacity:.5;cursor:wait}.chat-product a{color:#0b4ea2;font-weight:600}.chat-product details{font-size:12px}.chat-product details p{margin:8px 0;white-space:pre-wrap}.chat-compare-choice{display:flex;align-items:center;gap:7px;font-size:12px}.chat-selection{padding:8px 12px;font-size:12px;border-top:1px solid #d5deeb;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.chat-selection button{padding:7px;border:1px solid #b4c5d9;border-radius:6px;background:#fff;color:#123d70}.chat-comparison{overflow:auto;border:1px solid #cbd5e1;border-radius:8px}.chat-comparison table{border-collapse:collapse;font-size:12px;min-width:420px;width:100%;background:#fff}.chat-comparison caption{font-weight:bold;padding:8px;text-align:left}.chat-comparison th,.chat-comparison td{border:1px solid #d5deeb;padding:8px;min-width:95px;text-align:left;vertical-align:top;white-space:normal}.chat-comparison th{background:#edf3f9}.chat-heading button:focus-visible,.chat-product button:focus-visible,.chat-launcher:focus-visible,.chat-selection button:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}.admin-chat-view .chat-products{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.admin-chat-view .chat-comparison{grid-column:1/-1}.chat-window .chat-form{padding-top:8px}@media(max-width:480px){.chat-window{bottom:72px;max-height:calc(100dvh - 84px)}.chat-window .chat-messages{max-height:35dvh}.chat-heading{padding:10px 12px}.chat-notice{font-size:12px}.chat-form{gap:6px}.chat-product>img{height:120px}}
body:has(#tienda-chat) .catalog-cart-feedback{left:20px;right:auto}

/* Compositor sencillo del cliente; la bandeja de administración conserva su diseño. */
#tienda-chat:not([data-admin="1"]) .chat-window{width:min(420px,calc(100vw - 24px));border-radius:16px;display:flex;flex-direction:column;max-height:calc(100dvh - 110px)}
#tienda-chat:not([data-admin="1"]) .chat-heading{flex:none;min-height:30px}
#tienda-chat:not([data-admin="1"]) .chat-heading strong{font-size:16px}
#tienda-chat:not([data-admin="1"]) .chat-notice{font-size:12px;color:#526174;padding:10px 14px}
#tienda-chat:not([data-admin="1"]) .chat-messages{min-height:160px;max-height:min(38dvh,360px);flex:1 1 auto;overscroll-behavior:contain}
#tienda-chat:not([data-admin="1"]) .chat-messages:empty::before{content:"¿En qué podemos ayudarle?";margin:auto;text-align:center;color:#64748b;font-size:14px;padding:20px}
#tienda-chat:not([data-admin="1"]) .chat-form{border-top:1px solid #e2e8f0;padding:12px;gap:9px;background:#fff;flex:none}
#tienda-chat:not([data-admin="1"]) .chat-form textarea{border:1px solid #cbd5e1;border-radius:10px;min-height:72px;max-height:160px;font-size:16px;line-height:1.45;margin:0}
#tienda-chat:not([data-admin="1"]) .chat-form textarea:focus{outline:2px solid #0b4ea2;outline-offset:1px}
#tienda-chat:not([data-admin="1"]) #chat-estado:empty{display:none}
.chat-sr-only,.chat-file-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.chat-compose-tools{display:flex;align-items:center;gap:8px;position:relative}
.chat-compose-tools .chat-tool{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;box-sizing:border-box;padding:9px 10px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#233b57;font:600 13px Arial,sans-serif;cursor:pointer;white-space:nowrap;margin:0}
.chat-tool svg{width:20px;height:20px;flex:none}
.chat-compose-tools .chat-tool.is-recording{background:#fff1f2;border-color:#dc3545;color:#a91c2b}
.chat-compose-tools .chat-tool:disabled{cursor:default}
.chat-compose-tools #chat-enviar{margin-left:auto;padding:10px 16px;min-height:44px;font-size:14px}
.chat-tool:focus-visible,.chat-file-input:focus-visible+.chat-tool,.chat-options summary:focus-visible,#chat-quitar-foto:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}
.chat-dictation-note,.chat-dictation-preview{margin:0;font-size:12px;line-height:1.45;color:#526174}
.chat-dictation-preview{padding:7px 9px;background:#f1f5f9;border-radius:6px;max-height:70px;overflow:auto}
.chat-attachment{margin:0;padding:8px;border-radius:7px;background:#edf5ff;font-size:12px;overflow-wrap:anywhere}
.chat-attachment button{border:0;background:transparent;color:#0b4ea2;text-decoration:underline;font:inherit;min-height:30px;padding:3px 6px}
.chat-options{border-top:1px solid #e2e8f0;font-size:12px;color:#526174;padding-top:7px}
.chat-options summary{cursor:pointer;min-height:28px;display:list-item;list-style-position:inside}
.chat-options[open] summary{margin-bottom:10px}
.chat-options .chat-check{margin:10px 0;line-height:1.5}
.chat-options .chat-selection{padding:10px 0;margin:8px 0;border-bottom:1px solid #e2e8f0}
.chat-options .chat-avisos{padding:0}
.chat-options>button{padding:8px;border:1px solid #cbd5e1;border-radius:6px;background:white;color:#233b57;font:inherit}
@media(max-width:480px){#tienda-chat:not([data-admin="1"]) .chat-window{bottom:72px;max-height:calc(100dvh - 84px)}#tienda-chat:not([data-admin="1"]) .chat-messages{min-height:120px;max-height:34dvh}.chat-compose-tools{gap:6px}.chat-compose-tools .chat-tool{padding:9px 8px}.chat-compose-tools #chat-enviar{padding:10px 13px}}
