/* ZFL – Atención al cliente con IA · 24/7 */
.zcia-fab{position:fixed;right:18px;bottom:88px;z-index:99990;display:flex;align-items:center;gap:8px;padding:12px 16px;border:0;border-radius:999px;background:#ffcc00;color:#111827;font:600 15px/1.2 inherit;font-family:inherit;box-shadow:0 6px 20px rgba(17,24,39,.22);cursor:pointer;max-width:calc(100vw - 36px)}
.zcia-fab:hover,.zcia-fab:focus-visible{background:#f5c400;color:#111827}
.zcia-fab svg{flex:0 0 auto}
.zcia-fab small{display:block;font-weight:500;font-size:12px;opacity:.8}
.zcia-box{position:fixed;right:16px;bottom:16px;z-index:99991;width:360px;max-width:calc(100vw - 24px);height:520px;max-height:calc(100vh - 32px);display:flex;flex-direction:column;background:#fff;color:#111827;border-radius:16px;box-shadow:0 14px 40px rgba(17,24,39,.28);overflow:hidden;font-family:inherit}
.zcia-box[hidden]{display:none}
.zcia-head{display:flex;align-items:center;gap:10px;padding:12px 14px;background:#083e34;color:#fff}
.zcia-head b{display:block;font-size:15px}
.zcia-head span{font-size:12px;opacity:.85}
.zcia-x{margin-left:auto;border:0;background:transparent;color:#fff;font-size:24px;line-height:1;cursor:pointer;padding:4px 8px;border-radius:8px}
.zcia-x:hover{background:rgba(255,255,255,.12)}
.zcia-log{flex:1;overflow-y:auto;padding:12px;background:#f6f7f9;display:flex;flex-direction:column;gap:8px}
.zcia-m{max-width:85%;padding:9px 12px;border-radius:14px;font-size:14.5px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.zcia-m a{color:#0b5d4b;text-decoration:underline}
.zcia-bot{align-self:flex-start;background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:4px}
.zcia-me{align-self:flex-end;background:#fff4bf;border-bottom-right-radius:4px}
.zcia-wait{opacity:.7;font-style:italic}
.zcia-form{display:flex;gap:8px;padding:10px;border-top:1px solid #e5e7eb;background:#fff}
.zcia-form textarea{flex:1;resize:none;box-sizing:border-box;height:44px;min-height:44px;max-height:110px;margin:0;padding:10px 12px;border:1px solid #d1d5db;border-radius:12px;font:15px/1.35 inherit;font-family:inherit;color:#111827;background:#fff}
.zcia-form textarea:focus{outline:2px solid #ffcc00;border-color:#ffcc00}
.zcia-send{border:0;border-radius:12px;padding:0 16px;height:44px;align-self:flex-end;background:#ffcc00;color:#111827;font-weight:700;cursor:pointer;font-family:inherit}
.zcia-send:hover,.zcia-send:focus-visible{background:#f5c400;color:#111827}
.zcia-send:disabled{opacity:.6;cursor:default}
.zcia-note{padding:0 12px 8px;font-size:11.5px;color:#6b7280;background:#fff}
@media (max-width:600px){

 .zcia-box{left:0;right:0;bottom:0;width:100%;max-width:100%;height:85vh;max-height:85vh;border-radius:16px 16px 0 0}
}
@media (prefers-color-scheme:dark){
 html.zfl-dark .zcia-box{background:#1f2227;color:#f3f4f6}
}
/* Gana a los estilos de textarea del tema/tienda */
html body .zcia-box .zcia-form textarea{height:44px !important;min-height:44px !important;max-height:110px !important;padding:10px 12px !important;line-height:1.35 !important;font-size:15px !important;resize:none !important}
html body .zcia-box .zcia-send{height:44px !important;min-height:44px !important}
/* Un solo botón flotante: el chat ocupa el sitio del de WhatsApp (abajo a la derecha).
   El de WhatsApp (.zfl-wa-fab, de zfl-admin) se oculta SOLO cuando chat.js ya puso su botón (html.zcia-on). */
html.zcia-on .zfl-wa-fab{display:none !important}
/* Hablar con una persona por WhatsApp */
.zcia-wa{display:inline-flex;align-items:center;gap:6px;text-decoration:none !important}
.zcia-wa-bar{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 10px 10px;padding:11px 14px;border-radius:12px;background:#ffcc00;color:#111827 !important;font-size:14.5px;font-weight:700;text-decoration:none !important;font-family:inherit}
.zcia-wa-bar:hover,.zcia-wa-bar:focus-visible{background:#f5c400;color:#111827 !important}
.zcia-form{border-bottom:0}
/* Móvil: botón redondo solo con el icono, mismo tamaño y sitio que tenía el de WhatsApp */
@media (max-width:768px){
 html body .zcia-fab{right:18px;left:auto;bottom:88px;width:56px;height:56px;padding:0;gap:0;justify-content:center;border-radius:50%;box-shadow:0 4px 16px rgba(0,0,0,.35);max-width:none}
 html body .zcia-fab>span{display:none}
 html body .zcia-fab svg{width:28px;height:28px}
}
@media (max-width:650px){
 html body .zcia-fab{right:14px;bottom:84px;width:52px;height:52px}
 html body .zcia-fab svg{width:26px;height:26px}
}
/* v2: botones de marca (el tema Electro les pone .btn gris claro/hover oscuro), más abajo sin pisar el «subir arriba», y modo oscuro de la web (html.dark-mode) */
html body .zcia-fab,html body .zcia-send{background:#ffcc00 !important;background-image:none !important;border:0 !important;color:#111827 !important;text-shadow:none !important;opacity:1}
html body .zcia-fab:hover,html body .zcia-fab:focus-visible,html body .zcia-send:hover,html body .zcia-send:focus-visible,html body .zcia-fab:active,html body .zcia-send:active{background:#f5c400 !important;color:#111827 !important}
html body .zcia-send:disabled{background:#ffcc00 !important;opacity:.6}
html body .zcia-fab{right:68px;bottom:16px;padding:10px 16px;line-height:1.2;font-size:15px;font-weight:600;border-radius:999px;text-align:left}
html body .zcia-fab small{line-height:1.2}
html body .zcia-x{background:rgba(255,204,0,.16) !important;border:0 !important;color:#ffcc00 !important;width:34px;height:34px;padding:0 !important;display:inline-flex;align-items:center;justify-content:center;font-size:22px;line-height:1 !important;border-radius:10px}
html body .zcia-x:hover,html body .zcia-x:focus-visible{background:#ffcc00 !important;color:#111827 !important}
@media (max-width:768px){html body .zcia-fab{right:68px;bottom:16px;padding:0}}
@media (max-width:650px){html body .zcia-fab{right:64px;bottom:14px}}
/* Modo oscuro de la web */
html.dark-mode .zcia-box{background:#16191e;color:#e5e7eb;box-shadow:0 14px 40px rgba(0,0,0,.6);border:1px solid #2a2f37}
html.dark-mode .zcia-head{background:#0b2e27;border-bottom:1px solid #2a2f37}
html.dark-mode .zcia-log{background:#111418}
html.dark-mode .zcia-bot{background:#1f242b;border-color:#2f353e;color:#e5e7eb}
html.dark-mode .zcia-me{background:#3a3214;color:#fdf3c4}
html.dark-mode .zcia-m a{color:#ffcc00}
html.dark-mode .zcia-form{background:#16191e;border-top-color:#2a2f37}
html.dark-mode body .zcia-box .zcia-form textarea{background:#1f242b !important;color:#f3f4f6 !important;border:1px solid #3a414b !important}
html.dark-mode body .zcia-box .zcia-form textarea::placeholder{color:#8b93a0}
html.dark-mode .zcia-note{background:#16191e;color:#9ca3af}
/* v3: ventana movible y redimensionable en PC (≥900 px con ratón); móvil sin cambios */
html body .zcia-reset{margin-left:auto;font-size:18px}
html body .zcia-reset:not([hidden])+.zcia-x{margin-left:6px}
html body .zcia-reset[hidden]{display:none !important}
.zcia-rz{display:none}
.zcia-box.zcia-win .zcia-head{cursor:move;user-select:none;touch-action:none}
.zcia-box.zcia-win .zcia-head button{cursor:pointer}
.zcia-box.zcia-win .zcia-rz{display:block;position:absolute;z-index:2;touch-action:none}
.zcia-rz-n,.zcia-rz-s{left:10px;right:10px;height:7px;cursor:ns-resize}
.zcia-rz-n{top:-2px}.zcia-rz-s{bottom:-2px}
.zcia-rz-e,.zcia-rz-w{top:10px;bottom:10px;width:7px;cursor:ew-resize}
.zcia-rz-e{right:-2px}.zcia-rz-w{left:-2px}
.zcia-rz-ne,.zcia-rz-nw,.zcia-rz-se,.zcia-rz-sw{width:14px;height:14px}
.zcia-rz-ne{top:-2px;right:-2px;cursor:nesw-resize}.zcia-rz-sw{bottom:-2px;left:-2px;cursor:nesw-resize}
.zcia-rz-nw{top:-2px;left:-2px;cursor:nwse-resize}.zcia-rz-se{bottom:-2px;right:-2px;cursor:nwse-resize}
.zcia-box.zcia-win .zcia-rz-se::after{content:"";position:absolute;right:4px;bottom:4px;width:8px;height:8px;border-right:2px solid rgba(127,127,127,.55);border-bottom:2px solid rgba(127,127,127,.55);border-bottom-right-radius:3px}
.zcia-box.zcia-moving{user-select:none;transition:none}
.zcia-box.zcia-moving iframe{pointer-events:none}
.zcia-box.zcia-win{box-sizing:border-box}
html.zcia-dragging,html.zcia-dragging *{user-select:none !important;-webkit-user-select:none !important}
/* v4: sin el botón «subir arriba» del tema Electro (en toda la web) y el del chat pegado a la derecha */
.back-to-top-wrapper,a.back-to-top-link,.back-to-top-link{display:none !important}
html body .zcia-fab{right:16px;bottom:16px}
@media (max-width:768px){html body .zcia-fab{right:16px;bottom:16px}}
@media (max-width:650px){html body .zcia-fab{right:14px;bottom:14px}}
/* Barra de desplazamiento del chat: fina, de marca */
.zcia-log::-webkit-scrollbar{width:8px;height:8px}
.zcia-log::-webkit-scrollbar-track{background:transparent}
.zcia-log::-webkit-scrollbar-thumb{background:#4b5563;border-radius:8px;border:2px solid transparent;background-clip:padding-box}
.zcia-log::-webkit-scrollbar-thumb:hover{background:rgba(255,204,0,.55);background-clip:padding-box}
html.dark-mode .zcia-log::-webkit-scrollbar-thumb{background:#6b7280;background-clip:padding-box}
html.dark-mode .zcia-log::-webkit-scrollbar-thumb:hover{background:rgba(255,204,0,.45);background-clip:padding-box}
/* Firefox (sin ::-webkit-scrollbar): scrollbar-color; en Chrome/Edge/Safari mandan las reglas -webkit de arriba (con hover amarillo) */
@supports not selector(::-webkit-scrollbar){
 .zcia-log{scrollbar-width:thin;scrollbar-color:#4b5563 transparent}
 .zcia-log:hover{scrollbar-color:rgba(255,204,0,.6) transparent}
 html.dark-mode .zcia-log{scrollbar-color:#6b7280 transparent}
 html.dark-mode .zcia-log:hover{scrollbar-color:rgba(255,204,0,.5) transparent}
}
