:root {
    --ai-primary-color: #6366f1;
    --ai-primary-hover: #4f46e5;
    --ai-bg-glass: rgba(255, 255, 255, 0.8);
    --ai-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --ai-border: rgba(229, 231, 235, 0.5);
}

.ai-chat-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--ai-primary-color) !important;
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ai-shadow);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-chat-launcher:hover {
    transform: scale(1.1);
    background: var(--ai-primary-hover) !important;
}

.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: var(--ai-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ai-border);
    border-radius: 20px;
    box-shadow: var(--ai-shadow);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: slideIn 0.4s ease-out;
}

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

.ai-chat-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--ai-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-status {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.ai-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: #f3f4f6;
}

.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    margin-bottom: 5px;
}

.ai-chat-msg-ai {
    align-self: flex-start;
    background: #f8fafc;
    border: 1px solid var(--ai-border);
    border-bottom-left-radius: 4px;
    color: #1e293b;
}

.ai-chat-msg-ai:before {
    content: 'Assistente';
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ai-chat-msg-user {
    align-self: flex-end;
    background: var(--ai-primary-color);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.ai-chat-msg-user:before {
    content: 'Você';
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    text-align: right;
}

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

.ai-chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--ai-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#ai-chat-input {
    flex: 1;
    border: 1px solid var(--ai-border);
    border-radius: 10px;
    padding: 10px 15px;
    max-height: 100px;
    min-height: 44px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

#ai-chat-input:focus {
    border-color: var(--ai-primary-color);
}

.ai-chat-send {
    background: var(--ai-primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chat-send:hover {
    background: var(--ai-primary-hover) !important;
}

.ai-chat-msg.typing {
    font-style: italic;
    color: #6b7280;
}

/* Product Card Styles */
.ai-product-card {
    background: white;
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    margin-top: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.ai-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.ai-product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f9fafb;
    border-bottom: 1px solid var(--ai-border);
}

.ai-product-info {
    padding: 12px;
}

.ai-product-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-product-price {
    font-weight: 700;
    color: var(--ai-primary-color);
    font-size: 16px;
    margin-bottom: 12px;
}

.ai-product-actions {
    display: flex;
    gap: 8px;
}

.ai-btn-buy {
    flex: 1;
    background: var(--ai-primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.ai-btn-buy:hover {
    background: var(--ai-primary-hover);
}

.ai-btn-view {
    padding: 8px;
    border: 1px solid var(--ai-border);
    border-radius: 6px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-btn-view:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Coupon Card Styles */
.ai-coupon-card {
    background: #fdfcf6;
    border: 2px dashed #fcd34d;
    border-radius: 12px;
    margin-top: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.ai-coupon-info {
    flex: 1;
}

.ai-coupon-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-coupon-code:hover {
    background: #fde68a;
}

.ai-coupon-desc {
    font-size: 11px;
    color: #92400e;
    margin-top: 4px;
    line-height: 1.2;
}

.ai-btn-copy-coupon {
    background: #f59e0b !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.ai-btn-copy-coupon:hover {
    background: #d97706 !important;
}
