/* Chatbot Floating Widget Styles */
#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

#chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #22c55e, #16a34a);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    font-size: 30px;
}

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

#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #081a34;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(125, 153, 195, 0.25);
    backdrop-filter: blur(16px);
}

#chatbot-window.active {
    display: flex;
}

.chatbot-header {
    padding: 15px;
    background: linear-gradient(125deg, rgba(25, 48, 88, 0.45), rgba(7, 22, 47, 0.35));
    border-bottom: 1px solid rgba(125, 153, 195, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(145deg, #22c55e, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.chatbot-title {
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-close {
    cursor: pointer;
    color: #9cb2d6;
    font-size: 20px;
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 169, 215, 0.5) transparent;
}

.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    color: #e7f0ff;
}

.chatbot-msg.ai {
    align-self: flex-start;
    background: rgba(17, 34, 63, 0.72);
    border: 1px solid rgba(125, 153, 195, 0.25);
    border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
    align-self: flex-end;
    background: linear-gradient(145deg, #2f73ff, #2056d8);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid rgba(125, 153, 195, 0.2);
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    background: rgba(13, 28, 52, 0.75);
    border: 1px solid rgba(125, 153, 195, 0.25);
    border-radius: 10px;
    padding: 8px 12px;
    color: white;
    outline: none;
    font-size: 14px;
}

#chatbot-send {
    background: #22c55e;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

/* Product Cards in Chat */
.chatbot-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-self: stretch;
    flex: 0 0 auto;
    box-sizing: border-box;
    overflow: visible;
    margin-top: 10px;
    padding: 10px;
    background: rgba(8, 26, 52, 0.68);
    border: 1px solid rgba(125, 153, 195, 0.18);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.18);
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 197, 94, 0.4) transparent;
}

.chatbot-card-list::-webkit-scrollbar {
    display: none;
}

.chatbot-card-list::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.3);
    border-radius: 999px;
}

.chatbot-product-card {
    width: 100%;
    min-height: 138px;
    background: rgba(13, 31, 61, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.chatbot-product-card:hover {
    transform: translateY(-4px);
    border-color: #22c55e;
}

.chatbot-product-card:focus {
    outline: none;
}

.chatbot-product-card:focus-visible {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
}

.chatbot-product-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
}

.chatbot-product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.chatbot-product-name {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #22c55e;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.chatbot-price-wrap {
    margin-bottom: 10px;
    margin-top: auto;
}

.chatbot-product-price {
    font-size: 15px;
    font-weight: 800;
    color: #fef3c7;
}

.chatbot-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.chatbot-btn {
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.chatbot-btn-detail {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.chatbot-btn-buy {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
}

.chatbot-btn:hover {
    filter: brightness(1.1);
}

@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 30px);
        height: 550px;
        right: -10px;
    }
    .chatbot-card-list {
        width: 100%;
    }
    .chatbot-product-card {
        width: 100%;
    }
    .chatbot-actions {
        grid-template-columns: 1fr;
    }
}
