/* الأساسيات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-brown: #8B4513;
    --light-brown: #A0522D;
    --caramel: #D2691E;
    --beige: #F5F5DC;
    --gold: #FFD700;
    --white: #FFFFFF;
    --dark-text: #333333;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-text);
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الهيدر */
.header {
    background: linear-gradient(135deg, var(--primary-brown), var(--light-brown));
    color: var(--white);
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="%23ffffff" opacity="0.1"><path d="M50 20 L60 40 L80 45 L65 60 L70 80 L50 70 L30 80 L35 60 L20 45 L40 40 Z"/></svg>');
    background-size: 100px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
}

/* شريط التنقل */
.menu-nav {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-items {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    background: var(--light-gray);
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--primary-brown);
    color: var(--white);
    transform: translateY(-2px);
}

.nav-item.active {
    background: var(--primary-brown);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

/* أقسام المنيو */
.menu-section {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gold);
}

.section-icon {
    font-size: 2rem;
    color: var(--primary-brown);
    background: var(--beige);
    padding: 0.75rem;
    border-radius: 12px;
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-brown);
    margin: 0;
    flex: 1;
}

.section-badge {
    background: var(--gold);
    color: var(--dark-text);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* عناصر المنيو المصغرة */
.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.menu-item {
    background: var(--white);
    border-radius: 15px;
    padding: 1.25rem;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-brown), var(--gold));
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.item-image {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-overlay {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(139, 69, 19, 0.9);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.menu-item:hover .item-image img {
    transform: scale(1.1);
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 1.1rem;
    color: var(--primary-brown);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--caramel);
}

.item-category {
    font-size: 0.8rem;
    color: #666;
    background: var(--light-gray);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}

/* عناصر التحكم بالكمية المصغرة */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
}

.quantity-btn {
    background: var(--primary-brown);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--light-brown);
    transform: scale(1.1);
}

.quantity-input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 2px solid var(--primary-brown);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    background: var(--white);
}

/* ملخص الطلب المحسن */
.order-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 3px solid var(--gold);
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.order-summary.collapsed {
    transform: translateY(100%);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.summary-title {
    color: var(--primary-brown);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.items-count {
    background: var(--primary-brown);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.order-items {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--light-gray);
    border-radius: 10px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--white);
    border-radius: 8px;
    border-left: 3px solid var(--primary-brown);
}

.order-item:last-child {
    margin-bottom: 0;
}

.total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-brown);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--beige);
    border-radius: 10px;
}

.checkout-btn {
    background: linear-gradient(135deg, var(--primary-brown), var(--light-brown));
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* نموذج الطلب المحسن */
.order-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.order-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 2px solid var(--gold);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--beige);
}

.form-header h3 {
    color: var(--primary-brown);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--primary-brown);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light-gray);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-brown);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.cancel-btn, .submit-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cancel-btn {
    background: #6c757d;
    color: var(--white);
}

.cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-brown), var(--light-brown));
    color: var(--white);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

/* التجاوب مع الأجهزة المختلفة */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .nav-items {
        gap: 0.5rem;
    }
    
    .nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .menu-items {
        grid-template-columns: 1fr;
    }
    
    .menu-section {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .order-summary {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .menu-item {
        padding: 1rem;
    }
    
    .item-image {
        height: 100px;
    }
    
    .order-form {
        padding: 1.5rem;
        margin: 1rem;
    }
}