* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 1px;
    text-align: center;
    position: relative;
}

.chat-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.chat-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.company-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 5px;
    display: block;
}

.status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
}

.chat-messages {
    flex: 1;
    padding: 8px; /* Reducido de 10px a 8px */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reducido de 15px a 8px (47% menos espacio) */
    background-color: #f8fafc;
    min-height: 0; /* Importante: permite que se comprima */
}

.message {
    max-width: 80%;
    padding: 10px 14px; /* Reducido de 12px 16px a 10px 14px */
    border-radius: 16px; /* Reducido de 18px a 16px */
    line-height: 1.3; /* Reducido de 1.4 a 1.3 */
    animation: fadeIn 0.3s ease;
    position: relative;
    margin-bottom: 2px; /* Pequeño margen inferior en lugar de gap grande */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    background-color: white;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Sombra más sutil */
    border: 1px solid #e2e8f0;
    padding: 8px 12px; /* Aún más reducido para mensajes del bot */
}

.user-message {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    padding: 8px 12px; /* Aún más reducido para mensajes del usuario */
}

.chat-input {
    display: flex;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.chat-input button {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background: #2563eb;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e2e8f0;
}

.quick-reply {
    background-color: #eef2ff;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 8px 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background-color: #dbeafe;
}

.timestamp {
    font-size: 9px; /* Reducido de 10px a 9px */
    color: #64748b;
    margin-top: 2px; /* Reducido de 3px a 2px */
    text-align: right;
}

.suggested-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
    padding-left: 5px;
}

.chat-options {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.option-button {
    display: flex;
    align-items: center;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
}

.option-button i {
    margin-right: 5px;
}

.option-button:hover {
    color: #3b82f6;
}

.product-suggestion {
    background: white;
    border-radius: 6px; /* Reducido de 8px */
    padding: 10px; /* Reducido de 12px */
    margin: 6px 0; /* Reducido de 10px */
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Sombra más sutil */
}

.product-suggestion h4 {
    color: #3b82f6;
    margin-bottom: 3px; /* Reducido de 5px */
    font-size: 0.9rem; /* Reducido si era mayor */
}

.product-suggestion p {
    color: #64748b;
    font-size: 0.8rem; /* Reducido de 0.9rem */
}

.rating {
    display: flex;
    margin-top: 5px;
    color: #f59e0b;
}

.typing-indicator {
    display: flex;
    align-items: center;
    color: #64748b;
    font-size: 0.8rem; /* Reducido de 0.9rem */
}

.typing-dots {
    display: flex;
    margin-left: 6px; /* Reducido de 8px */
}

.typing-dot {
    width: 5px; /* Reducido de 6px */
    height: 5px; /* Reducido de 6px */
    background-color: #64748b;
    border-radius: 50%;
    margin: 0 1px; /* Reducido de 2px */
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.help-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.help-button {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s;
}

.help-button:hover {
    background-color: #2563eb;
}

.whatsapp-button {
    background-color: #25D366;
}

.whatsapp-button:hover {
    background-color: #128C7E;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    margin-bottom: 15px;
    color: #2563eb;
}

.modal p {
    margin-bottom: 20px;
    color: #64748b;
}

#qrcode {
    margin: 15px auto;
    display: flex;
    justify-content: center;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.modal-close {
    background-color: #e2e8f0;
    color: #64748b;
}

.modal-whatsapp {
    background-color: #25D366;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
}

.executive-option {
    background-color: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
}

.executive-option h4 {
    color: #d97706;
    margin-bottom: 10px;
}

