/* --- SGR Theme Compatibility Styles --- */
.sgr-recommendation-wrapper {
    clear: both;
    width: 100%;
}

.sgr-fomo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444; 
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ct-media-container {
    position: relative;
}

/* ==========================================
   FBT (Frequently Bought Together) Styles
========================================== */
.sgr-fbt-container {
    margin: 30px 0;
    padding: 20px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.sgr-fbt-container h3 {
    margin-top: 0;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--theme-headings-color, #1e293b);
}

.sgr-fbt-images {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.sgr-fbt-images a {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: opacity 0.3s;
}

.sgr-fbt-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgr-fbt-plus {
    font-size: 24px;
    color: #94a3b8;
    font-weight: bold;
}

.sgr-fbt-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
}

.sgr-fbt-list li {
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.sgr-fbt-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.sgr-fbt-main-item {
    font-weight: 600;
}

.sgr-fbt-checkbox {
    margin-right: 12px !important;
    width: 18px;
    height: 18px;
    accent-color: var(--theme-palette-color-1, #4f46e5);
}

.sgr-fbt-item-title {
    flex-grow: 1;
}

.sgr-fbt-item-price {
    color: #ef4444;
    font-weight: 700;
    margin-left: 10px;
}

.sgr-fbt-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.sgr-fbt-total-price {
    font-size: 1.1em;
    color: #64748b;
}

.sgr-fbt-total-price strong {
    color: #16a34a;
    font-size: 1.3em;
    margin-left: 5px;
}

.sgr-fbt-btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}

/* ==========================================
   CART UPSELL (Checkout / Cart Banner) Styles
========================================== */
.sgr-upsell-box {
    background: #fff;
    border: 2px dashed var(--theme-palette-color-1, #4f46e5);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

.sgr-upsell-title {
    margin-top: 0;
    font-size: 1.2em;
    font-weight: 800;
    color: var(--theme-headings-color, #1e293b);
    margin-bottom: 20px;
}

.sgr-upsell-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sgr-upsell-item {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.sgr-upsell-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.sgr-upsell-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 15px;
}

.sgr-upsell-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sgr-upsell-info {
    flex-grow: 1;
}

.sgr-upsell-info h4 {
    margin: 0 0 5px 0 !important;
    font-size: 15px;
    font-weight: 600;
}

.sgr-upsell-info .price {
    font-weight: bold;
    color: #ef4444;
}

.sgr-upsell-action .sgr-add-upsell-btn {
    padding: 6px 15px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    margin: 0 !important;
}

/* موبایل رسپانسیو */
@media (max-width: 600px) {
    .sgr-fbt-total-box {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .sgr-fbt-total-price {
        text-align: center;
    }
    .sgr-fbt-btn {
        width: 100%;
    }
    .sgr-upsell-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .sgr-upsell-img {
        margin-right: 0;
    }
}

/* ==========================================
   Smart Graph - Floating Toast Notification
========================================== */
#sgr-sticky-bar {
    position: fixed;
    bottom: -150px;
    left: 20px;
    right: 20px;
    max-width: 380px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 99999;
    padding: 10px 14px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    opacity: 0;
    pointer-events: none;
    transition: bottom 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.5s ease-in-out;
}

#sgr-sticky-bar.sgr-visible {
    bottom: 20px;
    opacity: 1;
    pointer-events: auto;
}

.sgr-sticky-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sgr-sticky-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    min-width: 0;
}

.sgr-sticky-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.sgr-sticky-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex-grow: 1;
}

.sgr-sticky-fomo {
    font-size: 11px;
    color: #059669;
    font-weight: 700;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sgr-sticky-text h4 {
    margin: 0 !important;
    font-size: 13px;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sgr-sticky-action {
    flex-shrink: 0;
}

.sgr-sticky-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

/* ==========================================
   🪄 SMARTGRAPH SELLORA - PREMIUM UI REVAMP
   ========================================== */

/* کانتینر چت اصلی هوش مصنوعی */
.sgr-concierge-wrapper {
    max-width: 800px !important;
    margin: 40px auto !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
}

/* هدر لوکس */
.sgr-concierge-header {
    background: linear-gradient(135deg, #4f46e5 0%, #1e1b4b 100%) !important;
    padding: 30px 25px !important;
    text-align: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.sgr-concierge-header h3 {
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 22px !important;
    margin: 0 !important;
    letter-spacing: -0.5px !important;
}

.sgr-concierge-header p {
    color: #c7d2fe !important;
    font-size: 14px !important;
    margin: 8px auto 0 !important;
    opacity: 0.9 !important;
}

/* باکس داخلی محتوای چت */
.sgr-concierge-chat-body {
    padding: 35px !important;
    background: #f8fafc !important;
}

.sgr-concierge-bundle-title {
    font-size: 1.5em !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 10px 0 !important;
    letter-spacing: -0.5px !important;
}

.sgr-concierge-explanation {
    color: #475569 !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    margin: 0 0 30px 0 !important;
}

/* ⚡ اصلاح قطعی گرید: چیدمان کنار هم بدون تداخل قالب */
.sgr-ai-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* فیکس دقیق روی سه ستون */
    gap: 20px !important;
    margin: 0 0 30px 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* ⚡ حذف تمام المان‌های فرعی قالب وو‌کومرس روی ساختار جدید */
.sgr-ai-grid::before, .sgr-ai-grid::after {
    display: none !important;
}

/* ⚡ کارت لوکس و فشرده اختصاصی هوش مصنوعی */
.sgr-ai-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 15px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
}

.sgr-ai-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.08) !important;
    border-color: #c7d2fe !important;
}

/* کادر تصویر یکپارچه */
.sgr-ai-card-img {
    display: block !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    margin-bottom: 12px !important;
    height: 150px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sgr-ai-card-img img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    width: auto !important;
    margin: 0 auto !important;
}

/* بخش بدنه کارت */
.sgr-ai-card-body {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    justify-content: space-between !important;
}

.sgr-ai-card-body h4 {
    margin: 0 0 8px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    height: 36px !important; /* فیکس کردن ارتفاع عنوان برای تراز شدن قیمت‌ها */
    overflow: hidden !important;
}

.sgr-ai-card-body h4 a {
    color: #1e293b !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

/* قیمت محصول */
.sgr-ai-price {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #4f46e5 !important;
    margin-bottom: 12px !important;
}

.sgr-ai-price del {
    color: #94a3b8 !important;
    font-size: 12px !important;
    margin-right: 6px !important;
    font-weight: 500 !important;
}

.sgr-ai-price ins {
    text-decoration: none !important;
    background: transparent !important;
}

/* دکمه ظریف افزودن تک محصول */
.sgr-ai-add-btn {
    width: 100% !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: none !important;
    padding: 10px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
}

.sgr-ai-add-btn:hover {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

/* دکمه بزرگ خرید کل باندل */
.sgr-concierge-add-all-btn {
    width: 100% !important;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    border: none !important;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.sgr-concierge-add-all-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.35) !important;
}

/* فوتر و باکس ورودی متنی */
.sgr-concierge-footer {
    padding: 20px 25px !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    gap: 12px !important;
}

#sgr-concierge-input {
    flex-grow: 1 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    outline: none !important;
    background: #ffffff !important;
    color: #1e293b !important;
}

#sgr-concierge-input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

#sgr-concierge-submit-btn {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0 25px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
}

/* موبایل رسپانسیو برای گرید چت */
@media (max-width: 768px) {
    .sgr-ai-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* دو ستون در تبلت */
    }
    .sgr-concierge-chat-body {
        padding: 20px !important;
    }
}

@media (max-width: 480px) {
    .sgr-ai-grid {
        grid-template-columns: 1fr !important; /* تک ستون در موبایل */
    }
}

.sgr-pulse-anim {
    animation: sgrPulse 2s infinite;
}