W/* Contenedor principal del Bot */
/* --- AJUSTES ESTRUCTURALES NUEVOS --- */

#farma-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#farma-avatar-box {
    width: 200px; 
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #007c52;
    transition: all 0.3s ease;
    background: white;
}

/* Esta clase se activa por JS al abrir el chat */
.chat-abierto #farma-avatar-box {
    width: 100px;  /* Reduce la foto */
    height: 100px;
    margin-bottom: -10px;
}

/* Solo cuando el chat está abierto y se muestra la imagen */
.chat-abierto #farma-avatar-box {
    width: 100px; 
    height: 100px;
    margin-bottom: -10px;
    border: 2px solid #007c52; /* Borde un poco más fino al ser pequeño */
}

/* Eliminamos la franja verde (caption) SOLO cuando el chat está abierto */
.chat-abierto #farma-caption {
    display: none !important;
}

/* Forzamos que la imagen estática ocupe todo el espacio sin franjas */
.chat-abierto #farma-avatar-static {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Si la franja verde es un fondo del contenedor, lo limpiamos aquí */
.chat-abierto #farma-avatar-box {
    background: white; /* O transparente */
}


/* Estado cuando el chat se cierra y queda la foto */
.chat-cerrado-con-foto #farma-avatar-box {
    width: 150px; /* Tamaño intermedio, más grande que en el chat */
    height: 150px;
    bottom: 120px; /* Lo subimos un poco más */
    border: 3px solid #007c52;
}



.chat-cerrado-con-foto #farma-restart-container {
    display: block !important;
    margin-top: -45px; /* Ajusta este valor (ej. -30px) hasta que quede pegado a tu gusto */
    z-index: 10;
    position: relative;
}

#farma-btn-reiniciar {
    background-color: #007c52;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}



/* boton volver */
.farma-btn-regresar {
    cursor: pointer; /* Cambia la flecha por la mano */
    display: inline-block;
    padding: 5px 10px;
    transition: opacity 0.2s;
}

.farma-btn-regresar:hover {
    opacity: 0.8; /* Da un ligero efecto visual al pasar el mouse */
    text-decoration: underline; /* Opcional: subraya el texto al posicionarse */
}


#farma-chat-header {
    /* Fondo con efecto Cristal (Glassmorphism) */
    background: rgba(0, 124, 82, 0.85) !important; 
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    
    /* Bordes y Separación */
    border-bottom: -1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px 25px 0 0; /* Más redondeado arriba */
    
    /* Espaciado para que el avatar no tape el texto */
    padding:-5px 15px 15px 15px !important; 
    margin-top: -10px !important; /* Subimos la franja para que envuelva al avatar */
    
    /* Flexbox */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 5;
    color: white;
}


#farma-close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: transform 0.2s;
}

#farma-close-chat:hover {
    transform: scale(1.2);
    color: #ff4d4d; /* Un tono rojo suave al pasar el mouse */
}



#farma-chat-window {
    width: 370px !important;
    height: 500px !important; /* Altura controlada para que no se corte el input */
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: none; /* Se cambia a flex con JS */
    flex-direction: column;
    overflow: hidden;
}

#farma-chat-messages {
    flex: 1;
    overflow-y: auto; /* Permite scroll si hay muchos botones */
    padding: 10px;
}

/* Asegura que el input siempre esté visible abajo */
#farma-chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
}

/* --- AQUÍ EMPIEZA TU CSS ACTUAL --- */
#farma-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Caja circular del Avatar */
#farma-avatar-box {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden; /* Mantiene el video dentro del círculo */
    border: 4px solid #007f5f;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: #000;
    z-index: 10;
    transform: translateZ(0); /* Fix para renderizado en navegadores basados en Chrome */
}

/* El Video */
#farma-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* Al fondo dentro de la caja */
}

/* Botón de Sonido (Unmute) */
#farma-unmute {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100; /* Por encima del video y de la transcripción */
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    user-select: none;
    border: 1px solid rgba(255,255,255,0.2);
}

#farma-unmute:hover {
    background: #007f5f;
    transform: scale(1.1);
}

/* Caja de Transcripción (Subtítulos) */
#farma-caption {

    position: absolute;
    bottom: 12px; /* La subimos un poco para que flote */
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* Que se ajuste al texto, no a todo el ancho */
    min-width: 60%; 
    background: #007f5f; /* Verde sólido o con muy poca transparencia */
    color: white;
    font-size: 11px; /* Un poco más pequeña para que sea elegante */
    font-weight: 600;
    padding: 4px 15px; /* Más padding a los lados */
    border-radius: 20px; /* Forma de cápsula */
    text-align: center;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.2); /* Un borde fino para dar relieve */

}

/* Botón Principal "Chatear" */
#farma-btn-chatear {
    margin-top: 15px;
    background: #007f5f;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 127, 95, 0.3);
    transition: all 0.3s ease;
}

#farma-btn-chatear:hover {
    background: #005f47;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 127, 95, 0.4);
}

/* Ventana de Chat (Oculta al inicio) */
#farma-chat-window {
    width: 350px;
    height: 450px;
    background: #f9f9f9;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    border: 1px solid #e1e1e1;
    overflow: hidden;
}

#farma-chat-header {
    background: #007f5f;
    color: white;
    padding: 20px;
    font-weight: bold;
    text-align: center;
}

#farma-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

#farma-chat-input-area {
    padding: 15px;
    background: white;
    display: flex;
    border-top: 1px solid #eee;
}

#farma-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 20px;
    outline: none;
}

#farma-send {
    background: #007f5f;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
}

/* Asegura que la imagen sea circular y llene el espacio */
#farma-avatar-static {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: none; /* Se activa por JavaScript */
}

/* Ajuste del contenedor cuando se hace pequeño */
#farma-avatar-box {
    position: relative;
    width: 250px; /* Tamaño inicial */
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #007f5f;
    z-index: 10;
    transition: all 0.5s ease; /* Para que el cambio de tamaño sea suave */
}


#farma-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
}

.farma-msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Burbuja del Asistente (Izquierda) */
.farma-msg-bot {
    align-self: flex-start;
    /*background: #e1f2ed;*/
    color: #333;
    border-bottom-left-radius: 2px;
}

/* Burbuja del Usuario (Derecha) */
.farma-msg-user {
    align-self: flex-end;
    background: #007f5f;
    color: white;
    border-bottom-right-radius: 2px;
}



/* opciones 1re menu */
.farma-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.farma-option-btn {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #007f5f;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 14px;
    color: #333;
    gap: 15px;
}

.farma-option-btn:hover {
    background: #e1f2ed;
    transform: translateY(-2px);
}

.farma-option-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
}





/* Burbuja de búsqueda de productos */
.farma-product-search-container {
    background: #f0f0f0;
    border-radius: 20px;
    padding: 20px;
    margin: 10px 0;
    max-width: 90%;
    align-self: flex-start;
}

.farma-product-search-title {
    font-weight: bold;
    font-size: 15px;
    color: #000;
    margin-bottom: 15px;
    display: block;
}

.farma-search-box {
    position: relative;
    background: white;
    border: 2px solid #000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 5px 15px;
}

.farma-search-box input {
    border: none;
    outline: none;
    width: 100%;
    padding: 10px 0;
    font-size: 14px;
}

.farma-search-box .farma-inline-send {
    cursor: pointer;
    color: #999;
    font-size: 20px;
    transition: color 0.3s;
}

.farma-search-box .farma-inline-send:hover {
    color: #007f5f;
}

.farma-search-help {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    display: block;
}


/* Contenedor para botones en fila */
.farma-flow-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

/* Botones secundarios (más pequeños para que quepan dos) */
.farma-btn-secondary {
    flex: 1 1 45%; /* Ocupan casi la mitad */
    background: white;
    border: 2px solid #007f5f;
    border-radius: 20px;
    padding: 10px 5px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    transition: 0.3s;
}

.farma-btn-wide {
    flex: 1 1 100%; /* Este ocupa todo el ancho abajo */
}

.farma-btn-secondary:hover {
    background: #e1f2ed;
}

.farma-label-small {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}
