/* Dodd's Furniture AI Chatbot Styles */
:root {
    --dodds-primary: #C8102E;
    --dodds-primary-dark: #A00D25;
    --dodds-primary-light: #E31837;
    --dodds-secondary: #1a1a1a;
    --dodds-text: #2c2c2c;
    --dodds-text-light: #666666;
    --dodds-bg: #ffffff;
    --dodds-bg-gray: #f5f5f5;
    --dodds-border: #e0e0e0;
    --dodds-shadow: rgba(200, 16, 46, 0.15);
    --dodds-shadow-dark: rgba(0, 0, 0, 0.2);
}

#dodds-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#dodds-chatbot-container.left { right: auto; left: 20px; }

.dodds-chat-button {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dodds-primary) 0%, var(--dodds-primary-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--dodds-shadow);
    transition: all 0.3s;
}

.dodds-chat-button:hover {
    transform: translateY(-4px) scale(1.05);
}

.dodds-chat-icon { width: 32px; height: 32px; fill: white; }

.dodds-chat-window {
    position: fixed;
    bottom: 100px; right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 650px;
    max-height: calc(100vh - 140px);
    background: var(--dodds-bg);
    border-radius: 20px;
    box-shadow: 0 16px 48px var(--dodds-shadow-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s;
}

.dodds-chat-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.dodds-chat-header {
    background: linear-gradient(135deg, var(--dodds-primary) 0%, var(--dodds-primary-dark) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dodds-chat-header-left { display: flex; align-items: center; gap: 12px; }
.dodds-chat-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dodds-chat-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.dodds-chat-title h3 { margin: 0; font-size: 18px; }
.dodds-chat-subtitle { font-size: 13px; opacity: 0.95; }

.dodds-action-btn {
    background: rgba(255,255,255,0.2);
    border: none; color: white;
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dodds-action-btn:hover { background: rgba(255,255,255,0.3); }

.dodds-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--dodds-bg-gray);
}

.dodds-message {
    display: flex;
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dodds-message.user { justify-content: flex-end; }

.dodds-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.dodds-message.bot .dodds-message-content {
    background: white;
    color: var(--dodds-text);
    border-bottom-left-radius: 4px;
}

.dodds-message.user .dodds-message-content {
    background: linear-gradient(135deg, var(--dodds-primary), var(--dodds-primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.dodds-typing-indicator {
    display: flex; gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
}

.dodds-typing-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--dodds-text-light);
    animation: typingBounce 1.4s infinite;
}

.dodds-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.dodds-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.dodds-product-card-v2 {
    background: #f9f9f9;
    border-radius: 20px;
    padding: 20px;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    max-width: 280px;
    margin-left: 0;
    border: 1px solid #f0f0f0;
}

.dodds-product-image-wrapper {
    width: 100%;
    max-width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
}

.dodds-product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dodds-category {
    color: #a0a0a0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.dodds-title {
    font-family: serif;
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.dodds-price-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dodds-old-price {
    color: #b0b0b0;
    font-size: 16px;
    text-decoration: line-through;
}

.dodds-new-price {
    color: #b1272c;
    font-size: 24px;
    font-weight: 700;
}

a.dodds-buy-button {
    background: #000000 !important;
    color: #ffffff !important;
    border-radius: 50px;
    padding: 10px 35px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.dodds-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 10px;
}

.dodds-quick-reply-btn {
    background: #ffffff;
    border: 1px solid #2a58e8;
    color: #2a58e8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.dodds-quick-reply-btn:hover {
    background: #2a58e8;
    color: #ffffff;
}

.dodds-chat-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--dodds-border);
}

.dodds-input-container { display: flex; gap: 8px; }

#dodds-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--dodds-border);
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
}

.dodds-send-btn {
    width: 44px; height: 44px;
    background: var(--dodds-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dodds-send-btn svg { width: 20px; height: 20px; fill: white; }

@media (max-width: 480px) {
    .dodds-chat-window {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%; height: 100%;
        border-radius: 0;
    }
}

/* خنثی‌سازی استایل‌های قالب Astra برای دکمه‌های چت‌باکس */
#dodds-chatbot-container .dodds-action-btn {
    /* بازنشانی پدینگ و ابعاد */
    padding: 0 !important;
    margin: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    
    /* بازنشانی استایل‌های ظاهری */
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    
    /* تراز کردن آیکون در وسط */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* حذف افکت‌های متن قالب */
    text-transform: none !important;
    line-height: 1 !important;
}

/* افکت هاور سفارشی */
#dodds-chatbot-container .dodds-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

/* اگر آیکون‌های شما SVG هستند، مطمئن شوید رنگ و سایز دارند */
#dodds-chatbot-container .dodds-action-btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: white !important; /* یا currentColor */
    fill: none;
    display: block;
}
/* ۱. خنثی‌سازی کلی برای تمام دکمه‌های داخل چت‌باکس */
#dodds-chatbot-container button,
#dodds-chatbot-container .dodds-chat-button,
#dodds-chatbot-container .dodds-send-btn,
#dodds-chatbot-container .dodds-action-btn {
    padding: 0 !important; /* حذف پدینگ بزرگ Astra */
    margin: 0 !important;
    border: none !important;
    text-transform: none !important; /* حذف حروف بزرگ اجباری */
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    min-width: auto !important;
    min-height: auto !important;
}

/* ۲. تنظیم ابعاد اختصاصی دکمه ارسال (Send) */
.dodds-send-btn {
    width: 40px !important;
    height: 40px !important;
    background-color: var(--dodds-primary) !important;
    border-radius: 50% !important;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* ۳. تنظیم ابعاد اختصاصی دکمه شناور اصلی (Floating Button) */
.dodds-chat-button {
    width: 60px !important;
    height: 60px !important;
    background-color: var(--dodds-primary) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    cursor: pointer;
}

/* ۴. استایل آیکون‌های داخل دکمه‌ها */
#dodds-chatbot-container button svg {
    width: 22px !important; /* سایز آیکون را اینجا تنظیم کنید */
    height: 22px !important;
    stroke: white !important;
    fill: none !important;
    display: block !important;
}

/* ۵. افکت هاور برای دکمه ارسال */
.dodds-send-btn:hover {
    transform: scale(1.1);
    background-color: var(--dodds-primary-dark) !important;
}
/* ظرف اصلی دکمه‌ها */
.dodds-quick-replies {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 15px 10px !important;
    padding: 0 !important;
    justify-content: flex-start !important;
}

/* استایل دقیق دکمه‌های متنی (بدون تداخل با دکمه‌های آیکون‌دار) */
#dodds-chatbot-container .dodds-quick-reply-btn {
    background: #ffffff !important;
    border: 1px solid #2a58e8 !important; /* رنگ آبی برند */
    color: #2a58e8 !important;
    padding: 8px 16px !important; /* پدینگ انسانی و مرتب */
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    width: auto !important; /* جلوگیری از تمام‌عرض شدن */
    height: auto !important;
    line-height: 1.4 !important;
    text-transform: none !important; /* جلوگیری از حروف بزرگ Astra */
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

#dodds-chatbot-container .dodds-quick-reply-btn:hover {
    background: #2a58e8 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.dodds-chat-body {
    padding-bottom: 100px !important; /* فضای خالی بزرگ برای راحتی کاربر */
    display: flex;
    flex-direction: column;
}
/* جلوگیری از اسکرول افقی کل سایت */
html, body {
    overflow-x: hidden;
    position: relative;
    max-width: 100%;
}

/* وقتی چت در موبایل باز است، اسکرول پشت آن را غیرفعال می‌کنیم */
body.dodds-chat-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
/* تنظیمات برای تبلت و موبایل (صفحه‌های کوچک‌تر از 768px) */
@media screen and (max-width: 768px) {
    .dodds-chat-window {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }

    /* وقتی پنجره چت باز است، دکمه دایره‌ای شروع چت را مخفی کن تا مزاحم نباشد */
    .dodds-chat-window.active + .dodds-chat-button {
        display: none !important;
    }
/* اصلاح ظرف نگهدارنده دکمه‌ها در هدر */
.dodds-header-actions {
    display: flex !important;
    flex-direction: row !important; /* اجبار به چیدمان افقی */
    align-items: center !important;
    gap: 12px !important; /* فاصله بین دو دکمه */
    margin-left: auto; /* چسباندن دکمه‌ها به سمت راست هدر */
}

/* استایل خود دکمه‌ها برای جلوگیری از تغییر شکل */
.dodds-action-btn {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.15); /* کمی پس‌زمینه برای لمس بهتر */
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.dodds-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* آیکون‌های SVG داخل دکمه */
.dodds-action-btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: white !important; /* رنگ آیکون‌ها */
}

    .dodds-action-btn {
        padding: 8px; /* بزرگتر کردن فضای لمس برای انگشت */
    }
}
/* جلوگیری از لرزش صفحه در موبایل هنگام باز بودن چت */
body.dodds-chat-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* اصلاح چیدمان دکمه‌های هدر */
.dodds-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.dodds-header-actions {
    display: flex;
    gap: 8px; /* ایجاد فاصله بین دکمه مینیمایز و بستن */
    align-items: center;
}

.dodds-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

/* تنظیمات مخصوص تبلت و موبایل */
@media screen and (max-width: 768px) {
    .dodds-chat-window {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        z-index: 999999 !important;
    }

    /* مخفی کردن آیکون شناور سایت وقتی چت باز است تا روی دکمه‌ها نیفتد */
    body.dodds-chat-open .dodds-chat-button {
        display: none !important;
    }

    .dodds-chat-header {
        padding: 15px; /* بزرگتر کردن هدر در موبایل */
    }

    .dodds-header-actions {
        gap: 15px; /* فاصله بیشتر برای لمس راحت‌تر با انگشت */
    }
}

