﻿.ai-chat-box {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 330px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,.15);
    overflow: hidden;
    z-index: 9999;
}


.ai-chat-header {
    cursor: move;
    user-select: none;
    height: 55px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-chat-box.minimized {
    width: 250px;
    height: 50px;
}

    .ai-chat-box.minimized .ai-chat-body {
        display: none;
    }

.ai-title {
    font-size: 16px;
    font-weight: bold;
}


#aiMinimize {
    position: absolute;
    left: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #2563eb;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-body {
    display: flex;
    flex-direction: column;
    height: 200px;
}

#aiResult {
    flex: 1;
    overflow-y: auto;
}

.ai-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
}
/*#aiChatBody {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    flex: 1;
    overflow-y: auto;
}*/
.ai-chat-body {
    display: flex;
    flex-direction: column;
    height: 100px;
    transition: height 0.3s ease;
}

   .ai-chat-body.has-results {
        height: 420px;
    }
    .ai-chat-body.no-results {
        height: 350px;
    }


#aiChatBox {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
#aiQuestion {
    flex: 1;
    width: auto;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
}


#aiSendButton {
    flex: 0 0 70px;
    width: 70px;
    height: 40px;
    margin-top: 0;
    padding: 0 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}


#aiOpenButton {
    position: absolute;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background-color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}



@media(max-width:600px) {

    .ai-chat-box {
        width: calc(100% - 30px);
        right: 15px;
        bottom: 15px;
    }


    #aiOpenButton {
        right: 15px;
        bottom: 15px;
    }

}

#openAiAssistant {
    display: inline-flex !important;
    width: auto !important;
    min-width: max-content;
    white-space: nowrap;
}

    #openAiAssistant::before {
        content: '';
    }

li:has(#openAiAssistant) {
    width: auto !important;
    display: flex !important;
}






.ai-product-card {
    display: flex;
    gap: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    background: #fff;
    transition: .2s;
}

    .ai-product-card:hover {
        box-shadow: 0 5px 20px rgba(0,0,0,.08);
    }

.ai-product-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.ai-product-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.ai-product-brand {
    color: #777;
    margin-top: 6px;
}

.ai-product-price {
    color: #198754;
    font-size: 18px;
    font-weight: bold;
    margin-top: 8px;
}
.ai-product-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

    .ai-product-buttons .btn {
        flex: 1;
        font-size: 13px;
    }

.ai-message {
    position: relative;
    background: #f5f7fa;
    color: #263238;
    padding: 12px 16px 12px 42px;
    margin: 10px 0;
    border-radius: 4px 16px 16px 16px;
    border-right: 4px solid #198754;
    font-size: 14px;
    line-height: 1.9;
    font-family: Tahoma, Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

    .ai-message::before {
        content: "🤖";
        position: absolute;
        left: 12px;
        top: 12px;
        font-size: 18px;
    }
.user-message {
    position: relative;
    background: #198754;
    color: #fff;
    padding: 10px 42px 10px 14px;
    margin: 10px 0 8px auto;
    border-radius: 16px 4px 16px 16px;
    font-size: 14px;
    line-height: 1.8;
    font-family: Tahoma, Arial, sans-serif;
    width: fit-content;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

    .user-message::after {
        content: "👤";
        position: absolute;
        right: 12px;
        top: 10px;
        font-size: 17px;
    }


#aiVoiceButton {
    width: 44px;
    height: 40px;
    flex-shrink: 0;
    background: #ffffff;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

    #aiVoiceButton:hover {
        background: #eff6ff;
        transform: translateY(-1px);
    }

    #aiVoiceButton:active {
        transform: scale(0.96);
    }

    #aiVoiceButton:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    #aiVoiceButton.listening {
        background: #2563eb;
        color: #ffffff;
        border-color: #2563eb;
        animation: aiVoicePulse 1.2s infinite;
    }

@keyframes aiVoicePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}