/* Ratio – Dawadmi menu. Customer screens + shared base styles. */

@font-face {
  font-family: 'Readex';
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url(/fonts/readex-arabic.woff2) format('woff2-variations'), url(/fonts/readex-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Readex';
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url(/fonts/readex-latin.woff2) format('woff2-variations'), url(/fonts/readex-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #07014F;
  --navy-deep: #020C34;
  --cream: #F3EADD;
  --cream-2: #EADFCC;
  --paper: #FFFBF5;
  --burgundy: #521B25;
  --ink: #07014F;
  --muted: rgba(7, 1, 79, .6);
  --faint: rgba(7, 1, 79, .38);
  --line: rgba(7, 1, 79, .12);
  --on-navy: #F3EADD;
  --on-navy-muted: rgba(243, 234, 221, .62);
  --radius: 22px;
  --shadow: 0 1px 2px rgba(7, 1, 79, .06), 0 10px 28px -14px rgba(7, 1, 79, .28);
  --rail-w: 264px;
  --font: 'Readex', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* Customer screens: kiosk behaviour (no text selection, no callouts, no zoom gestures). */
.welcome, .menu, .item-dialog {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-x pan-y;
}

/* ---------- Logo helpers (logo tinted with CSS masks) ---------- */
.logo-full {
  aspect-ratio: 1000 / 376;
  -webkit-mask: url(/img/logo-full.png) center / contain no-repeat;
  mask: url(/img/logo-full.png) center / contain no-repeat;
  background: var(--navy);
}
.logo-cream { background: var(--cream); }
.mark {
  -webkit-mask: url(/img/logo-mark.png) center / contain no-repeat;
  mask: url(/img/logo-mark.png) center / contain no-repeat;
  background: var(--navy);
}

/* ---------- Welcome ---------- */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 90% at 50% 40%, #0E0A63 0%, var(--navy) 55%, var(--navy-deep) 100%);
  color: var(--on-navy);
  overflow: hidden;
  cursor: pointer;
  transition: opacity .45s ease, visibility .45s;
}
.welcome.is-leaving { opacity: 0; visibility: hidden; }

.welcome-art { position: absolute; inset: 0; pointer-events: none; }
.welcome-art .ring {
  position: absolute;
  border-radius: 50%;
  border: clamp(36px, 6vw, 80px) solid rgba(243, 234, 221, .045);
}
.ring-a { width: 62vmax; height: 62vmax; top: -24vmax; right: -16vmax; }
.ring-b { width: 54vmax; height: 54vmax; bottom: -26vmax; left: -14vmax; }
.welcome-art .bar {
  position: absolute;
  width: clamp(36px, 6vw, 80px);
  height: 150vmax;
  top: 50%;
  left: 50%;
  background: rgba(243, 234, 221, .03);
  transform: translate(-50%, -50%) rotate(45deg);
}

.welcome-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}
.welcome .logo-full { width: min(62vw, 520px); }
.welcome-tag {
  margin: 28px 0 0;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 300;
  letter-spacing: .02em;
  color: var(--on-navy-muted);
}
.welcome-branch {
  margin: 6px 0 0;
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 500;
}
.welcome-branch:empty { display: none; }
.welcome-cta { margin: clamp(40px, 7vh, 72px) 0 0; }
.welcome-cta span {
  display: inline-block;
  padding: 16px 34px;
  border-radius: 999px;
  border: 1.5px solid rgba(243, 234, 221, .45);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* ---------- Menu layout ---------- */
.menu {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--cream);
}

/* Top bar on narrow screens (phones, iPad portrait) */
.rail {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand . owner" "tabs tabs tabs";
  align-items: center;
  gap: 12px 16px;
  padding: calc(14px + var(--safe-t)) calc(20px + var(--safe-r)) 14px calc(20px + var(--safe-l));
  background: var(--navy);
  color: var(--on-navy);
  z-index: 2;
}
.rail-brand { grid-area: brand; display: flex; align-items: center; gap: 14px; }
.rail-brand .logo-full { width: 120px; }
.rail-branch { font-size: 15px; color: var(--on-navy-muted); }
.rail-branch:empty { display: none; }

.tabs {
  grid-area: tabs;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -20px;
  padding: 0 20px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  appearance: none;
  border: 0;
  background: rgba(243, 234, 221, .08);
  color: var(--on-navy);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tab.is-active { background: var(--cream); color: var(--navy); }

.owner-btn {
  grid-area: owner;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--on-navy-muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  opacity: .7;
}
.owner-btn svg { width: 18px; height: 18px; }
.owner-btn:active { background: rgba(243, 234, 221, .1); }

.menu-body {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px calc(20px + var(--safe-r)) calc(48px + var(--safe-b)) calc(20px + var(--safe-l));
  outline: none;
}

/* Side rail on wide screens (iPad landscape, large iPads) */
@media (min-width: 900px) {
  .menu {
    grid-template-rows: none;
    grid-template-columns: var(--rail-w) 1fr;
  }
  .rail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: calc(34px + var(--safe-t)) calc(18px + var(--safe-r)) calc(18px + var(--safe-b)) 18px;
    overflow: hidden;
  }
  .rail-brand {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 8px 26px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(243, 234, 221, .12);
  }
  .rail-brand .logo-full { width: 170px; }
  .rail-branch { font-size: 16px; }
  .tabs {
    flex: 1;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .tab {
    text-align: right;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 19px;
    background: transparent;
    white-space: normal;
  }
  .tab.is-active { background: var(--cream); }
  .owner-btn { align-self: center; margin-top: 12px; }
  .menu-body { padding: 18px 36px calc(56px + var(--safe-b)) calc(36px + var(--safe-l)); }
}

/* ---------- Sections & cards ---------- */
.section { padding-top: 26px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 4px 18px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: -.01em;
}
.section-head .count { font-size: 15px; color: var(--faint); }
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr));
  gap: 18px;
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

.card {
  appearance: none;
  display: flex;
  flex-direction: column;
  text-align: right;
  border: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: rise .4s ease both;
}
.card:active { transform: scale(.975); }
.no-anim .card { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 15px;
  overflow: hidden;
  background: var(--cream-2);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; }
.ph .mark { width: 34%; aspect-ratio: 1601 / 1425; opacity: .13; }

.badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  background: var(--paper);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(7, 1, 79, .15);
}
.badge-new { background: var(--burgundy); color: var(--cream); }
.badge-best { background: var(--navy); color: var(--cream); }
.badge-out { background: var(--paper); color: var(--burgundy); }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 8px 6px;
}
.card-name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}
.card-desc {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}
.price { font-size: 23px; font-weight: 700; white-space: nowrap; }
/* Saudi Riyal symbol: same color as the number, numeral height, a space before it (SAMA rules). */
.price .cur { margin-inline-start: .3em; }
.sar { display: inline-block; height: .74em; width: auto; vertical-align: -0.02em; }
.cal {
  font-size: 13px;
  color: var(--muted);
  background: rgba(7, 1, 79, .055);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.card.is-out { box-shadow: none; background: rgba(255, 251, 245, .6); }
.card.is-out .media img, .card.is-out .ph { filter: grayscale(1); opacity: .55; }
.card.is-out .card-name, .card.is-out .price { color: var(--faint); }

.empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 60vh;
  text-align: center;
  color: var(--muted);
  font-size: 20px;
}
.empty .mark { width: 90px; aspect-ratio: 1601 / 1425; opacity: .2; }

/* ---------- Item dialog ---------- */
.item-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(2, 12, 52, .55);
  overflow: hidden;
}
.item-dialog[open] { display: flex; flex-direction: column; animation: pop .28s cubic-bezier(.2, .9, .3, 1.2) both; }
.item-dialog::backdrop { background: rgba(2, 12, 52, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.dlg-scroll { overflow-y: auto; }
.dlg-media { position: relative; aspect-ratio: 4 / 3; max-height: 52dvh; width: 100%; background: var(--cream-2); }
.dlg-media img { width: 100%; height: 100%; object-fit: cover; }
.dlg-media .ph .mark { width: 26%; }
.dlg-media .badges { top: 18px; right: 18px; }
.dlg-media .badge { font-size: 15px; padding: 6px 14px; }
.dlg-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 251, 245, .92);
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(7, 1, 79, .18);
  cursor: pointer;
}
.dlg-close svg { width: 22px; height: 22px; }
.dlg-body { padding: 24px 30px 30px; }
.dlg-body h2 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.3; }
.dlg-body p { margin: 12px 0 0; font-size: 18px; line-height: 1.75; color: var(--muted); }
.dlg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.dlg-foot .price { font-size: 32px; }
.dlg-foot .cal { font-size: 15px; padding: 6px 14px; }
.dlg-out { margin-top: 18px; color: var(--burgundy); font-weight: 600; font-size: 17px; }

.noscript { padding: 40px; text-align: center; font-size: 20px; }

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