/* ============================================================
   🎨 ESTILOS CHATBOT KIKI - QVER COSMÉTICA
   ============================================================ */

/* ================= VARIABLES DE MARCA ================= */
:root {
    --qver-lila: #9b7edb;
    --qver-lila-oscuro: #7a5fc5;
    --qver-lila-claro: #f3ecff;
    --qver-lila-fondo: #f1dfff;
    --qver-rosa: #f2c6d8;
    --qver-texto: #444;
    --qver-sombra: rgba(155, 126, 219, 0.25);
    --qver-sombra-fuerte: rgba(155, 126, 219, 0.4);
}

body {
    font-family: 'Poppins', sans-serif;
}

/* ================= BOTÓN FLOTANTE ================= */
#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--qver-lila), var(--qver-lila-oscuro));
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 22px var(--qver-sombra-fuerte);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: kiki-pulse 2s infinite;
}

#chat-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 14px 30px var(--qver-sombra-fuerte);
}

@keyframes kiki-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 126, 219, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(155, 126, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(155, 126, 219, 0);
    }
}

/* ================= VENTANA DEL CHAT ================= */
#chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: 92%;
    height: 500px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: 1px solid rgba(155, 126, 219, 0.18);
}


/* ================= HEADER ================= */
#chat-header {
    background: linear-gradient(135deg, var(--qver-lila), var(--qver-lila-oscuro));
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.3px;
}

#chat-header span:last-child {
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.25s ease;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-header span:last-child:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* ================= ÁREA DE MENSAJES ================= */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, #faf7ff 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Scrollbar personalizado */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: var(--qver-lila-claro);
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--qver-lila);
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--qver-lila-oscuro);
}

/* ================= MENSAJES ================= */
.message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    animation: kiki-fadeIn 0.3s ease;
    word-wrap: break-word;
    font-family: 'Poppins', sans-serif;
}

@keyframes kiki-fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-msg {
    background: var(--qver-lila-claro);
    color: var(--qver-texto);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-left: 3px solid var(--qver-lila);
}

.user-msg {
    background: linear-gradient(135deg, var(--qver-lila), var(--qver-lila-oscuro));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px var(--qver-sombra);
}

/* ================= BOTONES DE RESPUESTA RÁPIDA ================= */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    align-self: flex-start;
}

.quick-reply-btn {
    background: white;
    border: 1px solid var(--qver-lila);
    color: var(--qver-lila-oscuro);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 12px rgba(155, 126, 219, 0.12);
}

.quick-reply-btn:hover {
    background: linear-gradient(135deg, var(--qver-lila), var(--qver-lila-oscuro));
    color: white;
    box-shadow: 0 8px 22px var(--qver-sombra-fuerte);
    transform: translateY(-2px);
}

.quick-reply-btn:active {
    transform: translateY(1px);
}

/* ================= INDICADOR DE "ESCRIBIENDO..." ================= */
.typing-indicator {
    background: var(--qver-lila-claro);
    padding: 12px 16px;
    border-radius: 18px;
    align-self: flex-start;
    display: none;
    gap: 4px;
    border-left: 3px solid var(--qver-lila);
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: var(--qver-lila);
    border-radius: 50%;
    animation: kiki-typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes kiki-typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ================= ÁREA DE INPUT ================= */
#chat-input-area {
    display: flex;
    border-top: 1px solid rgba(155, 126, 219, 0.18);
    padding: 10px;
    background: white;
}

#chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(155, 126, 219, 0.3);
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    margin-right: 10px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.25s ease;
    background: #faf7ff;
}

#chat-input:focus {
    border-color: var(--qver-lila);
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 126, 219, 0.15);
}

#chat-input::placeholder {
    color: #999;
}

#chat-send {
    background: linear-gradient(135deg, var(--qver-lila), var(--qver-lila-oscuro));
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px var(--qver-sombra);
}

#chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 22px var(--qver-sombra-fuerte);
}

#chat-send:active {
    transform: scale(0.95);
}

/* ================= ENLACES DENTRO DEL CHAT ================= */
#chat-messages a {
    color: var(--qver-lila-oscuro);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

#chat-messages a:hover {
    color: var(--qver-lila);
    border-bottom-color: var(--qver-lila);
}

/* ================= PRODUCTOS DENTRO DEL CHAT ================= */
.bot-product {
    background: white;
    border-radius: 14px;
    padding: 12px;
    margin: 8px 0;
    border-left: 3px solid var(--qver-lila);
    box-shadow: 0 4px 12px rgba(155, 126, 219, 0.12);
    border: 1px solid rgba(155, 126, 219, 0.16);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
    #chat-widget {
        width: 95%;
        max-width: 380px;
        height: 70vh;
        max-height: 600px;
        bottom: 15px;
        right: 50%;
        transform: translateX(50%);
        border-radius: 20px;
        border: 1px solid rgba(155, 126, 219, 0.18);
    }
    
    #chat-toggle {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
    
    #chat-header {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    #chat-messages {
        padding: 15px;
    }
    
    .message {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .quick-reply-btn {
        font-size: 12px;
        padding: 7px 12px;
    }
    
    #chat-input {
        font-size: 13px;
        padding: 10px;
    }
    
    #chat-send {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

