/* =====================
   NEOQUIM CHATBOT WIDGET
   ===================== */

#neoquim-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
}

/* Botón flotante */
#neoquim-chat-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(215,38,61,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

#neoquim-chat-button img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 50%;
    margin: 0 !important;
    padding: 0 !important;
}

#neoquim-chat-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(215,38,61,0.5);
}

/* Caja del chat */
#neoquim-chat-box {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 92px;
    right: 0;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    border: 1px solid #e0e0e0;
    z-index: 99999;
}

#neoquim-chat-box.open {
    display: flex;
    animation: neoquimFadeIn 0.25s ease;
}

@keyframes neoquimFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Cabecera */
#neoquim-chat-header {
    background: #D7263D;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.neoquim-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.neoquim-header-avatar {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: #fff;
    border: 2px solid #fff;
    flex-shrink: 0;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

#neoquim-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#neoquim-close-btn:hover {
    opacity: 1;
}

/* Mensajes */
#neoquim-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f7f7;
}

.neoquim-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 90%;
}

.neoquim-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.neoquim-msg-bot {
    align-self: flex-start;
}

/* Avatar bot */
.neoquim-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neoquim-avatar img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

/* Burbujas */
.neoquim-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.45;
    word-break: break-word;
}

.neoquim-msg-bot .neoquim-bubble {
    background: #fff;
    color: #2a2a2a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.neoquim-msg-user .neoquim-bubble {
    background: #D7263D;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.neoquim-bubble a {
    color: #D7263D;
    font-weight: 600;
    text-decoration: underline;
}

.neoquim-msg-user .neoquim-bubble a {
    color: #ffd0d6;
}

.neoquim-bubble hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 8px 0;
}

.neoquim-bubble strong {
    color: #1a1a1a;
}

.neoquim-msg-user .neoquim-bubble strong {
    color: #fff;
}

/* Lista de viñetas */
.neoquim-bubble .neoquim-list {
    margin: 6px 0 6px 0;
    padding-left: 20px;
    list-style: none;
}

.neoquim-bubble .neoquim-li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 5px;
    line-height: 1.45;
}

.neoquim-bubble .neoquim-li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D7263D;
}

/* Typing indicator */
.neoquim-typing .neoquim-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
}

.neoquim-typing .neoquim-bubble span {
    width: 7px;
    height: 7px;
    background: #D7263D;
    border-radius: 50%;
    animation: neoquimBounce 1.2s infinite;
    opacity: 0.5;
}

.neoquim-typing .neoquim-bubble span:nth-child(2) { animation-delay: 0.2s; }
.neoquim-typing .neoquim-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes neoquimBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%           { transform: translateY(-6px); opacity: 1; }
}

/* Input */
#neoquim-chat-input-area {
    display: flex;
    padding: 10px 12px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    gap: 8px;
}

#neoquim-user-input {
    flex: 1;
    border: 1px solid #c8c8c8;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 15px;
    outline: none;
    color: #2a2a2a;
    background: #f7f7f7;
    transition: border-color 0.2s;
}

#neoquim-user-input:focus {
    border-color: #D7263D;
    background: #fff;
}

#neoquim-user-input::placeholder {
    color: #7D7D7D;
}

#neoquim-send-btn {
    background: #D7263D;
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 9px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#neoquim-send-btn:hover {
    background: #b01e30;
}

#neoquim-send-btn:active {
    transform: scale(0.97);
}

/* Responsive móvil */
@media (max-width: 480px) {
    #neoquim-chat-box {
        width: calc(100vw - 32px);
        right: -12px;
        height: 70vh;
    }
}

/* Opciones clickables */
.neoquim-option {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    color: #D7263D;
    border: 1.5px solid #D7263D;
    border-radius: 8px;
    padding: 7px 12px;
    margin: 4px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.neoquim-option:hover {
    background: #D7263D;
    color: #fff;
}

.neoquim-option:disabled {
    cursor: default;
}

/* Reducir espacio entre párrafos */
.neoquim-bubble br + br {
    display: none;
}
.neoquim-bubble hr {
    margin: 4px 0;
}
