/* assets/css/front-style.css - v61.2 (Final Styling) */

/* 1. استيراد الخطوط */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

/* 2. المتغيرات العامة */
:root {
    --cncpro-dd-height: 48px;
    --cncpro-dd-img-size-list: 45px;
    --cncpro-dd-img-size-selected: 32px;
    --cncpro-dd-font-size: 14px;
}

/* ==========================================================================
   A. التنسيقات الهيكلية العامة (Structure Only)
   ========================================================================== */
.cncpro-form-container { 
    max-width: 650px; margin: 30px auto; direction: rtl; box-sizing: border-box;
    position: relative; overflow: visible !important; /* لظهور القوائم */
}

.cncpro-field-wrapper { margin-bottom: 20px; position: relative; z-index: auto; }
.cncpro-field-wrapper label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 15px; }

/* حقول الإدخال */
.cncpro-field-wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), 
.cncpro-field-wrapper select, 
.cncpro-field-wrapper textarea { 
    width: 100%; padding: 12px; border-radius: 6px; font-size: 14px; 
    box-sizing: border-box; display: block; transition: all 0.3s; 
}
.cncpro-field-wrapper input:focus, .cncpro-field-wrapper textarea:focus, .cncpro-field-wrapper select:focus { outline: none; }

/* إطار الصورة المتغيرة */
.cncpro-img-wrapper {
    text-align: center; background: #fff; padding: 10px; border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid #eee; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 200px;
}
.cncpro-dynamic-img { max-width: 100%; height: auto; object-fit: contain; display: none; border-radius: 8px; }
.cncpro-dynamic-img.active { display: block; animation: zoomIn 0.4s ease; }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* القائمة الصورية */
.cncpro-img-dropdown { position: relative; width: 100%; user-select: none; z-index: 100; }
.cncpro-img-dd-selected { display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 10px; cursor: pointer; border-radius: 6px; position: relative; z-index: 101; }
.cncpro-img-dd-selected img { height: 85% !important; width: auto !important; max-width: 50px; object-fit: contain; margin-left: 10px; vertical-align: middle; }
.cncpro-img-dd-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 99999; display: none; max-height: 300px; overflow-y: auto; margin-top: 5px; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.cncpro-img-dd-list.active { display: block; }
.cncpro-img-dd-item { padding: 10px; display: flex; align-items: center; cursor: pointer; transition: 0.2s; }
.cncpro-img-dd-item img { width: var(--cncpro-dd-img-size-list); height: var(--cncpro-dd-img-size-list); border-radius: 4px; margin-left: 10px; object-fit: cover; }
.cncpro-img-dd-item span { font-weight: 700; font-size: var(--cncpro-dd-font-size); }

/* السلايدر المربع */
.cncpro-slider-wrapper { margin-bottom: 25px; }
.cncpro-slider-container { position: relative; width: 100%; padding-bottom: 100%; height: 0; overflow: hidden; border-radius: 12px; background: #f9f9f9; }
.cncpro-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; z-index: 1; }
.cncpro-slide.active { opacity: 1; z-index: 2; }

/* رفع الملفات */
.cncpro-file-upload { position: relative; width: 100%; }
.cncpro-file-input { display: none; }
.cncpro-upload-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; border-radius: 8px; cursor: pointer; text-align: center; transition: 0.2s; border-style: dashed; border-width: 2px; }
.cncpro-file-preview img { max-width: 150px; border-radius: 5px; margin-top: 10px; }

/* الأزرار */
.cncpro-submit-btn { border: none; padding: 15px 35px; font-size: 18px; border-radius: 8px; cursor: pointer; display: block; width: 100%; margin-top: 20px; transition: 0.3s; }
.cncpro-submit-btn:disabled { background-color: #ccc !important; cursor: not-allowed; }

/* الرسائل */
.cncpro-message-box { display: none; padding: 15px; border-radius: 4px; margin-top: 20px; text-align: center; font-weight: bold; }
.cncpro-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.cncpro-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }


/* ==========================================================================
   B. الثيم البسيط (Simple Theme) - [Isolated]
   ========================================================================== */
.cncpro-form-container.theme-simple { background: #fff; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); font-family: inherit; border: 1px solid #eee; color: #333; }
.theme-simple .cncpro-field-wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), 
.theme-simple .cncpro-field-wrapper select, .theme-simple .cncpro-field-wrapper textarea {
    background-color: #ffffff !important; border: 1px solid #cccccc !important; color: #333333 !important;
}
.theme-simple .cncpro-field-wrapper input:focus { border-color: #007cba !important; }
.theme-simple .cncpro-field-wrapper label { color: #333 !important; }
.theme-simple .cncpro-submit-btn { background-color: #007cba !important; color: white !important; }
.theme-simple .cncpro-submit-btn:hover { background-color: #005a87 !important; }
.theme-simple .cncpro-total-field { background: #f8f9fa !important; border: 2px solid #e9ecef !important; color: #2c3e50 !important; text-align: center; pointer-events: none; padding: 10px; font-weight: bold; font-size: 20px; }
.theme-simple .cncpro-img-dd-selected { background: #fff !important; border: 1px solid #ccc !important; color: #333 !important; }
.theme-simple .cncpro-img-dd-list { background: #fff !important; border: 1px solid #ccc !important; }
.theme-simple .cncpro-img-dd-item { border-bottom: 1px solid #eee; color: #333 !important; }
.theme-simple .cncpro-img-dd-item:hover { background: #f0f7ff !important; color: #007cba !important; }
.theme-simple .cncpro-check-group label, .theme-simple .cncpro-radio-group label { display: flex; align-items: center; margin-bottom: 8px; cursor: pointer; color: #333; justify-content: flex-start; gap: 8px; }
.theme-simple .cncpro-upload-label { background: #f9f9f9 !important; border-color: #007cba !important; color: #007cba !important; }


/* ==========================================================================
   C. الثيم الذهبي الفاخر (Premium Gold) - [Isolated]
   ========================================================================== */
.cncpro-form-container.theme-gold { background: #fdfdfd; padding: 40px; border-radius: 16px; font-family: 'Tajawal', sans-serif; box-shadow: 0 15px 40px rgba(0,0,0,0.08); border: 1px solid #fff; color: #111; }
.cncpro-form-container.theme-gold::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, #111, #d4af37, #111); z-index: 1; }
.theme-gold .cncpro-field-wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), 
.theme-gold .cncpro-field-wrapper select, .theme-gold .cncpro-field-wrapper textarea {
    background-color: #ffffff !important; border: 1px solid #e0e0e0 !important; color: #111 !important;
}
.theme-gold .cncpro-field-wrapper input:focus { border-color: #d4af37 !important; box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1); }
.theme-gold .cncpro-field-wrapper label { color: #111 !important; font-size: 16px; margin-bottom: 10px; }
.theme-gold .cncpro-submit-btn { background: #111 !important; color: #d4af37 !important; font-weight: 800; font-family: 'Tajawal', sans-serif; }
.theme-gold .cncpro-submit-btn:hover { background: #d4af37 !important; color: #111 !important; box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3); transform: translateY(-2px); }
.theme-gold .cncpro-total-field { background: #fffcf0 !important; border: 2px dashed #d4af37 !important; color: #111 !important; font-family: 'Tajawal', sans-serif; font-size: 26px !important; text-align: center; padding: 20px !important; }
.theme-gold .cncpro-radio-group label, .theme-gold .cncpro-check-group label { background: #fff; padding: 15px; border-radius: 8px; border: 2px solid #f4f4f4; transition: 0.3s; display: flex; align-items: center; justify-content: flex-start; margin-bottom: 10px; cursor: pointer; color: #111; gap: 12px; }
.theme-gold .cncpro-radio-group label:hover { border-color: #d4af37; }
.theme-gold .cncpro-radio-group label:has(input:checked) { border-color: #d4af37; background-color: #fffcf0; color: #111; box-shadow: 0 4px 10px rgba(212, 175, 55, 0.15); }
.theme-gold .cncpro-radio-group input { margin: 0; width: 18px !important; height: 18px; accent-color: #d4af37; }
.theme-gold .cncpro-img-dd-selected { background: #fff !important; border: 2px solid #f4f4f4 !important; height: 55px; color: #111 !important; }
.theme-gold .cncpro-img-dd-selected:hover { border-color: #d4af37 !important; }
.theme-gold .cncpro-img-dd-list { background: #fff !important; border: 1px solid #d4af37 !important; border-radius: 8px; }
.theme-gold .cncpro-img-dd-item { border-bottom: 1px solid #f9f9f9; padding: 12px; color: #111 !important; }
.theme-gold .cncpro-img-dd-item:hover { background: #111 !important; color: #d4af37 !important; }
.theme-gold .cncpro-img-dd-item:hover img { border-color: #d4af37; }
.theme-gold .cncpro-upload-label { border: 2px dashed #d4af37; background: #fffcf0; color: #111; }


/* ==========================================================================
   D. ثيم إلكترو الداكن (Electro Dark)
   ========================================================================== */
.cncpro-form-container.theme-electro { background: #2c2c2c; padding: 30px; border-radius: 12px; font-family: 'Tajawal', sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid #444; color: #fff; }
.theme-electro .cncpro-field-wrapper label { color: #ffd700 !important; margin-bottom: 8px; }
.theme-electro h3 { color: #fff !important; border-bottom: 2px solid #ffd700 !important; }
.theme-electro .cncpro-field-wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), 
.theme-electro .cncpro-field-wrapper select, 
.theme-electro .cncpro-field-wrapper textarea { 
    background-color: #3a3a3a !important; border: 1px solid #555 !important; color: #fff !important; 
}
.theme-electro .cncpro-field-wrapper input:focus { border-color: #ffd700 !important; box-shadow: 0 0 8px rgba(255, 215, 0, 0.2); }
.theme-electro .cncpro-img-dd-selected { background: #3a3a3a !important; border: 1px solid #555 !important; color: #fff !important; }
.theme-electro .cncpro-img-dd-selected:hover { border-color: #ffd700 !important; }
.theme-electro .cncpro-img-dd-list { background: #3a3a3a !important; border: 1px solid #ffd700 !important; }
.theme-electro .cncpro-img-dd-item { border-bottom: 1px solid #555; color: #fff !important; }
.theme-electro .cncpro-img-dd-item:hover { background: #222 !important; color: #ffd700 !important; }
.theme-electro .cncpro-radio-group label, .theme-electro .cncpro-check-group label { background: #3a3a3a; border: 1px solid #555; color: #fff; padding: 12px; border-radius: 6px; margin-bottom: 8px; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.theme-electro .cncpro-radio-group label:hover { border-color: #ffd700; }
.theme-electro .cncpro-radio-group label:has(input:checked) { border-color: #ffd700; background-color: rgba(255, 215, 0, 0.1); color: #ffd700; }
.theme-electro .cncpro-submit-btn { background: #ffd700 !important; color: #222 !important; font-weight: 800; border-radius: 30px; font-family: 'Tajawal', sans-serif; }
.theme-electro .cncpro-submit-btn:hover { background: #e6c200 !important; box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
.theme-electro .cncpro-total-field { background: #3a3a3a !important; border: 2px solid #ffd700 !important; color: #ffd700 !important; font-family: 'Tajawal', sans-serif; font-size: 26px !important; text-align: center; padding: 15px; border-radius: 8px; }
.theme-electro .cncpro-slider-container { background: #3a3a3a; }
.theme-electro .cncpro-upload-label { background: #3a3a3a !important; border-color: #555 !important; color: #aaa !important; }
.theme-electro .cncpro-upload-label:hover { border-color: #ffd700 !important; color: #ffd700 !important; }

/* ==========================================================================
   E. تنسيق نافذة الشحن المنبثقة (Checkout Modal)
   ========================================================================== */
.cncpro-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 999999;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.cncpro-modal-content {
    background: #2c2c2c; width: 90%; max-width: 550px;
    border-radius: 12px; border: 2px solid #ffd700;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease; overflow: hidden;
    color: #fff; font-family: 'Tajawal', sans-serif; direction: rtl;
}
@keyframes slideUp { from {transform: translateY(30px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

.cncpro-modal-header {
    background: #3a3a3a; padding: 15px 20px; border-bottom: 1px solid #444;
    display: flex; justify-content: space-between; align-items: center;
}
.cncpro-modal-header h3 { margin: 0; color: #ffd700; font-size: 18px; font-weight: 700; }
.cncpro-modal-close { cursor: pointer; font-size: 26px; color: #fff; line-height: 1; transition: 0.2s; }
.cncpro-modal-close:hover { color: #ffd700; transform: rotate(90deg); }

.cncpro-modal-body { padding: 25px; }

/* حقول الشحن */
.ship-input {
    width: 100%; padding: 12px; margin-bottom: 12px;
    background: #444; border: 1px solid #555; color: #fff;
    border-radius: 6px; box-sizing: border-box; font-family: 'Tajawal', sans-serif;
    font-size: 14px;
}
.ship-input:focus { border-color: #ffd700; outline: none; background: #555; }
.form-row-half { display: flex; gap: 12px; }
.form-row-half .ship-input { flex: 1; }

/* مربع التأكيد */
.payment-confirm-box {
    background: rgba(255, 215, 0, 0.05); border: 1px dashed #ffd700;
    padding: 15px; border-radius: 8px; text-align: center; margin: 20px 0;
}
.payment-confirm-box p { margin: 0; font-size: 17px; font-weight: 600; color: #fff; }
.payment-confirm-box small { color: #ccc; display: block; margin-top: 5px; font-size: 13px; }

/* زر الدفع النهائي */
.cncpro-final-pay-btn {
    background: #ffd700; color: #222; font-weight: 800; width: 100%;
    padding: 15px; border-radius: 50px; border: none; cursor: pointer;
    font-size: 18px; transition: 0.3s; font-family: 'Tajawal', sans-serif;
}
.cncpro-final-pay-btn:hover { background: #e6c200; box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); transform: translateY(-2px); }

/* Responsive */
@media (max-width: 768px) {
    .cncpro-form-container { padding: 15px; margin: 10px; }
    .cncpro-slider-container { padding-bottom: 100%; }
}