/*
Theme Name: Chef Jabr Restaurant
Description: قالب مطعم شيف جبر مع 13 فئة رئيسية للطعام
Version: 1.0
Author: MiniMax Agent
*/

/* نمط الصفحة الجديد مطابق للتصميم الأصلي */

/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    direction: rtl;
    text-align: right;
    overflow: hidden;
    line-height: 1.6;
}

/* صفحة الترحيب مع خلفيات متجاوبة */
#landing {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* طبقة الخلفية المتجاوبة */
#responsive-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: 1;
}

/* طبقة التراكب الداكن */
.dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.1) 50%, 
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 2;
}

/* مناطق النقر للخيارين */
.click-area {
    position: absolute;
    width: 50%;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
}

.left-click {
    left: 0;
    top: 0;
}

.right-click {
    right: 0;
    top: 0;
}

.click-area:hover {
    background: rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(5px);
}

/* تأثير النبضة */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        box-shadow: 0 0 0 30px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* تنسيقات الأجهزة اللوحية والهواتف */
@media (max-width: 768px) {
    /* تغيير الخلفية للهواتف فقط */
    #responsive-background {
        /* سيتم تحديد الصورة من CSS المخصص في index.php */
        background-attachment: scroll; /* تحسين الأداء على الهواتف */
    }
    
    /* تحسين الشعار للهواتف */
    .restaurant-logo {
        max-height: 140px; /* تقليل الحجم قليلاً على الهواتف */
        padding: 10px; /* تقليل الحشو للهواتف */
    }
    
    .header {
        padding: 25px 15px; /* تقليل الحشو على الهواتف */
        margin-bottom: 30px;
    }
}

/* الجسيمات */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #D4AF37;
    border-radius: 50%;
    opacity: 0.7;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* صفحة القائمة */
#menu-page {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    padding: 20px;
    position: relative;
    overflow-y: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* رأس الصفحة */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding: 40px 0; /* زيادة الحشو من 30px إلى 40px */
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.08) 100%);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo-container a {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-container a:hover {
    transform: translateY(-2px);
}

.restaurant-logo {
    max-height: 120px; /* تحسين الحجم */
    width: auto;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    filter: drop-shadow(0 5px 15px rgba(212, 175, 55, 0.3));
    /* إضافة خلفية شفافة */
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
}

.restaurant-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 50px rgba(212, 175, 55, 0.6);
    filter: drop-shadow(0 8px 20px rgba(212, 175, 55, 0.5));
    border-color: rgba(212, 175, 55, 0.5);
    background-color: rgba(255, 255, 255, 0.15);
}

/* شبكة الفئات - التصميم الجديد مطابق للصورة 34 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: linear-gradient(145deg, #222222 0%, #1a1a1a 100%);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    border: 2px solid rgba(212, 175, 55, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    height: 280px;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.2);
}

.category-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card:hover .category-image {
    transform: scale(1.1);
}

.category-info {
    padding: 20px;
    position: relative;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #D4AF37;
    margin-bottom: 8px;
    text-align: center;
    line-height: 1.3;
}

.english-name {
    font-size: 0.9rem;
    color: #cccccc;
    font-weight: normal;
    display: block;
    margin-top: 5px;
}

/* =================== CART BUTTON STYLES =================== */
.cart-toggle-btn {
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    min-width: 120px;
}

.cart-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #B8941F, #A67C1A);
}

.cart-toggle-btn:active {
    transform: translateY(0);
}

.cart-toggle-btn .cart-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.cart-toggle-btn.pulse {
    animation: pulse-cart 1s ease-in-out;
}

@keyframes pulse-cart {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.category-description {
    font-size: 0.9rem;
    color: #aaaaaa;
    text-align: center;
    margin-top: 5px;
}

.category-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 25px;
    height: 25px;
    background: linear-gradient(45deg, #D4AF37, #F4D03F);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* رأس الفئة */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.back-button {
    background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.category-title {
    font-size: 2rem;
    color: #D4AF37;
    text-align: center;
    flex-grow: 1;
}

.english-title {
    font-size: 1.2rem;
    color: #cccccc;
    font-weight: normal;
    display: block;
    margin-top: 5px;
}

/* شبكة الأصناف - تصميم متجاوب */
.items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* الافتراضي للهاتف: عمودين */
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* تابلت: 3 أعمدة */
@media (min-width: 768px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
        padding: 25px;
    }
}

/* كمبيوتر صغير: 3 أعمدة */
@media (min-width: 1024px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        padding: 30px;
    }
}

/* كمبيوتر كبير: 4 أعمدة */
@media (min-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

.item-card {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 320px;
}

.item-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.15);
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px 15px 0 15px;
    text-align: center;
}

.item-name {
    font-size: 1.1rem;
    color: #D4AF37;
    margin-bottom: 8px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
}

.item-english-name {
    font-size: 0.9rem;
    color: #cccccc;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.item-details {
    color: #aaaaaa;
    font-size: 0.8rem;
    margin-bottom: 8px;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-price {
    font-size: 1.2rem;
    color: #FF6B35;
    font-weight: bold;
    text-align: center;
    margin: 0;
}

/* عناصر التحكم - تصميم بسيط وواضح */
.item-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 15px 15px 15px;
    margin-top: auto;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border-radius: 0;
    padding: 4px;
    margin: 4px 0;
}

.quantity-btn {
    background: transparent;
    color: #D4AF37;
    border: 1px solid #D4AF37;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.15);
    color: #F4D03F;
    border-color: #F4D03F;
    transform: scale(1.05);
}

.quantity-btn:disabled {
    background: transparent;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.quantity-display {
    font-size: 1rem;
    font-weight: bold;
    color: #D4AF37;
    min-width: 20px;
    text-align: center;
}

.add-to-cart {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 255, 136, 0.3);
}

.notes-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    color: white !important;
    border: none !important;
    padding: 10px 15px !important;
    border-radius: 15px !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    margin-top: auto !important;
}

.notes-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3) !important;
}

/* السلة */
#cartSummary {
    position: relative;
    background: #2a2a2a !important;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    pointer-events: auto !important; /* السماح بالنقر داخل السلة */
}

#cartSummary.minimized {
    padding: 15px;
    max-height: auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.cart-title {
    color: #D4AF37;
    font-size: 1.2rem;
    font-weight: bold;
}

#cartBadge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-items {
    margin-bottom: 15px;
}

.cart-item {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.cart-item-name {
    color: #D4AF37;
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-english {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cart-item-notes {
    color: #aaaaaa;
    font-size: 0.8rem;
    margin-bottom: 8px;
    font-style: italic;
}

.cart-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cart-item-quantity {
    color: #cccccc;
    font-size: 0.9rem;
}

.cart-item-price {
    color: #00ff88;
    font-weight: bold;
}

.cart-item-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-total-price {
    color: #D4AF37;
    font-weight: bold;
    font-size: 1.1rem;
}

.cart-summary {
    padding-top: 15px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-summary-label {
    color: #cccccc;
}

.cart-summary-value {
    color: #D4AF37;
    font-weight: bold;
}

.cart-total {
    font-size: 1.2rem;
    color: #00ff88;
    font-weight: bold;
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.cart-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.clear-cart {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.submit-order {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
}

.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* نافذة الملاحظات */
#notesModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.notes-modal-content {
    background: linear-gradient(145deg, #2a2a2a 0%, #1e1e1e 100%);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.notes-modal-header {
    color: #D4AF37;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

#notesText {
    width: 100%;
    height: 150px;
    background: rgba(212, 175, 55, 0.05);
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 15px;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 20px;
}

#notesText:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.notes-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.notes-btn-save, .notes-btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.notes-btn-save {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
}

.notes-btn-cancel {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.notes-btn-save:hover, .notes-btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* نافذة الصورة */
#imageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 3000;
    cursor: pointer;
}

#imageModal.active {
    display: flex;
}

#modalImage {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* الصور المصغرة */
.item-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    justify-content: center;
}

.item-thumbnails img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(212, 175, 55, 0.2);
}

.item-thumbnails img:hover {
    transform: scale(1.1);
    border-color: rgba(212, 175, 55, 0.6);
}

/* زر العودة للرئيسية */
.home-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.home-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}


    font-weight: bold;
}

/* ========== تنسيقات خاصة بالشاشات أقل من 1200px ========== */
@media (max-width: 1200px) {
    .restaurant-logo {
        width: 900px;
        height: 420px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

/* ========== تنسيقات خاصة بالشاشات أقل من 992px ========== */
@media (max-width: 992px) {
    .menu-title {
        font-size: 2.2rem;
        padding: 15px 30px;
    }
    
    .menu-title i {
        font-size: 1.8rem;
        margin-left: 10px;
    }

    .restaurant-logo {
        width: 700px;
        height: 330px;
    }
}

/* ========== تنسيقات خاصة بالشاشات المتوسطة 769px-1024px (أجهزة التابلت الكبيرة) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
    
    .item-card {
        padding: 18px;
        aspect-ratio: 1 / 1; /* للتأكد من الشكل المربع على التابلت */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}


    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

/* النافذة المنبثقة للسلة */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.cart-modal {
    background: #2a2a2a;
    border-radius: 15px;
    padding: 0;
    max-width: 90%;
    max-height: 90%;
    width: 450px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== تنسيقات خاصة بالشاشات أقل من 768px (أجهزة التابلت والهواتف الكبيرة) ========== */
@media (max-width: 768px) {
    .left-half {
        clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
    }
    
    .right-half {
        clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .menu-title {
        font-size: 1.8rem;
        padding: 12px 25px;
    }
    
    .menu-title i {
        font-size: 1.5rem;
        margin-left: 8px;
    }
    
    .left-text {
        right: 10%;
    }
    
    .right-text {
        left: 10%;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* إصلاح تخطيط الأصناف للهواتف - ضمان عمودين */
    .items-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        padding: 8px;
    }

    .item-card {
        padding: 10px;
        aspect-ratio: 1 / 1; /* للتأكد من الشكل المربع على الهواتف */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 0;
    }
    
    /* تحسين حجم النصوص للهواتف */
    .item-name {
        font-size: 0.9rem;
        line-height: 1.1;
        margin-bottom: 4px;
    }
    
    .item-english-name {
        font-size: 0.75rem;
    }
    
    .item-details {
        font-size: 0.7rem;
        margin-bottom: 6px;
        -webkit-line-clamp: 1; /* تقليل عدد الأسطر على الهواتف */
    }
    
    .item-price {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    /* إعادة تصميم الأزرار للهواتف */
    .item-controls {
        gap: 6px;
        margin-top: auto;
    }
    
    .quantity-controls {
        padding: 4px;
        gap: 6px;
        background: transparent;
        border-radius: 0;
    }
    
    .quantity-btn {
        background: transparent;
        color: #D4AF37;
        border: 1px solid #D4AF37;
        width: 22px;
        height: 22px;
        border-radius: 3px;
        font-size: 0.8rem;
    }
    
    .quantity-display {
        font-size: 1rem;
        min-width: 25px;
    }
    
    .add-to-cart {
        padding: 6px 8px !important;
        border-radius: 12px !important;
        font-size: 0.75rem !important;
        margin-bottom: 3px !important;
    }
    
    .notes-btn {
        padding: 6px 8px !important;
        border-radius: 12px !important;
        font-size: 0.75rem !important;
        display: block !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 15 !important;
    }

    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .back-button {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .cart-badge {
        top: 15px;
        left: 15px;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .container {
        padding: 20px 15px;
    }

    .header {
        padding: 20px;
    }

    .category-page {
        padding: 25px 20px;
    }

    .restaurant-logo {
        width: 90%;
        height: auto;
    }

    .home-icon {
        top: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .option {
        padding: 30px 40px;
    }
    
    .option h1 {
        font-size: 2.2rem;
    }
    
    .option p {
        font-size: 1.2rem;
    }
    
    .category-card {
        height: 250px;
    }
}

/* ========== تنسيقات خاصة بالهواتف الصغيرة جداً أقل من 480px ========== */
@media (max-width: 480px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
        padding: 6px;
    }
    
    .item-card {
        padding: 8px;
        border-radius: 12px;
    }
    
    .item-name {
        font-size: 1.0rem !important;
        margin-bottom: 6px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.2 !important;
    }
    
    .item-english-name {
        font-size: 0.7rem;
    }
    
    .item-details {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }
    
    .item-price {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .quantity-btn {
        background: transparent;
        color: #D4AF37;
        border: 1px solid #D4AF37;
        width: 20px;
        height: 20px;
        border-radius: 3px;
        font-size: 0.7rem;
    }
    
    .quantity-controls {
        padding: 3px;
        gap: 5px;
        background: transparent;
        border-radius: 0;
    }
    
    .add-to-cart {
        padding: 5px 6px !important;
        font-size: 0.7rem !important;
        margin-bottom: 3px !important;
    }
    
    .notes-btn {
        padding: 5px 6px !important;
        font-size: 0.7rem !important;
        border-radius: 10px !important;
        display: block !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 20 !important;
    }
    
    .item-controls {
        gap: 4px;
    }
}
    
    .category-image {
        height: 150px;
    }
    
    #cartSummary {
        max-width: 300px;
        left: 10px;
        bottom: 10px;
    }
}

/* ========== تنسيقات خاصة بالشاشات أقل من 576px (هواتف متوسطة وصغيرة) ========== */
@media (max-width: 576px) {
    .background-split {
        flex-direction: column;
    }
    
    .left-half, .right-half {
        clip-path: none;
        flex: none;
        height: 50%;
    }
    
    .overlay-text {
        width: 100%;
        text-align: center;
    }
    
    .left-text, .right-text {
        left: auto;
        right: auto;
    }
    
    .menu-title {
        font-size: 1.6rem;
        padding: 10px 20px;
    }
    
    .menu-title i {
        font-size: 1.3rem;
        margin-left: 5px;
    }

    .restaurant-logo {
        width: 95%;
        height: auto;
    }
    
    .option {
        padding: 20px 30px;
    }
    
    .option h1 {
        font-size: 1.8rem;
    }
    
    .option p {
        font-size: 1rem;
    }
    
    .header {
        padding: 20px 0;
    }
}

/* تحسينات إضافية للهواتف الصغيرة جداً */
@media (max-width: 480px) {
    .left-half, .right-half {
        width: 100%;
        height: 50%;
    }
    
    #landing {
        flex-direction: column;
    }
    
    .restaurant-logo {
        width: 95%;
        height: auto;
    }
    
    .items-grid {
        gap: 8px;
        padding: 8px;
    }
    
    .item-card {
        padding: 10px;
        aspect-ratio: 1 / 1; /* للتأكد من الشكل المربع على الهواتف الصغيرة */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .item-name {
        font-size: 1rem;
        line-height: 1.1;
        margin-bottom: 4px;
    }
    
    .item-details {
        font-size: 0.75rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }
    
    .item-price {
        font-size: 1rem;
    }
    
    .quantity-btn {
        background: transparent;
        color: #D4AF37;
        border: 1px solid #D4AF37;
        width: 22px;
        height: 22px;
        border-radius: 3px;
        font-size: 0.8rem;
    }
    
    .quantity-display {
        font-size: 1rem;
    }
    
    .add-to-cart {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .notes-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
}

/* تأثيرات إضافية للحركة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }
.category-card:nth-child(7) { animation-delay: 0.7s; }
.category-card:nth-child(8) { animation-delay: 0.8s; }
.category-card:nth-child(9) { animation-delay: 0.9s; }
.category-card:nth-child(10) { animation-delay: 1.0s; }
.category-card:nth-child(11) { animation-delay: 1.1s; }
.category-card:nth-child(12) { animation-delay: 1.2s; }
.category-card:nth-child(13) { animation-delay: 1.3s; }

/* شريط التمرير المخصص */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #F4D03F 0%, #D4AF37 100%);
}

/* تحسينات إضافية للأجهزة المحمولة */
@media (max-width: 768px) {
    /* تغيير التخطيط للهواتف فقط - عمودي */
    .click-area {
        width: 100% !important;
        height: 50% !important;
    }
    
    .left-click {
        left: 0 !important;
        top: 50% !important;
    }
    
    .right-click {
        right: 0 !important;
        top: 0 !important;
    }
    
    .click-area {
        min-height: 200px; /* ارتفاع أدنى لسهولة النقر على الهاتف */
    }
    
    /* تحسين موقع الأزرار في الشاشات الصغيرة */
    .home-button {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    

}

/*
 * ========== حل شامل لمشاكل العرض على الأجهزة المحمولة ==========
 * يركز على: زر الملاحظات، حجم الكروت، التخطيط، والتمرير
 * تاريخ الإضافة: 2025-09-29
 */

/* إزالة التمرير الأفقي نهائياً */
body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

#menu-page {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.container {
    overflow-x: hidden !important;
    max-width: 100% !important;
    padding: 10px !important;
}

/* ========== إصلاحات خاصة بالأجهزة أقل من 900px ========== */
@media (max-width: 900px) {
    
    /* إصلاح شبكة العناصر - ضمان عمودين فقط */
    .items-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* تقليل حجم الكروت بشكل كبير */
    .item-card {
        height: 190px !important;
        max-height: 190px !important;
        min-height: 190px !important;
        padding: 8px !important;
        margin: 0 !important;
        aspect-ratio: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* تحسين محتوى الكرت */
    .item-info {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        margin-bottom: 8px !important;
    }
    
    /* تحسين أسماء العناصر */
    .item-name {
        font-size: 0.85rem !important;
        line-height: 1.1 !important;
        margin-bottom: 4px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        display: -webkit-box !important;
    }
    
    /* تحسين وصف العناصر */
    .item-details {
        font-size: 0.7rem !important;
        line-height: 1.1 !important;
        margin-bottom: 6px !important;
        color: #aaa !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        display: -webkit-box !important;
    }
    
    /* تحسين السعر */
    .item-price {
        font-size: 0.9rem !important;
        font-weight: bold !important;
        color: #00ff88 !important;
        margin-bottom: 8px !important;
    }
    
    /* إصلاح شامل لأزرار التحكم */
    .item-controls {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        margin-top: auto !important;
        width: 100% !important;
    }
    
    /* إصلاح أزرار الكمية */
    .quantity-controls {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 3px !important;
        background: transparent !important;
        border-radius: 0 !important;
        margin-bottom: 4px !important;
    }
    
    .quantity-btn {
        width: 20px !important;
        height: 20px !important;
        border-radius: 3px !important;
        border: 1px solid #D4AF37 !important;
        background: transparent !important;
        color: #D4AF37 !important;
        font-size: 0.7rem !important;
        font-weight: bold !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }
    
    .quantity-display {
        font-size: 0.9rem !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        min-width: 20px !important;
        text-align: center !important;
    }
    
    /* إصلاح زر الإضافة للسلة */
    .add-to-cart {
        background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%) !important;
        color: #000 !important;
        border: none !important;
        padding: 6px 8px !important;
        border-radius: 10px !important;
        font-size: 0.75rem !important;
        font-weight: bold !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        margin-bottom: 4px !important;
        width: 100% !important;
        display: block !important;
    }
    
    /* ========== إصلاح شامل لزر الملاحظات ========== */
    .notes-btn {
        /* إجبار الظهور بقوة */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        
        /* الموقع والحجم */
        width: 100% !important;
        padding: 6px 8px !important;
        margin: 0 !important;
        
        /* التصميم */
        background: linear-gradient(135deg, #ff6b6b 0%, #d63031 100%) !important;
        color: #fff !important;
        border: none !important;
        border-radius: 10px !important;
        font-size: 0.75rem !important;
        font-weight: bold !important;
        
        /* التأثيرات */
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        
        /* ضمان الظهور فوق العناصر الأخرى */
        position: relative !important;
        z-index: 50 !important;
        
        /* منع القطع أو الإخفاء */
        overflow: visible !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        
        /* خصائص إضافية للتأكد */
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }
    
    /* تأثير عند التمرير على زر الملاحظات */
    .notes-btn:hover {
        background: linear-gradient(135deg, #d63031 0%, #ff6b6b 100%) !important;
        transform: scale(1.02) !important;
    }
    
    /* ضمان ظهور زر الملاحظات في جميع الحالات */
    .item-card .notes-btn {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* إصلاح أي خاصية قد تخفي الزر */
    .notes-btn[style*="display: none"] {
        display: block !important;
    }
    
    .notes-btn[style*="visibility: hidden"] {
        visibility: visible !important;
    }
    
    .notes-btn[style*="opacity: 0"] {
        opacity: 1 !important;
    }
}

/* ========== إصلاحات خاصة بالهواتف الصغيرة (أقل من 600px) ========== */
@media (max-width: 600px) {
    
    /* تقليل حجم الكروت أكثر للهواتف الصغيرة */
    .item-card {
        height: 170px !important;
        max-height: 170px !important;
        min-height: 170px !important;
        padding: 6px !important;
    }
    
    /* تحسين النصوص للهواتف الصغيرة */
    .item-name {
        font-size: 0.8rem !important;
        -webkit-line-clamp: 1 !important;
    }
    
    .item-details {
        font-size: 0.65rem !important;
        -webkit-line-clamp: 1 !important;
    }
    
    .item-price {
        font-size: 0.85rem !important;
    }
    
    /* تحسين الأزرار للهواتف الصغيرة */
    .quantity-btn {
        background: transparent !important;
        color: #D4AF37 !important;
        border: 1px solid #D4AF37 !important;
        width: 18px !important;
        height: 18px !important;
        border-radius: 2px !important;
        font-size: 0.65rem !important;
    }
    
    .add-to-cart, .notes-btn {
        padding: 5px 6px !important;
        font-size: 0.7rem !important;
    }
}

/* ========== إصلاحات خاصة بالهواتف الصغيرة جداً (أقل من 400px) ========== */
@media (max-width: 400px) {
    
    /* تقليل حجم الكروت أكثر للهواتف الصغيرة جداً */
    .item-card {
        height: 150px !important;
        max-height: 150px !important;
        min-height: 150px !important;
        padding: 5px !important;
    }
    
    /* تحسين الأزرار للهواتف الصغيرة جداً */
    .add-to-cart, .notes-btn {
        padding: 4px 5px !important;
        font-size: 0.65rem !important;
    }
    
    /* تحسين الشبكة للهواتف الصغيرة جداً */
    .items-grid {
        gap: 8px !important;
        padding: 8px !important;
    }
}

/* ========== إصلاحات عامة إضافية ========== */

/* إزالة أي تمرير أفقي من العناصر الفرعية */
* {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* إصلاح شريط التمرير المخصص للموبايل */
@media (max-width: 900px) {
    ::-webkit-scrollbar {
        width: 4px !important;
    }
    
    ::-webkit-scrollbar-track {
        background: rgba(212, 175, 55, 0.1) !important;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #D4AF37 !important;
        border-radius: 2px !important;
    }
}

/* تحسين الحاوية الرئيسية */
@media (max-width: 900px) {
    .category-page {
        padding: 15px 10px !important;
        overflow-x: hidden !important;
    }
    
    .items-container {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ========== تأكيدات نهائية لزر الملاحظات ========== */

/* ضمان ظهور زر الملاحظات في جميع الأوضاع */
@media (max-width: 900px) {
    
    /* استهداف جميع أشكال زر الملاحظات */
    button[onclick*="openNotes"],
    .notes-btn,
    [class*="notes"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 100 !important;
    }
    
    /* إزالة أي خاصية قد تخفي الزر */
    .item-controls > *:last-child,
    .item-controls button:last-child {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* إصلاح إضافي للكلاس الجديد */
.mobile-fixed.notes-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
    width: 100% !important;
    background: linear-gradient(135deg, #ff6b6b 0%, #d63031 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: bold !important;
    cursor: pointer !important;
}

/* ========== تصميم الوجبات الفرعية الجديد ========== */

/* تصميم بطاقة الوجبة مع الصورة */
.item-card {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 320px;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
}

/* حاوي الصورة */
.item-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card:hover .item-img {
    transform: scale(1.05);
}

/* شريط السعر overlay - مخفي الآن لأننا نعرض السعر أسفل الاسم */
.item-price-overlay {
    display: none;
}

/* معلومات الوجبة */
.item-info {
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-info:hover {
    background-color: rgba(212, 175, 55, 0.1);
}

.item-name {
    color: #D4AF37;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 10px 0;
    text-align: center;
    line-height: 1.3;
}

/* السعر أسفل اسم المنتج */
.item-price {
    color: #FF6B35;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 0;
}

/* ========== النافذة المنبثقة ========== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.item-modal {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.item-modal.show {
    transform: translateY(0);
}

/* رأس النافذة */
.modal-header {
    position: relative;
    padding: 15px;
    text-align: left;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* محتوى النافذة */
.modal-content {
    position: relative;
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.modal-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-price-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* معلومات الوجبة في النافذة */
.modal-item-info {
    padding: 20px;
}

.modal-item-title {
    color: #D4AF37;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-align: right;
}

.modal-item-description {
    color: #f0f0f0;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    text-align: justify;
}

/* تذييل النافذة */
.modal-footer {
    padding: 20px;
}

.modal-close-button {
    width: 100%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.modal-close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* تصميم متجاوب للنافذة */
@media (max-width: 600px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .item-modal {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
    
    .modal-image-container {
        height: 200px;
    }
    
    .modal-item-info {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
}

/* ========== تحسينات المساحة والخطوط المتقدمة للهواتف المحمولة ========== */
/* تاريخ التحديث: 2025-10-01 */

@media (max-width: 767px) {
    /* تحسين الخطوط العامة لجميع العناصر */
    body {
        font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif !important;
        line-height: 1.3 !important;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
    }
    
    /* تحسين استغلال المساحة العامة */
    #menu-page {
        padding: 5px !important;
    }
    
    .container {
        padding: 0 3px !important;
        margin: 0 !important;
    }
    
    /* تحسين شبكة الأصناف للاستغلال الأمثل للمساحة */
    .items-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 4px !important;
        padding: 3px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* تحسين حجم وتخطيط المربعات */
    .item-card {
        height: auto !important;
        min-height: 160px !important;
        max-height: 180px !important;
        padding: 6px !important;
        margin: 0 !important;
        aspect-ratio: 0.95/1 !important; /* نسبة مربعة تقريباً مع استغلال أفضل */
        box-sizing: border-box !important;
        border-radius: 10px !important;
    }
    
    /* تحسين توزيع المحتوى داخل المربع */
    .item-info {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        margin-bottom: 6px !important;
        overflow: hidden !important;
    }
    
    /* تحسين الخطوط والنصوص */
    .item-name {
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
        margin-bottom: 8px !important;
        font-weight: 700 !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .item-english-name {
        font-size: 0.6rem !important;
        line-height: 1 !important;
        margin-top: 0 !important;
        margin-bottom: 3px !important;
        color: #cccccc !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    
    .item-details {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
        margin-bottom: 4px !important;
        color: #aaaaaa !important;
        flex: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        letter-spacing: -0.1px !important;
    }
    
    .item-price {
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        color: #00ff88 !important;
        margin-bottom: 4px !important;
        margin-top: auto !important;
    }
    
    /* تحسين أزرار التحكم */
    .item-controls {
        gap: 3px !important;
        margin-top: auto !important;
    }
    
    .quantity-controls {
        gap: 3px !important;
        padding: 2px !important;
        margin-bottom: 3px !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
    
    .quantity-btn {
        background: transparent !important;
        color: #D4AF37 !important;
        border: 1px solid #D4AF37 !important;
        width: 16px !important;
        height: 16px !important;
        font-size: 0.6rem !important;
        border-radius: 2px !important;
    }
    
    .quantity-display {
        font-size: 0.75rem !important;
        min-width: 18px !important;
        font-weight: 700 !important;
    }
    
    .add-to-cart {
        padding: 4px 6px !important;
        font-size: 0.65rem !important;
        border-radius: 8px !important;
        margin-bottom: 2px !important;
        letter-spacing: -0.2px !important;
    }
    
    .notes-btn {
        padding: 4px 6px !important;
        font-size: 0.65rem !important;
        border-radius: 8px !important;
        letter-spacing: -0.2px !important;
    }
    
    /* تحسين رأس الفئة للهواتف */
    .category-header {
        padding: 8px !important;
        margin-bottom: 10px !important;
        border-radius: 12px !important;
    }
    
    .back-button {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        border-radius: 15px !important;
    }
    
    .category-title {
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
    }
    
    .english-title {
        font-size: 0.8rem !important;
        margin-top: 2px !important;
    }
    
    /* تحسين الأزرار العلوية */
    .home-button {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
        top: 10px !important;
        right: 10px !important;
    }
    

    
    /* النافذة المنبثقة للموبايل */
    .cart-modal {
        width: 95% !important;
        max-width: none !important;
        margin: 10px !important;
    }
}

/* تحسينات إضافية للهواتف الصغيرة جداً */
@media (max-width: 480px) {
    /* إصلاح إضافي للتمركز على الشاشات الصغيرة */
    #cartSummary.centered {
        max-width: 98% !important;
        max-height: 85vh !important;
        margin: 0 !important;
        padding: 15px !important;
    }
    
    /* تحسين المحتوى داخل الشاشة المنبثقة */
    #cartSummary.centered .cart-header {
        padding: 10px !important;
        margin-bottom: 10px !important;
    }
    
    #cartSummary.centered .cart-items {
        max-height: 40vh !important;
        overflow-y: auto !important;
    }
    
    .item-card {
        min-height: 150px !important;
        max-height: 165px !important;
        padding: 5px !important;
    }
    
    .item-name {
        font-size: 1.0rem !important;
        margin-bottom: 6px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.2 !important;
    }
    
    .item-details {
        font-size: 0.55rem !important;
        -webkit-line-clamp: 1 !important;
    }
    
    .item-price {
        font-size: 1.1rem !important;
        color: #FF6B35 !important;
        font-weight: bold !important;
        text-align: center !important;
        margin: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .quantity-btn {
        background: transparent !important;
        color: #D4AF37 !important;
        border: 1px solid #D4AF37 !important;
        width: 16px !important;
        height: 16px !important;
        border-radius: 2px !important;
        font-size: 0.6rem !important;
    }
    
    .add-to-cart,
    .notes-btn {
        font-size: 0.6rem !important;
        padding: 3px 5px !important;
    }
}

/* تحسين النص العربي والإنجليزي */
@media (max-width: 767px) {
    * {
        font-feature-settings: "kern" 1 !important;
        text-rendering: optimizeLegibility !important;
    }
    
    /* تحسين وضوح الخط العربي */
    .item-name,
    .category-title,
    .add-to-cart,
    .notes-btn {
        font-variant: normal !important;
        text-shadow: 0 0 1px rgba(212, 175, 55, 0.1) !important;
    }
}

/* إضافة عامة للتأكد من التخطيط الصحيح */
.item-card .item-controls {
    margin-top: auto !important;
}

.item-card .item-info {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* ضمان ظهور أسماء الوجبات في جميع الأحجام */
.item-name {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: bold !important;
    color: #D4AF37 !important;
    text-align: center !important;
    min-height: auto !important;
    line-height: 1.2 !important;
}

.item-price {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: bold !important;
    color: #FF6B35 !important;
    text-align: center !important;
    min-height: auto !important;
}

/* =================== تحديثات التجاوب للتخطيط الجديد =================== */

/* الهاتف المحمول - عمودين */
@media (max-width: 767px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 15px !important;
    }
    
    .item-card {
        min-height: 280px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .item-image {
        height: 140px !important;
    }
    
    .item-name {
        font-size: 1.0rem !important;
        margin-bottom: 8px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.2 !important;
    }
    
    .item-price {
        font-size: 1.0rem !important;
        color: #FF6B35 !important;
        font-weight: bold !important;
        text-align: center !important;
        margin: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .quantity-controls {
        gap: 6px !important;
    }
    
    .quantity-btn {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.8rem !important;
    }
    
    .notes-btn {
        font-size: 0.9rem !important;
        padding: 8px 12px !important;
    }
}

/* التابلت - ثلاثة أعمدة */
@media (min-width: 768px) and (max-width: 1023px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
        padding: 20px !important;
    }
    
    .item-card {
        min-height: 320px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .item-image {
        height: 160px !important;
    }
    
    .item-name {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.2 !important;
    }
    
    .item-price {
        font-size: 1.1rem !important;
        color: #FF6B35 !important;
        font-weight: bold !important;
        text-align: center !important;
        margin: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* الكمبيوتر الصغير - ثلاثة أعمدة */
@media (min-width: 1024px) and (max-width: 1199px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 25px !important;
        padding: 25px !important;
    }
    
    .item-card {
        min-height: 340px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .item-image {
        height: 180px !important;
    }
    
    .item-name {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.2 !important;
    }
    
    .item-price {
        font-size: 1.1rem !important;
        color: #FF6B35 !important;
        font-weight: bold !important;
        text-align: center !important;
        margin: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* الكمبيوتر الكبير - أربعة أعمدة */
@media (min-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 30px !important;
        padding: 30px !important;
    }
    
    .item-card {
        min-height: 360px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .item-image {
        height: 200px !important;
    }
    
    .item-name {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        font-weight: bold !important;
        color: #D4AF37 !important;
        text-align: center !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        line-height: 1.2 !important;
    }
    
    .item-price {
        font-size: 1.1rem !important;
        color: #FF6B35 !important;
        font-weight: bold !important;
        text-align: center !important;
        margin: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* نافذة تأكيد الحذف */
.delete-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.delete-confirm-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.delete-confirm-icon {
    font-size: 60px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.delete-confirm-title {
    font-family: "Cairo", sans-serif;
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.delete-confirm-message {
    font-family: "Cairo", sans-serif;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

.delete-confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-delete-btn, .cancel-delete-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-family: "Cairo", sans-serif;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-delete-btn {
    background-color: #ff6b6b;
    color: white;
}

.confirm-delete-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.cancel-delete-btn {
    background-color: #f1f1f1;
    color: #333;
}

.cancel-delete-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* أنيميشن نافذة التأكيد */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* تحسينات للهواتف المحمولة */
@media (max-width: 768px) {
    .delete-confirm-content {
        padding: 25px;
        max-width: 350px;
    }
    
    .delete-confirm-icon {
        font-size: 50px;
    }
    
    .delete-confirm-title {
        font-size: 20px;
    }
    
    .delete-confirm-message {
        font-size: 14px;
    }
    
    .confirm-delete-btn, .cancel-delete-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}


/* تحسينات السلة للهواتف المحمولة */
.cart-controls {
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    #cartSummary {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
    }
    
    /* إصلاح مشكلة التمركز للشاشة المنبثقة على الجوال */
    #cartSummary.centered {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        max-width: 95% !important;
        max-height: 80vh !important;
        width: auto !important;
        z-index: 10000 !important;
    }
    
    #cartSummary.minimized {
        max-height: 80px !important;
    }
    
    .cart-header {
        background: linear-gradient(45deg, #1a1a1a, #2d2d2d) !important;
        border-radius: 8px !important;
        padding: 10px 15px !important;
        margin-bottom: 10px !important;
    }
    
    .cart-controls button {
        padding: 5px !important;
        border-radius: 50% !important;
        transition: all 0.3s ease !important;
    }
    
    .cart-controls button:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
        transform: scale(1.1) !important;
    }
    
    /* زر إغلاق مخصص للهواتف */
    #closeCartBtn {
        background: rgba(255, 107, 107, 0.2) !important;
    }
    
    #closeCartBtn:hover {
        background: rgba(255, 107, 107, 0.4) !important;
    }
    
    /* شريط السلة المصغر للهواتف */
    .cart-minimized {
        padding: 10px !important;
        background: rgba(0, 0, 0, 0.8) !important;
        border-radius: 8px !important;
    }
    

}

/* تأثيرات الأنيميشن */
@keyframes cartSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes cartSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

#cartSummary {
    animation: cartSlideIn 0.3s ease-out;
}

#cartSummary.cart-closing {
    animation: cartSlideOut 0.3s ease-in;
}
/* ===============================
   السلة الخضراء القابلة للسحب
   =============================== */

.draggable-cart {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    width: 65px !important;
    height: 65px !important;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    border-radius: 50% !important;
    color: white !important;
    border: 3px solid rgba(255,255,255,0.2) !important;
    cursor: grab !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(46,204,113,0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10000 !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    backdrop-filter: blur(10px) !important;
}

.draggable-cart:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 25px rgba(46,204,113,0.5) !important;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    border-color: rgba(255,255,255,0.4) !important;
}

.draggable-cart:active,
.draggable-cart.dragging {
    cursor: grabbing !important;
    transform: scale(0.95) rotate(3deg) !important;
    box-shadow: 0 8px 30px rgba(46,204,113,0.6) !important;
    opacity: 0.9 !important;
}

.draggable-cart i {
    font-size: 26px !important;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* عداد العناصر في السلة */
.cart-counter {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: none !important; /* مخفي بشكل افتراضي */
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: bold !important;
    border: 2px solid white !important;
    animation: cartPulse 1.5s infinite ease-in-out !important;
    box-shadow: 0 2px 8px rgba(231,76,60,0.4) !important;
}

/* إظهار العداد عندما يحتوي على عناصر */
.cart-counter.show {
    display: flex !important;
}

@keyframes cartPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(231,76,60,0.4);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 4px 12px rgba(231,76,60,0.6);
    }
}

/* تأثير نابض للسلة الخضراء عند وجود عناصر */
.fixed-cart.pulsing {
    animation: fixedCartPulse 2s infinite ease-in-out !important;
}

@keyframes fixedCartPulse {
    0% { 
        box-shadow: 0 4px 15px rgba(46,204,113,0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 25px rgba(46,204,113,0.8);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 4px 15px rgba(46,204,113,0.4);
        transform: scale(1);
    }
}

/* تأثيرات خاصة أثناء السحب */
.dragging {
    opacity: 0.85 !important;
    transform: rotate(2deg) scale(0.98) !important;
    box-shadow: 0 10px 35px rgba(46,204,113,0.7) !important;
    transition: none !important;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .draggable-cart {
        width: 55px !important;
        height: 55px !important;
        border-width: 2px !important;
    }
    
    .draggable-cart i {
        font-size: 22px !important;
    }
    
    .cart-counter {
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
        top: -6px !important;
        right: -6px !important;
    }
}

/* تأثير لمعان خفيف */
.draggable-cart::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.draggable-cart:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

/* تنسيقات الشاشة المنبثقة المتوسطة */
#cartSummary.centered {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1000 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
    border-radius: 15px !important;
    backdrop-filter: blur(10px) !important;
}

/* خلفية شبه شفافة للشاشة المنبثقة المتوسطة */
.cart-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important; /* إزالة الطبقة المعتمة */
    z-index: 999 !important;
    display: none;
    pointer-events: none !important; /* تعطيل النقر على الخلفية */
}

.cart-overlay.show {
    display: block !important;
}

/* تحسينات الخلفية للجوال */
@media (max-width: 768px) {
    .cart-overlay {
        background: transparent !important; /* إزالة الطبقة المعتمة للجوال */
        z-index: 9998 !important;
    }
}

/* تحسين المظهر عند التوسيط */
#cartSummary.centered .cart-header {
    border-radius: 15px 15px 0 0 !important;
}

/* تأثير الظهور للشاشة المنبثقة المتوسطة */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#cartSummary.centered {
    animation: modalFadeIn 0.3s ease-out;
}
