/* ================================
   TOGGLE BUTTON
================================ */
#mnd-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #fff;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999999;
    box-shadow: 0 4px 16px rgba(46,125,50,0.45);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    padding: 6px;
    border: 2px solid #2e7d32;
}
#mnd-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(46,125,50,0.55);
}
#mnd-chat-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}
/* ================================
   CHATBOX
================================ */
#mnd-chatbox {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 340px;
    height: 490px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 999999;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    animation: mnd-fadein 0.2s ease;
}
@keyframes mnd-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================
   HEADER
================================ */
#mnd-header {
    background: #2e7d32;
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
}
#mnd-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 4px;
}
#mnd-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#mnd-header-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
#mnd-header-text small {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}
#mnd-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #69f0ae;
    display: inline-block;
    animation: mnd-pulse 2s infinite;
}
@keyframes mnd-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
#mnd-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}
#mnd-close:hover { opacity: 1; }

/* ================================
   MESSAGES AREA
================================ */
#mnd-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f8f6;
}
#mnd-messages::-webkit-scrollbar { width: 4px; }
#mnd-messages::-webkit-scrollbar-thumb {
    background: #c8e6c9;
    border-radius: 4px;
}

/* ================================
   MESSAGE ROWS
================================ */
.mnd-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 100%;
}
.mnd-row-user { justify-content: flex-end; }
.mnd-row-bot  { justify-content: flex-start; }

/* ================================
   AVATAR
================================ */
.mnd-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #c8e6c9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
}
.mnd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ================================
   BUBBLES
================================ */
.mnd-bubble {
    max-width: 78%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}
.mnd-bubble a {
    text-decoration: underline;
}
.mnd-bubble strong { font-weight: 600; }

.mnd-bubble-user {
    background: #2e7d32;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}
.mnd-bubble-user a { color: #c8e6c9; }

.mnd-bubble-bot {
    background: #fff;
    color: #1a1a1a;
    border-radius: 16px 16px 16px 4px;
    border: 0.5px solid #e0e0e0;
}
.mnd-bubble-bot a { color: #2e7d32; }

/* ================================
   TYPING INDICATOR
================================ */
.mnd-typing-bubble {
    padding: 12px 16px !important;
    display: flex !important;
    gap: 5px;
    align-items: center;
    min-width: 56px;
}
.mnd-typing-bubble span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2e7d32;
    display: inline-block;
    animation: mnd-bounce 1.2s infinite;
}
.mnd-typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.mnd-typing-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes mnd-bounce {
    0%,80%,100% { transform: translateY(0);    opacity: 0.4; }
    40%          { transform: translateY(-6px); opacity: 1;   }
}

/* ================================
   PRODUCT CARDS
================================ */
.mnd-products-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.mnd-product {
    background: #f1f8f1;
    border: 0.5px solid #c8e6c9;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.mnd-product img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e8f5e9;
}
.mnd-product-no-img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.mnd-product-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}
.mnd-product-info strong {
    font-size: 13px;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mnd-product-info span {
    color: #2e7d32;
    font-weight: 700;
    font-size: 13px;
}
.mnd-product-actions {
    display: flex;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.mnd-product-actions a {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none !important;
    text-align: center;
    font-weight: 500;
    transition: opacity 0.15s;
}
.mnd-product-actions a:hover { opacity: 0.82; }
.mnd-view-btn {
    border: 1px solid #2e7d32;
    color: #2e7d32 !important;
    background: transparent;
}
.mnd-add-cart {
    background: #2e7d32;
    color: #fff !important;
    border: 1px solid #2e7d32;
}

/* ================================
   INPUT AREA
================================ */
#mnd-input-area {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #e8f5e9;
    background: #fff;
    flex-shrink: 0;
}
#mnd-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13px;
    background: #f7f8f6;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
#mnd-input:focus {
    border-color: #2e7d32;
    background: #fff;
}
#mnd-input:disabled { opacity: 0.5; cursor: not-allowed; }
#mnd-input::placeholder { color: #aaa; }

#mnd-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2e7d32;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}
#mnd-send:hover   { background: #256528; }
#mnd-send:active  { transform: scale(0.92); }
#mnd-send:disabled { opacity: 0.5; cursor: not-allowed; }
#mnd-send svg { pointer-events: none; }

/* ================================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 400px) {
    #mnd-chatbox {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 86px;
        height: 70vh;
    }
    #mnd-chat-toggle {
        right: 14px;
        bottom: 14px;
    }
}

/* ================================
   QUICK REPLY CHIPS
================================ */
#mnd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 8px 0;
}
.mnd-chip {
    background: #fff;
    border: 1px solid #2e7d32;
    color: #2e7d32;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.mnd-chip:hover {
    background: #2e7d32;
    color: #fff;
}

/* ================================
   CONTACT BAR
================================ */
#mnd-contact-bar {
    text-align: center;
    font-size: 11px;
    color: #888;
    padding: 6px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}
#mnd-contact-bar a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 500;
}
#mnd-contact-bar a:hover {
    text-decoration: underline;
}
