:root {
    --primary: #5a0418;
    --bg: #f9f5ea;
    --white: #fffdf8;
}

body {
    font-family: 'Tahoma', sans-serif;
    background-color: var(--bg);
    margin: 0;
    direction: rtl;
    padding-bottom: 100px; 
}

header {
    background: var(--white);
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
     border-top: 8px solid #5a0418;
     object-fit:contain;
}
.header_img{
    object-fit:contain;
}

/* الأقسام - سكرول أفقي */
.categories {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 10px;
    white-space: nowrap;
    background: var(--white);
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 100;
}
.categories::-webkit-scrollbar { display: none; }

.categories button {
    background: #f4f0e5;
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s;
}

.categories button.active {
    background: var(--primary);
    color: white;
}

/* الشبكة - 3 أصناف في الصف */
/* الأساس: للجوال (3 أعمدة) */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px;
    padding: 10px;
}

/* للتابلت: الشاشات أكبر من 600px (4 أعمدة) */
@media (min-width: 600px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

/* للابتوب: الشاشات أكبر من 1024px (6 أعمدة) */
@media (min-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
    }
}

/* لشاشات الكمبيوتر الكبيرة: أكبر من 1440px (8 أعمدة) */
@media (min-width: 1440px) {
    .menu-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.item-card {
    background: var(--white);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-card img {
    width: 100%;
    height: 100px;
    object-fit:contain;
    border-radius: 8px;
}

.item-card h4 {
    /* السماح للنص بالانتقال لسطر جديد */
    white-space: normal; 
    word-wrap: break-word;
    
    /* تحديد ارتفاع ثابت للعنوان لتوحيد شكل الكروت */
    min-height: 44px; /* مساحة تكفي لسطرين */
    
    /* تنسيق المحاذاة */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4; /* مسافة مريحة بين السطرين */
    
    /* منع النص من تخريب عرض الكارت */
    width: 100%;
    overflow: hidden;
    text-align: center;
}

.price { 
    display: block; 
    color: var(--primary); 
    font-weight: bold; 
    margin-bottom: 8px; 
    font-size: 11px;
}

.item-card button {
    width: 100%;
    color: white;
    border: none;
    padding: 6px 2px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
}

/* --- نظام السلة المنزلقة (Bottom Sheet) المعدل --- */

.cart-floating-bar {
    position: fixed;
    bottom: 20px;
    left: 5%;
    right: 5%;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 15px;
    display: none; 
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 999;
    cursor: pointer;
}

.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    z-index: 1000;
}

.cart-sheet {
    position: fixed;
    bottom: -100%; 
    left: 0;
    right: 0;
    background: var(--white);
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    z-index: 1001;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.cart-sheet.active {
    bottom: 0;
}

/* رأس السلة - توزيع العناصر بين اليمين واليسار */
/* رأس السلة - توزيع احترافي */
.sheet-header {
    position: relative; /* ضروري لعمل الموقع المطلق داخلها */
    padding: 20px;
    text-align: center; /* توسيط العنوان أو محاذاته يميناً */
    border-bottom: 1px solid #f4f0e5;
}

.sheet-header h3 {
    margin: 0;
    padding-right: 10px;
    text-align: right; /* محاذاة النص لليمين */
}

.close-sheet {
    position: absolute;
    left: 20px; /* تثبيتها في أقصى اليسار */
    top: 50%;
    transform: translateY(-50%); /* التوسيط العمودي الدقيق */
    font-size: 24px;
    color: #888;
    cursor: pointer;
}


.sheet-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* الفوتر: الإجمالي يمين والزر دائري يسار */
.sheet-footer {
    padding: 15px 20px;
    border-top: 1px solid #f4f0e5;
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-container {
    text-align: right;
}

.total-label {
    display: block;
    font-size: 14px;
    color: #666;
}

.total-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* زر "اطلب" الدائري الأخضر على اليسار */
.btn-send {
    background: var(--primary);
    color: white;
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* تنسيق الأصناف داخل السلة */
.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.item-details {
    text-align: right;
    flex: 1;
}

.item-details b {
    display: block;
    font-size: 14px;
}

.item-details span {
    font-size: 12px;
    color: var(--primary);
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 15px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-minus { background: #f4f0e5; color: #333; }
.btn-plus { background: var(--primary); color: white; }

.item-total-price {
    font-weight: bold;
    min-width: 60px;
    text-align: left;
}

.btn-send-whatsapp {
    background-color: #5a0418; /* خلفية فاتحة جداً مثل الصورة */
    color: #ffffff; /* لون النص */
    border: 1px solid #ccc; /* إطار خفيف وواضح */
    padding: 8px 15px;
    border-radius: 8px; /* حواف منحنية قليلاً وليست دائرية بالكامل */
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* مسافة بين أيقونة الواتساب والنص */
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* ظل ناعم جداً */
}

.btn-send-whatsapp:hover {
    background-color: #fff;
    border-color: #5a0418; /* يتحول الإطار للأخضر عند التمرير */
    color: #5a0418;
}

.btn-send-whatsapp:active {
    transform: scale(0.98); /* تأثير الضغط */
}

/* خلفية النافذة المظلمة ___________________________________*/
.modal-overlay-ohter {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none; /* مخفية */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px); /* تأثير تغبيش الخلفية */
}









/* تنسيق النافذة المنبثقة من الأسفل */
.variant-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 50vh; /* يغطي 45% من ارتفاع الشاشة فقط (أقل من النصف) */
    background-color: white;
    border-radius: 25px 25px 0 0; /* حواف دائرية من الأعلى فقط */
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out; /* حركة الظهور من الأسفل */
    z-index: 4000;
}

/* خلفية ضبابية معتمة */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none; /* قم بتغيير هذه القيمة من flex إلى none */
    align-items: flex-end;
    z-index: 3000;
}
/* أنيميشن الظهور من الأسفل */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* تنسيق أزرار الأحجام داخل النافذة */
.variants-list {
    margin: 5px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-btn {
    width: 100%;
    padding: 15px;
    border: 1px solid #f4f0e5;
    background: #f9f9f9;
    border-radius: 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}









/* زر الإضافة العادي (الأخضر كما في الصورة) */
.btn-add {
    background-color: #5a0418;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

/* زر الخيارات (التصميم المختلف) */
.btn-options {
    background-color: #5a0418; /* لون أزرق احترافي */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.btn-options:hover {
    background-color: #5a0418;
    transform: translateY(-2px);
}





/* صندوق النافذة - ملء العرض فقط */
.modal-content {
    display: flex;
    flex-direction: column;
    height: auto; 
    overflow: hidden; /* يمنع ظهور سكرول مزدوج مشوه */
    
    background: var(--white);
    padding: 25px;
    height: 100%;
    width: 100%;        /* يملأ عرض الحاوية الأب */
    max-width: 100%;    /* إلغاء التقييد بـ 350px */
    box-sizing: border-box; /* لضمان عدم خروج الحواف بسبب padding */
    
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

.table-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.table-numbers button {
    padding: 5px;
    border: 1px solid var(--primary);
    border-radius: 16px;
    background: #ffffff;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.table-numbers button:focus {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
#custom-table {
    grid-column: span 3;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    text-align: center;
}


.Price-selection{
    justify-content: space-between; /* توزيع المساحة بين العناصر */

     display: flex;
    flex-direction: column;
    height: auto; 
    overflow: hidden; /* يمنع ظهور سكرول مزدوج مشوه */
    
    background: var(--white);
    padding: 25px;
    height: 100%;
    width: 100%;        /* يملأ عرض الحاوية الأب */
    max-width: 100%;    /* إلغاء التقييد بـ 350px */
    box-sizing: border-box; /* لضمان عدم خروج الحواف بسبب padding */
    
    text-align: center;
    animation: slideUp 0.3s ease-out;
}


.modal-content {
    display: flex;
    flex-direction: column; /* ترتيب العناصر عمودياً */
    justify-content: space-between; /* توزيع المساحة بين العناصر */
}

/* تعديل كود الأزرار الذي أرسلته */
.modal-actions {
    flex-shrink: 0; /* يمنع ضغط الأزرار أو تحركها */
    display: flex;
    gap: 10px;
    margin-top: auto; /* هذا السطر سيدفع الأزرار دائماً للقاع */
    padding-top: 10px; /* مسافة بسيطة فوق الأزرار */
    width: 100%;
    margin-bottom: 7px;
}

.btn-confirm, .btn-cancel {
    flex: 1; /* لجعل الزرين متساويين في العرض */
}

.btn-confirm {
    flex: 2;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
}

.btn-cancel {
    flex: 1;
    background: #f4f0e5;
    border: none;
    padding: 12px;
    border-radius: 10px;
}

.btn-cancel-other {
    flex: none !important; /* إلغاء التمدد الإجباري */
    width: 90% !important; /* جعل العرض مناسباً وليس كاملاً جداً */
    margin: 10px auto !important; /* مسافة معقولة وتوسيط */
    padding: 12px !important;
    background-color: #f5f5f5 !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    border: none;
}


@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


.modal-body {
    flex: 1; /* يأخذ المساحة المتاحة بين العنوان والأزرار */
    overflow-y: auto; /* تفعيل السكرول العمودي عند الحاجة فقط */
    padding: 15px 20px;
    
    /* تحسين شكل السكرول ليكون ناعماً في الجوال */
    -webkit-overflow-scrolling: touch; 
}

/* اختياري: تخصيص شكل شريط السكرول ليكون مخفياً أو نحيفاً */
.modal-body::-webkit-scrollbar {
    width: 4px; /* عرض شريط التمرير */
}

.modal-body::-webkit-scrollbar-thumb {
    background: #ccc; /* لون شريط التمرير */
    border-radius: 10px;
}

/* تنسيق أزرار الطاولات */
.table-btn {
    padding: 15px;
    border: 2px solid #f4f0e5;
    border-radius: 12px;
    background: #f9f9f9;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* اللون الأخضر عند الاختيار */
.table-btn.selected {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.table-numbers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 5px 0;
}

/* للتابلت: الشاشات المتوسطة (8 أعمدة) */
@media (min-width: 600px) {
    .table-numbers {
        grid-template-columns: repeat(8, 1fr);
        gap: 8px; /* زيادة الفراغ قليلاً لراحة العين */
    }
}

/* للشاشات الكبيرة: لابتوب وكمبيوتر (10 أعمدة) */
@media (min-width: 1024px) {
    .table-numbers {
        grid-template-columns: repeat(10, 1fr);
        gap: 10px;
    }
}


.payment-methods {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    
}

.pay-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

/* حالة الاختيار لزر الدفع */
.pay-btn.selected {
    border-color: #5a0418;
    color: #5a0418;
    background: #f0fff4;
}

/* تنسيق صندوق الحسابات الرئيسي */
/* الحاوية الرئيسية */
.accounts-box {
    background: transparent; /* إزالة الخلفية البيضاء الكبيرة */
    padding: 10px;
    margin-top: 10px;
}

/* العنوان الصغير */
.mini-title {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-bottom: 8px;
}

/* تنسيق البطاقات الملونة */
.bank-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #202020; /* لون النص أبيض ليظهر على الخلفيات الملونة */
}

/* لون خاص للعمقي (مثلاً الكحلي أو الأزرق) */
.al-amqi {
   border: 3px solid #13a93d8a;
    border-right: 4px solid #13a93d8a;
}

/* لون خاص للكريمي (الأخضر المميز للكريمي) */
.al-kuraimi {
    border: 3px solid #8f0a9e8a;
    border-right: 4px solid #8f0a9e82;
}

.bsare {
    border: 3px solid #0a0a9e8a;
    border-right: 4px solid #0a0a9e8a;
}

.bndoal {
    border: 3px solid #ff00008a;
    border-right: 4px solid #0048ff8a;
}

.al-Qutaibi {
    border: 3px solid #2f9e0a8a;
    border-right: 4px solid #2f9e0a8a;
}

.b-name {
    font-size: 12px;
    font-weight: bold;
}

.b-number {
    cursor: pointer; /* تغيير شكل الماوس ليد */
    padding: 2px 8px;
    border-radius: 5px;
    transition: 0.3s;
    display: inline-block;
}

.b-number:active {
    background: #e0e0e0; /* تأثير عند الضغط */
    transform: scale(0.95);
}

.b-number::after {
    margin-right: 5px;
    font-size: 12px;
}

/* ملاحظة صغيرة */
.mini-note {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-top: 5px;
}

.box-header {
    text-align: center;
    color: #5a0418;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

/* الترتيب: اسم البنك يمين والرقم يسار */
.account-item {
    display: flex;
    justify-content: space-between; /* دفع العناصر للأطراف */
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f9f9f9;
}

.bank-name {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.account-num {
    font-family: 'monospace', sans-serif; /* لجعل الأرقام واضحة */
    font-size: 15px;
    font-weight: bold;
    color: #5a0418;
    letter-spacing: 1px;
    direction: ltr; /* لضمان ظهور الأرقام بشكل صحيح */
}

/* خط فاصل ناعم */
.divider {
    border: 0;
    height: 1px;
    background: #f4f0e5;
    margin: 15px 0;
}

/* تنسيق قسم رفع الملفات */
.upload-label {
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

#receipt-image {
    width: 100%;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

.upload-note {
    text-align: center;
    font-size: 11px;
    color: #e67e22;
    margin-top: 8px;
}

.btn-send-whatsapp {
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3) !important;
    transition: transform 0.2s;
}

.btn-send-whatsapp:active {
    transform: scale(0.95);
}

/* حقل الملاحظات */
.note-input {
    width: 100%;
    height: 45px;
    padding-top:  7px;
    padding-right:9px ;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 13px;
    margin-top: 5px;
}

.accounts-popup {
    position: fixed;
    bottom: -100%; /* تكون مخفية بالأسفل */
    left: 0;
    right: 0; /* لضمان العرض الكامل */
    width: 100%;
    height: auto;
    max-height: 70vh; /* لا تتجاوز 70% من طول الشاشة */
    background: white;
    z-index: 3000; /* أعلى من الـ Modal */
    transition: bottom 0.4s ease-out;
    border-radius: 25px 25px 0 0;
    padding: 20px;
    box-sizing: border-box; /* تمنع خروج المحتوى عن اليمين */
    direction: rtl;
}

.accounts-popup.active {
    bottom: 0; /* تظهر عند إضافة كلاس active */
}

/* خلفية مظلمة إضافية عند فتح الحسابات (اختياري لجمالية التصميم) */
.accounts-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 2999;
}

.accounts-scroll-area {
    overflow-y: auto;
    max-height: 250px;
    margin-top: 15px;
}

.sheet-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f4f0e5;
    padding-bottom: 10px;
    font-weight: bold;
}

.close-sheet-btn {
    background: #f4f0e5;
    border: none;
    font-size: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}