/* =====================================================================
   UGO DELIVERY — Asistente flotante (widget profesional)
   ===================================================================== */

.chatbot-burbuja {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B00, #FF8A3D);
    color: #fff;
    border: none;
    font-size: 1.7rem;
    box-shadow: 0 8px 24px rgba(255,107,0,0.4);
    cursor: pointer;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.chatbot-burbuja:hover { transform: scale(1.07); box-shadow: 0 10px 30px rgba(255,107,0,0.5); }
.chatbot-burbuja__icono-cerrar { display: none; }
.chatbot-burbuja.abierto .chatbot-burbuja__icono-abrir { display: none; }
.chatbot-burbuja.abierto .chatbot-burbuja__icono-cerrar { display: inline; }

.chatbot-panel {
    display: none;
    flex-direction: column;
    position: fixed;
    bottom: 92px;
    right: 20px;
    width: min(360px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 150px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.28);
    overflow: hidden;
    z-index: 1500;
    animation: chatbotAparecer .18s ease-out;
}
.chatbot-panel.abierto { display: flex; }
@keyframes chatbotAparecer {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-panel__header {
    background: linear-gradient(135deg, #FF6B00, #FF8A3D);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.chatbot-panel__avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.chatbot-panel__titulo { flex: 1; line-height: 1.3; }
.chatbot-panel__titulo strong { display: block; font-size: 0.95rem; }
.chatbot-panel__titulo span { font-size: 0.74rem; opacity: 0.9; display: flex; align-items: center; gap: 5px; }
.chatbot-punto-online {
    width: 7px; height: 7px; border-radius: 50%;
    background: #4ADE80;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(74,222,128,0.6);
    animation: chatbotPulso 1.8s infinite;
}
@keyframes chatbotPulso {
    0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
    70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.chatbot-panel__cerrar { cursor: pointer; opacity: .85; font-size: 1rem; padding: 4px; }
.chatbot-panel__cerrar:hover { opacity: 1; }

.chatbot-mensajes {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F7F7F9;
    display: flex;
    flex-direction: column;
}
.chatbot-fila-bot { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 10px; }
.chatbot-mini-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #FFE4CC;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}
.chatbot-msg {
    max-width: 78%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-line;
}
.chatbot-msg--usuario {
    background: #FF6B00;
    color: #fff;
    margin-left: auto;
    margin-bottom: 10px;
    border-bottom-right-radius: 3px;
}
.chatbot-msg--bot {
    background: #fff;
    color: #1F2937;
    border: 1px solid #ECECEC;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.chatbot-sugerencias {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px 16px;
    background: #F7F7F9;
    flex-shrink: 0;
}
.chatbot-chip {
    background: #fff;
    border: 1px solid #FFD1A8;
    color: #B34700;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 0.78rem;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease;
}
.chatbot-chip:hover { background: #FFEDE0; }

.chatbot-chip--whatsapp {
    background: #E7F9EF;
    border-color: #25D366;
    color: #128C4A;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}
.chatbot-chip--whatsapp:hover { background: #D2F4E0; }

.chatbot-boton-accion {
    display: inline-block;
    background: #FF6B00;
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    margin: -4px 0 10px 30px;
    transition: background .15s ease;
}
.chatbot-boton-accion:hover { background: #E85F00; }

.chatbot-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #EEE;
    background: #fff;
    flex-shrink: 0;
}
.chatbot-form input {
    flex: 1;
    border: 1px solid #DDD;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.86rem;
    outline: none;
}
.chatbot-form input:focus { border-color: #FF8A3D; }
.chatbot-form button {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: #FF6B00;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.chatbot-form button:hover { background: #E85F00; }

@media (max-width: 480px) {
    .chatbot-panel { right: 12px; bottom: 88px; }
    .chatbot-burbuja { right: 12px; bottom: 12px; }
}
