/* ================================
   MAIN CONTAINER & POSITIONING
   ================================ */
#custom-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* ================================
   FLOATING CHAT ICON
   ================================ */
.chatbot-icon {
    background-color: #d80000;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 35% / 35%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: all 0.2s ease-out;
}
.chatbot-icon:hover {
    transform: scale(1.1);
}
.chatbot-icon.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ================================
   CHAT WINDOW
   ================================ */
.chatbot-window {
    width: 360px;
    max-width: 90vw;
    height: 600px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    right: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
}
.chatbot-window.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* ================================
   CHAT HEADER
   ================================ */
.chatbot-header {
    background-color: #d80000;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}
.chatbot-logo img {
    height: 25px;
    display: block;
}
.chatbot-header-text {
    flex-grow: 1;
}
.chatbot-title {
    font-weight: bold;
    font-size: 1.1em;
}
.chatbot-subtitle {
    font-size: 0.85em;
    opacity: 0.9;
}
.chatbot-close {
    background: rgba(0,0,0,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
}
.chatbot-close:hover {
    background: rgba(0,0,0,0.4);
}

/* ================================
   CHAT BODY
   ================================ */
.chatbot-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    background-color: #ffffff;
}
.chatbot-message-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #6c5ce7;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.chatbot-sender-name {
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}
.chatbot-message {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chatbot-message.received {
    background-color: #f1f0f0;
    color: #333;
    border-top-left-radius: 0;
}
.chatbot-message a {
    color: #0066cc;
    text-decoration: underline;
}

/* ================================
   CHAT FOOTER (FIXED & FINALIZED)
   ================================ */
.chatbot-footer {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    flex-shrink: 0;
    gap: 10px;
}

.chatbot-upload-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background-color: #f5f5f5;
    transition: background-color 0.3s;
}
.chatbot-upload-icon svg {
    width: 22px;
    height: 22px;
    fill: #555;
}
.chatbot-upload-icon:hover {
    background-color: #eaeaea;
}
.chatbot-upload-icon:hover svg {
    fill: #000;
}

.chatbot-form {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-input {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
}

.chatbot-send:hover {
    background-color: #e0e0e0;
}

.chatbot-send svg {
    fill: #555;
    width: 22px;
    height: 22px;
}



/* Chatbot Product Slider Styles */
.chatbot-product-slider {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #ccc #f1f1f1;
}

/* For Chrome, Safari, and Opera */
.chatbot-product-slider::-webkit-scrollbar {
    height: 6px;
}
.chatbot-product-slider::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.chatbot-product-slider::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}
.chatbot-product-slider::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.chatbot-product-card {
    flex: 0 0 150px; /* Do not grow, do not shrink, base width of 150px */
    margin-right: 10px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.chatbot-product-card:hover {
    transform: translateY(-3px);
}

.chatbot-product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.chatbot-product-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.chatbot-product-details {
    padding: 8px;
}

.chatbot-product-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    height: 34px; /* Approx 2 lines of text */
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.chatbot-product-price {
    font-size: 14px;
    font-weight: bold;
    color: #e83e8c; /* Example color */
}

/* Typing Indicator */
.chatbot-typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 0;
}
.chatbot-typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #9E9E9E;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.chatbot-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}