/* Modern Design System by RestoManager */
:root {
     --primary-color: #e74c3c;
     /* Fallback */
     --font-family: 'Tajawal', sans-serif;
     /* Fallback */

     /* Neutrals */
     --bg-body: #f4f7f6;
     --bg-card: #ffffff;
     --text-main: #2c3e50;
     --text-secondary: #7f8c8d;
     --border-color: #ecf0f1;

     /* Shadows & Effects */
     --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
     --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.08);
     --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.1);
     --radius-sm: 8px;
     --radius-md: 16px;
     --radius-lg: 24px;

     /* Transitions */
     --transition-fast: 0.2s ease;
     --transition-smooth: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Global Reset */
* {
     box-sizing: border-box;
     outline: none;
     -webkit-tap-highlight-color: transparent;
}

body {
     margin: 0;
     background-color: var(--bg-body);
     color: var(--text-main);
     line-height: 1.6;
     scroll-behavior: smooth;
     /* Native smooth scroll for anchor links */
}

img {
     max-width: 100%;
     display: block;
}

a {
     text-decoration: none;
     color: inherit;
}

/* Container */
.container {
     max-width: 1200px;
     /* Wider for desktop */
     margin: 0 auto;
     padding: 0 20px;
}

@media (max-width: 768px) {
     .container {
          padding: 0 15px;
     }
}

/* Header - Glassmorphism ready */
.main-header {
     position: sticky;
     top: 0;
     z-index: 100;
     padding: 15px 0;
     transition: var(--transition-smooth);
}

.main-header .container {
     display: flex;
     justify-content: space-between;
     align-items: center;
}

.main-header h1 {
     font-weight: 800;
     letter-spacing: -0.5px;
}

/* Floating Cart Button */
#cart-btn {
     position: relative;
     background: var(--primary-color);
     color: white;
     border: none;
     width: 50px;
     height: 50px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 1.2rem;
     box-shadow: var(--shadow-md);
     cursor: pointer;
     transition: var(--transition-fast);
}

#cart-btn:hover {
     transform: scale(1.1);
     box-shadow: var(--shadow-lg);
}

#cart-btn:active {
     transform: scale(0.95);
}

#cart-count {
     position: absolute;
     top: -5px;
     right: -5px;
     background: #2c3e50;
     color: white;
     font-size: 0.75rem;
     width: 20px;
     height: 20px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     font-weight: bold;
     border: 2px solid white;
}

/* Hero Section */
.hero-section {
     display: flex;
     align-items: center;
     justify-content: center;
     min-height: 250px;
     text-align: center;
     padding: 40px 20px;
     margin-bottom: 30px;
     border-radius: 0 0 var(--radius-lg) var(--radius-lg);
     box-shadow: var(--shadow-sm);
     position: relative;
     overflow: hidden;
}

.hero-section h2 {
     margin: 0;
     font-weight: 800;
     line-height: 1.2;
}

.hero-section p {
     margin: 10px 0 0;
     font-size: 1.1rem;
     opacity: 0.9;
     font-weight: 500;
}

/* Category Navigation (Pills) */
.category-nav {
     position: sticky;
     top: 70px;
     /* Below header */
     z-index: 90;
     padding: 15px 0;
     overflow: hidden;
     /* Hide scrollbar wrapper */
}

.scroll-container {
     display: flex;
     gap: 12px;
     overflow-x: auto;
     padding: 5px 5px 15px 5px;
     /* Bottom padding for shadow */
     scroll-snap-type: x mandatory;
     scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
     display: none;
}

.cat-link {
     padding: 10px 24px;
     border-radius: 50px;
     background: var(--bg-card);
     color: var(--text-secondary);
     font-weight: 600;
     font-size: 0.95rem;
     white-space: nowrap;
     box-shadow: var(--shadow-sm);
     transition: all var(--transition-fast);
     border: 1px solid transparent;
     /* Prevent layout shift */
     scroll-snap-align: center;
}

.cat-link:hover {
     transform: translateY(-2px);
     color: var(--primary-color);
     box-shadow: var(--shadow-md);
}

.cat-link.active {
     background: var(--primary-color);
     color: white;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
     /* Glow effect */
}

/* Category Title */
.category-title {
     font-size: 1.8rem;
     font-weight: 800;
     margin: 40px 0 20px;
     position: relative;
     padding-left: 20px;
     /* for LTR */
}

html[dir="rtl"] .category-title {
     padding-left: 0;
     padding-right: 20px;
}

.category-title::before {
     content: '';
     position: absolute;
     left: 0;
     top: 10%;
     bottom: 10%;
     width: 6px;
     background: var(--primary-color);
     border-radius: 4px;
}

html[dir="rtl"] .category-title::before {
     left: auto;
     right: 0;
}

/* Menu Items Grid */
.items-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
     gap: 25px;
}

.menu-item-card {
     background: var(--bg-card);
     border-radius: var(--radius-md);
     overflow: hidden;
     position: relative;
     transition: var(--transition-smooth);
     display: flex;
     flex-direction: column;
     /* Clean look: no border usually, relying on shadow */
     box-shadow: var(--shadow-sm);
     border: 1px solid var(--border-color);
}

.menu-item-card:hover {
     transform: translateY(-5px);
     box-shadow: var(--shadow-lg);
}

.item-image {
     height: 200px;
     width: 100%;
     background-size: cover;
     background-position: center;
     position: relative;
}

.item-image.placeholder {
     background-color: #eee;
}

.item-details {
     padding: 20px;
     display: flex;
     flex-direction: column;
     flex-grow: 1;
}

.item-details h3 {
     font-size: 1.15rem;
     margin: 0 0 8px;
     font-weight: 700;
     color: var(--text-main);
}

.item-details .description {
     font-size: 0.9rem;
     color: var(--text-secondary);
     line-height: 1.5;
     margin-bottom: 20px;
     flex-grow: 1;
     /* Pushes action area down */
     display: -webkit-box;
     -webkit-line-clamp: 2;
     line-clamp: 2;
     /* Limit to 2 lines */
     -webkit-box-orient: vertical;
     overflow: hidden;
}

.price-action {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-top: auto;
     padding-top: 15px;
     border-top: 1px dashed var(--border-color);
}

.price {
     font-size: 1.25rem;
     font-weight: 800;
     color: var(--text-main);
}

.add-btn {
     background: var(--bg-body);
     color: var(--text-main);
     padding: 10px 20px;
     border-radius: var(--radius-sm);
     font-weight: 700;
     border: none;
     cursor: pointer;
     transition: var(--transition-fast);
}

.add-btn:hover {
     background: var(--primary-color);
     color: white;
     transform: scale(1.05);
}

.add-btn:active {
     transform: scale(0.95);
}

/* List View Overrides */
.list .items-grid {
     grid-template-columns: 1fr;
}

.list .menu-item-card {
     flex-direction: row;
     height: 140px;
}

.list .item-image {
     width: 140px;
     height: 100%;
}

.list .item-details {
     padding: 15px;
}

.list .description {
     -webkit-line-clamp: 1;
     line-clamp: 1;
     margin-bottom: 10px;
}

/* Modals (Cart & Checkout) */
.cart-modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.6);
     backdrop-filter: blur(5px);
     z-index: 999;
     display: none;
     justify-content: flex-end;
     opacity: 0;
     transition: opacity 0.3s ease;
}

.cart-modal.open {
     display: flex;
     opacity: 1;
}

.cart-content {
     width: 100%;
     max-width: 450px;
     background: var(--bg-card);
     height: 100%;
     display: flex;
     flex-direction: column;
     box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
     transform: translateX(100%);
     transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.cart-modal.open .cart-content {
     transform: translateX(0);
}

.cart-header {
     padding: 25px;
     display: flex;
     align-items: center;
     justify-content: space-between;
     border-bottom: 1px solid var(--border-color);
}

.cart-header h2 {
     margin: 0;
     font-size: 1.5rem;
}

.close-btn {
     background: none;
     border: none;
     font-size: 2rem;
     cursor: pointer;
     color: var(--text-secondary);
}

.cart-items {
     flex: 1;
     overflow-y: auto;
     padding: 25px;
}

.cart-item-row {
     display: flex;
     align-items: center;
     background: var(--bg-body);
     padding: 15px;
     border-radius: var(--radius-sm);
     margin-bottom: 15px;
}

.qty-controls {
     background: white;
     border-radius: 20px;
     padding: 2px 8px;
     box-shadow: var(--shadow-sm);
     display: flex;
     align-items: center;
     gap: 8px;
}

.qty-controls button {
     border: none;
     background: none;
     font-weight: bold;
     cursor: pointer;
     padding: 5px;
     color: var(--primary-color);
}

.cart-footer {
     padding: 30px;
     background: white;
     border-top: 1px solid var(--border-color);
}

.checkout-btn {
     width: 100%;
     padding: 18px;
     background: var(--primary-color);
     color: white;
     font-size: 1.1rem;
     font-weight: bold;
     border: none;
     border-radius: var(--radius-md);
     cursor: pointer;
     transition: 0.3s;
     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.checkout-btn:hover {
     transform: translateY(-3px);
     box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Animation Utils */
@keyframes fadeIn {
     from {
          opacity: 0;
          transform: translateY(20px);
     }

     to {
          opacity: 1;
          transform: translateY(0);
     }
}

.menu-item-card {
     animation: fadeIn 0.6s ease forwards;
}

/* Checkout Form Styles */
#checkout-form {
     padding: 25px;
     display: flex;
     flex-direction: column;
     overflow-y: auto;
     flex: 1;
}

.form-group {
     margin-bottom: 24px;
}

.form-group label {
     display: block;
     margin-bottom: 10px;
     font-size: 0.95rem;
     font-weight: 700;
     color: var(--text-main);
     letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
     width: 100%;
     padding: 15px 18px;
     font-size: 1rem;
     font-family: inherit;
     color: var(--text-main);
     background-color: var(--bg-body);
     border: 2px solid transparent;
     border-radius: var(--radius-md);
     transition: all 0.3s ease;
     box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
     background-color: #fff;
     border-color: var(--primary-color);
     box-shadow: 0 5px 15px rgba(231, 76, 60, 0.15);
     transform: translateY(-2px);
}

.form-group textarea {
     resize: vertical;
     min-height: 100px;
}

/* Ensure submit button has space */
#checkout-form .checkout-btn {
     margin-top: 10px;
}