/* ========== RESET & BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #c8102e;
  --primary-dark: #a00d24;
  --gold: #d4a855;
  --gold-light: #f5e6c8;
  --dark: #1a1a1a;
  --dark-soft: #2c2c2c;
  --bg: #faf8f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-light: #7a7a7a;
  --text-warm: #5a4a3a;
  --border: #ebe5dc;
  --success: #25d366;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --max-w: 480px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ========== LAYOUT ========== */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.container {
  padding: 0 16px;
  padding-bottom: 100px;
}

/* ========== HOME HERO ========== */
.hero {
  position: relative;
  height: 320px;
  background: var(--dark);
  overflow: hidden;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.95) 0%, rgba(26,26,26,0.3) 50%, rgba(26,26,26,0.1) 100%);
}
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 20px;
  color: white;
  text-align: center;
}
.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  margin: 0 auto 12px;
  border: 3px solid var(--gold);
  font-family: Georgia, serif;
}
.hero-content h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-family: Georgia, 'Times New Roman', serif;
}
.hero-content .tagline {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 4px;
  font-style: italic;
  color: var(--gold);
}

/* ========== RESTAURANT INFO BAR ========== */
.info-bar {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 14px 16px;
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.info-item svg {
  width: 14px;
  height: 14px;
  fill: var(--gold);
}

/* ========== SECTION HEADINGS ========== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  padding: 20px 4px 12px;
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

/* ========== CATEGORY GRID (HOME) ========== */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 4px;
}
.cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  text-decoration: none;
}
.cat-card:active { transform: scale(0.97); }
.cat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.cat-card:hover img { transform: scale(1.05); }
.cat-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.85) 0%, transparent 60%);
}
.cat-card-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  color: white;
}
.cat-card-text h3 {
  font-size: 15px;
  font-weight: 700;
}
.cat-card-text span {
  font-size: 11px;
  color: var(--gold);
}

/* full-width card for odd last category */
.cat-card.full-width {
  grid-column: 1 / -1;
  aspect-ratio: 2/1;
}

/* ========== VIEW MENU BUTTON (HOME) ========== */
.view-menu-btn {
  display: block;
  margin: 24px auto 16px;
  padding: 14px 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
  transition: all 0.2s;
  font-family: var(--font);
}
.view-menu-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ========== MENU PAGE HEADER ========== */
.menu-header {
  background: var(--dark);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  text-decoration: none;
}
.back-btn:hover { background: rgba(255,255,255,0.2); }
.menu-header-info h1 {
  font-size: 18px;
  font-weight: 700;
  font-family: Georgia, serif;
}
.menu-header-info p {
  font-size: 12px;
  color: var(--gold);
}

/* ========== CATEGORY TABS ========== */
.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 68px;
  z-index: 99;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 25px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.cat-tab.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

/* ========== MENU SECTION ========== */
.menu-section { margin-top: 16px; }
.menu-section h2 {
  font-size: 17px;
  font-weight: 700;
  padding: 8px 4px;
  color: var(--dark);
  font-family: Georgia, serif;
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ========== DISH CARD ========== */
.dish-card {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  gap: 12px;
  transition: transform 0.15s;
  border: 1px solid var(--border);
}
.dish-card:active { transform: scale(0.98); }

.dish-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.dish-info { flex: 1; min-width: 0; }
.dish-info h3 {
  font-size: 15px;
  font-weight: 600;
}
.dish-info .dish-name-ar {
  font-size: 12px;
  color: var(--text-warm);
  margin-top: 1px;
}
.dish-info .dish-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dish-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.dish-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: var(--font);
}
.qty-btn.add {
  background: var(--primary);
  color: white;
}
.qty-btn.add:hover { background: var(--primary-dark); }
.qty-btn.remove {
  background: #f0ebe5;
  color: var(--text);
}
.qty-btn.remove:hover { background: #e5ddd3; }
.qty-display {
  font-size: 15px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* ========== CART BAR ========== */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: var(--dark);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  z-index: 200;
  transition: transform 0.3s;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cart-bar.hidden { transform: translateX(-50%) translateY(100%); }
.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-count {
  background: var(--primary);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.cart-bar-label { font-weight: 600; font-size: 15px; }
.cart-bar-total { font-weight: 700; font-size: 17px; color: var(--gold); }

/* ========== CART MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.cart-modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: var(--max-w);
  background: white;
  border-radius: 20px 20px 0 0;
  z-index: 301;
  max-height: 85vh;
  overflow-y: auto;
  transition: transform 0.35s ease;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.cart-modal.open { transform: translateX(-50%) translateY(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.cart-header h2 {
  font-size: 18px;
  font-family: Georgia, serif;
}
.cart-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0ebe5;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.cart-items { padding: 12px 20px; }

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info h4 { font-size: 14px; font-weight: 600; }
.cart-item-info span { font-size: 12px; color: var(--text-light); }
.cart-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-footer {
  padding: 16px 20px;
  border-top: 2px solid var(--border);
  position: sticky;
  bottom: 0;
  background: white;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  font-family: Georgia, serif;
}
.cart-total .total-price { color: var(--primary); }

.cart-note {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
  resize: none;
  font-family: var(--font);
  background: var(--bg);
}
.cart-note:focus { outline: none; border-color: var(--gold); }

.whatsapp-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--radius);
  background: #25d366;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  font-family: var(--font);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.whatsapp-btn:hover { background: #1ebe57; }
.whatsapp-btn svg { width: 22px; height: 22px; }

.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 15px;
}

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-light);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.footer a {
  color: var(--text-warm);
  text-decoration: none;
}

/* ========== ADMIN ========== */
.admin-header {
  background: var(--dark);
  color: white;
  padding: 20px;
  text-align: center;
}
.admin-header h1 {
  font-size: 20px;
  font-family: Georgia, serif;
}
.admin-header p { font-size: 13px; color: var(--gold); margin-top: 2px; }

.admin-nav {
  display: flex;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.admin-nav button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  flex-shrink: 0;
}
.admin-nav button.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
}
.admin-card-info { min-width: 0; flex: 1; }
.admin-card-info h3 { font-size: 15px; font-weight: 600; }
.admin-card-info p { font-size: 13px; color: var(--text-light); }

.admin-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-edit { background: #eef4ff; color: #1a73e8; }
.btn-edit:hover { background: #dce8fa; }
.btn-delete { background: #fef0f0; color: #c8102e; }
.btn-delete:hover { background: #fcd8d8; }

.btn-add {
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
  font-family: var(--font);
}
.btn-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ========== FORM MODAL ========== */
.form-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.form-modal.open { opacity: 1; pointer-events: auto; }

.form-content {
  width: 100%;
  max-width: var(--max-w);
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  transform: translateY(100%);
  transition: transform 0.35s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.form-modal.open .form-content { transform: translateY(0); }

.form-content h2 {
  font-size: 18px;
  margin-bottom: 16px;
  font-family: Georgia, serif;
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-warm);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  background: white;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn-cancel {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}
.btn-save {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}
.btn-save:hover { background: var(--primary-dark); }

/* ========== SETTINGS ========== */
.settings-group {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.settings-group h3 {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-warm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}
.btn-reset {
  padding: 10px 20px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  font-family: var(--font);
}
.btn-reset:hover { background: #fef0f0; }

/* ========== LANGUAGE SWITCHER ========== */
.lang-switch {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 8px 0;
}
.lang-switch-dark {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 10;
  padding: 0;
}
[dir="rtl"] .lang-switch-dark {
  right: auto;
  left: 12px;
}
.lang-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  font-family: var(--font);
}
.lang-btn:hover { background: rgba(0,0,0,0.5); color: white; }
.lang-btn.active {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}
/* Light variant for admin */
.lang-switch-light .lang-btn {
  background: white;
  border-color: var(--border);
  color: var(--text-light);
  backdrop-filter: none;
}
.lang-switch-light .lang-btn:hover { color: var(--text); }
.lang-switch-light .lang-btn.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

/* ========== RESPONSIVE ========== */
@media (min-width: 481px) {
  .container { padding: 0 24px; padding-bottom: 100px; }
  .hero { height: 380px; }
  .hero-content h1 { font-size: 32px; }
  .cat-grid { gap: 14px; }
  .dish-card { padding: 16px; }
}
