
/* =========================================
   FLOWERVIEW - CHATBOT USUARIO
   Estilos aislados del resto del ecommerce
========================================= */

.flower-chatbot-usuario {
    --chat-primary: #332724;
    --chat-primary-dark: #332724;
    --chat-pink: #ffc5d3;
    --chat-background: #fffaf9;
    --chat-text: #454545;

    font-family: inherit;
    color: var(--chat-text);

    position: relative;
    width: 0;
    height: 0;
    overflow: visible;

    --dark-bg: #332724;
    --brown-bg: #443734;
    --text-light: #eef1f5;    
    --light-leaf: #7dc262; 
    --dark-leaf: #2f8344;
    --unactive-leaf: #9ab98e;  
}
/* =========================================
    DISEÑO NOMBRE Y PRECIO PRODUCTO
========================================= */

.chatbot-inline-name {
    font-weight: 700 !important;
    font-style: italic;
    color: #2f8344 !important;
}

.chatbot-inline-price {
    font-weight: 700 !important;
    color: var(--dark-bg) !important;
    border-radius: 6px !important;
    padding: 0 0.3em !important;
    white-space: nowrap !important;   /* evita que "$19.000" se parta en dos líneas */
}

/* =========================================
   BOTÓN FLOTANTE
========================================= */

.flower-chatbot-usuario .toggle-box {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 4rem;
    height: 4rem;
    border: none;
    border-radius: 1rem;
    background: var(--dark-bg);
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
    line-height: 1;
    display: inline-block;
    z-index: 9998;
    transition: transform 0.45s ease;
}

.chatbot-toggle{
    position: relative;
    border: none;
    padding: 0;
    margin: 0;
    height: 0;
    width: 0;
}

.flower-chatbot-usuario .toggle-box:hover {
    background: var(--brown-bg);
    transform: scale(1.07);
}

.flower-chatbot-usuario .chatbot-toggle i{
    position: absolute;
    transform: translate(55%, -20%);
    color: var(--text-light)
}
/* =========================================
   VENTANA DEL CHAT
========================================= */

.flower-chatbot-usuario .chatbot-window {
    position: fixed;
    right: 1rem;
    bottom: 6rem;
    width: 25rem;
    height: fit-content;
    min-height: 30rem;
    max-height: calc(100vh - 125px);
    background: var(--chat-background);
    border-radius: clamp(10px, 1vw, 12px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: none;

    box-sizing: border-box;
    max-width: calc(100vw - 20px);
    min-width: 0;
    transition: height 0.75s ease;
}

.flower-chatbot-usuario .chatbot-window[hidden] {
    height: 10rem;
    display: none;
}

/* =========================================
   ENCABEZADO
========================================= */

.flower-chatbot-usuario .chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--chat-primary);
    color: white;
}

.flower-chatbot-usuario .chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flower-chatbot-usuario .chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--chat-pink);
    color: var(--chat-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.flower-chatbot-usuario .chatbot-header h2 {
    font-size: 16px;
    margin: 0 0 4px;
    font-weight: 600;
}

.flower-chatbot-usuario .chatbot-header span {
    font-size: 12px;
    opacity: 0.9;
}

.flower-chatbot-usuario .chatbot-close {
    border: none;
    background: transparent;
    color: white;
    font-size: 27px;
    cursor: pointer;
}

/* =========================================
   MENSAJES
========================================= */

.flower-chatbot-usuario .chatbot-messages {
    flex: 1;
    min-width: 0;
    padding: 18px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flower-chatbot-usuario .chatbot-message {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.flower-chatbot-usuario .chatbot-message-bot {
    align-self: flex-start;
    background: #f3e9ec;
    border-bottom-left-radius: 4px;
}

.flower-chatbot-usuario .chatbot-message-user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.flower-chatbot-usuario .chatbot-message-loading {
    font-style: italic;
    opacity: 0.7;
}

/* =========================================
   PRODUCTOS RECOMENDADOS
========================================= */

.flower-chatbot-usuario .chatbot-products-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.flower-chatbot-usuario .chatbot-products-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--chat-text);
    margin: 4px 0;
}

.flower-chatbot-usuario .chatbot-product-card {
    display: flex;
    align-items: stretch;
    gap: 11px;
    width: 100%;
    height: 7.5rem;
    min-width: 0;
    padding: 0;
    background: white;
    border-radius: 13px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.flower-chatbot-usuario .chatbot-product-image-container {
    width: 115px;
    min-width: 115px;
    height: 100%;
    border-top-left-radius: 9px;
    border-bottom-left-radius: 9px;
    overflow: hidden;
    background: #f3e9ec;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 10px;
    color: #777;
}

.flower-chatbot-usuario .chatbot-product-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.flower-chatbot-usuario .chatbot-product-information {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 10px;
}

.flower-chatbot-usuario .chatbot-product-name {
    font-size: 13px;
    max-height: 2rem;
    min-width: 0;
    line-height: 1.3;
    font-weight: 500;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-wrap: anywhere;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flower-chatbot-usuario .chatbot-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--chat-primary);
    margin: 2px 0;
}

/* =========================================
   BOTÓN AGREGAR AL CARRITO
========================================= */

.flower-chatbot-usuario .chatbot-add-cart {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: none;
    border-radius: 8px;
    background: var(--light-leaf);
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.flower-chatbot-usuario .chatbot-add-cart:hover:not(:disabled) {
    background: var(--dark-leaf);
    transform: translateY(-1px);
}

.flower-chatbot-usuario .chatbot-add-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.flower-chatbot-usuario .chatbot-add-cart:focus-visible {
    outline: 2px solid var(--chat-pink);
    outline-offset: 2px;
}

/* =========================================
   FORMULARIO
========================================= */

.flower-chatbot-usuario .chatbot-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee3e5;
    min-width: 0;
    box-sizing: border-box;
}

.flower-chatbot-usuario .chatbot-form input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5d9dc;
    border-radius: 25px;
    outline: none;
    font-size: 13px;
    box-sizing: border-box;
}

.flower-chatbot-usuario .chatbot-form input:focus {
    border-color: var(--chat-primary);
}

.flower-chatbot-usuario .chatbot-form button {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    font-size: 19px;
    cursor: pointer;
}

.flower-chatbot-usuario .chatbot-form button:hover {
    background: var(--chat-primary-dark);
}
/* =========================================
   BARRA DE SCROLL
========================================= */

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
    margin: 6px 0;                 /* separa la pista de los bordes redondeados */
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--dark-bg);
    border-radius: 999px;
}

/* =========================================
   PIE DEL CHAT
========================================= */

.flower-chatbot-usuario .chatbot-footer {
    padding: 7px;
    padding-top: 0;
    text-align: center;
    font-size: 10px;
    color: #999;
    background: white;
}

/* =========================================
   RESPONSIVE - TABLETS Y CELULARES
========================================= */

@media (max-width: 480px) {

    .flower-chatbot-usuario .chatbot-toggle {
        .chatbot-toggle{
        position: relative;
        border: none;
        padding: 0;
        margin: 0;
        height: 0;
        width: 0;
}
    }

    .flower-chatbot-usuario .chatbot-toggle i{
        position: absolute;
        transform: translate(55%, -20%);
        color: var(--text-light)
    }

    .flower-chatbot-usuario .chatbot-window {
        right: 10px;
        bottom: 6rem;
        width: calc(100vw - 20px);
        min-height: 30rem;
        height: fit-content;
        margin-top: 5rem;
        max-height: calc(100vh - 105px);
        border: 0;
    }

    .flower-chatbot-usuario .chatbot-messages {
        padding: 13px 10px;
    }

    .flower-chatbot-usuario .chatbot-product-card {
        height: 105px;
    }

    .flower-chatbot-usuario .chatbot-product-image-container {
        width: 100px;
        min-width: 100px;
        height: 105px;
    }

    .flower-chatbot-usuario .chatbot-product-name {
        font-size: 12px;
        line-height: 1;
        max-height: 1.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .flower-chatbot-usuario .chatbot-product-price {
        font-size: 13px;
    }

    .flower-chatbot-usuario .chatbot-add-cart {
        font-size: 10px;
    }
}

/* =========================================
   CELULARES MUY PEQUEÑOS
========================================= */

@media (max-width: 350px) {

    .flower-chatbot-usuario .chatbot-product-image-container {
        width: 70px;
        min-width: 70px;
        height: 95px;
    }

    .flower-chatbot-usuario .chatbot-product-card {
        gap: 7px;
        padding: 7px;
    }

    .flower-chatbot-usuario .chatbot-product-description {
        font-size: 10px;
    }
}
