/* --- BOTÓN DEL CHATBOT --- */
#chatbot-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 80px;
    height: 80px;
    background: #2b7cff;
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    text-align: center;
    line-height: 60px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    z-index: 99999;
}

/* --- CHATBOX --- */
#my-chatbox {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 400px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    overflow: hidden;
    display: none;
    z-index: 10000;
    font-family: 'Segoe UI', sans-serif;
}
.paquito-img {
    width: 100%;
    max-width: 50px; /* tamaño máximo */
    height: auto;     /* mantiene proporción */
}

#my-messages {
    max-height: 320px;
    overflow-y: auto;
    padding: 12px;
}
@media (max-width: 480px) {
    .paquito-img {
        max-width: 90px;
    }
}


/* --- TOOLTIP DE PAQUITO (CORREGIDO y CON CLOSE) --- */
#chat-tooltip {
    position: fixed;
    right: 95px;          /* a la izquierda del botón */
    bottom: 80px;
    background: #007bff;
    color: white;
    padding: 10px 14px;
    border-radius: 10px 10px 2px 20px;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: auto;
    transition: opacity .4s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
}

/* Texto del tooltip */
.chat-tooltip-text {
    font-size: 14px;
}

/* Botón de cerrar (X) */
.chat-tooltip-close {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

/* Tooltip visible */
#chat-tooltip.visible {
    opacity: 1;
}

/* --- MENSAJES --- */
.my-msg {
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-block;
    max-width: 85%;
}

.my-msg.user {
    background: #e6f0ff;
    float: right;
    clear: both;
}

.my-msg.bot {
    background: #f1f1f1;
    float: left;
    clear: both;
}

/* --- INPUT Y BOTÓN ENVÍO --- */
#my-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
}

#myUserInput {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

#mySendBtn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: #2b7cff;
    color: white;
    cursor: pointer;
}

#mySendBtn:hover {
    opacity: 0.95;
}

/* --- LOADER --- */
#my-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 100%;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #ccc;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.my-msg {
    max-width: 90%;
    word-break: break-word;
}

.my-msg.bot {
    background: #f1f1f1;
    border-radius: 10px;
}

.emoji {
    width: 20px;
    height: 20px;
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- RESPONSIVE: CHAT FULLSCREEN Y TOOLTIP FULL WIDTH EN MOVIL --- */
@media (max-width: 768px) {

    /* Chatbox pantalla completa */
    #my-chatbox {
        bottom: 100px;
        right: 5px;
        width: 98.5%;
        height: 100%;
        border-radius: 12px;
    }

    #my-messages {
        max-height: calc(100vh - 160px);
    }

    /* Tooltip full width */
    /* #chat-tooltip {
        right: 0;
        left: 0;
        width: 100%;
        bottom: 0;
        border-radius: 0;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .chat-tooltip-close {
        position: absolute;
        right: 10px;
        top: 8px;
        font-size: 22px;
    } */
}