@font-face {
  font-family: 'LamaSans';
  src: url('/assets/fonts/LamaSans-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'LamaSans';
  src: url('/assets/fonts/LamaSans-Medium.ttf') format('truetype');
  font-weight: 500;
}
@font-face {
  font-family: 'LamaSans';
  src: url('/assets/fonts/LamaSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
}
@font-face {
  font-family: 'LamaSans';
  src: url('/assets/fonts/LamaSans-Bold.ttf') format('truetype');
  font-weight: 700;
}

:root {
  --teal: #1f8687;
  --orange: #f37021;
  --bg: #0a0a0a;
  --card: #17181a;
  --card2: #1f2124;
  --line: #2b2d30;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'LamaSans', 'Segoe UI', Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input, select, textarea {
  font-family: inherit;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--teal); }
img { display: block; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 14px; }

/* ── Header ── */
.topbar {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  text-align: center;
}
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; }
.table-pill {
  display: inline-block;
  margin-top: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  padding: 5px 20px;
}
.table-warn { margin-top: 8px; font-size: 12px; color: #fbbf24; }
.table-note { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ── Category tabs ── */
.cat-row { display: flex; align-items: stretch; gap: 6px; margin: 14px 0 10px; }
.cat-nav {
  width: 40px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 20px;
}
.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  padding: 2px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  scroll-snap-align: center;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.cat-tab.on { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── Item cards ── */
.item {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: right;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
}
.item:active { background: var(--card2); }
.item-img {
  width: 72px; height: 72px;
  border-radius: 10px;
  background: var(--card2);
  object-fit: cover;
  flex-shrink: 0;
}
.item-img.ph { display: flex; align-items: center; justify-content: center; color: var(--line); font-size: 22px; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 14px; font-weight: 600; }
.item-desc { font-size: 11px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-price { font-size: 14px; font-weight: 700; color: var(--orange); margin-top: 5px; }
.item-price .hint { font-size: 11px; font-weight: 600; color: var(--muted); }
.spicy { color: var(--danger); font-size: 11px; margin-right: 4px; }

.qty-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; }
.qty-btn {
  min-width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.qty-btn.minus { background: none; border: 1px solid var(--line); color: var(--muted); }
.qty-num { font-size: 13px; font-weight: 700; }

/* ── Cart bar ── */
.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, var(--bg) 55%, transparent);
  padding: 18px 14px calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
}
.cart-bar .wrap { display: flex; }
.cart-open-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #25a5a6, var(--teal));
  border-radius: 999px;
  padding: 13px 20px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(31,134,135,0.45);
}
.cart-open-btn:active { transform: scale(0.98); }
.cart-count {
  background: var(--orange);
  border-radius: 999px;
  min-width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(243,112,33,0.4);
}

/* ── Modals / sheets ── */
.sheet-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px;
  max-height: 88vh;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 16px;
}
.sheet-x { color: var(--muted); font-size: 22px; padding: 0 6px; }
.sheet-body { overflow-y: auto; padding: 14px 16px; flex: 1; }
.sheet-foot { padding: 14px 16px; border-top: 1px solid var(--line); }

.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: none; }
.cart-line img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--card2); }
.cart-line .nm { flex: 1; font-size: 14px; font-weight: 600; }
.cart-line .pr { font-size: 13px; color: var(--muted); }
.cart-line .qty-ctl { display: flex; align-items: center; gap: 8px; }

.btn {
  width: 100%;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.btn-teal { background: var(--teal); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-ghost { border: 1px solid var(--line); color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { width: auto; padding: 8px 16px; font-size: 13px; border-radius: 10px; }

.err { color: var(--danger); font-size: 13px; text-align: center; margin-top: 10px; }
.ok-box { text-align: center; padding: 30px 16px; }
.ok-box .big { font-size: 44px; margin-bottom: 8px; }
.ok-box h2 { font-size: 19px; margin-bottom: 6px; }
.ok-box p { color: var(--muted); font-size: 13px; }
.ok-lines { margin: 16px 0; text-align: right; }
.ok-lines .row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--muted); }
.ok-lines .row.total { font-weight: 700; color: var(--text); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }

.center-msg { text-align: center; color: var(--muted); padding: 50px 20px; font-size: 14px; line-height: 2; }

/* ── Admin ── */
.admin-wrap { max-width: 860px; margin: 0 auto; padding: 14px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.admin-head h1 { font-size: 18px; font-weight: 700; }
.key-gate { max-width: 420px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.key-gate h2 { font-size: 17px; margin-bottom: 6px; }
.key-gate p { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { padding: 9px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600; }
.tab.on { background: var(--teal); border-color: var(--teal); color: #fff; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: right; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--card); }
.tbl .thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--card2); }

.badge { display: inline-block; font-size: 11px; border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.badge.on { background: rgba(31,134,135,0.2); color: #4ecaca; }
.badge.off { background: rgba(239,68,68,0.15); color: #f87171; }

.row-actions { display: flex; gap: 6px; }
.icon-btn { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.icon-btn:hover { background: var(--card2); color: var(--text); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.form-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px 0; }
.chk input { width: auto; }

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 18px;
  font-size: 13px; z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.toast.err-t { border-color: var(--danger); color: #fca5a5; }
.toast.ok-t { border-color: var(--teal); color: #6ee7e7; }

.top-actions { display: flex; gap: 8px; }
.hidden { display: none !important; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .tbl { font-size: 12px; }
}

/* ═══════════ صفحة المنيو (m-*) ═══════════ */

/* ترويسة مدمجة — خلفية بنر العلامة */
.m-head {
  position: relative;
  padding: 18px 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(10,10,10,0.35), rgba(10,10,10,0.88) 82%),
    url('/assets/images/backmenu.png') top center / cover no-repeat;
}
.m-head-top { display: flex; align-items: center; gap: 12px; }
.m-logo {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.14);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  object-fit: cover; flex-shrink: 0;
}
.m-brand-col { flex: 1; min-width: 0; }
.m-brand { font-size: 19px; font-weight: 700; }
.m-brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.m-table { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-table-label { font-size: 10px; color: var(--muted); font-weight: 600; }
.m-table-num {
  background: linear-gradient(180deg, #25a5a6, var(--teal));
  color: #fff; font-weight: 800; font-size: 16px;
  border-radius: 12px; padding: 6px 14px; min-width: 52px; text-align: center;
  box-shadow: 0 4px 14px rgba(31,134,135,0.45);
}
.m-warn { margin-top: 10px; font-size: 12px; color: #fbbf24; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); border-radius: 10px; padding: 8px 12px; text-align: center; }
.m-note { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* شريط لاصق: بحث + تصنيفات */
.m-sticky { position: sticky; top: 0; z-index: 30; background: rgba(10,10,10,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 10px 14px 9px; border-bottom: 1px solid var(--line); }
.m-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; transition: border-color .15s, box-shadow .15s; }
.m-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,134,135,0.15); }
.m-search input { flex: 1; border: none; background: none; padding: 12px 0; font-size: 14px; }
.m-search input:focus { outline: none; }
.m-search input::-webkit-search-cancel-button { display: none; }
.m-search-ico { font-size: 15px; opacity: 0.6; }
.m-search-x { color: var(--muted); font-size: 14px; padding: 6px; }

/* تبويبات التصنيفات */
.m-catrow { margin-top: 9px; }
.m-cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.m-cats::-webkit-scrollbar { display: none; }
.m-cat { flex-shrink: 0; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: all .15s; }
.m-cat:active { transform: scale(0.96); }
.m-cat.on { background: linear-gradient(180deg, #25a5a6, var(--teal)); border-color: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(31,134,135,0.4); }

/* عنوان القسم داخل القائمة */
.m-list-title { display: flex; align-items: center; gap: 10px; margin: 14px 2px 2px; }
.m-list-title .t { font-size: 14px; font-weight: 800; }
.m-list-title .c { font-size: 10px; font-weight: 700; color: #4ecaca; background: rgba(31,134,135,0.12); border: 1px solid rgba(31,134,135,0.35); border-radius: 999px; padding: 2px 9px; }
.m-list-title .ln { flex: 1; height: 1px; background: var(--line); }

/* مسافة أسفل القائمة حتى لا يغطيها زر السلة العائم */
#main { padding-bottom: 96px; }

/* بطاقة صنف */
.m-item { display: flex; gap: 12px; align-items: center; background: linear-gradient(180deg, var(--card), #141517); border: 1px solid var(--line); border-radius: 18px; padding: 10px; margin: 10px 0; cursor: pointer; transition: border-color .15s, transform .12s, box-shadow .15s; animation: m-in .3s ease both; }
@keyframes m-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.m-item:active { transform: scale(0.985); border-color: var(--teal); box-shadow: 0 6px 20px rgba(31,134,135,0.15); }
.m-item-img { width: 90px; height: 90px; border-radius: 14px; background: var(--card2); object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.m-item-img.ph { display: flex; align-items: center; justify-content: center; color: var(--line); font-size: 26px; background: linear-gradient(135deg, var(--card2), #1a1c1f); }
.m-item-info { flex: 1; min-width: 0; }
.m-item-name { font-size: 15px; font-weight: 800; line-height: 1.45; }
.m-item-desc { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-item-cat { font-size: 10px; color: #4ecaca; margin-top: 3px; font-weight: 700; }
.m-item-price { font-size: 15px; font-weight: 800; color: var(--orange); margin-top: 7px; }
.m-variants-tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.m-spicy { font-size: 10px; color: #f87171; font-weight: 700; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); border-radius: 999px; padding: 1px 7px; }
.m-item-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; }
.m-add { width: 36px; height: 36px; border-radius: 12px; background: var(--orange); color: #fff; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(243,112,33,0.35); transition: transform .1s; }
.m-add:active { transform: scale(0.9); }
.m-add.minus { background: none; border: 1px solid var(--line); color: var(--muted); box-shadow: none; font-size: 16px; }
.m-qty { font-size: 14px; font-weight: 800; min-width: 20px; text-align: center; }

/* سكليتون تحميل */
.skel { background: linear-gradient(90deg, var(--card2) 25%, #2a2c30 50%, var(--card2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
.m-item.sk { cursor: default; animation: none; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* مقبض الشيت + صف الإجمالي */
.m-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 10px auto 0; }
.m-total-row { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.m-total-row span:last-child { color: var(--orange); font-weight: 800; }

