/* Professional Chat Interface Styles */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
}

.chatbot-container.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.chatbot-header {
    background: linear-gradient(135deg, #4f46e5, #7c73e6);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
    fill: #4f46e5;
}

.chatbot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-subtitle {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

/* Custom scrollbar for chat */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.message {
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: #4f46e5;
    color: white;
    border-radius: 18px 18px 6px 18px;
    padding: 12px 16px;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.2);
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background: white;
    color: #334155;
    border-radius: 18px 18px 18px 6px;
    padding: 12px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.bot-message .message-avatar {
    position: absolute;
    left: -40px;
    bottom: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bot-message .message-avatar svg {
    width: 16px;
    height: 16px;
    fill: #4f46e5;
}

.chatbot-input-container {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chatbot-send {
    padding: 12px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    width: 44px;
    height: 44px;
}

.chatbot-send:hover {
    background: #4338ca;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.chatbot-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 16px 20px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.chatbot-toggle-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Product Cards */
.product-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.product-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 15px;
}

.product-price {
    color: #4f46e5;
    font-weight: 700;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.product-description {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.product-link {
    color: #4f46e5;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.product-link:hover {
    text-decoration: underline;
}

.product-link svg {
    width: 14px;
    height: 14px;
    fill: #4f46e5;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    align-self: flex-start;
    margin: 5px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    align-items: center;
    gap: 8px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-chip {
    background: #f1f5f9;
    border: none;
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-chip:hover {
    background: #e2e8f0;
}

/* Responsive adjustments for your layout */
@media (max-width: 768px) {
    .chatbot-container {
        width: 90%;
        right: 5%;
        bottom: 80px;
        height: 70vh;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        padding: 14px 18px;
        font-size: 14px;
    }

    .message {
        max-width: 90%;
    }

    .bot-message .message-avatar {
        left: -35px;
        width: 25px;
        height: 25px;
    }
}

/* Ensure chatbot doesn't interfere with other elements */
#to-top {
    z-index: 10001; /* Above chatbot */
}

.chat-wa {
    z-index: 9998; /* Below chatbot */
}

/* Fix for passive event listener warning */
.chatbot-messages {
    touch-action: pan-y;
}

.chatbot-input {
    touch-action: manipulation;
}

/* Fix for smooth-scrollbar passive event listener warning */
[data-scrollbar] {
    touch-action: auto !important;
}

/* Ensure chatbot elements don't interfere with smooth-scrollbar */
.chatbot-messages {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chatbot-input {
    touch-action: manipulation;
}


/* Increased width for chatbot */
.chatbot-container {
    width: 420px; /* Increased from 380px */
    right: 20px;
}

/* Product card improvements */
.product-card {
    margin: 8px 0;
    padding: 12px;
    border-radius: 10px;
}

.product-image {
    width: 80px; /* Slightly larger */
    height: 80px;
}

.product-name {
    font-size: 16px;
}

.product-price {
    font-size: 18px;
    color: #4f46e5;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading-message {
    animation: pulse 1.5s infinite;
    color: #64748b;
}

/* No products found message */
.no-products-message {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.search-website-link {
    color: #4f46e5;
    text-decoration: underline;
    font-weight: 500;
}

/* Auto-scroll container */
.chatbot-messages {
    scroll-behavior: smooth;
}

/* Welcome message styling */
.welcome-message {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 10px 0;
}
