/* ===== CHATBOT GEMINI - Botón flotante y panel ===== */

/* Grupo de botones flotantes (WhatsApp + Chatbot apilados) */
.footer-fab-group {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

/* Ajustar posición individual de los FABs (ya no usan position fixed propio) */
.footer-fab-group .footer-whatsapp-fab,
.footer-fab-group .footer-chatbot-fab {
    position: relative;
    bottom: auto;
    right: auto;
}

/* Botón del chatbot - paleta JYS (negro, amarillo, blanco) */
.footer-chatbot-fab {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #FFD700, #FFC000);
    color: #1a1a1a;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 200, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-chatbot-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 200, 0, 0.5);
}

.footer-chatbot-fab:focus {
    outline: none;
}

/* Panel del chat */
.chatbot-panel {
    position: fixed;
    bottom: 0;
    right: 1.5rem;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.chatbot-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Header del chat - negro con acento amarillo */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.chatbot-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-title i {
    font-size: 1.1rem;
    color: #FFD700;
}

.chatbot-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 215, 0, 0.3);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.chatbot-msg-bot {
    align-self: flex-start;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

.chatbot-msg-user {
    align-self: flex-end;
    background: #1a1a1a;
    color: #fff;
}

.chatbot-msg p {
    margin: 0;
    white-space: pre-wrap;
}

/* Botones de productos recomendados */
.chatbot-product-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.chatbot-product-btn {
    display: block;
    padding: 10px 14px;
    background: linear-gradient(135deg, #FFD700, #FFC000);
    color: #1a1a1a !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-product-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 200, 0, 0.4);
    color: #1a1a1a !important;
}

.chatbot-msg.chatbot-msg-loading .chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: chatbot-bounce 1.4s ease-in-out infinite both;
}

.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input */
.chatbot-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chatbot-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #FFD700, #FFC000);
    color: #1a1a1a;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
    .footer-fab-group {
        bottom: 1rem;
        right: 1rem;
        gap: 8px;
    }

    .footer-fab-group .footer-whatsapp-fab {
        width: 48px;
        height: 48px;
        font-size: 1.35rem;
    }

    .footer-chatbot-fab {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .chatbot-panel {
        right: 0;
        left: 0;
        width: 100%;
        max-width: none;
        border-radius: 16px 16px 0 0;
    }
}
