/* ════════════════════════════════════════════════════════════════
   Goustenu · menu — نمط المنيو العام (RTL · موبايل أولاً)
   الألوان تُحقَن كمتغيّرات CSS من app.mjs (applyTheme) — القيم هنا احتياط.
   ════════════════════════════════════════════════════════════════ */

:root {
  --primary: #B23A2E; --primaryLight: #C85B4E;
  --secondary: #D9A441; --secondaryLight: #E8C170;
  --bg: #FBF7F2; --bgCard: #FFFFFF;
  --text: #2A211C; --textMuted: #8A7A6E; --border: #EFE6DB;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .16);
  --maxw: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 1rem 6rem;
  min-height: 100vh;
}

h1, h2 { margin: 0; font-weight: 700; }

/* ─── الترويسة ─── */
.header { padding: 1.75rem 0 .5rem; text-align: center; }
.r-headwrap { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.r-name {
  font-size: 1.7rem; color: var(--primary);
  letter-spacing: -.01em;
}
.r-bio { margin: 0; color: var(--textMuted); font-size: .98rem; max-width: 34ch; }
.r-metarow {
  display: flex; flex-wrap: wrap; gap: .4rem 1rem;
  justify-content: center; margin-top: .25rem; font-size: .9rem;
}
.r-link, .r-meta { color: var(--text); text-decoration: none; }
.r-link { border-bottom: 1px dashed var(--border); padding-bottom: 1px; }
.r-link:hover { color: var(--primary); border-color: var(--primary); }

/* ─── شارة الحالة ─── */
.status-wrap { display: flex; justify-content: center; margin: .5rem 0 1.25rem; }
.status-badge {
  display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  justify-content: center;
  background: var(--bgCard); border: 1px solid var(--border);
  border-radius: 999px; padding: .55rem 1.1rem;
  box-shadow: var(--shadow); font-size: .92rem;
  max-width: 100%;
}
.status-dot { font-size: .8rem; line-height: 1; }
.status-title { font-weight: 700; }
.status-detail { color: var(--textMuted); font-size: .85rem; }
.status-open { border-color: #cde9cd; }
.status-open .status-title { color: #1a7a3a; }
.status-closed { border-color: #f0d2cf; }
.status-closed .status-title { color: var(--primary); }
.status-vacation { border-color: #dcd3ef; }
.status-vacation .status-title { color: #6b4fb0; }

/* ─── المنيو ─── */
.menu { display: flex; flex-direction: column; gap: 1.75rem; }
.cat { display: flex; flex-direction: column; gap: .75rem; }
.cat-title {
  font-size: 1.25rem; color: var(--text);
  padding-bottom: .4rem; position: relative;
}
.cat-title::after {
  content: ''; position: absolute; bottom: 0; inset-inline-start: 0;
  width: 44px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--secondary), var(--secondaryLight));
}

.dish {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--bgCard); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1rem;
  box-shadow: var(--shadow);
}
.dish-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.dish-head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.dish-name { font-weight: 700; font-size: 1.02rem; }
.dish-price { color: var(--primary); font-weight: 700; white-space: nowrap; }
.dish-desc { margin: 0; color: var(--textMuted); font-size: .9rem; }
.dish-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .15rem; }
.tag {
  font-size: .72rem; color: var(--textMuted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: .1rem .55rem;
}
.dish-action { display: flex; align-items: center; }

/* أزرار الإضافة / العدّاد */
.add-btn {
  border: 0; cursor: pointer;
  background: var(--primary); color: #fff;
  font-family: inherit; font-weight: 700; font-size: .88rem;
  border-radius: 999px; padding: .5rem .9rem;
  transition: background .15s, transform .05s;
}
.add-btn:hover { background: var(--primaryLight); }
.add-btn:active { transform: scale(.96); }

.qty { display: inline-flex; align-items: center; gap: .1rem; }
.qty-btn {
  border: 1px solid var(--border); background: var(--bgCard); cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1.1rem; line-height: 1; color: var(--primary);
  display: grid; place-items: center; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.qty-btn:hover { background: var(--bg); border-color: var(--primary); }
.qty-num { min-width: 1.6rem; text-align: center; font-weight: 700; }

/* ─── ملاحظات فارغة / تذييل ─── */
.empty-note { text-align: center; color: var(--textMuted); padding: 2.5rem 1rem; }
.foot { text-align: center; color: var(--textMuted); font-size: .8rem; padding: 2rem 0 1rem; }
.foot strong { color: var(--primary); }

/* ─── زرّ السلّة العائم ─── */
.cart-button {
  position: fixed; inset-block-end: 1rem; inset-inline: 1rem;
  max-width: calc(var(--maxw) - 2rem); margin-inline: auto;
  display: flex; align-items: center; gap: .6rem;
  background: var(--primary); color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 1rem;
  border-radius: 999px; padding: .85rem 1.3rem;
  box-shadow: var(--shadow-lg);
  transition: background .15s, transform .05s;
  z-index: 40;
}
.cart-button:hover { background: var(--primaryLight); }
.cart-button:active { transform: scale(.99); }
.cart-icon { font-size: 1.2rem; }
.cart-badge {
  background: #fff; color: var(--primary);
  border-radius: 999px; min-width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center; font-size: .85rem; padding: 0 .35rem;
}
.cart-btn-total { margin-inline-start: auto; }
.hidden { display: none !important; }

/* ─── الطبقة المعتمة + الدرج (بوتوم-شيت) ─── */
.backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 50;
}
.backdrop.show { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed; inset-inline: 0; inset-block-end: 0;
  max-width: var(--maxw); margin-inline: auto;
  background: var(--bg); color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 1.1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .28s ease;
  z-index: 60; max-height: 88vh; overflow-y: auto;
}
.cart-drawer.open { transform: translateY(0); }

.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.drawer-head h2 { font-size: 1.25rem; }
.close-btn {
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.3rem; color: var(--textMuted); width: 2rem; height: 2rem;
  border-radius: 50%; display: grid; place-items: center;
}
.close-btn:hover { background: var(--border); color: var(--text); }

.cart-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.cart-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--bgCard); border: 1px solid var(--border);
  border-radius: 12px; padding: .6rem .8rem;
}
.cart-row-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.cart-row-name { font-weight: 600; }
.cart-row-price { color: var(--textMuted); font-size: .85rem; }

.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 2px dashed var(--border); padding-top: .9rem; margin-bottom: 1rem;
  font-size: 1.05rem;
}
.cart-total-row strong { color: var(--primary); font-size: 1.15rem; }

/* ─── نموذج الطلب ─── */
.order-form { display: flex; flex-direction: column; gap: .6rem; }
.field {
  width: 100%; font-family: inherit; font-size: 1rem;
  background: var(--bgCard); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem .85rem; resize: vertical;
}
.field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(178, 58, 46, .12); }
.form-err { margin: 0; color: var(--primary); font-size: .85rem; min-height: 1rem; }
.send-btn {
  border: 0; cursor: pointer; margin-top: .25rem;
  background: #25D366; color: #fff;
  font-family: inherit; font-weight: 700; font-size: 1.05rem;
  border-radius: 12px; padding: .9rem;
  transition: filter .15s, transform .05s;
}
.send-btn:hover { filter: brightness(1.05); }
.send-btn:active { transform: scale(.99); }
.send-btn:disabled { background: var(--textMuted); cursor: not-allowed; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .backdrop, .add-btn, .qty-btn, .cart-button { transition: none; }
}
