/* ========================================================
   🎨 المتغيرات المخصصة بالكامل (Custom Design System)
   ======================================================== */
:root {
    /* الألوان الرئيسية والحدود */
    --primary: #ff5a1f;
    --primary-hover: #e84b12;
    --success: #16a34a;
    --border: #e5e5e5;
    --border-focus: #ff5a1f;
    --radius: 16px;

    /* 🎯 1. المسافة بين عناصر النموذج */
    --form-gap: 25px;

    /* تخصيص الحاوية (Card Container) */
    --form-max-width: 700px;
    --form-bg: #ffffff;
    --form-radius: 16px;
    --form-padding: 30px;
    --form-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);

    /* تخصيص كارت المنتج (Product Card) */
    --card-bg: #ffffff;
    --card-border: #ececec;
    --card-radius: 16px;
    --card-padding: 25px;
    --card-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);

    /* تخصيص صورة المنتج */
    --img-width: 220px;
    --img-radius: 14px;

    /* تخصيص العناوين والأسعار */
    --form-title-color: #222222;
    --form-title-size: 28px;
    --customer-title-color: #000000;
    --customer-title-size: 22px;
    
    /* 🎯 2 & 3. ألوان وحجوم الأسعار */
    --price-size: 36px;
    --price-color: #16a34a;           /* متغير لون السعر المفرد */
    --total-price-size: 28px;
    --total-price-color: #16a34a;     /* متغير لون السعر الإجمالي */

    /* تخصيص حقول إدخال بيانات الزبون */
    --input-height: 52px;
    --input-bg: #ffffff;
    --input-border: #ddd;
    --input-radius: 12px;
    --input-text-color: #333333;
    /* 🎯 4. متغير حجم الخط داخل حقول الإدخال */
    --input-font-size: 16px;          

    /* تخصيص أزرار الكمية (+ و -) */
    --qty-btn-size: 48px;
    --qty-btn-radius: 12px;
    --qty-btn-bg: var(--primary);
    /* 🎯 5. لون أزرار الكمية عند Hover */
    --qty-btn-hover-bg: var(--primary-hover); 
    --qty-btn-color: #ffffff;
    --qty-input-width: 70px;

    /* تخصيص الزر الرئيسي (تأكيد الطلب) */
    --btn-submit-height: 56px;
    --btn-submit-bg: var(--primary);
    --btn-submit-hover: var(--primary-hover);
    --btn-submit-text-color: #ffffff;
    --btn-submit-font-size: 20px;
    --btn-submit-radius: 14px;

    /* تخصيص زر (إضافة إلى السلة) */
    --btn-cart-height: 52px;
    --btn-cart-border: var(--primary);
    --btn-cart-text-color: var(--primary);
    --btn-cart-hover-bg: var(--primary);
    --btn-cart-hover-text: #ffffff;
    --btn-cart-font-size: 18px;
    --btn-cart-radius: 14px;

    /* شارة الأمان */
    --secure-badge-color: #666666;
    --secure-badge-size: 14px;
}

/* ========================================================
   📦 تصميم الحاوية الكلية للفورم
   ======================================================== */
.essalek-form {
    max-width: var(--form-max-width);
    margin: 30px auto;
    padding: var(--form-padding);
    background: var(--form-bg);
    border: 1px solid var(--border);
    border-radius: var(--form-radius);
    box-shadow: var(--form-shadow);
    box-sizing: border-box;
}

/* كارت عرض المنتج */
.essalek-product-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    text-align: center;
    box-shadow: var(--card-shadow);
    margin-bottom: var(--form-gap); /* تطبيق المسافة المخصصة */
}

/* صورة المنتج */
.essalek-image img {
    width: var(--img-width);
    max-width: 100%;
    border-radius: var(--img-radius);
    height: auto;
}

/* عنوان المنتج */
.essalek-title {
    font-size: var(--form-title-size);
    font-weight: 700;
    color: var(--form-title-color);
    margin: 20px 0 10px;
}

/* سعر المنتج المفرد */
.essalek-price {
    font-size: var(--price-size);
    font-weight: 800;
    color: var(--price-color); /* استخدام لون السعر المخصص */
    margin-bottom: 20px;
}

/* ========================================================
   🔢 تحكم الأزرار والكمية (مخصص)
   ======================================================== */
.essalek-qty {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: var(--form-gap) 0; /* تطبيق المسافة المخصصة */
}

.essalek-qty button {
    width: var(--qty-btn-size);
    height: var(--qty-btn-size);
    border: none;
    border-radius: var(--qty-btn-radius);
    background: var(--qty-btn-bg);
    color: var(--qty-btn-color);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
}

/* لون زر الكمية عند مرورة الماوس (Hover) */
.essalek-qty button:hover {
    background: var(--qty-btn-hover-bg); 
}

.essalek-qty input {
    width: var(--qty-input-width);
    height: var(--qty-btn-size);
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: var(--qty-btn-radius);
    outline: none;
    box-sizing: border-box;
}

/* ========================================================
   💵 السعر الإجمالي
   ======================================================== */
.essalek-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: var(--form-gap) 0; /* تطبيق المسافة المخصصة */
}

.essalek-summary-col {
    flex: 1;
}

#essalek-total-price{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    height:var(--qty-btn-size);
    font-size:var(--price-size);
    font-weight:700;
    color:var(--price-color);
}

/* ========================================================
   📝 حقول إدخال بيانات الزبون
   ======================================================== */
.essalek-customer {
    margin-top: var(--form-gap); /* تطبيق المسافة المخصصة */
}

.essalek-section-title {
    font-size: var(--customer-title-size);
    font-weight: 700;
    color: var(--customer-title-color);
    margin-bottom: 20px;
    text-align: right;
}

.essalek-field {
    margin-bottom: calc(var(--form-gap) * 0.6); /* مسافة متناسبة بين الحقول */
}

.essalek-field input {
    width: 100%;
    height: var(--input-height);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--input-radius);
    padding: 0 18px;
    font-size: var(--input-font-size); /* حجم الخط المخصص للحقول */
    color: var(--input-text-color);
    transition: 0.3s ease;
    box-sizing: border-box;
    text-align: right;
}

.essalek-field input:focus {
    border-color: var(--border-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.15);
}

/* ========================================================
   🚀 أزرار الطلب والسلة وشارة الأمان
   ======================================================== */
.essalek-submit {
    margin-top: var(--form-gap); /* تطبيق المسافة المخصصة */
}

/* 1. زر تأكيد الطلب الرئيسي */
.essalek-submit-button {
    width: 100%;
    height: var(--btn-submit-height);
    border: none;
    border-radius: var(--btn-submit-radius);
    background-color: var(--btn-submit-bg) !important;
    color: var(--btn-submit-text-color) !important;
    font-size: var(--btn-submit-font-size);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s ease;
    touch-action: manipulation;
}

.essalek-submit-button:hover {
    background-color: var(--btn-submit-hover) !important;
}

.essalek-submit-button:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
}

/* 2. زر إضافة إلى السلة */
.essalek-add-to-cart-button {
    width: 100%;
    height: var(--btn-cart-height);
    border: 2px solid var(--btn-cart-border);
    border-radius: var(--btn-cart-radius);
    background-color: transparent !important;
    color: var(--btn-cart-text-color) !important;
    font-size: var(--btn-cart-font-size);
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    touch-action: manipulation;
}

.essalek-add-to-cart-button:hover {
    background-color: var(--btn-cart-hover-bg) !important;
    color: var(--btn-cart-hover-text) !important;
}

.essalek-add-to-cart-button:disabled {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
}

/* 3. شارة الدفع الآمن والتوصيل */
.essalek-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    font-size: var(--secure-badge-size);
    color: var(--secure-badge-color);
    font-weight: 600;
}