/* المتغيرات الأساسية للمطعم */
:root { 
    --primary: #800000;  /* الأحمر الماروني التقليدي */
    --dark: #121212; 
    --gold: #ffc107;     /* اللون الذهبي للهوية */
    --bg: #f8f9fa; 
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background-color: #1a1a1a; 
    color: #fff;
    margin: 0;
}

body.cart-open { 
    padding-bottom: 180px; 
    transition: padding 0.4s ease; 
}

/* الهيدر واللوجو */
header { 
    background: linear-gradient(135deg, var(--primary) 0%, #4a0000 100%); 
    text-align: center; 
    padding: 25px 20px; 
    border-bottom: 5px solid var(--gold); 
}

.logo { 
    max-width: 130px; 
    height: auto; 
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); 
}

/* شريط الأقسام العلوي */
.nav-tabs { 
    display: flex; 
    overflow-x: auto; 
    background: var(--dark); 
    padding: 12px; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    gap: 10px; 
    border-bottom: 3px solid var(--primary); 
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar { 
    display: none; 
}

.tab-btn { 
    flex: 0 0 auto; 
    padding: 8px 18px; 
    border-radius: 25px; 
    border: 1px solid #333; 
    background: #1a1a1a; 
    color: #bbb; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.3s; 
    font-family: 'Cairo';
}

.tab-btn.active { 
    background: var(--primary); 
    color: #fff; 
    border-color: var(--gold); 
    transform: scale(1.05); 
}

/* الحاوية والشبكة */
.container { 
    max-width: 1200px; 
    margin: auto; 
    padding: 10px; 
}

.menu-grid { 
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px; 
}

@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.menu-section { 
    display: none; 
}

.menu-section.active { 
    display: block; 
    animation: fadeIn 0.4s ease; 
}

/* الكارت (التنسيق الأفقي) */
.item-card { 
    background: #fff; 
    border-radius: 12px; 
    display: flex; 
    flex-direction: row-reverse; 
    overflow: hidden; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
    position: relative; 
    border: 1px solid #eee;
    height: 140px; 
}

/* ممر الصور وعلامة الإضافة */
.mini-slideshow {
    width: 130px;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
}

.mini-slideshow::after {
    content: '+';
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: #000;
    background: rgba(255, 255, 255, 0.6);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.mini-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; 
    cursor: pointer;
}

/* نصوص الصنف */
.item-info { 
    padding: 10px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    text-align: right; 
    justify-content: space-between;
}

.item-name { 
    font-weight: 700; 
    font-size: 1.1rem; 
    color: var(--dark); 
    margin: 0; 
}

.item-desc { 
    font-size: 0.85rem; 
    color: #666; 
    margin: 2px 0; 
    line-height: 1.3; 
    flex-grow: 1;
    overflow: hidden;
}

.price-tag { 
    color: var(--primary); 
    font-weight: 900; 
    font-size: 1.1rem; 
    margin-bottom: 5px; 
}

/* أزرار الكمية والتحكم */
.order-controls {
    display: flex;
    align-items: center;
    background: #333; 
    border-radius: 8px;
    padding: 2px 5px;
    gap: 5px;
    width: fit-content;
}

.qty-btn {
    background: #4a4a4a; 
    border: none; 
    color: white;
    width: 24px; 
    height: 24px; 
    border-radius: 4px;
    font-size: 1rem; 
    cursor: pointer;
}

.qty-val { 
    color: white; 
    font-weight: bold; 
    min-width: 15px; 
    text-align: center; 
    font-size: 0.9rem; 
}

.item-check {
    appearance: none; 
    -webkit-appearance: none;
    width: 60px; 
    height: 26px; 
    background: var(--primary); 
    border-radius: 6px;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.item-check::after { 
    content: "إضافة"; 
    color: white; 
    font-weight: bold; 
    font-size: 0.75rem; 
}

.item-check:checked { 
    background: #28a745; 
}

.item-check:checked::after { 
    content: "✓"; 
}

/* نافذة التكبير Lightbox */
.modal { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); 
    z-index: 9999; 
    display: none; 
    align-items: center; 
    justify-content: center; 
}

.modal-content { 
    width: 95%; 
    max-width: 500px; 
    position: relative; 
    text-align: center; 
}

.modal-main-img { 
    width: 100%; 
    max-height: 70vh; 
    object-fit: contain; 
    border-radius: 15px; 
    border: 2px solid var(--gold); 
}

.modal-details { 
    background: rgba(255,255,255,0.1); 
    margin-top: 15px; 
    padding: 15px; 
    border-radius: 10px; 
    color: white; 
    text-align: right;
}

.modal-details h3 { 
    color: var(--gold); 
    margin: 0 0 5px 0; 
}

.modal-details p { 
    font-size: 0.9rem; 
    margin: 5px 0; 
    color: #ddd; 
}

.modal-details .modal-price { 
    color: #fff; 
    font-weight: bold; 
    font-size: 1.2rem; 
    display: block; 
    margin-top: 8px;
}

.prev, .next {
    position: absolute; 
    top: 40%; 
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2); 
    border: none; 
    color: white;
    font-size: 30px; 
    cursor: pointer; 
    padding: 15px; 
    border-radius: 50%;
    z-index: 10001;
}

.prev { right: 10px; } 
.next { left: 10px; }  

.close-modal {
    position: absolute; 
    top: -50px; left: 0; 
    color: white; 
    font-size: 40px; 
    cursor: pointer;
}

/* الفوتر ونظام السلة */
.cart-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1a1a1a; 
    border-top: 3px solid var(--gold); 
    z-index: 9990;
    display: none; 
    padding: 15px 10px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.footer-container {
    max-width: 600px; 
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#tableInput {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: #222;
    color: #fff;
    border: 2px solid #444;
    text-align: center;
    font-size: 1rem;
    outline: none;
}

#tableInput:focus { 
    border-color: var(--gold); 
}

.type-selection-row {
    display: flex;
    gap: 10px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    background: #333; 
    color: #fff;
    border: 1px solid #444;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.type-btn.active {
    background: var(--gold) !important; 
    color: #000 !important; 
    border-color: #fff;
}

.bottom-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.price-display {
    font-weight: 900;
    color: var(--gold); 
    font-size: 1.2rem;
}

.btn-send {
    background: #28a745 !important; 
    color: white !important;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 900;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

/* الحركات (Animations) */
.show-cart {
    display: block !important;
    animation: slideUpFooter 0.4s ease-out forwards;
}

@keyframes slideUpFooter {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
/* --- التنسيق النهائي المعتمد للموبايل --- */
@media (max-width: 600px) {
    .item-card {
        flex-direction: row-reverse !important; 
        height: auto !important; 
        min-height: 140px;
        background: #fff !important; 
        border-radius: 15px !important;
        margin-bottom: 5px;
    }

    .item-info {
        padding: 12px 10px !important;
    }

    .item-name {
        color: #000 !important; 
        font-size: 1rem !important;
        margin-bottom: 4px !important;
    }

    .item-desc {
        color: #555 !important;
        font-size: 0.8rem !important;
        -webkit-line-clamp: 2; 
        margin-bottom: 8px !important;
    }

    .order-controls {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important; 
        align-items: center !important;
        width: 100% !important;
        background: #333 !important; 
        padding: 5px 10px !important;
        border-radius: 10px !important;
        margin-top: 5px !important;
    }

    .price-tag {
        margin: 0 !important;
        font-size: 1rem !important;
        color: #800000 !important; 
    }

    .qty-box {
        background: transparent !important;
        gap: 10px !important;
    }
    
    .qty-btn {
        width: 28px !important;
        height: 28px !important;
    }

    .item-check {
        width: 70px !important;
        height: 30px !important;
    }

    /* تحسين السلة (داخل الميديا كويري لتعمل على الموبايل فقط) */
    .cart-footer {
        padding: 10px 8px !important;
        border-top-left-radius: 20px !important;
        border-top-right-radius: 20px !important;
    }

    .footer-container {
        gap: 8px !important;
    }

    #tableInput {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }

    .btn-send {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
} /* نهاية قوس الميديا كويري */
html {
    scroll-behavior: smooth;
}