/* ===== القوائم الرقمية — واجهة عامة ===== */
:root {
  --primary: #6f4e37;
  --accent: #d4a95f;
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1f1a15;
  --muted: #8a8078;
  --line: #e8e1d7;
  --shadow: 0 6px 24px rgba(31, 26, 21, .08);
  --radius: 16px;
}
.mode-dark {
  --bg: #10151c;
  --card: #1a212b;
  --text: #f0ebe3;
  --muted: #9aa3ad;
  --line: #2a3441;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.muted { color: var(--muted); }
.wrap { max-width: 760px; margin-inline: auto; padding: 0 16px 48px; }

/* ---------- الرئيسية ---------- */
.home-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 16px; }
.home-hero { text-align: center; margin-bottom: 32px; }
.home-logo { font-size: 44px; }
.home-hero h1 { margin: 8px 0 4px; font-size: 26px; }
.home-sub { color: var(--muted); margin: 0; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; width: 100%; max-width: 760px; }
.store-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease; position: relative; overflow: hidden;
}
.store-card::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.store-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.store-logo { width: 56px; height: 56px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 12%, transparent); display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-name { font-weight: 700; font-size: 18px; }
.store-desc { color: var(--muted); font-size: 13.5px; }
.store-go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 14px; }
.home-foot { margin-top: auto; padding-top: 40px; display: flex; gap: 12px; align-items: center; }
.admin-link { color: var(--muted); opacity: .35; }
.lang-switch a { color: var(--muted); font-size: 14px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 14px; }

/* ---------- رأس المتجر ---------- */
.store-banner { max-height: 260px; overflow: hidden; }
.store-banner img { width: 100%; height: 260px; object-fit: cover; }
.store-head { max-width: 760px; margin: -40px auto 0; padding: 0 16px; text-align: center; position: relative; }
.store-logo-lg {
  width: 96px; height: 96px; margin-inline: auto; border-radius: 24px; background: var(--card);
  border: 3px solid var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 40px; overflow: hidden;
}
.store-logo-lg img { width: 100%; height: 100%; object-fit: cover; }
.store-title { margin: 12px 0 6px; font-size: 28px; }
.store-desc { color: var(--muted); margin: 0 auto 16px; max-width: 560px; }
.contact-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip-ic { font-size: 14px; }

/* ---------- بطاقات القوائم ---------- */
.section-title { font-size: 19px; margin: 32px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.menus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.menu-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s ease;
}
.menu-card:hover { transform: translateY(-3px); }
.menu-cover { aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--primary) 10%, var(--card)); display: grid; place-items: center; }
.menu-cover img { width: 100%; height: 100%; object-fit: cover; }
.menu-cover-empty { font-size: 42px; opacity: .5; }
.menu-card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.menu-card-title { font-weight: 700; font-size: 17px; }
.menu-card-btn {
  background: var(--primary); color: #fff; text-align: center; border-radius: 10px; padding: 9px;
  font-size: 14px; font-weight: 600;
}
.qr-box { display: flex; justify-content: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; width: fit-content; margin-inline: auto; }

/* ---------- صفحة القائمة ---------- */
.menu-top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 10px 16px 8px; }
.back-link { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.menu-title { margin: 4px 0 10px; font-size: 24px; }
.menu-tools { margin-bottom: 8px; }
.search-input {
  width: 100%; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; outline: none;
}
.search-input:focus { border-color: var(--accent); }
.cat-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-chip {
  white-space: nowrap; padding: 6px 14px; border-radius: 99px; background: var(--card);
  border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.cat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cat-title { font-size: 20px; margin: 28px 0 12px; }
.items-grid { display: flex; flex-direction: column; gap: 12px; }
.item-card {
  display: flex; gap: 12px; text-align: start; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s ease; position: relative; width: 100%;
}
.item-card:hover { transform: translateY(-2px); }
.item-thumb { width: 92px; height: 92px; border-radius: 12px; overflow: hidden; flex: none; background: color-mix(in srgb, var(--primary) 8%, var(--card)); display: grid; place-items: center; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { font-size: 30px; opacity: .45; }
.item-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-name { font-weight: 700; font-size: 15.5px; }
.item-desc { color: var(--muted); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.item-price { font-weight: 800; color: var(--accent); font-size: 15px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.mode-dark .badge { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge.off { background: #b3261e22; color: #b3261e; }
.item-off { opacity: .55; }
.empty-state { text-align: center; padding: 40px 0; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(10, 8, 6, .6); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal-back[hidden] { display: none; }
.modal-card {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; position: relative; animation: slide-up .22s ease;
}
@media (min-width: 640px) {
  .modal-back { align-items: center; padding: 24px; }
  .modal-card { border-radius: 22px; }
}
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 5; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; cursor: pointer;
}
.modal-img-wrap { aspect-ratio: 16/10; background: color-mix(in srgb, var(--primary) 10%, var(--card)); display: grid; place-items: center; }
.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.modal-img-wrap:has(img[hidden]) img { display: none; }
.modal-body { padding: 18px 20px 24px; }
.modal-body h3 { margin: 0 0 2px; font-size: 21px; }
.modal-cat { font-size: 12.5px; margin: 0 0 8px; }
.modal-desc { font-size: 14.5px; margin: 8px 0; white-space: pre-line; }
.modal-kcal { font-size: 13px; }
.size-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.size-row:last-child { border-bottom: none; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-primary {
  display: block; text-align: center; background: var(--primary); color: #fff; border: none;
  border-radius: 12px; padding: 12px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-ghost { display: block; text-align: center; border: 1px solid var(--line); color: var(--muted); border-radius: 12px; padding: 10px; font-size: 14px; }
.btn-primary:hover { filter: brightness(1.08); }

/* ---------- صفحة الصنف ---------- */
.crumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { font-weight: 600; }
.item-hero { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.item-hero-img { border-radius: var(--radius); width: 100%; aspect-ratio: 16/10; object-fit: cover; box-shadow: var(--shadow); }
.hero-empty { display: grid; place-items: center; font-size: 60px; background: var(--card); }
.item-hero-body h1 { margin: 0 0 8px; font-size: 26px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item-price-lg { font-size: 22px; font-weight: 800; color: var(--accent); margin: 6px 0; }
.item-full-desc { white-space: pre-line; }
.item-actions { max-width: 380px; }

/* ---------- مشاركة وذيل ---------- */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 28px 0 8px; }
.share-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 7px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text);
}
.store-foot {
  max-width: 760px; margin: 24px auto 0; padding: 18px 16px 26px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px;
  border-top: 1px solid var(--line);
}
.foot-links { display: flex; gap: 14px; }
.foot-links a { font-weight: 600; }

/* ---------- 404 ---------- */
.nf-wrap { min-height: 90vh; display: grid; place-content: center; text-align: center; gap: 10px; padding: 20px; }
.nf-emoji { font-size: 52px; }
