/* =========================================================
   دار المذاق — Design System (Base)
   Premium / Editorial / Calm Arabic Restaurant Aesthetic
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Aref+Ruqaa:wght@400;700&display=swap');

:root{
  /* Neutral palette */
  --ivory:#F8F4EC;
  --cream:#F1E9DA;
  --beige:#E8DCC5;
  --sand:#D9C7A4;
  --charcoal:#241F19;
  --espresso:#3A2C21;
  --ink:#26211B;
  --muted:#7C7061;
  --muted-2:#9B8F7C;
  --line:rgba(38,33,27,0.10);
  --line-strong:rgba(38,33,27,0.18);
  --white:#FFFFFF;

  /* Accent — muted brass / warm gold */
  --accent:#A87C3F;
  --accent-dark:#8C6530;
  --accent-soft:#EFE1C4;
  --accent-ink:#5B4423;

  /* Status */
  --success:#4C7A5A;
  --success-soft:#E4EEE6;
  --danger:#A8483B;
  --danger-soft:#F5E4E1;

  /* Shadows — soft, restrained */
  --shadow-sm:0 1px 3px rgba(36,31,25,0.06), 0 1px 2px rgba(36,31,25,0.05);
  --shadow-md:0 6px 20px -6px rgba(36,31,25,0.14);
  --shadow-lg:0 20px 45px -18px rgba(36,31,25,0.28);

  /* Radii — restrained, not "bubbly" */
  --r-sm:8px;
  --r-md:12px;
  --r-lg:18px;
  --r-pill:999px;

  /* Typography */
  --font-body:'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-display:'Aref Ruqaa', 'Cairo', serif;

  --ease:cubic-bezier(.22,.61,.36,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
html,body{ margin:0; padding:0; }

body{
  font-family:var(--font-body);
  background:var(--ivory);
  color:var(--ink);
  direction:rtl;
  text-align:right;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4,p{ margin:0; }

::selection{ background:var(--accent-soft); color:var(--accent-ink); }

/* Scrollbar (subtle) */
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:var(--line-strong); border-radius:10px; }
::-webkit-scrollbar-track{ background:transparent; }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

/* ---------- Utility ---------- */
.visually-hidden{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.container{ max-width:1180px; margin:0 auto; padding:0 20px; }
.serif{ font-family:var(--font-display); }
.no-scroll{ overflow:hidden; }

/* ---------- Demo Banner ---------- */
.demo-strip{
  background:var(--charcoal);
  color:var(--beige);
  font-size:12.5px;
  padding:8px 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  letter-spacing:.2px;
  position:relative;
  z-index:60;
}
.demo-strip .dot{
  width:6px; height:6px; border-radius:50%; background:var(--accent);
  box-shadow:0 0 0 3px rgba(168,124,63,.25);
  flex:none;
}
.demo-strip a{
  color:var(--accent);
  border-bottom:1px solid rgba(168,124,63,.5);
  font-weight:600;
  white-space:nowrap;
}
.demo-strip a:hover{ color:#D6B378; }
.demo-strip strong{ font-weight:700; color:var(--white); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:var(--font-body); font-weight:600; font-size:14.5px;
  padding:12px 22px; border-radius:var(--r-sm);
  border:1px solid transparent; transition:all .2s var(--ease);
  white-space:nowrap; line-height:1;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--charcoal); color:var(--ivory); }
.btn-primary:hover{ background:#332b22; }
.btn-accent{ background:var(--accent); color:#fff; }
.btn-accent:hover{ background:var(--accent-dark); }
.btn-outline{ background:transparent; border-color:var(--line-strong); color:var(--ink); }
.btn-outline:hover{ border-color:var(--ink); background:rgba(38,33,27,0.03); }
.btn-ghost{ background:transparent; color:var(--muted); padding:10px 14px; }
.btn-ghost:hover{ color:var(--ink); background:rgba(38,33,27,0.04); }
.btn-danger{ background:var(--danger); color:#fff; }
.btn-danger:hover{ background:#8f3a2f; }
.btn-sm{ padding:8px 14px; font-size:13px; }
.btn-block{ width:100%; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn-icon{
  width:38px; height:38px; padding:0; border-radius:var(--r-sm);
  background:transparent; border:1px solid var(--line-strong); color:var(--ink);
  display:inline-flex; align-items:center; justify-content:center; font-size:15px;
}
.btn-icon:hover{ background:rgba(38,33,27,0.05); }
.btn-icon.danger{ color:var(--danger); border-color:rgba(168,72,59,.3); }
.btn-icon.danger:hover{ background:var(--danger-soft); }

/* ---------- Badges ---------- */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11.5px; font-weight:700; padding:5px 11px;
  border-radius:var(--r-pill); letter-spacing:.2px;
  border:1px solid transparent;
}
.badge-bestseller{ background:#3A2C21; color:#F3E6CC; }
.badge-new{ background:var(--success-soft); color:var(--success); }
.badge-chef{ background:var(--accent-soft); color:var(--accent-ink); }
.badge-unavailable{ background:rgba(38,33,27,0.85); color:#fff; }
.badge-outline{ background:transparent; border-color:var(--line-strong); color:var(--muted); }

.pill-status{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12.5px; font-weight:600; padding:6px 13px; border-radius:var(--r-pill);
}
.pill-open{ background:rgba(76,122,90,.14); color:#3E6B4C; }
.pill-open .dot{ width:6px; height:6px; border-radius:50%; background:#4C7A5A; }
.pill-closed{ background:rgba(168,72,59,.12); color:#8C4636; }
.pill-closed .dot{ width:6px; height:6px; border-radius:50%; background:#A8483B; }

/* ---------- Forms ---------- */
.field{ margin-bottom:16px; }
.field label{
  display:block; font-size:13px; font-weight:700; color:var(--espresso);
  margin-bottom:7px;
}
.field .hint{ display:block; font-size:12px; color:var(--muted); margin-top:6px; }
.input, .textarea, .select{
  width:100%; padding:12px 14px; border:1px solid var(--line-strong);
  border-radius:var(--r-sm); background:var(--white); color:var(--ink);
  font-size:14.5px; font-family:inherit; transition:border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus{
  outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(168,124,63,.15);
}
.textarea{ resize:vertical; min-height:90px; }
.select{ appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%237C7061' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:left 14px center; padding-left:34px; }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:520px){ .field-row{ grid-template-columns:1fr; } }

.switch{ position:relative; display:inline-block; width:44px; height:26px; flex:none; }
.switch input{ opacity:0; width:0; height:0; }
.switch .track{
  position:absolute; inset:0; background:var(--line-strong); border-radius:999px; transition:background .2s;
}
.switch .thumb{
  position:absolute; top:3px; right:3px; width:20px; height:20px; background:#fff; border-radius:50%;
  transition:transform .2s var(--ease); box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track{ background:var(--success); }
.switch input:checked + .track .thumb{ transform:translateX(18px); }

.upload-box{
  border:1.5px dashed var(--line-strong); border-radius:var(--r-md);
  padding:18px; text-align:center; background:var(--cream);
  transition:border-color .2s, background .2s; cursor:pointer;
}
.upload-box:hover{ border-color:var(--accent); background:var(--accent-soft); }
.upload-box i{ font-size:22px; color:var(--muted); margin-bottom:8px; display:block; }
.upload-preview{
  width:100%; height:150px; border-radius:var(--r-md); overflow:hidden; margin-bottom:12px;
  background:var(--beige); position:relative;
}
.upload-preview img{ width:100%; height:100%; object-fit:cover; }

/* ---------- Chips (badge choice / category filter shared) ---------- */
.choice-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 16px; border-radius:var(--r-pill); border:1px solid var(--line-strong);
  font-size:13.5px; font-weight:600; color:var(--muted); background:var(--white); cursor:pointer;
  transition:all .18s var(--ease);
}
.choice-chip.active{ background:var(--charcoal); color:#fff; border-color:var(--charcoal); }

/* ---------- Toast ---------- */
#toast-root{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%);
  z-index:9999; display:flex; flex-direction:column; gap:10px; align-items:center;
  pointer-events:none;
}
.toast{
  display:flex; align-items:center; gap:10px;
  background:var(--charcoal); color:#fff; padding:13px 20px; border-radius:var(--r-md);
  font-size:14px; font-weight:600; box-shadow:var(--shadow-lg);
  animation:toast-in .28s var(--ease);
  pointer-events:auto;
}
.toast.success i{ color:#8FCB9F; }
.toast.danger i{ color:#E39A8C; }
.toast.leaving{ animation:toast-out .22s var(--ease) forwards; }
@keyframes toast-in{ from{ opacity:0; transform:translateY(10px) scale(.96); } to{ opacity:1; transform:none; } }
@keyframes toast-out{ to{ opacity:0; transform:translateY(6px) scale(.97); } }

/* ---------- Modal base ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(28,24,19,0.55);
  backdrop-filter:blur(2px);
  display:flex; align-items:flex-end; justify-content:center;
  z-index:1000; opacity:0; visibility:hidden; transition:opacity .25s var(--ease);
}
.modal-overlay.open{ opacity:1; visibility:visible; }
.modal-panel{
  background:var(--ivory); width:100%; max-width:560px;
  border-radius:22px 22px 0 0; max-height:92vh; overflow-y:auto;
  transform:translateY(24px); transition:transform .3s var(--ease);
  box-shadow:var(--shadow-lg);
}
.modal-overlay.open .modal-panel{ transform:translateY(0); }
@media (min-width:720px){
  .modal-overlay{ align-items:center; }
  .modal-panel{ border-radius:var(--r-lg); max-height:88vh; }
}
.modal-drag{ width:40px; height:4px; background:var(--line-strong); border-radius:99px; margin:12px auto 0; }
@media (min-width:720px){ .modal-drag{ display:none; } }
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px 14px; border-bottom:1px solid var(--line);
}
.modal-head h3{ font-size:18px; font-weight:800; }
.modal-close{
  width:34px; height:34px; border-radius:50%; border:1px solid var(--line-strong);
  background:transparent; display:flex; align-items:center; justify-content:center; color:var(--muted);
  transition:background .15s;
}
.modal-close:hover{ background:rgba(38,33,27,0.06); }
.modal-body{ padding:20px 22px 26px; }
.modal-actions{ display:flex; gap:10px; margin-top:22px; }
.modal-actions .btn{ flex:1; }

/* ---------- Confirm dialog ---------- */
.confirm-icon{
  width:52px; height:52px; border-radius:50%; background:var(--danger-soft); color:var(--danger);
  display:flex; align-items:center; justify-content:center; font-size:20px; margin-bottom:14px;
}

/* ---------- Skeleton loading ---------- */
.skeleton{
  background:linear-gradient(100deg, var(--beige) 30%, var(--cream) 50%, var(--beige) 70%);
  background-size:200% 100%; animation:shimmer 1.4s infinite;
  border-radius:var(--r-sm);
}
@keyframes shimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }

/* ---------- Empty states ---------- */
.empty-state{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  padding:56px 20px; color:var(--muted);
}
.empty-state i{ font-size:34px; color:var(--sand); margin-bottom:14px; }
.empty-state h4{ font-size:16px; color:var(--espresso); font-weight:700; margin-bottom:6px; }
.empty-state p{ font-size:13.5px; max-width:280px; }

/* Fade-in-up utility for subtle entrance animation */
@keyframes fadeUp{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }
.fade-up{ animation:fadeUp .5s var(--ease) both; }
