.mq-pc-root {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147483647;
    font-family: "sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    direction: rtl;
}

/* اعمال فونت sans روی کل چت‌بات، با اولویت بالا */
.mq-pc-root,
.mq-pc-root * {
    font-family: "sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}


/* کل ویجت */
.mq-pc-widget {
    position: relative;
}

/* دکمه لانچر (پیل + آیکن + متن) */
.mq-pc-launcher {
    height: 56px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #111827, #4b5563);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    padding: 0 18px;
}

.mq-pc-launcher:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
    background: linear-gradient(135deg, #0f172a, #6b7280);
}

.mq-pc-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mq-pc-launcher-label {
    font-family: "sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #f9fafb;
    white-space: nowrap;
}

.mq-pc-icon-svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #f9fafb;
    stroke-width: 2;
}

/* پنجره چت */
.mq-pc-window {
    position: absolute;
    left: 0;
    bottom: 70px;
    width: 340px;
    max-height: 520px;
    background: rgba(15, 23, 42, 0.97);
    border-radius: 18px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.9);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(18px);
}

@media (max-width: 768px) {
    .mq-pc-root {
        left: 16px;
        right: auto;
        bottom: 16px;
        width: auto;
        display: block;
        z-index: 2147483647;
    }
    .mq-pc-window {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        border: none;
    }
}

.mq-pc-hidden {
    display: none;
}

/* هدر */
.mq-pc-header {
    background: radial-gradient(circle at top left, #0f172a, #020617);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.mq-pc-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mq-pc-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
}

.mq-pc-header-subtitle {
    font-size: 11px;
    color: #9ca3af;
}

.mq-pc-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 999px;
    transition: background 0.1s ease, color 0.1s ease, transform 0.1s ease;
}

.mq-pc-close:hover {
    background: rgba(148, 163, 184, 0.16);
    color: #e5e7eb;
    transform: scale(1.08);
}

/* بدنه چت */
.mq-pc-body {
    padding: 8px 10px;
    background: radial-gradient(circle at top, #020617, #020617);
    flex: 1;
    overflow-y: auto;
}

.mq-pc-messages {
    min-height: 100%;
    padding-right: 2px;
}

/* اسکرول بار */
.mq-pc-body::-webkit-scrollbar,
.mq-pc-messages::-webkit-scrollbar {
    width: 4px;
}
.mq-pc-body::-webkit-scrollbar-track,
.mq-pc-messages::-webkit-scrollbar-track {
    background: transparent;
}
.mq-pc-body::-webkit-scrollbar-thumb,
.mq-pc-messages::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 999px;
}

/* پیام‌ها */
.mq-pc-message {
    display: flex;
    margin-bottom: 8px;
}

.mq-pc-message-bot {
    align-items: flex-start;
}

.mq-pc-message-user {
    justify-content: flex-end;
}

/* آواتار بات */
.mq-pc-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #f97316, #facc15);
    margin-left: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
}

/* حباب پیام */
.mq-pc-bubble {
    max-width: 80%;
    border-radius: 14px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.6;
}

.mq-pc-message-bot .mq-pc-bubble {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.mq-pc-message-user .mq-pc-bubble {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #111827;
    border-bottom-left-radius: 4px;
}

.mq-pc-bubble-product {
    padding: 0;
}

/* تایپینگ */
.mq-pc-bubble-text.mq-pc-typing {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.mq-pc-bubble-text.mq-pc-typing span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
    opacity: 0.3;
    animation: mq-pc-bounce 1s infinite;
}

.mq-pc-bubble-text.mq-pc-typing span:nth-child(2) {
    animation-delay: 0.15s;
}
.mq-pc-bubble-text.mq-pc-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes mq-pc-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* فوتر / دکمه‌ها */
.mq-pc-footer {
    padding: 8px 10px 10px 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.98);
}

.mq-pc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* دکمه‌های گلوله‌ای */
.mq-pc-pill {
    border-radius: 999px;
    border: none;
    font-size: 11px;
    padding: 6px 10px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.7);
    transition: background 0.12s ease, transform 0.08s ease, box-shadow 0.1s ease, color 0.12s ease;
    white-space: nowrap;
}

.mq-pc-pill:hover {
    background: rgba(30, 64, 175, 0.9);
    color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.5);
}

.mq-pc-pill:active {
    transform: translateY(0);
    box-shadow: none;
}

/* گزینه چندگانه انتخاب شده */
.mq-pc-option-multi.mq-pc-option-selected {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #111827;
    border-color: transparent;
}

/* کارت محصول */
.mq-pc-product-card {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 8px;
    margin-top: 4px;
}

.mq-pc-product-main {
    display: flex;
    gap: 8px;
}

.mq-pc-product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: #020617;
}

.mq-pc-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mq-pc-product-name {
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
}

.mq-pc-product-price {
    font-size: 12px;
    color: #facc15;
}

.mq-pc-product-link {
    font-size: 11px;
    margin-top: 2px;
    color: #60a5fa;
    text-decoration: none;
}

.mq-pc-product-link:hover {
    text-decoration: underline;
}

/* دلایل پیشنهاد */
.mq-pc-reasons {
    margin: 6px 0 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px dashed rgba(148, 163, 184, 0.5);
    padding-top: 4px;
}

.mq-pc-reasons li {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 2px;
}
