/* نظام العضوية - تصميم صفحة الدفع بالتقسيط */

/* إضافة عبارة الضريبة بعد كل سعر */
.woocommerce-checkout-review-order-table .amount:after {
    content: "+ الضريبة";
    display: block;
    font-size: 12px;
    color: #f39c12;
    font-weight: bold;
    margin-top: 3px;
    direction: rtl;
    text-align: right;
}

/* إضافة عبارة خاصة للمجموع النهائي */
.woocommerce-checkout-review-order-table .order-total .amount:after {
    content: "+ الضريبة المضافة (15%)";
    font-size: 14px;
    color: #e74c3c;
    font-weight: bold;
    margin-top: 5px;
}

/* ضمان ظهور عبارة الضريبة */
.woocommerce table.shop_table .amount {
    position: relative;
}

.woocommerce table.shop_table .amount:before {
    content: "+ الضريبة";
    position: absolute;
    bottom: -18px;
    right: 0;
    font-size: 11px;
    color: #f39c12;
    font-weight: bold;
    direction: rtl;
    width: 100%;
    text-align: right;
}

.ksa-specific-fields {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #e9ecef;
    direction: rtl;
    text-align: right;
}

.ksa-specific-fields h3 {
    color: #2a5298;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid #2a5298;
    padding-bottom: 10px;
}

/* أزرار اختيار نوع الدفع */
.ksa-specific-fields input[type="radio"] {
    margin-left: 10px;
    transform: scale(1.2);
}

.ksa-specific-fields label {
    font-weight: 500;
    color: #333;
    cursor: pointer;
    padding: 8px 0;
    display: block;
}

.ksa-specific-fields input[name="payment_method_choice"] + label {
    background: #fff;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.ksa-specific-fields input[name="payment_method_choice"]:checked + label {
    background: #e8f4fd;
    border-color: #2a5298;
    color: #2a5298;
    font-weight: bold;
}

/* تصميم معلومات التقسيط */
.installment-details {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #d4a017;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.alert-info {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.installment-details h4 {
    color: #d4a017;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.installment-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.installment-details li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(212, 160, 23, 0.2);
    color: #7d5d00;
    font-weight: 500;
}

.installment-details li:last-child {
    border-bottom: none;
}

/* تصميم حقول الإدخال */
.ksa-specific-fields .form-row {
    margin-bottom: 15px;
}

.ksa-specific-fields input[type="text"],
.ksa-specific-fields input[type="tel"],
.ksa-specific-fields select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    direction: rtl;
}

.ksa-specific-fields input[type="text"]:focus,
.ksa-specific-fields input[type="tel"]:focus,
.ksa-specific-fields select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* أيقونات المدن */
.ksa-specific-fields select option {
    padding: 10px;
    direction: rtl;
}

/* رسائل التحقق */
.woocommerce-error,
.woocommerce-message {
    direction: rtl;
    text-align: right;
}

/* تحسين التصميم للجوال */
@media (max-width: 768px) {
    .ksa-specific-fields {
        padding: 15px;
        margin: 15px 0;
    }
    
    .ksa-specific-fields h3 {
        font-size: 16px;
    }
    
    .installment-details {
        padding: 15px;
    }
    
    .ksa-specific-fields input[type="text"],
    .ksa-specific-fields input[type="tel"],
    .ksa-specific-fields select {
        padding: 10px 12px;
        font-size: 16px; /* منع التكبير في iOS */
    }
}

/* تأثيرات بصرية جميلة */
.ksa-specific-fields {
    position: relative;
    overflow: hidden;
}

.ksa-specific-fields::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #2a5298, #1e3c72);
}

/* تحسين تصميم أزرار الراديو */
.ksa-specific-fields input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-left: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ksa-specific-fields input[type="radio"]:checked {
    border-color: #2a5298;
    background: #2a5298;
}

.ksa-specific-fields input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* إضافة نجمة للحقول المطلوبة */
.ksa-specific-fields .required label::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

/* تحسين مظهر السلة والإجمالي */
.cart-subtotal .amount,
.order-total .amount {
    font-weight: bold;
    color: #2a5298;
    font-size: 18px;
}

/* رسالة توضيحية جميلة */
.payment-method-info {
    background: linear-gradient(135deg, #e8f4fd, #cfe2f3);
    border-right: 4px solid #2a5298;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.payment-method-info h4 {
    color: #2a5298;
    margin-bottom: 10px;
    font-size: 16px;
}

.payment-method-info p {
    color: #5a6169;
    margin: 0;
    line-height: 1.6;
}

/* أنماط قوية لإظهار عبارة الضريبة - أولوية عالية */
.woocommerce-checkout-review-order-table .amount {
    position: relative !important;
}

.woocommerce-checkout-review-order-table .amount::after {
    content: "+ الضريبة" !important;
    display: block !important;
    font-size: 12px !important;
    color: #f39c12 !important;
    font-weight: bold !important;
    margin-top: 3px !important;
    direction: rtl !important;
    text-align: right !important;
}

.woocommerce-checkout-review-order-table .order-total .amount::after {
    content: "+ الضريبة المضافة (15%)" !important;
    font-size: 14px !important;
    color: #e74c3c !important;
}

/* إضافة صف ضريبة في الجدول */
.woocommerce-checkout-review-order-table .cart-subtotal::after {
    content: "🏛️ الضريبة المضافة + 15% ستضاف حسب النظام السعودي";
    display: table-row !important;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
    border: 2px solid #f39c12 !important;
    padding: 15px !important;
    text-align: right !important;
    direction: rtl !important;
    font-weight: bold !important;
    color: #d68910 !important;
    font-size: 14px !important;
}

/* تأكيد ظهور العبارة في جميع الأسعار */
#order_review .amount::before {
    content: "+ الضريبة " !important;
    color: #f39c12 !important;
    font-weight: bold !important;
    font-size: 12px !important;
    display: inline !important;
    margin-left: 5px !important;
}

/* تأكيد اتجاه النص العربي */
body.rtl .woocommerce-checkout-review-order-table,
body.rtl #order_review {
    direction: rtl !important;
    text-align: right !important;
}
