/* Variables and Resets */
:root {
    --primary: #ff5e3a; /* Appetizing orange/red */
    --primary-hover: #e54c2a;
    --secondary: #1a1a1a;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f7f8fa;
    --white: #ffffff;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 40px rgba(255, 94, 58, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--secondary);
    font-weight: 800;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    outline: none;
    transition: var(--transition);
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
}

.logo i {
    font-size: 1.8rem;
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    background: var(--bg-color);
    border-radius: 50px;
    overflow: hidden;
    padding: 0.3rem;
    border: 1px solid #ebebeb;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    outline: none;
    font-family: 'Tajawal', sans-serif;
}

.search-bar button {
    background: var(--primary);
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar button:hover {
    background: var(--primary-hover);
}

.cart-icon {
    position: relative;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--secondary);
    padding: 0.5rem;
    transition: var(--transition);
}

.cart-icon:hover {
    color: var(--primary);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 5%;
    background: linear-gradient(135deg, #fff5f3 0%, #ffffff 100%);
    min-height: 70vh;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-content .highlight {
    color: var(--primary);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cta-btn {
    background-color: var(--primary);
    color: var(--white);
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(255, 94, 58, 0.3);
}

.cta-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 94, 58, 0.4);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    border-radius: 50%;
    width: 100%;
    max-width: 500px;
    height: 500px;
    object-fit: cover;
    box-shadow: var(--shadow);
    border: 15px solid rgba(255, 255, 255, 0.5);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Categories Section */
.categories {
    padding: 3rem 5%;
    text-align: center;
}

.categories h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

.category-list {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    background-color: var(--white);
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 2px solid transparent;
}

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

.category-btn.active {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(255, 94, 58, 0.2);
}

/* Restaurants Section */
.restaurants-section {
    padding: 2rem 5% 5rem;
}

.restaurants-section h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.restaurants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.restaurant-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.restaurant-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.restaurant-img-wrap {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.restaurant-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.restaurant-info {
    padding: 1.5rem;
}

.restaurant-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.restaurant-tags {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.restaurant-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #ffb800;
    font-weight: 700;
    background: rgba(255, 184, 0, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius-sm);
}

.delivery-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Footer Section */
footer {
    background-color: var(--secondary);
    color: var(--white);
    padding: 3rem 5%;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.programmer-credit {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    font-size: 1.1rem;
}

.programmer-credit strong {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    width: 90%;
    max-height: 90vh;
    position: relative;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    left: 15px; /* RTL context */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    z-index: 10;
}

.close-modal:hover {
    background: #ffebe6;
    color: var(--primary);
}

/* Menu Modal Specific */
.menu-modal {
    max-width: 800px;
}

.restaurant-header {
    text-align: center;
    margin-bottom: 2rem;
}

.restaurant-header img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.restaurant-header h2 {
    font-size: 2rem;
    margin: 1rem 0 0.5rem;
}

.menu-title {
    padding: 0 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 0.5rem;
}

.menu-items {
    padding: 0 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.menu-item:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.item-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.item-info .item-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.item-info .item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.add-btn {
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* Cart Modal Specific */
.cart-modal {
    max-width: 500px;
    padding: 2rem;
}

.cart-modal h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.cart-items {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-name {
    font-weight: 700;
    flex: 1;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.3rem 0.5rem;
    border-radius: 50px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-weight: bold;
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
}

.cart-item-price {
    font-weight: bold;
    color: var(--primary);
    width: 80px;
    text-align: left;
}

.empty-cart-msg {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 0;
}

.cart-summary {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    color: var(--text-light);
}

.summary-row.total {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
    margin-top: 1rem;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 800;
}

.summary-row.total span:last-child {
    color: var(--primary);
}

.checkout-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    margin-top: 1.5rem;
}

.checkout-btn:hover {
    background: var(--primary-hover);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    color: #4cd964;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 2rem;
    }
    
    .search-bar {
        display: none; /* Hide on mobile to save space, or make it toggleable */
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-image img {
        height: 300px;
        width: 300px;
    }
    
    .categories .category-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 1rem;
    }
    
    .category-btn {
        flex-shrink: 0;
    }
}
