
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.tiw-chat-bot {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 9999;
    
}

.tiw-chat-boton {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0066cc;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    
}

.tiw-chat-boton:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,102,204,0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.tiw-chat-contenedor {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 380px;
    height: 580px;
    background: white;
    border-radius: 16px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    
    
}

.tiw-chat-contenedor.active {
    display: flex;
    
}


.tiw-chat-encabezado {
    background: #0066cc;
    color: white;
    padding: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    
}

.tiw-chat-encabezado-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tiw-chat-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #000000;
}



.tiw-chat-encabezado-texto h3 {
    font-size: 16px;
    margin: 0;
    margin-bottom: 3px;
    font-weight: 600;
    line-height: 1.2;
}

.tiw-chat-estado {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.tiw-estado-indicador {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    
}

.tiw-chat-mensajes {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #b4b4b4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tiw-chat-mensajes::-webkit-scrollbar {
    width: 6px;
}

.tiw-chat-mensajes::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tiw-chat-mensajes::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 3px;
}


.tiw-mensajes {
    margin-bottom: 0;
    animation: fadeIn 0.3s ease-in;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}



.tiw-bot-mensajes {
    align-self: flex-start;
}

.tiw-user-mensajes {
    align-self: flex-end;
}

.tiw-mensajes-contenido {
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.tiw-bot-mensajes .tiw-mensajes-contenido {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    
}

.tiw-user-mensajes .tiw-mensajes-contenido {
    background: #0066cc;
    color: white;
    border-bottom-right-radius: 4px;
    
}

.tiw-mensajes-tiempo {
    font-size: 11px;
    color: #000000;
    margin-top: 4px;
    padding: 0 4px;
}

.tiw-user-mensajes .tiw-mensajes-tiempo {
    text-align: right;
}

.tiw-mensajes-contenido strong {
    font-weight: 600;
    color: #0066cc;
}

.tiw-bot-mensajes .tiw-mensajes-contenido strong {
    color: #0066cc;
}

.tiw-user-mensajes .tiw-mensajes-contenido strong {
    color: white;
    font-weight: 600;
}

.tiw-mensajes-contenido a {
    color: #0066cc;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.tiw-mensajes-contenido a:hover {
    color: #004499;
}

.tiw-user-mensajes .tiw-mensajes-contenido a {
    color: white;
}



.tiw-typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    align-items: center;
    gap: 4px;
}

.tiw-typing-indicator.active {
    display: flex;
}

.tiw-typing-indicator span {
    height: 8px;
    width: 8px;
    background: #0066cc;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
}

.tiw-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.tiw-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.tiw-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { 
        transform: translateY(0);
        opacity: 0.7;
    }
    30% { 
        transform: translateY(-8px);
        opacity: 1;
    }
}


.tiw-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    animation: fadeIn 0.3s ease;
}

.tiw-quick-replies.hidden {
    display: none;
}

.tiw-quick-reply-btn {
    background: white;
    border: 2px solid #0066cc;
    color: #0066cc;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
    font-family: inherit;
}

.tiw-quick-reply-btn:hover {
    background: #0066cc;
    color: white;
    transform: translateY(-2px);
   
}

.tiw-quick-reply-btn:active {
    transform: translateY(0);
}

.tiw-quick-reply-btn i {
    margin-right: 4px;
}

.tiw-chat-input-area {
    padding: 10px;
    background: white;
    
}

.tiw-chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tiw-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #6c757d;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}


.tiw-send-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #0066cc;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    
}

.tiw-send-button:hover {
    transform: scale(1.1);
    
}


.tiw-send-button i {
    pointer-events: none;
}


.tiw-powered-by {
    text-align: center;
    padding: 5px 5px;
    font-size: 11px;
    background: #a0a0a0;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tiw-powered-by button {
    margin-left: 10px;
    padding: 6px 12px;
    font-size: 11px;
    border: none;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #000000;
}

.tiw-powered-by button:hover {
    background: #ff4444;
    
}

.tiw-powered-by button i {
    font-size: 12px;
}



.tiw-mensajes-contenido a[href^="https://wa.me"] {
    display: inline-block;
    background: #25D366;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    margin: 4px 0;
}


@media (max-width: 480px) {
    .tiw-chat-contenedor {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 80px;
    }
    
    .tiw-chat-bot {
        right: 65px;
        bottom: 10px;
    }

    .tiw-chat-boton {
        width: 55px;
        height: 55px;
        font-size: 24px;
        
    }

    .tiw-mensajes {
        max-width: 90%;
    }

    .tiw-quick-reply-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 360px) {
    .tiw-chat-contenedor {
        width: calc(100vw - 10px);
        right: 5px;
    }

    .tiw-chat-bot {
        right: 65px;
    }
}
