/**
 * مشاور زیبایی ShopyMoon — CSS فرانت‌اند (نسخه بازطراحی‌شده، تم‌پذیر)
 * رنگ‌ها از طریق متغیرهای CSS (--sc-primary / --sc-secondary) قابل تنظیم از پنل ادمین هستند.
 */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --sc-primary: #4338ca;
    --sc-secondary: #7c3aed;
    --sc-radius: 18px;
}

.shopymoon-consultant-box, .shopymoon-consultant-float {
    --sc-grad: linear-gradient(135deg, var(--sc-primary), var(--sc-secondary));
}

/* ===== باکس اینلاین ===== */
.shopymoon-consultant-box {
    max-width: 620px; margin: 24px auto; border-radius: var(--sc-radius); overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,.12); font-family: 'Vazirmatn', sans-serif; direction: rtl;
    background: #fff; border: 1px solid rgba(0,0,0,.05);
}
.sc-header {
    background: var(--sc-grad); color: #fff; padding: 22px 26px; position: relative; overflow: hidden;
}
.sc-header::after {
    content: ''; position: absolute; top: -40px; left: -30px; width: 140px; height: 140px;
    background: rgba(255,255,255,.12); border-radius: 50%;
}
.sc-header h3 { margin: 0; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sc-header p { margin: 7px 0 0; font-size: 13px; opacity: .9; }
.sc-header .sc-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }

.sc-chat { padding: 18px; background: #f7f8fc; }
.sc-messages { min-height: 220px; max-height: 420px; overflow-y: auto; margin-bottom: 14px; padding: 8px; scroll-behavior: smooth; }
.sc-messages::-webkit-scrollbar { width: 6px; }
.sc-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ===== پیام‌ها ===== */
.sc-msg { margin-bottom: 14px; display: flex; align-items: flex-end; gap: 8px; animation: sc-fade .3s ease; }
.sc-msg-bot { justify-content: flex-end; flex-direction: row; }
.sc-msg-user { justify-content: flex-start; flex-direction: row-reverse; }
.sc-msg::before {
    content: ''; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background-size: cover; display: inline-block;
}
.sc-msg-bot::before { content: '💄'; background: var(--sc-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.sc-msg-user::before { content: '🙋'; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.sc-msg-bubble {
    max-width: 78%; padding: 11px 16px; border-radius: var(--sc-radius); font-size: 13.5px; line-height: 1.8; word-break: break-word;
}
.sc-msg-bot .sc-msg-bubble { background: var(--sc-grad); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 3px 10px rgba(67,56,202,.25); }
.sc-msg-user .sc-msg-bubble { background: #fff; color: #1e293b; border: 1px solid #e6e9f2; border-bottom-left-radius: 5px; }
@keyframes sc-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== کارت محصول ===== */
.sc-product-card {
    display: flex; gap: 12px; padding: 12px; background: #fff; border-radius: 14px;
    margin: 10px 0; box-shadow: 0 2px 10px rgba(0,0,0,.07); border: 1px solid #eef1f8;
    transition: transform .2s, box-shadow .2s;
}
.sc-product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.sc-product-card img { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; }
.sc-product-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.sc-product-info strong { font-size: 13px; display: block; color: #1e293b; margin-bottom: 4px; }
.sc-product-info .sc-price { color: var(--sc-primary); font-weight: 800; font-size: 14px; }
.sc-product-info .sc-buy {
    display: inline-block; margin-top: 6px; padding: 6px 16px; background: var(--sc-grad); color: #fff;
    font-size: 12px; border-radius: 8px; text-decoration: none; font-weight: 600; text-align: center; transition: opacity .2s;
}
.sc-product-info .sc-buy:hover { opacity: .9; }

/* ===== ورودی ===== */
.sc-input-area { display: flex; gap: 8px; }
.sc-input-area input {
    flex: 1; padding: 12px 16px; border: 1.5px solid #e2e8f0; border-radius: 12px;
    font-family: inherit; font-size: 13.5px; direction: rtl; background: #fff; transition: border-color .2s;
}
.sc-input-area input:focus { outline: none; border-color: var(--sc-primary); box-shadow: 0 0 0 3px rgba(67,56,202,.12); }
.sc-send-btn {
    padding: 11px 20px; background: var(--sc-grad); color: #fff; border: none; border-radius: 12px;
    cursor: pointer; font-family: inherit; font-weight: 700; transition: transform .15s, box-shadow .2s;
}
.sc-send-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(67,56,202,.35); }
.sc-send-btn:active { transform: translateY(0); }

/* ===== دکمه‌های سریع ===== */
.sc-quick-btns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.sc-quick {
    padding: 7px 15px; background: #fff; color: var(--sc-primary); border: 1.5px solid #d9defb;
    border-radius: 22px; cursor: pointer; font-size: 12px; font-family: inherit; font-weight: 600; transition: all .2s;
}
.sc-quick:hover { background: var(--sc-grad); color: #fff; border-color: transparent; transform: translateY(-1px); }

/* ===== ویجت شناور ===== */
.shopymoon-consultant-float { position: fixed; z-index: 99998; font-family: 'Vazirmatn', sans-serif; direction: rtl; }
.shopymoon-consultant-float.bottom-left { bottom: 22px; left: 22px; }
.shopymoon-consultant-float.bottom-right { bottom: 22px; right: 22px; }

.sc-float-btn {
    display: flex; align-items: center; gap: 9px; padding: 13px 22px;
    background: var(--sc-grad); color: #fff; border: none; border-radius: 32px; cursor: pointer;
    box-shadow: 0 6px 22px rgba(67,56,202,.45); font-family: inherit; font-size: 14px; font-weight: 700; transition: all .3s;
    animation: sc-pulse 2.4s infinite;
}
.sc-float-btn:hover { transform: scale(1.06); box-shadow: 0 8px 26px rgba(67,56,202,.55); }
.sc-float-icon { font-size: 21px; }
@keyframes sc-pulse { 0%,100% { box-shadow: 0 6px 22px rgba(67,56,202,.45); } 50% { box-shadow: 0 6px 30px rgba(124,58,237,.6); } }

.sc-float-panel {
    position: absolute; bottom: 64px; width: 390px; max-height: 540px;
    background: #fff; border-radius: var(--sc-radius); box-shadow: 0 12px 40px rgba(0,0,0,.2);
    overflow: hidden; animation: sc-slide .3s ease;
}
@keyframes sc-slide { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.shopymoon-consultant-float.bottom-left .sc-float-panel { left: 0; }
.shopymoon-consultant-float.bottom-right .sc-float-panel { right: 0; }

.sc-float-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--sc-grad); color: #fff; padding: 15px 19px;
}
.sc-float-header h4 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.sc-float-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }

.sc-float-panel .sc-messages { height: 270px; padding: 14px; overflow-y: auto; background: #f7f8fc; }
.sc-float-panel .sc-input-area { padding: 11px 13px; background: #fff; border-top: 1px solid #f1f5f9; }
.sc-float-panel .sc-quick-btns { padding: 0 13px 12px; margin-top: 0; }

/* ===== لودینگ ===== */
.sc-typing { display: flex; gap: 4px; padding: 12px 16px; }
.sc-typing span { width: 8px; height: 8px; background: var(--sc-secondary); border-radius: 50%; animation: sc-bounce .6s infinite alternate; }
.sc-typing span:nth-child(2) { animation-delay: .2s; }
.sc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sc-bounce { to { transform: translateY(-6px); opacity: .5; } }

/* ===== ریسپانسیو ===== */
@media (max-width: 480px) {
    .sc-float-panel { width: calc(100vw - 24px); left: 12px !important; right: 12px !important; }
    .shopymoon-consultant-float { left: 10px !important; right: 10px !important; }
    .sc-float-btn { width: auto; }
    .sc-float-text { display: none; }
}
