:root {
  --primary: #e65100;
  --primary-hover: #bf360c;
  --primary-light: #fff3e0;
  --secondary: #2e7d32;
  --dark: #1e293b;
  --gray-100: #f8fafc;
  --gray-200: #f1f5f9;
  --gray-300: #e2e8f0;
  --gray-600: #64748b;
  --gray-800: #334155;
  --white: #ffffff;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #0284c7;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  direction: rtl;
  text-align: right;
  background-color: var(--gray-100);
  color: var(--dark);
  line-height: 1.6;
  padding-bottom: 80px;
}

/* Header */
.header {
  background: var(--white);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

/* Category Tabs (Fixed/Sticky horizontally) */
.category-nav {
  position: sticky;
  top: 65px;
  background: var(--white);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  z-index: 40;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: var(--gray-200);
  border: none;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gray-800);
}

.cat-btn.active, .cat-btn:hover {
  background: var(--primary);
  color: var(--white);
}

/* Container & Menu Grid */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 24px 0 16px;
  color: var(--gray-800);
  border-right: 4px solid var(--primary);
  padding-right: 10px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.item-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background-color: var(--gray-200);
}

.item-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.item-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.item-desc {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 14px;
  flex: 1;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.item-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}
.btn-secondary:hover {
  background: var(--gray-300);
}

.btn-success {
  background: var(--secondary);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* Floating Cart Bar (Customer screen) */
.cart-floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 12px 20px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.cart-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  background: var(--primary);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 10px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-800);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.95rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Order Item Row in Cart */
.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-new { background: #fee2e2; color: #b91c1c; }
.status-preparing { background: #fef3c7; color: #b45309; }
.status-ready { background: #dbeafe; color: #1d4ed8; }
.status-done { background: #dcfce7; color: #15803d; }

/* Alert & States */
.state-box {
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}

.spinner {
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
