/* =========================================================
   Barza Menu — styles
   - Mobile-first: base styles target phones, media queries
     add columns on bigger screens.
   - Colours come from CSS variables. app.js overwrites them
     with the values in config.json, so you rarely need to
     edit this file to re-brand.
   - We use "logical" properties (margin-inline-start, etc.)
     so the same CSS works for RTL (Arabic) and LTR (English).
   ========================================================= */

:root {
  --primary: #0F5257;
  --accent: #D9962B;
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --text: #1F2A2B;
  --muted: #5F6B6C;
  --border: #E7E0D4;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
  --font: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Make sure the HTML "hidden" attribute always wins over display:flex/grid below */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  /* leave room at the bottom so the floating cart bar never hides content */
  padding-bottom: 96px;
}

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }

/* Visible focus ring for keyboard users */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; inset-inline-start: 8px; top: -60px;
  background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { top: 8px; }

/* ---------- Demo banner ---------- */
.demo-banner {
  background: #FFF4D6; color: #6B4E00; text-align: center;
  font-size: .85rem; padding: 6px 12px; border-bottom: 1px solid #F0DFA8;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 16px 12px;
  max-width: 1100px; margin: 0 auto;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.brand h1 { margin: 0; font-size: 1.35rem; color: var(--primary); }
.tagline { margin: 0; color: var(--muted); font-size: .9rem; }
.meta { margin: 4px 0 0; font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.status-pill { padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.status-pill.open { background: #E3F4EA; color: #1E6B3A; }
.status-pill.closed { background: #FBE6E6; color: #9B2C2C; }

.lang-toggle {
  flex-shrink: 0; min-width: 48px; min-height: 44px;
  border: 1.5px solid var(--primary); background: transparent; color: var(--primary);
  border-radius: 999px; font-weight: 700; cursor: pointer;
}
.lang-toggle:hover { background: var(--primary); color: #fff; }

/* ---------- Toolbar (search + tabs), sticks to top ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding: 8px 16px 0;
  max-width: 1100px; margin: 0 auto;
}
.toolbar.scrolled { box-shadow: 0 6px 12px -10px rgba(0,0,0,.25); }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 12px; color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-height: 46px; color: var(--text); }
.search:focus-within { border-color: var(--primary); }

.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Menu sections & item cards ---------- */
.menu { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.section-title { font-size: 1.1rem; margin: 18px 0 10px; color: var(--primary); }

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }

.card {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--surface); border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow); border: 1px solid transparent;
}
.card.unavailable { opacity: .55; }

.card-img {
  width: 88px; height: 88px; flex-shrink: 0; border-radius: 12px; object-fit: cover;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  display: grid; place-items: center; font-size: 2.2rem;
}

.card-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-title { margin: 0; font-size: 1rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.badge { font-size: .7rem; background: var(--accent); color: #fff; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.badge.off { background: #9AA3A4; }
.card-desc { margin: 2px 0 8px; font-size: .85rem; color: var(--muted); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; color: var(--primary); }

/* Add button and the  –  1  +  stepper */
.add-btn, .step-btn {
  min-width: 44px; min-height: 40px; border-radius: 12px; cursor: pointer; font-weight: 700;
}
.add-btn { border: 0; background: var(--primary); color: #fff; padding: 0 14px; }
.add-btn:disabled { background: #C9CFCF; cursor: not-allowed; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.step-btn { border: 1.5px solid var(--primary); background: var(--surface); color: var(--primary); min-width: 40px; }
.qty { min-width: 1.5em; text-align: center; font-weight: 700; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--primary); font-weight: 600; }

/* ---------- Floating cart bar ---------- */
.cart-bar {
  position: fixed; inset-inline: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 16px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--primary); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 600;
}
.cart-bar strong { margin-inline-start: auto; }
.cart-count {
  background: var(--accent); color: #fff; min-width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; font-size: .9rem;
}
.cart-bar.bump { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.04); } }

/* ---------- Cart dialog ---------- */
.cart-dialog {
  width: min(560px, 100%); max-height: 92vh; border: 0; padding: 0;
  border-radius: 20px 20px 0 0; margin: auto auto 0; /* bottom sheet on phones */
  background: var(--surface); color: var(--text);
}
@media (min-width: 640px) { .cart-dialog { border-radius: 20px; margin: auto; } }
.cart-dialog::backdrop { background: rgba(0,0,0,.45); }

.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; position: sticky; top: 0; background: var(--surface); }
.cart-head h2 { margin: 0; font-size: 1.2rem; }
.icon-btn { border: 0; background: var(--bg); width: 40px; height: 40px; border-radius: 999px; cursor: pointer; font-size: 1rem; }

.cart-list { list-style: none; margin: 0; padding: 0 16px; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-line .line-name { flex: 1; min-width: 0; }
.cart-line .line-name small { display: block; color: var(--muted); }
.cart-empty { color: var(--muted); padding: 16px 0; text-align: center; }

.order-form { padding: 12px 16px 20px; display: grid; gap: 10px; }
.order-form label { display: grid; gap: 4px; font-size: .9rem; }
.order-form input, .order-form textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--bg); min-height: 44px;
}
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; padding: 6px 0; }

.whatsapp-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; border: 0; border-radius: 14px; cursor: pointer;
  background: #1FA855; color: #fff; font-weight: 700; font-size: 1.05rem;
}
.whatsapp-btn:disabled { background: #A8B5AD; cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 30;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
