:root {
    --verde-principal: #006400;
    --verde-degradado-inicio: #83cbe4;
    --verde-degradado-fin: #06680a;
    --fondo: #f8f9fa;
    --texto: #333333;
}

body { font-family: 'Segoe UI', sans-serif; background-color: var(--fondo); margin: 0; }

/* --- BOTÓN FLOTANTE 3D --- */
#jumi-btn {
    position: fixed; bottom: 20px; right: 20px; width: 70px; height: 70px;
    cursor: pointer; z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    
    /* Esto hace la magia para que sea redondo */
    border-radius: 50%;
    overflow: hidden; 
    box-shadow: 0px 8px 15px rgba(0,0,0,0.3); /* Sombra al contenedor */
    background-color: white; /* Por si la imagen tiene fondo transparente */
    
    animation: flotar3D 4s ease-in-out infinite;
    transition: transform 0.3s ease;
}

#jumi-btn img {
    width: 100%; height: 100%; 
    object-fit: cover; /* Obliga a la imagen a llenar el círculo sin deformarse */
    border-radius: 50%; /* Hace que la imagen también sea redonda */
    transition: all 0.3s ease;
}

#jumi-btn:hover img {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0px 15px 20px rgba(0,0,0,0.4));
}

/* Animación de saludo (un pequeño salto y giro) */
.saludando img {
    animation: saludarRobot 0.6s ease-in-out;
}

@keyframes flotar3D {
    0%, 100% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
    50% { transform: translateY(-8px) rotateX(10deg) rotateY(-10deg); }
}

@keyframes saludarRobot {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(-15deg) translateY(-15px); }
    100% { transform: scale(1) rotate(0deg); }
}

/* --- VENTANA DE CHAT CON TRANSICIÓN SUAVE --- */
#chat-window {
    position: fixed; bottom: 100px; right: 20px; width: 350px; height: 500px;
    background: white; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex; flex-direction: column; z-index: 1000; overflow: hidden;
    
    /* Transición suave elástica */
    transform-origin: bottom right;
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-window.hidden {
    opacity: 0;
    transform: scale(0.5) translateY(50px);
    pointer-events: none; /* Evita clics cuando está oculto */
}

/* Cabecera */
.chat-header {
    background: linear-gradient(135deg, var(--verde-degradado-inicio), var(--verde-degradado-fin));
    color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center;
}
.header-info { display: flex; align-items: center; gap: 10px; }
.header-avatar { 
    width: 45px; 
    height: 45px; 
    object-fit: cover; /* Para que llene el círculo sin estirarse */
    border-radius: 50%; 
    background: white; 
    border: 2px solid white; /* Un bordecito para que resalte */
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.2)); 
}
.chat-header h3 { margin: 0; font-size: 16px; }
.chat-header span { font-size: 12px; opacity: 0.8; }
.chat-header button { background: none; border: none; color: white; font-size: 18px; cursor: pointer; transition: transform 0.2s; }
.chat-header button:hover { transform: scale(1.2); }

/* Mensajes */
#chat-messages { flex: 1; padding: 15px; overflow-y: auto; background: var(--fondo); display: flex; flex-direction: column; gap: 10px; }
.message { padding: 10px 15px; border-radius: 15px; max-width: 80%; font-size: 14px; color: var(--texto); animation: aparecerMensaje 0.3s ease; }
.bot-message { background: white; border: 1px solid #ddd; align-self: flex-start; border-bottom-left-radius: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.user-message { background: var(--verde-principal); color: white; align-self: flex-end; border-bottom-right-radius: 0; }

@keyframes aparecerMensaje {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input */
.chat-input { display: flex; padding: 10px; background: white; border-top: 1px solid #ddd; }
.chat-input input { flex: 1; padding: 10px 15px; border: 1px solid #ccc; border-radius: 20px; outline: none; font-size: 14px; transition: border 0.3s; }
.chat-input input:focus { border-color: var(--verde-principal); }
.chat-input button { background: var(--verde-principal); color: white; border: none; padding: 10px 15px; margin-left: 10px; border-radius: 20px; cursor: pointer; font-weight: bold; transition: background 0.3s, transform 0.1s; }
.chat-input button:hover { background: var(--verde-degradado-fin); }
.chat-input button:active { transform: scale(0.95); }

/* --- TARJETAS DE PRODUCTOS EN EL CHAT --- */
.productos-contenedor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
    animation: aparecerMensaje 0.4s ease;
}

.producto-tarjeta {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.producto-tarjeta:hover {
    transform: scale(1.02);
    border-color: var(--verde-principal);
}

.prod-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
}

.prod-info {
    flex: 1;
}

.prod-info h4 {
    margin: 0;
    font-size: 14px;
    color: var(--texto);
}

.prod-categoria {
    margin: 2px 0;
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
}

.prod-precio {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: var(--verde-principal);
}

.opciones-contenedor {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    animation: aparecerMensaje 0.4s ease;
}

.opcion-btn {
    background-color: white;
    color: var(--verde-principal);
    border: 1.5px solid var(--verde-principal);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.opcion-btn:hover {
    background-color: var(--verde-principal);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Estilo para el botón de enlace dentro de la tarjeta */
.btn-ver-producto {
    background-color: var(--verde-principal);
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-left: auto; /* Empuja el botón a la derecha */
    transition: background 0.3s;
}

.btn-ver-producto:hover {
    background-color: var(--verde-degradado-fin);
}