/* Estilos para la ventana de saludo */
#greeting-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 280px;
    max-width: 320px;
    background: #1f1f1f;
    color: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    animation: slideIn 0.5s forwards 1s;
    display: none;
}

@keyframes slideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#greeting-header {
    background-color: #efcb7b;
    color: #fff;
    padding: 10px 16px;
    font-weight: 600;
    text-align: center;
    position: relative;
    font-size: 15px;
}

#greeting-body {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
}

#greeting-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #fff;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#greeting-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Estilos para la burbuja de chat */
#chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #efcb7b;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transition: all 0.3s;
}

#chat-bubble:hover {
    transform: scale(1.1);
}

/* 🔹 Hacemos que el ícono ocupe igual que el SVG de WhatsApp */
#chat-bubble i {
    font-size: 32px;
    /* antes 24px */
    color: #fff;
    width: 36px;
    /* ocupa casi todo el círculo */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Estilos para la ventana de chat */
/* Estilos para la ventana de chat */
#chat-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 320px;
    max-width: 95%;
    max-height: 500px;
    /* 🔹 Evita que crezca infinito en desktop */
    background: #1f1f1f;
    color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    z-index: 9999;
    display: none;
    flex-direction: column;
    touch-action: none;
}

/* Ajustamos el cuerpo para que scrollee en lugar de expandirse */
#chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #111;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

#chat-window.active {
    display: flex;
}

#chat-header {
    background-color: #efcb7b;
    color: #fff;
    padding: 12px;
    font-weight: bold;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

#close-chat {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
    color: #fff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    transition: background-color 0.2s;
}

#close-chat:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Ajustamos el cuerpo para que scrollee en lugar de expandirse */
#chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #111;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.assistant-msg,
.user-msg {
    margin-bottom: 10px;
    padding: 10px 16px;
    border-radius: 15px;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    display: block;
}

.assistant-msg {
    background-color: #2c2c2c;
    align-self: flex-start;
    margin-right: auto;
}

.user-msg {
    background-color: #efcb7b;
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
}

#chat-input-container {
    display: flex;
    padding: 8px;
    background: transparent;
    flex-shrink: 0;
    align-items: center;
}

#user-input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 14px;
    background: #2c2c2c;
    color: white;
    border-radius: 20px;
    outline: none;
    resize: none;
    min-height: 20px;
    max-height: 100px;
}

#send-btn {
    background: #efcb7b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.price-list,
.schedule-list {
    margin: 0;
    padding-left: 15px;
}

.price-list li,
.schedule-list li {
    margin-bottom: 5px;
}

/* Estilo para enlaces en los mensajes del bot */
.assistant-msg a {
    color: #efcb7b;
    text-decoration: underline;
}

/* Evita scroll del fondo cuando el chat está activo */
body.chat-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Responsividad mejorada */
@media (max-width: 768px) {
    #greeting-window {
        bottom: 90px;
        right: 16px;
        width: 260px;
        max-width: 260px;
    }

    #greeting-header {
        padding: 8px 12px;
        font-size: 14px;
    }

    #greeting-body {
        padding: 12px;
        font-size: 13px;
    }

    #chat-bubble {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    #chat-bubble i {
        font-size: 20px;
    }

    #chat-window {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        height: 80vh;
        max-height: 500px;
    }

    #chat-body {
        height: auto;
        min-height: 200px;
        max-height: 300px;
        padding: 12px;
    }

    .assistant-msg,
    .user-msg {
        font-size: 16px;
        max-width: 85%;
        padding: 12px 16px;
        margin-bottom: 14px;
    }

    #chat-input-container {
        padding: 8px;
    }

    #user-input {
        padding: 8px 12px;
        font-size: 16px;
    }

    #send-btn {
        width: 32px;
        height: 32px;
        margin-left: 8px;
    }

    #close-chat {
        width: 42px;
        height: 42px;
        font-size: 24px;
        top: 6px;
        right: 6px;
    }

    #greeting-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

/* Para teléfonos pequeños */
@media (max-width: 480px) {
    #greeting-window {
        right: 12px;
        width: 240px;
        max-width: 240px;
    }

    #greeting-header {
        padding: 7px 10px;
        font-size: 13px;
    }

    #greeting-body {
        padding: 10px;
        font-size: 12px;
    }

    #chat-window {
        height: 75vh;
        max-height: 400px;
    }

    #chat-body {
        max-height: 250px;
        padding: 8px;
    }

    .assistant-msg,
    .user-msg {
        font-size: 15px;
        padding: 10px 14px;
        max-width: 90%;
        margin-bottom: 12px;
    }
}

/* Para dispositivos con teclado virtual */
@media (max-height: 600px) {
    #chat-window {
        height: 70vh;
        max-height: 350px;
    }

    #chat-body {
        max-height: 200px;
    }
}

/* ===== Overrides para igualar tamaño con WhatsApp y alinear en mobile ===== */

/* Desktop: icono grande y centrado (ya tienes 60×60 en el contenedor) */
#chat-bubble i,
#chat-bubble svg {
    font-size: 32px;
    /* si es <i> de Font Awesome */
    width: 36px;
    /* si usas <svg>, también se aplica */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile (<=768px): mantener 60×60 igual que WhatsApp y alinear al mismo right */
@media (max-width: 768px) {
    #chat-bubble {
        width: 50px;
        /* antes 50px */
        height: 50px;
        /* antes 50px */
        right: 10px;
        /* alinea con .whatsapp-btn { right: 10px } */
        bottom: 20px;
        /* conserva tu posición; ajústalo si lo quieres más alto */
    }

    #chat-bubble i,
    #chat-bubble svg {
        font-size: 32px;
        width: 36px;
        height: 36px;
    }
}