/* CSS Variables for Light/Dark Theme / متغيرات الألوان للوضع الليلي والنهاري */
:root {
    /* Light Theme Colors / ألوان الوضع النهاري */
    --bg-color: #f8f9fa;
    --text-color: #2b2b2b;
    --card-bg: #ffffff;
    --primary-color: #e63946; /* يمكنك تغيير هذا اللون ليكون لون مطعمك الأساسي */
    --primary-hover: #d62828;
    --secondary-color: #457b9d;
    --border-color: #e0e0e0;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.15);
    --badge-bg: #ffca3a;
    --badge-text: #111;
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-height: 80px; /* الارتفاع الثابت للهيدر لضمان توافق الأقسام */
    --nav-height: 70px; /* ارتفاع شريط الأقسام */
    --overlay-color: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] {
    /* Dark Theme Colors / ألوان الوضع الليلي */
    --bg-color: #121212;
    --text-color: #f1faee;
    --card-bg: #1e1e1e;
    --primary-color: #ef233c;
    --primary-hover: #d90429;
    --secondary-color: #a8dadc;
    --border-color: #2b2b2b;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.7);
    --badge-bg: #ffca3a;
    --badge-text: #111;
    --header-bg: rgba(30, 30, 30, 0.95);
    --header-height: 80px;
    --overlay-color: rgba(0, 0, 0, 0.75);
}

/* Reset & Base Styles / الإعدادات الأساسية والخطوط */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif; /* استخدام خط Cairo بشكل أساسي للموقع بالكامل */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* Button Styles / تنسيق الأزرار */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.5);
}

/* Header / الهيدر الثابت */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    z-index: 2000; /* أعلى من كل شيء */
    background-color: var(--header-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    transition: background-color 0.4s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    /* removed max-width to allow content to push to absolute edges */
    margin: 0 auto;
    width: 100%;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 600;
}

.control-btn:hover {
    background-color: rgba(128, 128, 128, 0.15);
    transform: scale(1.05);
}

/* Hero Section / خلفية المطعم الرئيسية */
.hero {
    position: relative;
    /* استخدام الصورة المولدة والجديدة للمطعم */
    background: url('ameg/hero-bg.png') center/cover no-repeat;
    height: 80vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: var(--overlay-color);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0 5%;
}

.hero-logo {
    width: 240px;
    height: 260px;
    border-radius: 24px;
    object-fit: cover;
    /*border: 4px solid rgba(255,255,255,0.8);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);*/
    transition: transform 0.4s ease;
}

.hero-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 650px;
    opacity: 0.9;
    font-weight: 300;
}

.social-icons {
    display: flex;
    gap: 1.2rem;
}

.social-icons a {
    color: #fff;
    font-size: 1.8rem;
    transition: color 0.3s, transform 0.3s;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Categories Navigation (Sticky) / شريط الأقسام الثابت تحت الهيدر */
.categories-nav {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    position: sticky;
    top: var(--header-height); /* يلتصق تماماً تحت الهيدر */
    z-index: 1999; /* أقل من الهيدر بدرجة واحدة */
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

/* حالة الشريط عند التمرير ليصبح أكثر بروزاً */
.categories-nav.scrolled {
    background-color: var(--header-bg); /* يستخدم نفس خلفية الهيدر المموجهة */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.categories-list {
    display: flex;
    list-style: none;
    overflow-x: auto;
    padding: 9px 5%;
    gap: 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    max-width: 1200px;
    margin: 0 auto;
}

.categories-list::-webkit-scrollbar {
    display: none;
}

.category-link {
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 12px; /* زوايا مائلة (مربع بزوايا مائلة) */
    background-color: transparent;
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

.category-link.active {
    background-color: var(--primary-color); /* تضليل كامل باللون الأحمر */
    color: #fff; /* خط أبيض للتضليل الصريح */
    border-color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
    transform: translateY(-2px);
}

.category-link:hover:not(.active) {
    background-color: rgba(128, 128, 128, 0.08);
    opacity: 1;
}

/* Offers Section / تنسيق قسم العروض */
.offers-section {
    padding: 5rem 5% 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 3rem;
    text-align: center;
    font-weight: 800;
}

.offers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
}

.offer-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 1.2rem;
    width: calc(50% - 1.25rem);
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    /* الإمالة الجذابة المطلوبة */
    transform: rotate(-1.5deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.offer-card:nth-child(even) {
    transform: rotate(1.5deg);
}

.offer-card:hover {
    transform: rotate(0) translateY(-10px);
    box-shadow: var(--shadow-hover);
    z-index: 5;
}

.offer-card img {
    border-radius: 12px;
    margin-bottom: 1.2rem;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.offer-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background-color: var(--badge-bg);
    color: var(--badge-text);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 800;
    transform: rotate(5deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    z-index: 2;
}

/* تعديل موقع البادج في وضع العربي */
html[dir="rtl"] .offer-badge {
    right: auto;
    left: -12px;
    transform: rotate(-5deg);
}

/* Menu Sections / أقسام المنتجات */
.menu-sections {
    padding: 2rem 5% 5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.menu-category {
    margin-bottom: 4rem;
    /* التعديل لضمان وصول التمرير للمكان الصحيح تحت الهيدر الثابت */
    scroll-margin-top: calc(var(--header-height) + 100px); 
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
}

.img-slider {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #eee;
}

.slider-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.slider-img.active {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-top: 1rem;
}

/* Footer / الفوتر */
.footer {
    background-color: var(--card-bg);
    padding: 5rem 5% 4rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

.footer h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
}

.footer .social-icons a {
    color: var(--text-color);
    background: rgba(128,128,128,0.1);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.footer .social-icons a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Responsive / توافق التصميم مع الجوال */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .categories-nav {
        top: 68px; /* تعديل طفيف للموبايل */
    }
    .offer-card {
        width: 100%;
    }
}
