:root {
    --km-primary: #2563eb;
    --km-bg: #ffffff;
    --km-text: #1e293b;
    --km-bubble-bot: #f1f5f9;
    --km-bubble-user: #2563eb;
    --km-text-user: #ffffff;
    --km-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

#km-chatbot-container * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#km-chatbot-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--km-primary);
    color: white;
    box-shadow: var(--km-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.2s ease-in-out;
}

#km-chatbot-launcher:hover {
    transform: scale(1.1);
}

#km-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--km-bg);
    box-shadow: var(--km-shadow);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#km-chatbot-window.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#km-chatbot-header {
    background: var(--km-primary);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#km-chatbot-header .bot-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#km-chatbot-header .bot-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
}

#km-chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.km-msg-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.km-msg-bot {
    align-self: flex-start;
    background: var(--km-bubble-bot);
    color: var(--km-text);
    border-bottom-left-radius: 4px;
}

.km-msg-user {
    align-self: flex-end;
    background: var(--km-bubble-user);
    color: var(--km-text-user);
    border-bottom-right-radius: 4px;
}

.km-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--km-bubble-bot);
    border-radius: 18px;
    width: fit-content;
}

.km-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: km-fade 1.4s infinite both;
}

.km-typing span:nth-child(2) { animation-delay: 0.2s; }
.km-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes km-fade {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.km-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.km-chip {
    background: #fff;
    border: 1px solid var(--km-primary);
    color: var(--km-primary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.km-chip:hover {
    background: var(--km-primary);
    color: #fff;
}

#km-chatbot-footer {
    padding: 16px;
    border-top: 1px solid #f1f5f9;
}

#km-chatbot-input-container {
    display: flex;
    gap: 8px;
}

#km-chatbot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

#km-chatbot-input:focus {
    border-color: var(--km-primary);
}

.km-send-btn {
    background: var(--km-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.km-product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.km-product-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    text-align: center;
    padding-bottom: 10px;
}

.km-product-card img { width: 100%; height: 100px; object-fit: cover; }
.km-product-card h4 { margin: 8px 5px; font-size: 12px; }
.km-product-card .price { color: var(--km-primary); font-weight: bold; font-size: 12px; }

.km-lead-form {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.km-lead-form input {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
}

.km-lead-form button {
    width: 100%;
    background: var(--km-primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

.km-menu-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
}

.km-dropdown {
    position: absolute;
    top: 50px;
    right: 15px;
    background: white;
    box-shadow: var(--km-shadow);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 10001;
    color: #1e293b;
    list-style: none;
    margin: 0;
    min-width: 140px;
}

.km-dropdown li {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

.km-dropdown li:hover {
    background: #f1f5f9;
}
