/* AI Compare - styles */
.aicompare-wrapper {
    margin: 15px 0;
}

.aicompare-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    line-height: 1;
}
.aicompare-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: #fff !important;
}
.aicompare-icon { font-size: 18px; }

/* Modal */
.aicompare-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aicompare-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.aicompare-dialog {
    position: relative;
    background: #fff;
    width: 92%;
    max-width: 640px;
    max-height: 88vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: aicompareIn 0.2s ease-out;
}
@keyframes aicompareIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.aicompare-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.aicompare-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}
.aicompare-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    opacity: 0.85;
}
.aicompare-close:hover { opacity: 1; }

.aicompare-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.aicompare-step { display: none; flex: 1; flex-direction: column; }
.aicompare-step.active { display: flex; }

.aicompare-intro {
    margin: 0 0 16px;
    color: #555;
    font-size: 15px;
}
.aicompare-suggestions h4,
.aicompare-search h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.6px;
    margin: 0 0 10px;
    font-weight: 600;
}
.aicompare-search { margin-top: 24px; }

.aicompare-search-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.aicompare-search-input:focus { border-color: #667eea; }

.aicompare-suggestions-list,
.aicompare-search-results {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.aicompare-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.aicompare-card:hover {
    border-color: #667eea;
    background: #faf9ff;
}
.aicompare-card img,
.aicompare-noimg {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f3f3;
    flex-shrink: 0;
}
.aicompare-card-info { flex: 1; min-width: 0; }
.aicompare-card-name {
    font-weight: 500;
    font-size: 14px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aicompare-card-price {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    margin-top: 3px;
}

/* Chat */
.aicompare-products-bar {
    margin-bottom: 12px;
    min-height: 0;
}
.aicompare-bar-label {
    display: inline-block;
    background: #f0eefb;
    color: #5a4a9f;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.aicompare-chat-messages {
    flex: 1;
    min-height: 220px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aicompare-bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}
.aicompare-bubble ul {
    margin: 6px 0;
    padding-left: 20px;
}
.aicompare-bubble li { margin: 2px 0; }
.aicompare-bubble strong { font-weight: 600; }

.aicompare-bubble-user {
    align-self: flex-end;
    background: #667eea;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.aicompare-bubble-assistant {
    align-self: flex-start;
    background: #f3f3f7;
    color: #222;
    border-bottom-left-radius: 4px;
}
.aicompare-bubble-error {
    background: #ffe9e9;
    color: #c0392b;
}
.aicompare-loading-bubble { opacity: 0.7; font-style: italic; }

.aicompare-chat-input-wrap {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}
.aicompare-chat-input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    box-sizing: border-box;
}
.aicompare-chat-input:focus { border-color: #667eea; }

.aicompare-chat-send {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}
.aicompare-chat-send:disabled,
.aicompare-chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aicompare-loader,
.aicompare-empty,
.aicompare-error {
    text-align: center;
    color: #888;
    padding: 12px;
    font-size: 14px;
}
.aicompare-error { color: #c0392b; }

@media (max-width: 600px) {
    .aicompare-dialog {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .aicompare-chat-messages { max-height: none; }
}
