﻿.bdr-searchwa-wrapper {
    width: 100%;
    flex-shrink: 0;
    padding: 0 10px 8px;
    background: #fff;
    box-sizing: border-box;
    margin-top: auto;
    margin-bottom: 20px;
    bottom: 8px;
    z-index: 20;
    /* FIJO ABAJO DENTRO DEL SCROLL */
    position: sticky;
}
.bdr-searchwa {
    display: grid;
    grid-template-columns: 25px 1fr 25px;
    grid-template-areas:
        "clear textarea send";
    align-items: center;
    width: 100%;
    min-height: 50px;



    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #808080;
    border-radius: 25px;
    box-sizing: border-box;

}


/* Textarea */
#search-containerwa {
    grid-area: textarea;
    width: 100%;
    min-width: 0;
    height: 28px;
    max-height: 120px;
    padding: 4px 10px;
    margin: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    line-height: 20px;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

#search-containerwa {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #b8bec7 transparent;
}

    /* Chrome, Edge, Safari */
    #search-containerwa::-webkit-scrollbar {
        width: 4px;
    }

    #search-containerwa::-webkit-scrollbar-track {
        background: transparent;
    }

    #search-containerwa::-webkit-scrollbar-thumb {
        background-color: #b8bec7;
        border-radius: 10px;
    }

        #search-containerwa::-webkit-scrollbar-thumb:hover {
            background-color: #8f96a0;
        }


/* Botón enviar */
.btn-Tosend {
    grid-area: send;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

    /* Hover */
    .btn-Tosend:hover {
        background: #1d4ed8;
    }

    /* Al presionar */
    .btn-Tosend:active {
        transform: scale(0.92);
    }

/* Flecha */
.Content-Tosend {
    font-size: 18px;
    line-height: 1;
    font-weight: 600;
    pointer-events: none;
}
/* Clase: btn-clear | ID: btn-clear-search | Name: btn-clearsearch */
/* Botón limpiar */
.btn-clear-wa {
    grid-area: clear;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    min-width: 25px;
    height: 25px;
    margin: 0 0 0 4px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    visibility: visible;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
}
/* Ocultación por JS */
    .btn-clear-wa.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
.bdr-searchwa.multiline {
    grid-template-columns: 25px 1fr 25px;
    grid-template-areas:
        "textarea textarea textarea"
        "clear    .        send";
    row-gap: 6px;
}
/* =====================================================
   CONTENEDOR DE MENSAJES
   ===================================================== */

.wa-messages {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    min-height: 100%;
    gap: 10px;
    padding: 10px 4px;
    box-sizing: border-box;
    flex-shrink: 0;
}


/* =====================================================
   FILAS
   ===================================================== */

.wa-message-row {
    display: flex;
    width: 100%;
}

    /* Usuario → derecha */
    .wa-message-row.user {
        justify-content: flex-end;
    }

    /* IA → izquierda */
    .wa-message-row.assistant {
        justify-content: flex-start;
    }


/* =====================================================
   BURBUJA BASE
   ===================================================== */

.wa-message {
    width: fit-content;
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}


/* =====================================================
   USUARIO
   ===================================================== */

.wa-message-row.user .wa-message {
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}


/* =====================================================
   WACHAT IA
   ===================================================== */

.wa-message-row.assistant .wa-message {
    background: #f1f3f5;
    color: #2c3e50;
    border-bottom-left-radius: 5px;
}
.wa-ai-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 5px 12px;
    color: #9ca3af;
    background: #ffffff;
    box-sizing: border-box;
    user-select: none;
}

.wa-ai-notice-icon {
    flex-shrink: 0;
    font-size: 12px;
    color: #9ca3af;
}

.wa-ai-notice-text {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    color: #9ca3af;
}
.wa-scroll-bottom {
    position: sticky;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    width: 34px;
    height: 34px;
    margin-top: -34px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #ffffff;
    color: #4b5563;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    z-index: 30;
    transition: transform 0.15s ease, background-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.wa-content.no-chat-scroll {
    overflow-y: hidden !important;
}
    .wa-scroll-bottom.show {
        display: flex;
    }

    .wa-scroll-bottom:hover {
        background: #f3f4f6;
    }

    .wa-scroll-bottom:active {
        transform: translateX(-50%) scale(0.92);
    }
@media (min-width: 600px) {
    .bdr-searchwa-wrapper {
        margin-bottom: 25px;
    }
}
