/* ============================================================
   AI Product Chatbot Pro — apc-chat.css  v6.0.0
   ============================================================ */

/* ── کانتینر اصلی ─────────────────────────────────────────── */
#apc-chatbot-container {
    position: fixed;
    z-index: 999999;
    direction: rtl;
    font-family: -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

/* ── حباب CTA ──────────────────────────────────────────────── */
#apc-cta-bubble {
    position: absolute;
    right: 50%; transform: translateX(50%);
    padding: 9px 18px;
    background: var(--apc-bubble, #7c3aed);
    color: #fff;
    border-radius: 24px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(124,58,237,.35);
    opacity: 0; pointer-events: none;
    animation: apc-bubble-pop 9s ease-in-out 2s forwards;
}
.position-bottom-right #apc-cta-bubble,
.position-bottom-left  #apc-cta-bubble { bottom: calc(100% + 14px); }
.position-top-right    #apc-cta-bubble,
.position-top-left     #apc-cta-bubble { top: calc(100% + 14px); }

/* ── دکمه FAB ───────────────────────────────────────────────── */
#apc-chat-button {
    width: 62px; height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--apc-primary,#7c3aed), color-mix(in srgb, var(--apc-primary,#7c3aed) 80%, #000));
    border: none; cursor: pointer;
    box-shadow: 0 6px 24px color-mix(in srgb, var(--apc-primary,#7c3aed) 50%, transparent);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    transition: transform .3s, box-shadow .3s;
    position: relative; overflow: visible;
}
#apc-chat-button i { font-size: var(--apc-icon-size, 26px); transition: transform .35s; }
#apc-chat-button:hover { transform: scale(1.1); box-shadow: 0 10px 30px color-mix(in srgb, var(--apc-primary,#7c3aed) 60%, transparent); }
#apc-chat-button.is-open i { transform: rotate(90deg); }

/* Badge */
#apc-chat-button .apc-notif-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff;
    border-radius: 50%; width: 20px; height: 20px;
    font-size: 11px; font-weight: 700;
    display: none; align-items: center; justify-content: center;
    animation: apc-pulse-badge .9s ease infinite alternate;
    border: 2px solid #fff;
}

/* ── پنجره چت ──────────────────────────────────────────────── */
#apc-chat-window {
    position: absolute;
    width: 340px; max-width: 340px;
    height: 510px; max-height: calc(100vh - 100px);
    background: var(--apc-win-bg, #ffffff);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08);
    display: flex; flex-direction: column; overflow: hidden;
    visibility: hidden; opacity: 0;
    transform: translateY(24px) scale(.95);
    transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.position-bottom-right #apc-chat-window,
.position-bottom-left  #apc-chat-window { bottom: 78px; }
.position-top-right    #apc-chat-window,
.position-top-left     #apc-chat-window { top: 78px; }
.position-bottom-right #apc-chat-window,
.position-top-right    #apc-chat-window { right: 0; }
.position-bottom-left  #apc-chat-window,
.position-top-left     #apc-chat-window { left: 0; }
#apc-chat-window.open {
    visibility: visible; opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── هدر ───────────────────────────────────────────────────── */
#apc-chat-header {
    background: linear-gradient(135deg,
        var(--apc-primary,#7c3aed) 0%,
        color-mix(in srgb, var(--apc-primary,#7c3aed) 70%, #4f46e5) 100%);
    color: #fff; padding: 0;
    display: flex; flex-direction: column; flex-shrink: 0;
    position: relative;
    border-radius: 24px 24px 0 0;
}
/* زینت */
#apc-chat-header::after {
    content: '';
    position: absolute; top: -30px; left: -20px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,.06);
    border-radius: 50%; pointer-events: none;
}

.apc-header-top {
    display: flex; align-items: center;
    padding: 16px 16px 12px; gap: 12px;
}
.apc-header-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
    border: 2px solid rgba(255,255,255,.4);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.apc-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.apc-header-avatar i   { font-size: 20px; color: #fff; }
.apc-header-info { flex: 1; }
.apc-header-title { font-weight: 700; font-size: 15px; margin: 0; letter-spacing: .2px; }
.apc-header-status {
    font-size: 11px; opacity: .85;
    display: flex; align-items: center; gap: 5px; margin-top: 3px;
}
.apc-online-dot {
    width: 7px; height: 7px; background: #34d399; border-radius: 50%;
    display: inline-block; animation: apc-pulse-dot 1.5s ease infinite;
    box-shadow: 0 0 6px rgba(52,211,153,.6);
}
#apc-chat-close {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    cursor: pointer; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0; transition: background .2s;
    line-height: 1;
}
#apc-chat-close:hover { background: rgba(255,255,255,.3); }

/* ── تب‌ها ──────────────────────────────────────────────────── */
.apc-header-tabs {
    display: flex;
    border-top: 1px solid rgba(255,255,255,.15);
    background: rgba(0,0,0,.08);
}
.apc-tab-btn {
    flex: 1; background: none; border: none;
    color: rgba(255,255,255,.55);
    padding: 10px 6px; font-size: 12.5px;
    cursor: pointer; transition: all .25s;
    border-bottom: 3px solid transparent;
    font-family: inherit; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.apc-tab-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.apc-tab-btn[data-tab="chat"] {
    color: var(--apc-tab-chat, #fff);
}
.apc-tab-btn[data-tab="chat"].active {
    color: #fff;
    border-bottom-color: var(--apc-tab-chat, #fff);
    font-weight: 700;
    background: var(--apc-tab-chat-bg, rgba(255,255,255,.18));
}
.apc-tab-btn[data-tab="contact"] {
    color: var(--apc-tab-cnt, #fcd34d);
}
.apc-tab-btn[data-tab="contact"].active {
    color: #fff;
    border-bottom-color: var(--apc-tab-cnt, #fcd34d);
    font-weight: 700;
    background: var(--apc-tab-cnt-bg, rgba(252,211,77,.18));
}
.apc-tab-btn[data-tab="contact"]:hover { color: #fff; }

/* ── Tab Panes ──────────────────────────────────────────────── */
.apc-tab-pane { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.apc-tab-pane.active { display: flex; }

/* ── ناحیه پیام‌ها ─────────────────────────────────────────── */
#apc-chat-messages {
    flex: 1; padding: 16px 14px;
    overflow-y: auto; scroll-behavior: smooth;
    background: linear-gradient(180deg, #f8f7ff 0%, var(--apc-win-bg,#fff) 60%);
}
#apc-chat-messages::-webkit-scrollbar { width: 4px; }
#apc-chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── پیام‌ها ────────────────────────────────────────────────── */
.apc-message {
    margin-bottom: 14px;
    display: flex; align-items: flex-end; gap: 8px;
    animation: apc-msg-in .25s ease;
}
.apc-message.user { flex-direction: row-reverse; }

.apc-bot-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: color-mix(in srgb, var(--apc-primary,#7c3aed) 12%, transparent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
    border: 1.5px solid color-mix(in srgb, var(--apc-primary,#7c3aed) 25%, transparent);
}
.apc-bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.apc-bot-avatar i   { font-size: 14px; color: var(--apc-primary,#7c3aed); }

.apc-message-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    color: var(--apc-text, #1f2937);
    line-height: 1.6; word-wrap: break-word; font-size: 13.5px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.apc-message.user  .apc-message-bubble {
    background: var(--apc-primary, #7c3aed);
    color: #fff;
    border-bottom-right-radius: 5px;
}
.apc-message.bot   .apc-message-bubble {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 5px;
}
.apc-message.status .apc-message-bubble {
    background: #fefce8; color: #854d0e;
    font-size: 12px; text-align: center;
    max-width: 90%; margin: 0 auto; border-radius: 12px;
    border: 1px solid #fde68a;
}
.apc-message-bubble strong { font-weight: 700; }
.apc-message-bubble ul     { padding-right: 18px; margin: 6px 0; }
.apc-message-bubble ul li  { margin-bottom: 3px; }
.apc-msg-image { max-width: 180px; border-radius: 10px; margin-top: 6px; display: block; }

/* پیام صوتی نمایشی */
.apc-voice-msg {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--apc-primary,#7c3aed) 10%, transparent);
    border-radius: 14px; font-size: 12.5px; color: var(--apc-primary,#7c3aed);
}
.apc-voice-msg i { font-size: 16px; }

/* ── Typing ─────────────────────────────────────────────────── */
.apc-typing {
    display: none; padding: 10px 14px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 18px; border-bottom-left-radius: 5px;
    margin-bottom: 14px; width: fit-content;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.apc-typing-dots span {
    display: inline-block; width: 7px; height: 7px;
    background: #9ca3af; border-radius: 50%; margin-left: 3px;
    animation: apc-dot-bounce 1.4s infinite both;
}
.apc-typing-dots span:nth-child(2) { animation-delay: .2s; }
.apc-typing-dots span:nth-child(3) { animation-delay: .4s; }

/* ── Footer ─────────────────────────────────────────────────── */
#apc-chat-footer {
    padding: 8px 12px 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: var(--apc-win-bg, #fff);
}

/* Quick replies */
#apc-quick-replies {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center;
    margin-bottom: 8px;
}
#apc-quick-replies:empty { margin-bottom: 0; }
.apc-quick-reply-btn {
    background: color-mix(in srgb, var(--apc-primary,#7c3aed) 8%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--apc-primary,#7c3aed) 30%, transparent);
    color: var(--apc-primary, #7c3aed);
    padding: 5px 13px; border-radius: 20px;
    cursor: pointer; font-size: 12.5px;
    transition: all .2s;
}
.apc-quick-reply-btn:hover {
    background: var(--apc-primary, #7c3aed); color: #fff;
}

/* ── Input area: textarea | send + img + mic ───────────────── */
#apc-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0;
    background: #f4f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 18px;
    padding: 4px 4px 4px 8px;
    transition: border-color .2s, box-shadow .2s;
}
#apc-chat-input-area:focus-within {
    border-color: var(--apc-primary, #7c3aed);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--apc-primary,#7c3aed) 10%, transparent);
    background: #fff;
}

/* textarea — بدون border چون کانتینر border داره */
#apc-chat-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    padding: 7px 4px 7px 0 !important;
    outline: none !important;
    font-size: 14px !important;
    resize: none !important;
    height: 34px !important; max-height: 80px; min-height: 34px !important;
    direction: rtl !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    margin: 0 !important;
    background: transparent !important;
    display: block !important;
}
#apc-chat-input:focus { box-shadow: none !important; border: none !important; }
#apc-chat-input.expanded { height: auto !important; overflow-y: auto !important; }

/* گروه دکمه‌های سمت چپ */
.apc-input-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding: 2px 2px;
}

/* دکمه ارسال */
#apc-chat-send {
    background: var(--apc-primary, #7c3aed); color: #fff;
    border: none; border-radius: 13px;
    width: 34px; height: 34px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; flex-shrink: 0;
    font-size: 14px;
}
#apc-chat-send:hover    { opacity: .88; transform: scale(1.05); }
#apc-chat-send:disabled { background: #d1d5db; cursor: not-allowed; transform: none; }

/* دکمه‌های تصویر و صدا */
#apc-upload-btn,
#apc-voice-btn {
    background: none;
    border: none;
    color: #b0b0b8; cursor: pointer;
    font-size: 16px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    transition: color .2s, transform .2s;
    border-radius: 8px;
    flex-shrink: 0;
}
#apc-upload-btn:hover { color: var(--apc-primary,#7c3aed); transform: scale(1.1); }
#apc-voice-btn:hover  { color: #ef4444; transform: scale(1.1); }
#apc-voice-btn.recording {
    color: #ef4444;
    animation: apc-mic-pulse .8s ease infinite alternate;
}

.apc-loader {
    border: 3px solid rgba(255,255,255,.4);
    border-top: 3px solid #fff;
    border-radius: 50%; width: 16px; height: 16px;
    animation: apc-spin 1s linear infinite;
}

/* ── پیش‌نمایش تصویر ───────────────────────────────────────── */
#apc-image-preview-container { margin-top: 0; }
.apc-image-preview {
    display: flex; align-items: center; gap: 10px;
    background: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 7px 12px; margin-top: 6px;
}
.apc-image-preview-thumb {
    width: 36px; height: 36px; border-radius: 7px;
    object-fit: cover; flex-shrink: 0; border: 1px solid #cbd5e1;
}
.apc-image-preview-info { flex: 1; min-width: 0; }
.apc-image-preview-name { font-size: 12px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.apc-image-preview-size { font-size: 11px; color: #94a3b8; margin-top: 1px; display: block; }
.apc-remove-image {
    background: none; border: none; color: #cbd5e1;
    cursor: pointer; font-size: 20px; padding: 0 2px;
    line-height: 1; flex-shrink: 0; transition: color .15s;
}
.apc-remove-image:hover { color: #ef4444; }

/* نوار ضبط صدا */
#apc-voice-indicator {
    display: none; align-items: center; gap: 10px;
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 12px; padding: 8px 14px; margin-top: 6px;
    color: #dc2626; font-size: 13px;
}
#apc-voice-indicator.active { display: flex; }
.apc-voice-wave { display: flex; align-items: center; gap: 3px; }
.apc-voice-wave span {
    display: inline-block; width: 3px; background: #ef4444;
    border-radius: 3px; animation: apc-wave 1s ease infinite;
}
.apc-voice-wave span:nth-child(1) { height: 8px; }
.apc-voice-wave span:nth-child(2) { height: 14px; animation-delay: .15s; }
.apc-voice-wave span:nth-child(3) { height: 10px; animation-delay: .3s; }
.apc-voice-wave span:nth-child(4) { height: 16px; animation-delay: .1s; }
.apc-voice-wave span:nth-child(5) { height: 7px;  animation-delay: .25s; }
#apc-voice-timer { font-size: 12px; font-weight: 600; margin-right: auto; }
#apc-voice-cancel {
    background: none; border: none; color: #ef4444;
    cursor: pointer; font-size: 13px; font-weight: 600;
    padding: 3px 8px; border-radius: 8px;
    transition: background .2s;
}
#apc-voice-cancel:hover { background: #fee2e2; }

/* ── دکمه‌های اکشن ──────────────────────────────────────────── */
#apc-chat-messages .apc-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    color: #fff !important; padding: 10px 16px;
    border-radius: 12px; text-decoration: none !important;
    text-align: center; margin-top: 8px; font-weight: 600;
    transition: all .2s; border: none; cursor: pointer;
    width: 100%; font-family: inherit; font-size: 13.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
#apc-chat-messages .apc-action-btn:hover {
    transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,.15);
}
.apc-action-btn.add-to-cart { background: linear-gradient(135deg,#059669,#047857); }
.apc-action-btn.add-to-cart:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }
.apc-action-btn.whatsapp  { background: linear-gradient(135deg,#25D366,#128C7E); }
.apc-action-btn.telegram  { background: linear-gradient(135deg,#0088cc,#006aa3); }
.apc-action-btn.instagram { background: linear-gradient(45deg,#405de6,#833ab4,#c13584,#fd1d1d); }
.apc-action-btn.category  { background: linear-gradient(135deg, var(--apc-primary,#7c3aed), color-mix(in srgb, var(--apc-primary,#7c3aed) 70%, #4f46e5)); }
.apc-action-btn.general-link { background: var(--apc-gen-bg,#6c757d); color: var(--apc-gen-txt,#fff) !important; }
.apc-action-btn.phone-link { background: linear-gradient(135deg,#dc2626,#b91c1c); }

/* ── کارت محصول ─────────────────────────────────────────────── */
.apc-product-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 16px; padding: 12px;
    margin-top: 10px; display: flex; gap: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,.06);
    transition: all .3s;
}
.apc-product-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.apc-product-card-img  { width: 76px; height: 76px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #f3f4f6; }
.apc-product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.apc-product-card-body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.apc-product-card-title { font-size: 13px; font-weight: 700; color: #111827; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.apc-product-card-price { font-size: 13px; color: #059669; font-weight: 700; margin: 0; }
.apc-product-card-stock { font-size: 11px; margin: 0; }
.in-stock   { color: #059669; } .out-of-stock { color: #dc2626; }
.apc-product-card-btns { display: flex; gap: 5px; margin-top: 4px; }
.apc-product-card-btns a,
.apc-product-card-btns button {
    font-size: 11.5px; padding: 6px 10px; border-radius: 8px;
    text-decoration: none; border: none; cursor: pointer;
    flex: 1; text-align: center; font-weight: 600; transition: all .2s;
}
.apc-pc-view { background: var(--apc-primary,#7c3aed); color: #fff !important; }
.apc-pc-view:hover { opacity: .88; }
.apc-pc-add { background: #059669; color: #fff !important; }
.apc-pc-add:hover { opacity: .88; }
.apc-pc-add:disabled { background: #9ca3af; cursor: not-allowed; }
.apc-product-placeholder { color: #9ca3af; font-size: 12px; padding: 10px; text-align: center; }

/* ── پنل تماس ───────────────────────────────────────────────── */
.apc-contact-panel { flex: 1; overflow-y: auto; padding: 16px; background: #f9fafb; }
.apc-contact-section { margin-bottom: 16px; }
.apc-contact-section h4 {
    margin: 0 0 10px; font-size: 11px; color: #9ca3af;
    text-transform: uppercase; letter-spacing: .8px; font-weight: 600;
}
.apc-contact-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 14px; margin-bottom: 8px;
    text-decoration: none; color: inherit;
    transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.apc-contact-item:hover { background: #f8f7ff; border-color: color-mix(in srgb, var(--apc-primary,#7c3aed) 30%, transparent); transform: translateX(-2px); box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.apc-contact-item-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 18px;
}
.apc-contact-item.whatsapp  .apc-contact-item-icon { background: #dcfce7; color: #16a34a; }
.apc-contact-item.telegram  .apc-contact-item-icon { background: #dbeafe; color: #0088cc; }
.apc-contact-item.instagram .apc-contact-item-icon { background: #fce7f3; color: #db2777; }
.apc-contact-item.phone     .apc-contact-item-icon { background: #fee2e2; color: #dc2626; }
.apc-contact-item-text      { flex: 1; min-width: 0; }
.apc-contact-item-label     { font-size: 11px; color: #9ca3af; margin-bottom: 2px; }
.apc-contact-item-value     { font-size: 14px; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apc-contact-item-arrow     { color: #d1d5db; font-size: 11px; }

.apc-contact-address {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 14px; background: #fff; border: 1px solid #e5e7eb;
    border-radius: 14px; margin-bottom: 8px;
}
.apc-contact-address-icon { width: 38px; height: 38px; border-radius: 10px; background: #fef2f2; color: #dc2626; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.apc-contact-hours-box {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; background: #fefce8; border: 1px solid #fde68a;
    border-radius: 14px; margin-bottom: 8px;
}
.apc-contact-hours-icon { width: 38px; height: 38px; border-radius: 10px; background: #fef9c3; color: #ca8a04; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }

/* Collect contact */
.apc-collect-contact { background: #eff6ff; border: 1.5px solid #bfdbfe; border-radius: 14px; padding: 14px; margin-top: 10px; }
.apc-collect-contact p { font-size: 13px; color: #374151; margin: 0 0 10px; }
.apc-collect-contact-row { display: flex; gap: 8px; }
.apc-collect-contact-input { flex: 1; border: 1.5px solid #bfdbfe; border-radius: 20px; padding: 8px 14px; font-size: 13px; outline: none; direction: rtl; font-family: inherit; background: #fff; }
.apc-collect-contact-input:focus { border-color: var(--apc-primary,#7c3aed); }
.apc-collect-contact-submit { background: var(--apc-primary,#7c3aed); color: #fff; border: none; border-radius: 20px; padding: 8px 16px; font-size: 13px; cursor: pointer; white-space: nowrap; font-family: inherit; }

/* Promo */
.apc-promo-message {
    background: linear-gradient(135deg,#fefce8,#fef9c3);
    border: 1.5px solid #fde68a; border-radius: 14px;
    padding: 14px; margin-bottom: 14px;
}
.apc-promo-message p { margin: 0; font-size: 13.5px; color: #854d0e; line-height: 1.6; }
.apc-promo-close { float: left; background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 16px; padding: 0; }

/* ── انیمیشن‌ها ─────────────────────────────────────────────── */
@keyframes apc-spin        { to { transform: rotate(360deg); } }
@keyframes apc-dot-bounce  { 0%,80%,100%{transform:scale(0)} 40%{transform:scale(1)} }
@keyframes apc-bubble-pop  { 0%,100%{opacity:0;transform:translateX(50%) translateY(8px)} 15%,85%{opacity:1;transform:translateX(50%) translateY(0)} }
@keyframes apc-pulse-badge { to { transform: scale(1.25); } }
@keyframes apc-pulse-dot   { 50% { opacity: .3; } }
@keyframes apc-msg-in      { from { opacity:0; transform:translateY(8px); } }
@keyframes apc-mic-pulse   { to { text-shadow: 0 0 12px rgba(239,68,68,.7); } }
@keyframes apc-wave        { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(1.8)} }

/* ── فونت ارثبری از قالب ─────────────────────────────────────── */
#apc-chatbot-container,
#apc-chatbot-container * {
    font-family: inherit;
    box-sizing: border-box;
}

/* ── موبایل ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #apc-chatbot-container {
        bottom: 76px !important;
        right: 12px !important;
        left: auto !important;
        top: auto !important;
    }
    #apc-chat-button { width: 52px; height: 52px; }
    #apc-chat-button i { font-size: 20px !important; }

    #apc-chat-window {
        position: fixed !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        /* ارتفاع کمتر: فاصله پایین بیشتر تا دکمه FAB و نوار */
        height: calc(100dvh - 170px) !important;
        max-height: 520px !important;
        right: 10px !important;
        left: 10px !important;
        bottom: 135px !important;
        top: auto !important;
        border-radius: 18px !important;
        transform: translateY(14px) scale(.96) !important;
    }
    #apc-chat-window.open {
        transform: translateY(0) scale(1) !important;
    }
    /* جلوگیری از zoom روی iOS */
    #apc-chat-input { font-size: 16px !important; }
    .apc-message-bubble { font-size: 13px !important; }
    /* footer فشرده‌تر در موبایل */
    #apc-chat-footer { padding: 0 10px 10px; }
    #apc-quick-replies { padding-top: 8px; gap: 5px; }
}
