/* بک‌گراند تاریک پاپ‌آپ */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

/* بدنه اصلی پاپ‌آپ */
.custom-cross-sell-modal-content {
    background: #fff; width: 100%; max-width: 500px;
    border-radius: 20px 20px 0 0; padding: 20px 20px 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    max-height: 85vh; overflow-y: auto;
}
.modal-overlay.active .custom-cross-sell-modal-content { transform: translateY(0); }

/* خط درگ موبایل */
.modal-indicator {
    width: 40px; height: 5px; background: #e0e0e0;
    border-radius: 10px; margin: 0 auto 15px auto;
}

/* هدر پاپ‌آپ */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 1px solid #f5f5f5; padding-bottom: 15px;
}
.modal-header h4 { margin: 0; font-size: 18px; color: #333; }
.close-modal {
    background: none; border: none; font-size: 28px;
    line-height: 1; cursor: pointer; color: #888;
}

/* نمایش محصول اصلی */
.main-product-preview {
    display: flex; align-items: center; gap: 15px;
    background: #f9f9f9; padding: 15px; border-radius: 15px; margin-bottom: 20px;
}
.main-product-preview img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.preview-details { display: flex; flex-direction: column; gap: 5px; }
.preview-title { font-size: 14px; color: #555; }
.preview-price { font-size: 16px; color: #111; font-weight: bold; }

/* هدر بخش پیشنهادات */
.suggested-section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.suggested-section-header h5 { margin: 0; font-size: 15px; color: #444; }
.optional-badge { font-size: 12px; color: #888; background: #f0f0f0; padding: 3px 8px; border-radius: 20px; }

/* لیست محصولات پیشنهادی */
.suggested-products-list { list-style: none; padding: 0; margin: 0; }
.bundle-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; border: 1px solid #eee; border-radius: 16px;
    margin-bottom: 10px; transition: all 0.2s ease; cursor: pointer;
}
.bundle-item.selected { 
    border-color: #cc33ff; 
    background: #faf2ff; /* پس‌زمینه بسیار روشن ترکیب طوسی و بنفش */
}

.product-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.product-info img { width: 55px; height: 55px; border-radius: 10px; object-fit: cover; }
.item-details { display: flex; flex-direction: column; gap: 4px; }
.item-title { font-size: 13px; color: #444; }
.item-price { font-size: 14px; color: #111; font-weight: bold; }

/* استایل چک‌باکس اختصاصی */
.checkbox-wrapper { position: relative; width: 26px; height: 26px; flex-shrink: 0; }
.bundle-checkbox { opacity: 0; position: absolute; z-index: -1; }
.custom-checkbox {
    width: 100%; height: 100%; border: 2px solid #ddd;
    border-radius: 8px; display: block; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.bundle-checkbox:checked + .custom-checkbox { 
    background-color: #cc33ff; 
    border-color: #cc33ff; 
}
.bundle-checkbox:checked + .custom-checkbox::after { content: '✔'; color: white; font-size: 14px; }

/* فوتر و دکمه پرداخت */
.bundle-footer {
    position: sticky; bottom: -30px; background: #fff;
    padding-top: 15px; border-top: 1px solid #f0f0f0; margin-top: 20px;
}
.total-price-wrapper {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.total-price-wrapper span { font-size: 14px; color: #666; }
.bundle-total-price { font-size: 18px; color: #111; font-weight: bold; }

.submit-bundle-btn {
    width: 100%; 
    background: #cc33ff; 
    color: #fff; 
    border-radius: 14px;
    padding: 16px; 
    font-weight: bold; 
    border: none; 
    font-size: 16px;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(204, 51, 255, 0.35); /* سایه بنفش هماهنگ با کد رنگ */
    transition: all 0.3s ease;
}
.submit-bundle-btn:disabled { 
    background: #e6b3ff; /* بنفش کدر برای حالت لودینگ */
    cursor: not-allowed; 
    box-shadow: none;
}

/* ریسپانسیو برای دسکتاپ */
@media (min-width: 768px) {
    .modal-overlay { align-items: center; }
    .custom-cross-sell-modal-content { border-radius: 20px; max-height: 80vh; bottom: auto; }
    .modal-indicator { display: none; }
    .bundle-footer { bottom: -20px; }
}