:root {
    --primary-color: #2f3542;
    --text-color: #ffffff;
}

body {
    font-family: 'Raleway', sans-serif;
}

.widget {
    display: none;
    position: fixed !important;
    bottom: 90px !important;
    right: 20px !important;
    width: 350px !important;
    height: 500px !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    z-index: 99998 !important;
    transition: all 0.3s ease;
}

.chat_header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 15px;
    background: var(--primary-color);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.chat_header_title {
    color: white;
    font-size: 16px;
    margin: 0;
}

.chats {
    max-height: calc(100% - 110px);
    overflow-y: auto;
    padding: 15px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
    background: #ffffff !important;
    position: relative !important;
    z-index: 99997 !important;
}

div.chats::-webkit-scrollbar {
    overflow-y: hidden;
    width: 0px;
    background: transparent;
}

.botAvatar {
    float: left;
    margin-right: 10px;
    margin-top: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-block;
}

.botMsg {
    float: left;
    margin-left: 5px;
    max-width: 70%;
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.message-icon {
    margin-right: 5px;
    font-size: 16px;
}

.userMsg {
    animation: fadeIn 0.3s ease;
    margin-top: 5px;
    word-wrap: break-word;
    float: right;
    margin-right: 10px;
    background: #fff;
    color: #333;
    padding: 10px 15px;
    border-radius: 15px 15px 0 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.1);
    max-width: 70%;
}

.userAvatar {
    float: right;
    margin-left: 5px;
    margin-top: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-block;
}

.usrInput {
    padding: 0.5em;
    width: 80%;
    margin-left: 4%;
    border: 0;
    padding-left: 15px;
    height: 40px;
}

.keypad {
    background: white;
    height: 50px;
    position: absolute;
    bottom: 0px;
    width: 100%;
    padding: 5px;
    border-radius: 0 0 10px 10px;
}

#sendButton {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    float: right;
    margin-right: 30px;
    text-align: center;
    padding: 5px;
    font-size: 20px;
    cursor: pointer;
    color: var(--primary-color);
}

/* Quick Replies */
.suggestions {
    padding: 5px;
    width: 80%;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 2px 5px 5px 1px #dbdade;
}

.menuChips {
    display: block;
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 14px;
    word-wrap: break-word;
}

/* Bot Typing Animation */
.botTyping {
    float: left;
    margin-top: 5px;
    background: var(--primary-color);
    color: white;
    box-shadow: 2px 3px 9px 0px #9a82847a;
    margin-left: 0.5em;
    padding: 10px;
    border-radius: 0 20px 20px 20px;
    max-width: 60%;
    min-width: 20%;
    word-wrap: break-word;
}

.botTyping > div {
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    margin-right: 5px;
}

/* Animations */
@keyframes animateElement {
    0% {
        opacity: 0;
        transform: translate(0px, 10px);
    }
    100% {
        opacity: 1;
        transform: translate(0px, 0px);
    }
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }
    40% {
        -webkit-transform: scale(1.0);
        transform: scale(1.0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
input:focus, 
video:focus {
    outline: none;
}

.clearfix {
    clear: both;
    margin-bottom: 15px;
    overflow: hidden;
}

.chat-bubble {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 60px !important;
    height: 60px !important;
    background-color: #2f3542 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    z-index: 99999 !important;
    padding: 12px !important;
    overflow: hidden !important;
}

.chat-bubble img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1) !important;
}

.userAvatar, .botAvatar {
    width: 30px;
    height: 30px;
    margin-top: 5px;
}

.close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 5px;
    color: white;
}

.close svg {
    width: 16px;
    height: 16px;
    display: block;
}

@media (max-width: 480px) {
    .widget {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .botMsg, .userMsg {
        max-width: 85%;
    }
}

.typing-indicator {
    padding: 8px;
    background: rgba(226,55,68,0.1);
    border-radius: 15px;
    margin-left: 45px;
    margin-bottom: 10px;
    display: none; /* Se muestra cuando el bot está "escribiendo" */
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: var(--primary-color);
    display: inline-block;
    border-radius: 50%;
    margin-right: 5px;
    animation: typing 1s infinite;
}

.userAvatar img, .botAvatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover; /* Asegura que la imagen cubra bien el círculo */
}

.userAvatar, .botAvatar {
    width: 30px;
    height: 30px;
    margin-top: 5px;
    border-radius: 50%;
    overflow: hidden; /* Asegura que la imagen se mantenga dentro del círculo */
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 20px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.whatsapp-link:hover {
    background: #128C7E;
    text-decoration: none;
    color: white;
}

.whatsapp-link svg {
    width: 24px;
    height: 24px;
}

.botMsg a {
    color: white;
    text-decoration: underline;
}

.botMsg a:hover {
    color: #f0f0f0;
}

/* Modificar los estilos de la animación */
.dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    background: var(--primary-color);
    border-radius: 15px;
    margin-left: 45px;
    margin-bottom: 10px;
    min-width: 60px;
    max-width: 100px;
}

.dot {
    height: 8px;
    width: 8px;
    margin: 0 3px;
    border-radius: 50%;
    background-color: #ffffff;
    animation: pulse 1.5s infinite ease-in-out;
}

.dot:last-child {
    margin-right: 0;
}

.dot:nth-child(1) {
    animation-delay: -0.3s;
}

.dot:nth-child(2) {
    animation-delay: -0.1s;
}

.dot:nth-child(3) {
    animation-delay: 0.1s;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        background-color: #ffffff;
    }
    50% {
        transform: scale(1.2);
        background-color: #f0f0f0;
    }
    100% {
        transform: scale(0.8);
        background-color: #ffffff;
    }
}

.social-button {
    margin: 10px 0;
}

.social-button a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-button svg {
    flex-shrink: 0;
}

.whatsapp-button a {
    background-color: #25D366;
}

.whatsapp-button a:hover {
    background-color: #128C7E;
}

.instagram-button a {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
}

.instagram-button a:hover {
    opacity: 0.9;
}

/* Asegurar que los mensajes estén siempre visibles */
.chats {
    background: #ffffff !important;
    position: relative !important;
    z-index: 99997 !important;
}

/* Asegurar que el fondo de la sección de contacto no interfiera */
.contact-sectn {
    position: relative;
    z-index: 1;
}