#medifarm-ai-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#medifarm-ai-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0f9d58;
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#medifarm-ai-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 340px;
    max-height: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.medifarm-ai-hidden {
    display: none !important;
}

#medifarm-ai-header {
    background: #0f9d58;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

#medifarm-ai-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

#medifarm-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 200px;
}

.medifarm-ai-msg {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.4;
}

.medifarm-ai-user {
    background: #0f9d58;
    color: #fff;
    margin-left: auto;
}

.medifarm-ai-bot {
    background: #f1f1f1;
    color: #222;
}

.medifarm-ai-typing {
    font-style: italic;
    opacity: 0.7;
}

.medifarm-ai-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.medifarm-ai-product-card {
    display: flex;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 6px;
    transition: box-shadow 0.15s ease;
}

.medifarm-ai-product-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.medifarm-ai-product-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.medifarm-ai-product-name {
    font-size: 13px;
    font-weight: 600;
}

.medifarm-ai-product-price {
    font-size: 13px;
    color: #0f9d58;
}

.medifarm-ai-out-of-stock {
    font-size: 11px;
    color: #c0392b;
}

#medifarm-ai-form {
    display: flex;
    border-top: 1px solid #eee;
}

#medifarm-ai-input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 14px;
    outline: none;
}

#medifarm-ai-form button {
    border: none;
    background: #0f9d58;
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
}

@media (max-width: 400px) {
    #medifarm-ai-window {
        width: calc(100vw - 40px);
    }
}
