/* Custom Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');
/* @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap'); */

:root {
    --primary-color: #5C3A21; /* Rich Coffee Brown - Deeper and more sophisticated */
    --secondary-color: #8B4513; /* Burnt Orange/Terracotta - Warmer, earthy accent */
    --accent-color: #C89F6B; /* Creamy Caramel - Richer, inviting highlight */
    --light-color: #F8F4ED; /* Off-White/Cream - Softer, warm background */
    --background-section-color: #EFE8DF; /* New: Warm beige for alternating sections */
    --white-color: #FFFFFF; /* Pure white for specific elements like cart sidebar */
    --text-color: #3D3D3D; /* Dark Grey - Softer than pure black for readability */
    --shadow-light: rgba(0, 0, 0, 0.08); /* Adjusted for new palette */
    --shadow-medium: rgba(0, 0, 0, 0.18); /* Adjusted for new palette */
    --transition-speed: 0.3s;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif; /* أو 'Tajawal' */
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color); /* Overall page background */
    direction: rtl; /* من اليمين إلى اليسار */
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 5px;
}

.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 12px 25px;
    border-radius: 5px;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.highlight {
    color: var(--secondary-color);
}

/* Header */
.header {
    background-color: var(--white-color); /* Keep header clean white */
    padding: 15px 0;
    box-shadow: 0 2px 5px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: sans-serif; /* للوجو الإنجليزي فقط */
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
    display: flex; /* To align image and text */
    align-items: center; /* To align image and text vertically */
}

/* Styling for the logo icon */
.logo-icon {
    height: 30px; /* Adjust size as needed */
    vertical-align: middle;
    margin-left: 10px; /* Adjust spacing as needed for RTL */
}

.navbar .nav-links {
    list-style: none;
    display: flex;
}

.navbar .nav-links li {
    margin-right: 25px;
}

.navbar .nav-links a {
    color: var(--text-color);
    font-weight: bold;
    transition: color var(--transition-speed) ease;
    position: relative;
}

.navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed) ease;
}

.navbar .nav-links a:hover {
    color: var(--secondary-color);
}

.navbar .nav-links a:hover::after {
    width: 100%;
}

.cart-icon {
    font-size: 1.5em;
    cursor: pointer;
    margin-right: 20px;
    position: relative;
    transition: transform 0.2s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

#cart-count {
    background-color: var(--secondary-color);
    color: var(--white-color);
    font-size: 0.7em;
    border-radius: 50%;
    padding: 3px 7px;
    position: absolute;
    top: -5px;
    left: -5px;
}

.hamburger-menu {
    display: none; /* Hide by default on desktop */
    font-size: 2em;
    cursor: pointer;
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/hero.jpg') no-repeat center center/cover;
    color: var(--white-color);
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden; /* For animation */
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    animation: fadeInScale 1s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-section h2 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--white-color);
}

.hero-section p {
    font-size: 1.3em;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image {
    display: none; /* Hero image in content is not needed if using background image */
}

/* General Section Styling */
section {
    padding: 80px 0;
    background-color: var(--white-color); /* Default for sections */
    margin-bottom: 30px;
    box-shadow: 0 0 15px var(--shadow-light);
    border-radius: 8px;
}

section:nth-of-type(even) {
    background-color: var(--background-section-color); /* Use the new variable for alternating sections */
}

/* Menu Section */
.menu-section {
    background-color: var(--background-section-color); /* Consistent with alternating section color */
}

.menu-section .menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.menu-item {
    background-color: var(--white-color); /* Menu items themselves are white */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    text-align: center;
    padding-bottom: 20px;
    position: relative; /* For animations */
}

.menu-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--shadow-medium);
}

.menu-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--accent-color);
    transition: transform 0.5s ease;
}

.menu-item:hover img {
    transform: scale(1.05);
}

.menu-item h3 {
    font-size: 1.5em;
    margin: 15px 0 10px;
    color: var(--primary-color); /* Changed to primary for consistency/depth */
}

.menu-item p {
    font-size: 1.1em;
    color: var(--secondary-color); /* Price can stand out with secondary */
    font-weight: bold;
    margin-bottom: 15px;
}

.menu-item .add-to-cart-btn {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.menu-item .add-to-cart-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* About Section */
.about-section p {
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* Location Section */
.map-container {
    background-color: var(--background-section-color); /* Using new background for map placeholder */
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-light);
    margin-top: 30px;
}

.map-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contact Section */
.contact-info {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.contact-info li {
    font-size: 1.1em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.contact-info li .icon {
    font-size: 1.5em;
    color: var(--secondary-color);
    margin-left: 10px; /* Adjust for RTL */
}

.contact-info a {
    color: var(--text-color);
    transition: color var(--transition-speed) ease;
}

.contact-info a:hover {
    color: var(--secondary-color);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5m;
    font-family: 'Cairo', sans-serif;
    font-size: 1em;
    color: var(--text-color); /* Ensure text input color is good */
    background-color: var(--light-color); /* Light background for inputs */
}

.contact-form textarea {
    resize: vertical;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white-color);
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -350px; /* Hidden by default */
    width: 320px;
    height: 100%;
    background-color: var(--white-color);
    box-shadow: -5px 0 15px var(--shadow-medium);
    transition: right var(--transition-speed) ease-in-out;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--background-section-color); /* Softer border */
}

.cart-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-btn {
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2);
}

.cart-items {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--background-section-color); /* Softer dashed border */
    padding-bottom: 10px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
    margin-left: 15px; /* Adjust for RTL */
}

.item-details {
    flex-grow: 1;
}

.item-details h4 {
    margin: 0 0 5px;
    font-size: 1.1em;
    color: var(--text-color);
}

.item-details p {
    margin: 0;
    color: var(--secondary-color); /* Price color */
    font-size: 0.9em;
    font-weight: bold;
}

.item-quantity {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.quantity-btn {
    background-color: var(--accent-color);
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-weight: bold;
    color: var(--primary-color); /* Button text color */
    transition: background-color 0.2s ease;
}

.quantity-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

.item-quantity span {
    margin: 0 8px;
    font-weight: bold;
    color: var(--text-color);
}

.remove-item-btn {
    background-color: transparent;
    border: none;
    color: #E74C3C; /* A slightly darker red for delete */
    font-size: 1.2em;
    cursor: pointer;
    margin-right: 10px; /* Adjust for RTL */
    transition: transform 0.2s ease;
}

.remove-item-btn:hover {
    transform: scale(1.1);
}

.empty-cart-message {
    text-align: center;
    color: #888;
    margin-top: 50px;
}

.cart-summary {
    padding: 20px;
    border-top: 1px solid var(--background-section-color); /* Softer border */
    text-align: center;
}

.cart-summary p {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.checkout-btn {
    width: 90%;
}

/* Animations (JavaScript controlled classes) */
.menu-item.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item.add-animation {
    animation: addItemToCart 0.5s ease-out;
}

@keyframes addItemToCart {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        display: none; /* Hide desktop nav */
        flex-direction: column;
        width: 100%;
        background-color: var(--white-color);
        position: absolute;
        top: 70px;
        left: 0;
        box-shadow: 0 5px 10px var(--shadow-light);
        padding-bottom: 10px;
    }

    .navbar.active {
        display: flex;
    }

    .navbar .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .navbar .nav-links li {
        margin: 0;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--background-section-color); /* Softer border */
    }

    .navbar .nav-links li:last-child {
        border-bottom: none;
    }

    .hamburger-menu {
        display: block; /* Show hamburger */
    }

    .header .container {
        justify-content: space-between;
    }

    .hero-section {
        padding: 80px 0;
        min-height: 400px;
    }

    .hero-section h2 {
        font-size: 2.5em;
    }

    .hero-section p {
        font-size: 1em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .menu-section .menu-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
    }

    .cart-sidebar {
        width: 100%; /* Full width on small screens */
        right: -100%;
    }

    .cart-sidebar.open {
        right: 0;
    }

    section {
        padding: 50px 0;
    }

    h2 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8em;
    }

    .cart-icon {
        margin-right: 10px;
    }

    .hero-section {
        padding: 50px 0;
    }

    .hero-section h2 {
        font-size: 2em;
    }

    .hero-section p {
        font-size: 0.9em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .menu-item h3 {
        font-size: 1.3em;
    }

    .menu-item p {
        font-size: 1em;
    }
}
/* --- Menu Categories Styles --- */

.menu-section {
    padding: 60px 0; /* Add some padding to the section */
    background-color: #f9f9f9; /* Light background for the section */
}

.menu-categories {
    display: flex; /* Use flexbox to arrange buttons in a row */
    flex-wrap: wrap; /* Allow buttons to wrap to the next line on smaller screens */
    justify-content: center; /* Center the buttons horizontally */
    gap: 15px; /* Space between buttons */
    margin-bottom: 40px; /* Space below the category buttons */
    padding: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 900px; /* Limit width for better appearance */
    margin-left: auto;
    margin-right: auto;
}

.category-btn {
    background-color: #e0e0e0; /* Light grey background for inactive buttons */
    color: #333; /* Dark text color */
    border: none;
    padding: 10px 25px;
    border-radius: 25px; /* Rounded corners */
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease; /* Smooth transition for hover and active states */
    white-space: nowrap; /* Prevent text from wrapping inside the button */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.category-btn:hover {
    background-color: #d0d0d0; /* Slightly darker grey on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.category-btn.active {
    background-color: #6a057f; /* Vibrant purple for the active button */
    color: #fff; /* White text for active button */
    box-shadow: 0 4px 8px rgba(106, 5, 127, 0.3); /* Purple shadow */
    transform: translateY(-2px); /* Keep lift effect for active */
}

/* Adjustments for the menu grid itself */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */
    gap: 30px; /* Space between menu items */
    padding: 20px;
}

/* Ensure menu items have consistent height if needed (optional) */
.menu-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute content nicely */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Ensures rounded corners apply to images */
    text-align: center;
    padding-bottom: 20px; /* Padding inside the item */
    transition: transform 0.2s ease-in-out;
    opacity: 0; /* For initial fade-in animation */
    transform: translateY(20px); /* For initial fade-in animation */
}

.menu-item.fade-in {
    animation: fadeInSlideUp 0.5s forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item img {
    width: 100%;
    height: 200px; /* Fixed height for images */
    object-fit: cover; /* Ensures images cover the area without distortion */
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.menu-item h3 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 10px;
    padding: 0 15px;
}

.menu-item p {
    font-size: 1.1em;
    color: #6a057f; /* Use your brand color for prices */
    font-weight: bold;
    margin-bottom: 15px;
}

.menu-item select { /* Style for size dropdowns */
    width: calc(100% - 30px); /* Full width minus padding */
    padding: 8px 10px;
    margin: 0 15px 15px; /* Center with padding */
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
    background-color: #f0f0f0;
    cursor: pointer;
}

.menu-item .add-to-cart-btn {
    background-color: #6a057f; /* Your brand color */
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0 15px; /* Center with padding */
    width: calc(100% - 30px); /* Full width minus padding */
}

.menu-item .add-to-cart-btn:hover {
    background-color: #5a046f; /* Slightly darker purple on hover */
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Smaller items on tablets */
        gap: 20px;
    }

    .category-btn {
        font-size: 1em;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 20px;
    }

    .category-btn {
        font-size: 0.9em;
        padding: 7px 15px;
    }

    .menu-categories {
        gap: 10px;
        margin-bottom: 20px;
        padding: 5px;
    }
}