/* دکمه شناور */
#msc-launcher {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #25D366;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    transition: transform 0.3s;
}

.msc-icon {
    font-size: 28px;
    line-height: 1;
}

/* پنجره چت - برگشت به حالت استاندارد برای جلوگیری از بهم ریختگی */
#msc-window {
    display: none;
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 350px;
    max-width: 90%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    font-family: Tahoma, Arial, sans-serif;
    overflow: hidden;
    border: 1px solid #ddd;
    direction: rtl;
}

/* هدر */
.msc-header {
    background: #075E54;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
}

#msc-close {
    cursor: pointer;
    font-size: 20px;
}

/* ناحیه پیام‌ها */
.msc-messages {
    height: 380px;
    overflow-y: auto;
    padding: 15px;
    background: #e5ddd5;
}

/* حباب پیام‌ها */
.msc-msg-bot,
.msc-msg-user {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 13px;
    max-width: 85%;
    word-wrap: break-word;
    position: relative;
    clear: both;
}

.msc-msg-bot {
    background: #fff;
    color: #333;
    border-radius: 0 10px 10px 10px;
    margin-left: auto;
    float: right;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.msc-msg-user {
    background: #dcf8c6;
    color: #333;
    border-radius: 10px 0 10px 10px;
    margin-right: auto;
    float: left;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* استایل انیمیشن سه نقطه (درخواست شما) */
.msc-typing {
    background: #fff;
    padding: 10px 15px;
    border-radius: 0 10px 10px 10px;
    float: right;
    width: fit-content;
    margin-bottom: 10px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 20px;
    color: #888;
    line-height: 10px;
    height: 35px;
    direction: ltr;
    /* برای اینکه نقطه‌ها درست نمایش داده شوند */
}

.msc-typing::after {
    content: ' ⌛ ';
    animation: typing 1.5s infinite steps(4);
    font-weight: bold;
    letter-spacing: 2px;
}

@keyframes typing {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

/* سیستم منوی دو ستونه */
.msc-chips-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.msc-chip-full {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    color: #075E54;
    border: 1px solid #075E54;
    padding: 8px 5px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 45px;
    line-height: 1.3;
    box-sizing: border-box;
}

.msc-chip-full:hover {
    background: #075E54;
    color: #fff;
}

/* نمایش ستونی (مثل لیست محصولات) */
.msc-chips-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.msc-chips-column .msc-chip-full {
    width: 100%;
    text-align: right;
    border-radius: 8px;
    padding: 10px;
    justify-content: flex-start;
}

/* دکمه‌های لینک‌دار */
.msc-btn-full,
.msc-btn-half {
    display: block;
    text-decoration: none;
    color: #fff !important;
    text-align: center;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 12px;
    padding: 10px;
    font-weight: bold;
}

.msc-btn-full {
    width: 100%;
}

.msc-btn-half {
    display: inline-block;
    width: 48%;
}

/* ورودی متن */
.msc-input-area {
    display: flex;
    padding: 10px;
    background: #f0f0f0;
    align-items: center;
    border-top: 1px solid #ddd;
    /* اطمینان از اینکه ورودی پایین می‌ماند */
    position: relative;
    bottom: 0;
}

#msc-input {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    background: #fff;
}

#msc-send {
    background: #075E54;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* نتایج جستجو */
.msc-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
}

.msc-search-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.msc-load-more-btn {
    width: 100%;
    padding: 8px;
    background: #075E54;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* متن هشدار قرمز (درخواست شما) */
.msc-warning-text {
    color: #d32f2f;
    font-size: 11px;
    margin-top: 5px;
    display: block;
    font-weight: bold;
    background: #ffebee;
    padding: 5px;
    border-radius: 5px;
}
/* استایل‌های جدید برای دکمه‌های کارت محصول */
.msc-btn-blue {
    display: block;
    width: 100%;
    background: #0277bd; /* آبی */
    color: #fff !important;
    text-align: center;
    padding: 10px;
    border-radius: 25px; /* گردتر مثل عکس */
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.msc-btn-blue:hover { background: #01579b; }

.msc-btn-yellow {
    display: block;
    width: 100%;
    background: #fbc02d; /* زرد */
    color: #333 !important;
    text-align: center;
    padding: 10px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.msc-btn-yellow:hover { background: #f9a825; }

.msc-btn-green {
    display: block;
    width: 100%;
    background: #25D366; /* سبز واتساپ */
    color: #fff !important;
    text-align: center;
    padding: 10px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 8px;
}
.msc-btn-green:hover { background: #128c7e; }

/* دکمه‌های سفید پایین (سایر محصولات) */
.msc-btn-white {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    color: #555 !important;
    padding: 8px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 11px;
    height: 40px;
    cursor: pointer;
}
.msc-btn-white:hover { background: #f5f5f5; }

/* گرید دکمه‌ها */
.msc-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.msc-input-area {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
}

#msc-input {
    flex: 1;
    /* کادر متن بقیه فضا را پر کند */
}

#msc-attach-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 16px;
    line-height: 1;
}

#msc-attach-btn:hover {
    background: #e0e0e0;
}
.msc-time-tag {
    font-size: 11px; /* فونت را از 8px به 11px افزایش دادیم تا کاملاً خوانا شود */
    color: #000000; /* رنگ کاملاً مشکی */
    margin-top: 6px;
    display: block;
    text-align: left;
    direction: rtl;
    opacity: 0.85; /* کمی از شدت سیاهی مطلق کم می‌کند تا چشم را نزند، اگر خواستید ۱۰۰٪ مشکی باشد این خط را پاک کنید */
    font-weight: 500; /* کمی ضخیم‌تر شد */
}

.msc-msg-user .msc-time-tag {
    text-align: right;
    color: #000000; /* رنگ مشکی برای پیام‌های خود کاربر */
}