/* Chat en linea estilo WhatsApp - carpeta /chat */
#chat-flotante-plasmart,
#chat-flotante-plasmart *{box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;}

.chat-boton-flotante{
    position:fixed;
    left:20px;
    bottom:20px;
    width:60px;
    height:60px;
    border-radius:50%;
    background:#00a884;
    color:#fff;
    border:0;
    box-shadow:0 14px 35px rgba(0,0,0,.28);
    z-index:99998;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:27px;
    line-height:1;
}
.chat-boton-flotante:hover{background:#008f72;}

.chat-ventana{
    position:fixed;
    left:20px;
    bottom:92px;
    width:370px;
    max-width:calc(100vw - 28px);
    height:590px;
    max-height:calc(100vh - 116px);
    background:#fff;
    border-radius:14px;
    box-shadow:0 20px 55px rgba(0,0,0,.32);
    z-index:99999;
    display:none;
    overflow:hidden;
    border:1px solid rgba(0,0,0,.08);
}
.chat-ventana.is-open{display:flex;flex-direction:column;}
.chat-ventana.is-min{height:76px;}
.chat-ventana.is-min .chat-cuerpo,
.chat-ventana.is-min .chat-typing,
.chat-ventana.is-min .chat-input{display:none;}

.chat-header{
    height:72px;
    background:#008069;
    color:#fff;
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    flex:0 0 auto;
}
.chat-avatar{
    width:48px;
    height:48px;
    border-radius:50%;
    background:#d9fdd3;
    color:#008069;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:23px;
    font-weight:900;
    border:2px solid rgba(255,255,255,.42);
    flex:0 0 auto;
    text-transform:uppercase;
}
.chat-title{min-width:0;flex:1;}
.chat-title strong{display:block;font-size:16px;line-height:1.1;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-title span{display:block;font-size:12px;line-height:1.15;opacity:.95;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-header button{
    width:34px;
    height:34px;
    min-width:34px;
    border-radius:50%;
    background:rgba(255,255,255,.13);
    border:0;
    color:#fff;
    font-size:20px;
    font-weight:800;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
}
.chat-header button:hover{background:rgba(255,255,255,.24);}

.chat-cuerpo{
    position:relative;
    flex:1;
    background:#efeae2;
    background-image:
        radial-gradient(circle at 12px 12px, rgba(0,0,0,.026) 2px, transparent 3px),
        radial-gradient(circle at 42px 36px, rgba(0,0,0,.024) 1px, transparent 3px);
    background-size:58px 58px;
    overflow:auto;
    padding:14px;
}
.chat-login{
    position:absolute;
    inset:0;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    z-index:2;
}
.chat-login-box{width:100%;}
.chat-login-box h3{margin:0 0 8px;font-size:22px;color:#111827;font-weight:900;}
.chat-login-box p{margin:0 0 14px;color:#4b5563;font-size:14px;line-height:1.45;}
.chat-login-box input{width:100%;height:45px;border:1px solid #d1d5db;border-radius:12px;padding:0 13px;font-size:15px;margin-bottom:10px;outline:none;background:#fff;}
.chat-login-box input:focus{border-color:#00a884;box-shadow:0 0 0 3px rgba(0,168,132,.13);}
.chat-login-box button{width:100%;height:44px;border:0;border-radius:12px;background:#00a884;color:#fff;font-weight:900;font-size:15px;cursor:pointer;}
.chat-login-box button:hover{background:#008f72;}
.chat-error{color:#b91c1c;font-size:12px;margin-top:6px;display:none;}

.chat-mensajes{display:flex;flex-direction:column;gap:8px;min-height:100%;}
.chat-msg{
    max-width:82%;
    border-radius:9px;
    padding:8px 9px 6px;
    font-size:14px;
    line-height:1.35;
    box-shadow:0 1px 1px rgba(0,0,0,.12);
    word-wrap:break-word;
    position:relative;
    color:#111827;
}
.chat-msg small{display:block;text-align:right;margin-top:3px;font-size:10px;color:#667085;}
.chat-msg.visitante{align-self:flex-end;background:#d9fdd3;border-top-right-radius:2px;}
.chat-msg.admin{align-self:flex-start;background:#fff;border-top-left-radius:2px;}
.chat-msg img.chat-img{display:block;max-width:220px;max-height:220px;border-radius:8px;margin-bottom:4px;object-fit:cover;}
.chat-msg a.chat-img-link{display:block;color:inherit;text-decoration:none;}

.chat-input{
    height:66px;
    background:#f0f2f5;
    display:flex;
    align-items:center;
    gap:7px;
    padding:10px;
    flex:0 0 auto;
}
.chat-input textarea{flex:1;height:44px;max-height:90px;resize:none;border:0;border-radius:22px;padding:12px 14px;font-size:14px;outline:none;background:#fff;color:#111827;}
.chat-input button{width:42px;height:42px;min-width:42px;border:0;border-radius:50%;background:#00a884;color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}
.chat-input button.chat-clip{background:#e5e7eb;color:#374151;font-size:17px;}
.chat-input button:hover{filter:brightness(.94);}
.chat-input input[type="file"]{display:none;}
.chat-typing{font-size:12px;color:#667085;padding:0 12px 8px;background:#f0f2f5;display:none;}

@media(max-width:520px){
    .chat-ventana{left:8px;right:8px;bottom:84px;width:auto;height:74vh;max-width:none;}
    .chat-boton-flotante{left:16px;bottom:16px;}
}

/* App administrador */
.chat-admin-page,
.chat-admin-page *{box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;}
.chat-admin-page{margin:0;background:#e9edef;color:#111827;min-height:100vh;overflow:hidden;}
.chat-admin-app{height:100vh;background:#e9edef;position:relative;}
.chat-admin-sidebar{width:430px;max-width:100%;height:100vh;background:#fff;display:flex;flex-direction:column;min-width:0;border-right:1px solid #d1d7db;box-shadow:8px 0 22px rgba(15,23,42,.07);}
.chat-admin-top{height:82px;padding:15px 18px;background:#008069;color:#fff;border-bottom:1px solid #00735f;display:flex;align-items:center;gap:13px;}
.chat-admin-top h1{font-size:24px;margin:0;line-height:1.05;font-weight:900;letter-spacing:-.4px;color:#fff;}
.chat-admin-top span{display:block;font-size:13px;color:rgba(255,255,255,.92);margin-top:4px;font-weight:700;}
.chat-admin-logo{background:#d9fdd3 !important;color:#008069 !important;}
.chat-admin-search{padding:12px 14px;border-bottom:1px solid #e5e7eb;background:#f0f2f5;}
.chat-admin-search input{width:100%;height:44px;border:1px solid #d7dde1;border-radius:12px;padding:0 13px;background:#fff;outline:none;font-size:14px;color:#111827;}
.chat-admin-search input:focus{border-color:#00a884;box-shadow:0 0 0 3px rgba(0,168,132,.12);}
.chat-admin-lista{overflow:auto;flex:1;background:#fff;}
.chat-admin-item{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:12px;padding:13px 14px;border-bottom:1px solid #edf0f2;cursor:pointer;color:#111827;text-decoration:none;background:#fff;align-items:center;}
.chat-admin-item:hover,
.chat-admin-item.active{background:#e9edef;}
.chat-admin-foto{position:relative;width:52px;height:52px;border-radius:50%;background:#d1fae5;display:flex;align-items:center;justify-content:center;color:#008069;font-weight:900;font-size:19px;flex:0 0 auto;text-transform:uppercase;}
.chat-dot{position:absolute;right:1px;bottom:1px;width:13px;height:13px;border-radius:50%;border:2px solid #fff;background:#a3a3a3;}
.chat-dot.online{background:#22c55e;animation:chatPulse 1.2s infinite;}
.chat-admin-info{min-width:0;}
.chat-admin-info strong{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:900;color:#0f172a;}
.chat-admin-info small{display:block;color:#475569;font-size:11px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.25;}
.chat-admin-last{color:#111827 !important;font-weight:700;}
.chat-admin-meta{text-align:right;color:#667085;font-size:11px;white-space:nowrap;}
.chat-admin-meta .badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;border-radius:10px;background:#00a884;color:#fff;font-weight:bold;margin-top:4px;}

.chat-admin-main{position:fixed;inset:0;background:rgba(17,24,39,.48);z-index:50;display:none;align-items:center;justify-content:center;padding:22px;}
.chat-admin-main.is-open{display:flex;}
.chat-admin-popup{width:920px;max-width:calc(100vw - 44px);height:760px;max-height:calc(100vh - 44px);background:#efeae2;border-radius:16px;overflow:hidden;box-shadow:0 24px 70px rgba(0,0,0,.33);display:flex;flex-direction:column;}
.chat-admin-header{height:92px;background:#008069;color:#fff;border-bottom:1px solid #00735f;display:flex;align-items:center;padding:13px 18px;gap:13px;flex:0 0 auto;}
.chat-admin-header .chat-admin-foto{background:#d9fdd3;color:#008069;}
.chat-admin-header-user{min-width:0;}
.chat-admin-header h2{margin:0;font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;font-weight:900;}
.chat-admin-header small{display:block;color:rgba(255,255,255,.9);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;}
.chat-admin-datos{margin-left:auto;text-align:right;color:rgba(255,255,255,.88);font-size:12px;max-width:410px;line-height:1.35;}
.chat-admin-datos span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-admin-cerrar{width:38px;height:38px;min-width:38px;border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;font-size:25px;cursor:pointer;margin-left:8px;padding:0;display:flex;align-items:center;justify-content:center;}
.chat-admin-cerrar:hover{background:rgba(255,255,255,.24);}
.chat-admin-mensajes{flex:1;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:8px;background:#efeae2;background-image:radial-gradient(circle at 20px 20px, rgba(0,0,0,.026) 2px, transparent 3px);background-size:56px 56px;}
.chat-admin-empty{margin:auto;text-align:center;color:#475569;background:rgba(255,255,255,.82);padding:24px;border-radius:16px;font-weight:800;}
.chat-admin-input{height:74px;background:#f0f2f5;border-top:1px solid #d7dde1;display:flex;align-items:center;gap:9px;padding:12px;flex:0 0 auto;}
.chat-admin-input textarea{flex:1;height:46px;resize:none;border:0;border-radius:24px;padding:13px 16px;font-size:14px;outline:none;background:#fff;color:#111827;}
.chat-admin-input button{height:46px;min-width:48px;border:0;border-radius:23px;background:#00a884;color:#fff;font-weight:900;cursor:pointer;padding:0 18px;font-size:14px;}
.chat-admin-input button.chat-admin-clip{min-width:46px;width:46px;padding:0;background:#e5e7eb;color:#374151;font-size:18px;}
.chat-admin-input button:hover{filter:brightness(.94);}
.chat-admin-input button:disabled{opacity:.5;cursor:not-allowed;}
.chat-admin-input input[type="file"]{display:none;}
.chat-admin-msg{max-width:72%;padding:9px 11px 7px;border-radius:10px;font-size:14px;line-height:1.35;box-shadow:0 1px 1px rgba(0,0,0,.12);word-wrap:break-word;color:#111827;}
.chat-admin-msg.admin{align-self:flex-end;background:#d9fdd3;border-top-right-radius:2px;}
.chat-admin-msg.visitante{align-self:flex-start;background:#fff;border-top-left-radius:2px;}
.chat-admin-msg small{display:block;text-align:right;margin-top:4px;color:#667085;font-size:10px;}
.chat-admin-msg img.chat-img{display:block;max-width:260px;max-height:260px;border-radius:8px;margin-bottom:4px;object-fit:cover;}
.chat-admin-msg a.chat-img-link{display:block;color:inherit;text-decoration:none;}

@keyframes chatPulse{0%{box-shadow:0 0 0 0 rgba(34,197,94,.45)}70%{box-shadow:0 0 0 7px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}}

@media(max-width:760px){
    .chat-admin-sidebar{width:100%;}
    .chat-admin-main{padding:10px;}
    .chat-admin-popup{width:100%;max-width:none;height:92vh;max-height:none;border-radius:14px;}
    .chat-admin-datos{display:none;}
}


/* Refuerzo v2: evita que los estilos globales del sitio deformen los botones */
#chat-flotante-plasmart button,
#chat-flotante-plasmart textarea,
#chat-flotante-plasmart input,
.chat-admin-page button,
.chat-admin-page textarea,
.chat-admin-page input{
    font-family:Arial,Helvetica,sans-serif !important;
    box-sizing:border-box !important;
}

#chatSalirBorrar,
#chatMinimizar,
#chatCerrar{
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
    max-width:32px !important;
    border-radius:50% !important;
    padding:0 !important;
    margin:0 !important;
    line-height:32px !important;
    background:rgba(255,255,255,.16) !important;
    color:#fff !important;
    border:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:19px !important;
    font-weight:900 !important;
}

#chatSalirBorrar:hover,
#chatMinimizar:hover,
#chatCerrar:hover{
    background:rgba(255,255,255,.28) !important;
}

#chatEnviar{
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    border-radius:50% !important;
    padding:0 !important;
    font-size:18px !important;
    background:#00a884 !important;
    color:#fff !important;
}

#chatGaleria,
#chatCamara{
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    max-width:40px !important;
    border-radius:50% !important;
    padding:0 !important;
    background:#e5e7eb !important;
    color:#334155 !important;
}

.chat-boton-flotante{
    width:62px !important;
    height:62px !important;
    min-width:62px !important;
    max-width:62px !important;
    border-radius:50% !important;
    padding:0 !important;
    left:18px !important;
    right:auto !important;
    bottom:18px !important;
    background:#00a884 !important;
}

.chat-ventana{
    left:18px !important;
    right:auto !important;
    bottom:92px !important;
}

.chat-header{
    background:#008069 !important;
}

.chat-title strong,
.chat-title span{
    color:#fff !important;
}

.chat-avatar,
.chat-admin-foto{
    text-transform:uppercase !important;
    letter-spacing:.2px !important;
}

.chat-admin-cerrar{
    width:38px !important;
    height:38px !important;
    min-width:38px !important;
    max-width:38px !important;
    border-radius:50% !important;
    padding:0 !important;
    background:rgba(255,255,255,.18) !important;
    color:#fff !important;
}

.chat-admin-input button.chat-admin-clip{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    border-radius:50% !important;
    padding:0 !important;
}

#chatAdminEnviar{
    min-width:80px !important;
    height:44px !important;
    border-radius:22px !important;
    padding:0 18px !important;
    background:#00a884 !important;
    color:#fff !important;
}

.chat-admin-item{
    min-height:78px !important;
}

.chat-admin-info strong{
    font-size:16px !important;
}

.chat-admin-info small{
    font-size:12px !important;
}

@media(max-width:520px){
    .chat-ventana{
        left:8px !important;
        right:8px !important;
        bottom:86px !important;
        width:auto !important;
    }
    .chat-boton-flotante{
        left:14px !important;
        right:auto !important;
    }
}

/* Chat global + cotizacion unificado v10 */
#chat-flotante-plasmart{font-family:Arial,Helvetica,sans-serif !important;}
#chat-flotante-plasmart .fa-solid,
#chat-flotante-plasmart i[class^="fa-"],
#chat-flotante-plasmart i[class*=" fa-"]{font-family:"Font Awesome 6 Free" !important;font-weight:900 !important;}

#chat-flotante-plasmart .chat-boton-flotante{
    left:18px !important;
    right:auto !important;
    bottom:18px !important;
    width:62px !important;
    height:62px !important;
    min-width:62px !important;
    max-width:62px !important;
    border-radius:50% !important;
    background:#00a884 !important;
    color:#fff !important;
    font-size:27px !important;
    box-shadow:0 12px 30px rgba(0,0,0,.26) !important;
}

#chat-flotante-plasmart .chat-ventana{
    left:18px !important;
    right:auto !important;
    width:370px !important;
    max-width:calc(100vw - 36px) !important;
    border-radius:14px !important;
    overflow:hidden !important;
    border:1px solid rgba(0,0,0,.08) !important;
    box-shadow:0 18px 50px rgba(0,0,0,.28) !important;
}

#chat-flotante-plasmart .chat-header{
    height:68px !important;
    background:#008069 !important;
    color:#fff !important;
    padding:10px 12px !important;
    gap:9px !important;
}

#chat-flotante-plasmart .chat-avatar{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    border-radius:50% !important;
    background:#d9fdd3 !important;
    color:#008069 !important;
    font-size:20px !important;
    font-weight:900 !important;
}

#chat-flotante-plasmart .chat-title strong,
#chat-flotante-plasmart #chatTituloVentana{
    color:#fff !important;
    font-size:17px !important;
    line-height:1.05 !important;
    max-width:160px !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}

#chat-flotante-plasmart .chat-title span{
    color:rgba(255,255,255,.92) !important;
    font-size:12px !important;
    font-weight:700 !important;
}

#chat-flotante-plasmart .chat-header-btn,
#chat-flotante-plasmart #chatSalirBorrar,
#chat-flotante-plasmart #chatMinimizar,
#chat-flotante-plasmart #chatCerrar,
#chat-flotante-plasmart #chatModoGeneral{
    width:34px !important;
    height:34px !important;
    min-width:34px !important;
    max-width:34px !important;
    border-radius:50% !important;
    border:0 !important;
    padding:0 !important;
    margin:0 !important;
    background:rgba(255,255,255,.14) !important;
    color:#fff !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:15px !important;
    line-height:1 !important;
}

#chat-flotante-plasmart #chatModoGeneral[style*="display:none"]{display:none !important;}
#chat-flotante-plasmart .chat-header-btn:hover{background:rgba(255,255,255,.24) !important;}

#chat-flotante-plasmart .chat-cotizacion-bar{
    background:#e7f8ef !important;
    border-bottom:1px solid #c7f0d8 !important;
    padding:8px 10px !important;
}
#chat-flotante-plasmart .chat-cotizacion-bar button{
    width:100% !important;
    border:0 !important;
    border-radius:9px !important;
    background:#00a884 !important;
    color:#fff !important;
    height:38px !important;
    font-size:13px !important;
    font-weight:900 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:7px !important;
    cursor:pointer !important;
}

#chat-flotante-plasmart .chat-cuerpo{
    background:#efeae2 !important;
    background-image:radial-gradient(circle at 18px 18px, rgba(0,0,0,.035) 2px, transparent 3px) !important;
    background-size:44px 44px !important;
}

#chat-flotante-plasmart .chat-msg{font-size:14px !important;}
#chat-flotante-plasmart .chat-msg-autor{display:block;font-weight:900;font-size:12px;margin-bottom:2px;}
#chat-flotante-plasmart .chat-msg.admin{background:#fff !important;align-self:flex-start !important;}
#chat-flotante-plasmart .chat-msg.visitante{background:#d9fdd3 !important;align-self:flex-end !important;}

#chat-flotante-plasmart .chat-input{
    height:64px !important;
    background:#f0f2f5 !important;
    padding:8px !important;
    gap:6px !important;
}
#chat-flotante-plasmart .chat-input textarea{
    height:42px !important;
    border-radius:22px !important;
    background:#fff !important;
    color:#111827 !important;
    font-size:14px !important;
}
#chat-flotante-plasmart .chat-input button{
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    max-width:40px !important;
    border-radius:50% !important;
    border:0 !important;
    padding:0 !important;
    margin:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    background:#00a884 !important;
    color:#fff !important;
    font-size:16px !important;
}
#chat-flotante-plasmart .chat-input button.chat-clip{
    background:#e5e7eb !important;
    color:#475569 !important;
}
#chat-flotante-plasmart .chat-input button.chat-clip-paste{
    display:inline-flex !important;
}

#chat-flotante-plasmart .chat-img-link,
.chat-admin-page .chat-img-link{
    border:0 !important;
    background:transparent !important;
    padding:0 !important;
    margin:0 !important;
    display:block !important;
    cursor:pointer !important;
    border-radius:8px !important;
    overflow:hidden !important;
    max-width:230px !important;
}
#chat-flotante-plasmart .chat-img-link img,
.chat-admin-page .chat-img-link img{display:block !important;}

#chat-flotante-plasmart .chat-lightbox,
.chat-admin-page .chat-lightbox{
    position:fixed !important;
    inset:0 !important;
    z-index:2147483647 !important;
    background:rgba(0,0,0,.82) !important;
    display:none !important;
    align-items:center !important;
    justify-content:center !important;
    padding:24px !important;
}
#chat-flotante-plasmart .chat-lightbox.is-open,
.chat-admin-page .chat-lightbox.is-open{display:flex !important;}
#chat-flotante-plasmart .chat-lightbox img,
.chat-admin-page .chat-lightbox img{
    max-width:92vw !important;
    max-height:88vh !important;
    border-radius:12px !important;
    box-shadow:0 18px 55px rgba(0,0,0,.45) !important;
    background:#fff !important;
}
#chat-flotante-plasmart .chat-lightbox button,
.chat-admin-page .chat-lightbox button{
    position:absolute !important;
    top:20px !important;
    right:20px !important;
    width:44px !important;
    height:44px !important;
    border-radius:50% !important;
    border:0 !important;
    background:#fff !important;
    color:#111827 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    cursor:pointer !important;
}

@media(max-width:520px){
    #chat-flotante-plasmart .chat-ventana{left:8px !important;right:8px !important;width:auto !important;bottom:84px !important;height:74vh !important;}
    #chat-flotante-plasmart .chat-boton-flotante{left:16px !important;bottom:16px !important;}
    #chat-flotante-plasmart .chat-input button.chat-clip-paste{display:none !important;}
}

/* Parche v12: estabilidad del input, ticks de lectura y estado online */
#chat-flotante-plasmart .chat-typing{
    display:none !important;
    height:0 !important;
    padding:0 !important;
    overflow:hidden !important;
}

#chat-flotante-plasmart .chat-avatar{
    position:relative !important;
}

#chat-flotante-plasmart .chat-status-dot{
    position:absolute !important;
    right:-1px !important;
    bottom:-1px !important;
    width:13px !important;
    height:13px !important;
    border-radius:50% !important;
    border:2px solid #008069 !important;
    background:#9ca3af !important;
    box-shadow:0 1px 4px rgba(0,0,0,.22) !important;
}

#chat-flotante-plasmart .chat-status-dot.is-online{
    background:#22c55e !important;
    animation:chatPulse 1.2s infinite !important;
}

#chat-flotante-plasmart .chat-status-dot.is-offline{
    background:#9ca3af !important;
    animation:none !important;
}

#chat-flotante-plasmart .chat-msg-meta,
.chat-admin-page .chat-msg-meta{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:5px !important;
    margin-top:4px !important;
    font-size:10px !important;
    line-height:1.1 !important;
    color:#667085 !important;
    white-space:nowrap !important;
}

#chat-flotante-plasmart .chat-msg-estado,
.chat-admin-page .chat-msg-estado{
    font-weight:800 !important;
    color:#667085 !important;
}

#chat-flotante-plasmart .chat-msg-estado.is-read,
.chat-admin-page .chat-msg-estado.is-read{
    color:#0ea5e9 !important;
}

#chat-flotante-plasmart .chat-input,
#chat-flotante-plasmart .chat-input textarea,
#chat-flotante-plasmart .chat-input button{
    transform:none !important;
    transition:background-color .15s ease, filter .15s ease !important;
}

#chat-flotante-plasmart .chat-input textarea{
    min-width:0 !important;
    pointer-events:auto !important;
    user-select:text !important;
    -webkit-user-select:text !important;
}


/* Ajuste puntual v13: input estable, boton enviar claro y aviso de conexion */
#chat-flotante-plasmart .chat-offline-alert{
    background:#fee2e2 !important;
    color:#991b1b !important;
    font-size:13px !important;
    font-weight:900 !important;
    text-align:center !important;
    padding:8px 10px !important;
    border-bottom:1px solid #fecaca !important;
}

#chat-flotante-plasmart .chat-typing{
    display:none !important;
    height:0 !important;
    min-height:0 !important;
    max-height:0 !important;
    padding:0 !important;
    margin:0 !important;
    overflow:hidden !important;
}

#chat-flotante-plasmart .chat-input{
    height:64px !important;
    display:grid !important;
    grid-template-columns:40px 40px 40px minmax(0,1fr) 46px !important;
    align-items:center !important;
    gap:8px !important;
    padding:8px 10px !important;
    background:#f0f2f5 !important;
}

#chat-flotante-plasmart .chat-input textarea{
    width:100% !important;
    min-width:0 !important;
    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;
    border:0 !important;
    border-radius:22px !important;
    padding:12px 15px !important;
    margin:0 !important;
    background:#fff !important;
    color:#111827 !important;
    font-size:14px !important;
    line-height:20px !important;
    resize:none !important;
    outline:none !important;
    overflow:hidden !important;
    box-shadow:none !important;
}

#chat-flotante-plasmart .chat-input textarea:focus{
    box-shadow:0 0 0 2px rgba(0,168,132,.18) !important;
}

#chat-flotante-plasmart #chatEnviar,
.chat-admin-page #chatAdminEnviar{
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    border-radius:50% !important;
    padding:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    background:#00a884 !important;
    color:#fff !important;
    font-size:18px !important;
    border:0 !important;
}

.chat-admin-page .chat-admin-input{
    height:74px !important;
    display:grid !important;
    grid-template-columns:44px 44px 44px minmax(0,1fr) 52px !important;
    align-items:center !important;
    gap:9px !important;
    padding:12px !important;
    background:#f0f2f5 !important;
}

.chat-admin-page .chat-admin-input textarea{
    width:100% !important;
    min-width:0 !important;
    height:46px !important;
    min-height:46px !important;
    max-height:46px !important;
    border-radius:23px !important;
    padding:13px 16px !important;
    margin:0 !important;
    background:#fff !important;
    color:#111827 !important;
    border:0 !important;
    outline:none !important;
    resize:none !important;
    overflow:hidden !important;
}

.chat-admin-page .chat-admin-input textarea:focus{
    box-shadow:0 0 0 2px rgba(0,168,132,.18) !important;
}

.chat-admin-page .chat-admin-input button.chat-admin-clip{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    border-radius:50% !important;
    padding:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    background:#e5e7eb !important;
    color:#334155 !important;
    border:0 !important;
    font-size:17px !important;
}

@media(max-width:520px){
    #chat-flotante-plasmart .chat-input{
        grid-template-columns:38px 38px minmax(0,1fr) 44px !important;
    }
    #chat-flotante-plasmart .chat-input .chat-clip-paste{
        display:none !important;
    }
}


/* Ajuste puntual: mensajes propios a la derecha y mensajes externos a la izquierda */
#chat-flotante-plasmart .chat-mensajes{
    align-items:stretch !important;
}
#chat-flotante-plasmart .chat-msg.chat-mio,
#chat-flotante-plasmart .chat-msg.visitante.chat-mio{
    align-self:flex-end !important;
    margin-left:auto !important;
    margin-right:0 !important;
    background:#d9fdd3 !important;
    border-top-right-radius:2px !important;
    border-top-left-radius:9px !important;
    text-align:left !important;
}
#chat-flotante-plasmart .chat-msg.chat-otro,
#chat-flotante-plasmart .chat-msg.admin.chat-otro{
    align-self:flex-start !important;
    margin-left:0 !important;
    margin-right:auto !important;
    background:#ffffff !important;
    border-top-left-radius:2px !important;
    border-top-right-radius:9px !important;
    text-align:left !important;
}
#chat-flotante-plasmart .chat-msg.chat-mio .chat-msg-autor{
    text-align:left !important;
}
#chat-flotante-plasmart .chat-msg.chat-mio small,
#chat-flotante-plasmart .chat-msg.chat-otro small{
    text-align:right !important;
}

/* Ajuste puntual v14: minimizar solo deja el globo y muestra contador de mensajes no vistos */
#chat-flotante-plasmart .chat-ventana.is-min,
#chat-flotante-plasmart .chat-ventana:not(.is-open){
    display:none !important;
}

#chat-flotante-plasmart .chat-boton-flotante{
    position:fixed !important;
    overflow:visible !important;
}

#chat-flotante-plasmart .chat-unread-badge{
    position:absolute !important;
    right:-4px !important;
    top:-7px !important;
    min-width:22px !important;
    height:22px !important;
    padding:0 6px !important;
    border-radius:999px !important;
    background:#ff1f1f !important;
    color:#fff !important;
    border:2px solid #fff !important;
    box-shadow:0 4px 12px rgba(0,0,0,.25) !important;
    display:none;
    align-items:center !important;
    justify-content:center !important;
    font-size:12px !important;
    font-weight:900 !important;
    line-height:1 !important;
    z-index:2 !important;
    font-family:Arial,Helvetica,sans-serif !important;
}


/* Ajuste puntual v15: tabs vendedor/cotizacion, avatar por modo e input */
#chat-flotante-plasmart .chat-avatar{
    overflow:hidden !important;
    background:#d9fdd3 !important;
    color:#008069 !important;
}
#chat-flotante-plasmart .chat-avatar-img{
    width:100% !important;
    height:100% !important;
    object-fit:cover !important;
    display:block !important;
    border-radius:50% !important;
}
#chat-flotante-plasmart .chat-cotizacion-bar{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
    padding:8px 10px;
    background:#f0f2f5;
    border-bottom:1px solid #d7dde1;
}
#chat-flotante-plasmart .chat-cotizacion-bar .chat-tab{
    height:38px !important;
    min-height:38px !important;
    border:0 !important;
    border-radius:11px !important;
    padding:0 8px !important;
    margin:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:7px !important;
    background:#ffffff !important;
    color:#0f172a !important;
    font-size:13px !important;
    font-weight:900 !important;
    cursor:pointer !important;
    box-shadow:0 1px 3px rgba(15,23,42,.08) !important;
}
#chat-flotante-plasmart .chat-cotizacion-bar .chat-tab.is-active{
    background:#00a884 !important;
    color:#ffffff !important;
}
#chat-flotante-plasmart .chat-cotizacion-bar .chat-tab i{
    font-family:"Font Awesome 6 Free" !important;
    font-weight:900 !important;
}
#chat-flotante-plasmart.chat-modo-vendedor .chat-cuerpo{
    background-color:#eef7f3 !important;
}
#chat-flotante-plasmart.chat-modo-cotizacion .chat-cuerpo{
    background-color:#f2eee4 !important;
}
#chat-flotante-plasmart .chat-input textarea::placeholder{
    color:#64748b !important;
}
#chat-flotante-plasmart .chat-input i,
.chat-admin-page .chat-admin-input i,
.chat-admin-page .chat-admin-header i,
#chat-flotante-plasmart .chat-header i{
    font-family:"Font Awesome 6 Free" !important;
    font-weight:900 !important;
}
@media(min-width:761px){
    #chat-flotante-plasmart #chatCamara,
    .chat-admin-page #chatAdminCamara{
        display:none !important;
    }
    #chat-flotante-plasmart .chat-input{
        grid-template-columns:42px 42px minmax(0,1fr) 46px !important;
    }
    .chat-admin-page .chat-admin-input{
        grid-template-columns:44px 44px minmax(0,1fr) 52px !important;
    }
}

/* Ajuste puntual v16: sugerencias y estado de pestañas */
#chat-flotante-plasmart .chat-cotizacion-bar .chat-tab{
    height:48px !important;
    min-height:48px !important;
    padding:5px 8px !important;
    flex-direction:column !important;
    gap:2px !important;
    position:relative !important;
    line-height:1.05 !important;
}
#chat-flotante-plasmart .chat-tab-linea{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:6px !important;
    width:100% !important;
    min-width:0 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}
#chat-flotante-plasmart .chat-tab-linea span:not(.chat-tab-badge){
    overflow:hidden !important;
    text-overflow:ellipsis !important;
}
#chat-flotante-plasmart .chat-cotizacion-bar .chat-tab small{
    display:block !important;
    width:100% !important;
    font-size:9px !important;
    line-height:1.1 !important;
    font-weight:800 !important;
    opacity:.82 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    text-align:center !important;
}
#chat-flotante-plasmart .chat-tab-badge{
    position:absolute !important;
    top:-6px !important;
    right:-5px !important;
    min-width:18px !important;
    height:18px !important;
    padding:0 5px !important;
    border-radius:999px !important;
    background:#ff1d1d !important;
    color:#fff !important;
    font-size:10px !important;
    line-height:18px !important;
    font-weight:900 !important;
    align-items:center !important;
    justify-content:center !important;
    border:2px solid #fff !important;
    box-shadow:0 2px 6px rgba(0,0,0,.18) !important;
    z-index:2 !important;
}
#chat-flotante-plasmart .chat-sugerencias{
    margin:auto auto 18px auto !important;
    width:calc(100% - 34px) !important;
    max-width:300px !important;
    display:grid;
    gap:7px !important;
    align-self:center !important;
}
#chat-flotante-plasmart .chat-sugerencias-titulo{
    text-align:center !important;
    color:#667085 !important;
    font-size:11px !important;
    font-weight:900 !important;
    margin-bottom:2px !important;
}
#chat-flotante-plasmart .chat-sugerencia{
    width:100% !important;
    min-height:34px !important;
    border:1px solid rgba(0,168,132,.22) !important;
    border-radius:18px !important;
    background:rgba(255,255,255,.92) !important;
    color:#0f172a !important;
    font-size:13px !important;
    font-weight:800 !important;
    text-align:left !important;
    padding:8px 12px !important;
    cursor:pointer !important;
    box-shadow:0 2px 8px rgba(15,23,42,.07) !important;
}
#chat-flotante-plasmart .chat-sugerencia:hover{
    background:#d9fdd3 !important;
    border-color:#00a884 !important;
}

#chat-flotante-plasmart .chat-header-btn-salir:hover{
    background:rgba(239,68,68,.35) !important;
}

/* Configuracion chat v18: nombre completo, popup info, colores y respuestas rapidas */
#chat-flotante-plasmart .chat-info-popup{
    position:fixed !important;
    inset:0 !important;
    z-index:2147483646 !important;
    display:none !important;
    align-items:center !important;
    justify-content:center !important;
    background:rgba(17,24,39,.46) !important;
    padding:18px !important;
}
#chat-flotante-plasmart .chat-info-popup.is-open{display:flex !important;}
#chat-flotante-plasmart .chat-info-card{
    width:340px !important;
    max-width:calc(100vw - 32px) !important;
    background:#fff !important;
    border-radius:18px !important;
    padding:22px !important;
    box-shadow:0 24px 70px rgba(0,0,0,.28) !important;
    color:#111827 !important;
    position:relative !important;
    text-align:center !important;
}
#chat-flotante-plasmart .chat-info-cerrar{
    position:absolute !important;
    top:10px !important;
    right:10px !important;
    width:34px !important;
    height:34px !important;
    border:0 !important;
    border-radius:50% !important;
    background:#f1f5f9 !important;
    color:#111827 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    cursor:pointer !important;
}
#chat-flotante-plasmart .chat-info-logo img{
    width:64px !important;
    height:64px !important;
    object-fit:cover !important;
    border-radius:50% !important;
    margin-bottom:10px !important;
}
#chat-flotante-plasmart .chat-info-card h3{margin:0 0 8px !important;font-size:20px !important;font-weight:900 !important;}
#chat-flotante-plasmart .chat-info-card p{margin:0 0 10px !important;font-size:14px !important;line-height:1.45 !important;color:#374151 !important;}
#chat-flotante-plasmart .chat-info-card small{font-weight:900 !important;color:#008069 !important;}
#chat-flotante-plasmart .chat-header,
#chat-flotante-plasmart .chat-tab.is-active,
#chat-flotante-plasmart .chat-login-box button,
#chat-flotante-plasmart #chatEnviar,
#chat-flotante-plasmart .chat-boton-flotante{
    background:var(--chat-color-primario,#008069) !important;
}
#chat-flotante-plasmart .chat-cuerpo{
    background-color:var(--chat-color-fondo,#efeae2) !important;
}
#chat-flotante-plasmart .chat-msg.visitante{
    background:var(--chat-color-secundario,#d9fdd3) !important;
}
#chat-flotante-plasmart .chat-avatar{cursor:pointer !important;}
.chat-admin-config-link{display:inline-flex;align-items:center;gap:5px;margin-top:6px;color:#fff;text-decoration:none;font-size:12px;font-weight:900;opacity:.96;}
.chat-admin-config-link:hover{text-decoration:underline;}
.chat-admin-rapidas{height:46px;max-width:190px;border:0;border-radius:23px;padding:0 12px;background:#fff;color:#111827;outline:none;font-size:13px;font-weight:800;}
.chat-admin-rapidas:disabled{opacity:.5;}
@media(max-width:760px){.chat-admin-rapidas{max-width:120px;font-size:11px;}}

/* Preview amigable de productos compartidos por URL */
.chat-producto-card{
    margin-top:7px;
    display:grid;
    grid-template-columns:58px minmax(0,1fr);
    gap:8px;
    max-width:240px;
    padding:7px;
    border-radius:12px;
    background:#ffffff;
    border:1px solid rgba(0,0,0,.08);
    color:#111827;
    text-decoration:none;
    box-shadow:0 3px 10px rgba(0,0,0,.08);
}
.chat-msg.visitante .chat-producto-card,.chat-msg.chat-mio .chat-producto-card{background:#efffea;}
.chat-producto-img{width:58px;height:58px;border-radius:10px;background:#f3f4f6;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#6b7280;}
.chat-producto-img img{width:100%;height:100%;object-fit:cover;display:block;}
.chat-producto-info{min-width:0;display:grid;gap:2px;align-content:center;}
.chat-producto-info b{font-size:13px;line-height:1.15;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-producto-info small{font-size:10px;line-height:1.25;color:#6b7280;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.chat-producto-info strong{font-size:12px;color:#008069;font-weight:900;}
.chat-admin-msg .chat-producto-card{max-width:320px;}
.chat-sistema{align-self:center!important;max-width:88%;padding:9px 12px!important;border-radius:12px!important;background:#fff3cd!important;color:#6b4e00!important;font-size:12px;text-align:center;box-shadow:none!important;}


/* Ajuste puntual v20: footer admin /chat/ legible y boton enviar visible */
.chat-admin-page .chat-admin-popup{
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
}
.chat-admin-page .chat-admin-mensajes{
    flex:1 1 auto !important;
    min-height:0 !important;
    overflow:auto !important;
}
.chat-admin-page .chat-admin-input{
    flex:0 0 auto !important;
    height:76px !important;
    min-height:76px !important;
    max-height:76px !important;
    overflow:visible !important;
    display:grid !important;
    align-items:center !important;
    gap:8px !important;
    padding:10px 12px !important;
    background:#f0f2f5 !important;
    border-top:1px solid #d7dde1 !important;
}
.chat-admin-page #chatAdminTexto{
    width:100% !important;
    min-width:0 !important;
    height:46px !important;
    min-height:46px !important;
    max-height:46px !important;
    display:block !important;
    border-radius:23px !important;
    padding:13px 18px !important;
    box-sizing:border-box !important;
    font-size:15px !important;
    line-height:20px !important;
    overflow:hidden !important;
}
.chat-admin-page #chatAdminTexto::placeholder{
    color:#64748b !important;
    opacity:1 !important;
}
.chat-admin-page #chatAdminEnviar{
    position:static !important;
    inset:auto !important;
    transform:none !important;
    width:50px !important;
    height:50px !important;
    min-width:50px !important;
    max-width:50px !important;
    min-height:50px !important;
    max-height:50px !important;
    border-radius:50% !important;
    padding:0 !important;
    margin:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:visible !important;
    background:#00a884 !important;
    color:#fff !important;
    font-size:19px !important;
    line-height:1 !important;
    box-shadow:none !important;
}
.chat-admin-page #chatAdminEnviar i{
    display:block !important;
    font-family:"Font Awesome 6 Free" !important;
    font-weight:900 !important;
    font-size:18px !important;
    line-height:1 !important;
    color:#fff !important;
}
.chat-admin-page #chatAdminRapidas{
    width:100% !important;
    min-width:0 !important;
    height:46px !important;
    min-height:46px !important;
    max-height:46px !important;
    border-radius:23px !important;
    padding:0 14px !important;
    box-sizing:border-box !important;
}
@media(min-width:761px){
    .chat-admin-page #chatAdminCamara{
        display:none !important;
    }
    .chat-admin-page .chat-admin-input{
        grid-template-columns:44px 44px minmax(135px,170px) minmax(240px,1fr) 50px !important;
    }
}
@media(max-width:760px){
    .chat-admin-page .chat-admin-input{
        grid-template-columns:42px 42px minmax(0,1fr) 48px !important;
    }
    .chat-admin-page #chatAdminRapidas{
        display:none !important;
    }
    .chat-admin-page #chatAdminCamara{
        display:none !important;
    }
}


/* Ajuste admin /chat/: escritorio dividido y boton eliminar chat */
.chat-admin-eliminar{width:38px;height:38px;min-width:38px;border:0;border-radius:50%;background:rgba(239,68,68,.92);color:#fff;font-size:15px;cursor:pointer;margin-left:8px;padding:0;display:flex;align-items:center;justify-content:center;}
.chat-admin-eliminar:hover{background:#dc2626;}
@media(min-width:761px){
    .chat-admin-app{display:flex !important;}
    .chat-admin-sidebar{width:25% !important;min-width:300px !important;max-width:430px !important;flex:0 0 25% !important;}
    .chat-admin-main{position:relative !important;inset:auto !important;z-index:auto !important;display:flex !important;flex:1 1 auto !important;min-width:0 !important;height:100vh !important;background:#e9edef !important;padding:0 !important;align-items:stretch !important;justify-content:stretch !important;}
    .chat-admin-main.is-open{display:flex !important;}
    .chat-admin-popup{width:100% !important;max-width:none !important;height:100vh !important;max-height:none !important;border-radius:0 !important;box-shadow:none !important;}
    .chat-admin-cerrar{display:none !important;}
}
