/* ===== Dish panel ("Design A") -- design v2 only (see public/js/dish-panel.js) =====
   Reference: docs/reference/dish-panel-a-reference.html. Loaded after menu-tabs.css; every selector is a new .dp* class,
   so no existing rule is touched. Colours: --dp-* are written on .dp by dish-panel.js from the client's theme variables
   (--brand-bg/-text/-muted/-accent/-primary) with WCAG >= 4.5:1 text colours; the values below are only the fallbacks.
   Rules that matter (tested in test-browser/dish-panel.pw.js):
   - exactly ONE scroll container at a time (.dp-scroll; while the reviews sheet is open it takes over and the main one is
     overflow:hidden), scrollbars hidden but touch / wheel / keyboard scrolling kept, overscroll-behavior: contain;
   - no vh units: dvh + inset:0 + safe-area insets;
   - only transform / opacity animate, <= 250ms, off under prefers-reduced-motion;
   - logical properties everywhere, so RTL is a mirror image with no extra rules (except the sticker tilt). */

/* scroll lock: the page keeps its scroll position (no position:fixed trick); the scrollbar's width stays reserved
   (scrollbar-gutter) so nothing moves when the scrollbar disappears. dish-panel.js adds padding-right instead on engines
   without scrollbar-gutter. */
html.dp-lock { overflow: hidden; }
html.dp-lock.dp-gutter { scrollbar-gutter: stable; } /* only when a scrollbar was there to replace: on a page that did not scroll it would ADD a blank strip */

.dp-back {
  position: fixed; inset: 0; z-index: 95; display: none;
  background: rgba(0, 0, 0, 0.62); overscroll-behavior: contain;
}
.dp-back.open { display: block; }
.dp-back:not(.ready) { pointer-events: none; }

.dp {
  --dp-bg: #0b0b0b; --dp-surface: #141414; --dp-surface-2: #1c1c1c; --dp-pill: #1f1f1f; --dp-line: #2a2a2a;
  --dp-text: #ffffff; --dp-muted: #a8a8a8; --dp-body: #c4c4c4;
  --dp-accent: #ffb400; --dp-on-accent: #000; --dp-accent-text: #ffb400; --dp-accent-hero: #ffb400; --dp-star-off: #5a5a5a;
  --dp-bar-h: 92px;
  position: fixed; inset: 0; z-index: 96; display: none; flex-direction: column; overflow: hidden;
  background: var(--dp-bg); color: var(--dp-text);
  font-family: var(--bf-body, var(--brand-font, system-ui, sans-serif)); font-size: 14px; line-height: 1.4;
  contain: layout paint; box-sizing: border-box;
}
.dp.open { display: flex; }
.dp.no-bar { --dp-bar-h: 0px; }
.dp:not(.ready) { pointer-events: none; }
.dp *, .dp *::before, .dp *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.dp button { font-family: inherit; cursor: pointer; }
.dp [hidden] { display: none !important; }
.dp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dp :focus-visible { outline: 2px solid var(--dp-accent-text); outline-offset: 2px; }

/* laptop / tablet: a centred card, not a stretched phone sheet (still one scroller, scrollbar hidden) */
@media (min-width: 768px) {
  .dp { inset: 0; margin: auto; width: min(480px, 100%); height: min(92dvh, 860px); border-radius: 24px; border: 1px solid var(--dp-line); }
}
@media (prefers-reduced-motion: no-preference) {
  .dp.open { animation: dp-in 0.22s ease-out; }
  @keyframes dp-in { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
}

/* ---------- the ONE scroller ---------- */
.dp-scroll {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
}
.dp-scroll::-webkit-scrollbar, .dp-rv-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.dp.reviews-open .dp-scroll { overflow: hidden; }

/* ---------- hero ---------- */
.dp-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: min(56dvh, 470px); padding: calc(204px + env(safe-area-inset-top)) 20px 30px; /* room for close button + price sticker, so a long name can never run into them */
  background: radial-gradient(ellipse at 50% 36%, color-mix(in srgb, var(--dp-accent) 38%, #0b0b0b) 0%, #121212 62%, #0b0b0b 100%);
  color: #fff;
}
.dp-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 62%; background: linear-gradient(transparent, rgba(11, 11, 11, 0.94)); pointer-events: none; z-index: 1; }
.dp-photo { position: absolute; inset: 0; z-index: 0; overflow: hidden; direction: ltr; display: none; }
.dp-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dp-hero.has-photo .dp-photo { display: block; }
.dp-nophoto { position: absolute; inset: 0; z-index: 0; display: none; background: linear-gradient(160deg, #1f1f1f, #121212 60%, #0b0b0b); overflow: hidden; }
.dp-hero.no-photo .dp-nophoto { display: block; }
.dp-big { position: absolute; top: -70px; inset-inline-end: -30px; font-size: 440px; font-weight: 900; line-height: 1; color: var(--dp-accent-hero); opacity: 0.14; direction: ltr; user-select: none; }
.dp-ring { position: absolute; top: calc(96px + env(safe-area-inset-top)); inset-inline: 0; display: flex; justify-content: center; color: var(--dp-accent-hero); }
.dp-ring span { width: 132px; height: 132px; border-radius: 50%; border: 2px solid var(--dp-accent-hero); display: flex; align-items: center; justify-content: center; }

.dp-x {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid #5a5a5a; background: rgba(11, 11, 11, 0.6); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.dp-close { position: absolute; z-index: 3; top: calc(16px + env(safe-area-inset-top)); inset-inline-end: 16px; }
.dp.reviews-open .dp-close { visibility: hidden; } /* one close button visible at a time */
.dp-sticker {
  position: absolute; z-index: 2; top: calc(104px + env(safe-area-inset-top)); inset-inline-start: 20px; width: 84px; height: 84px; border-radius: 50%;
  background: var(--dp-accent); color: var(--dp-on-accent); display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-8deg); box-shadow: 0 6px 0 #0b0b0b; unicode-bidi: isolate;
}
.dp[dir="rtl"] .dp-sticker { transform: rotate(8deg); }
.dp-sticker i { font-style: normal; font-size: 12px; font-weight: 800; line-height: 1; }
.dp-sticker b { font-size: 30px; font-weight: 900; line-height: 1.05; max-width: 80px; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.dp-sticker b:empty { display: none; }

.dp-title { position: relative; z-index: 2; min-width: 0; }
/* the scrim is tied to the title block (not to a % of the hero), so the eyebrow + name sit on near-black whatever the photo and however many lines the name takes */
.dp-title::before { content: ""; position: absolute; z-index: -1; inset: -120px -20px -36px; background: linear-gradient(transparent, rgba(11, 11, 11, 0.92) 120px, rgba(11, 11, 11, 0.95)); pointer-events: none; }
.dp-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dp-accent-hero); overflow-wrap: anywhere; }
.dp-eyebrow:empty { display: none; }
.dp-name {
  margin: 6px 0 0; font-family: var(--bf-heading, inherit); font-size: 44px; font-weight: 900; line-height: 0.95; letter-spacing: -0.01em;
  text-transform: uppercase; overflow-wrap: anywhere; text-align: start; color: #fff;
}
.dp-name[data-size="l"] { font-size: 36px; }
.dp-name[data-size="m"] { font-size: 30px; line-height: 1; }
.dp-name[data-size="s"] { font-size: 24px; line-height: 1.05; }
.dp[dir="rtl"] .dp-eyebrow { letter-spacing: 0; font-size: 13px; font-weight: 700; text-transform: none; }
.dp[dir="rtl"] .dp-name { text-transform: none; letter-spacing: 0; font-weight: 700; line-height: 1.15; font-size: 46px; }
.dp[dir="rtl"] .dp-name[data-size="l"] { font-size: 38px; }
.dp[dir="rtl"] .dp-name[data-size="m"] { font-size: 31px; line-height: 1.2; }
.dp[dir="rtl"] .dp-name[data-size="s"] { font-size: 25px; line-height: 1.25; }

/* ---------- content sheet ---------- */
.dp-sheet {
  position: relative; z-index: 2; margin-top: -22px; background: var(--dp-surface); border-radius: 28px 28px 0 0;
  padding: 14px 20px calc(var(--dp-bar-h) + 24px + env(safe-area-inset-bottom)); min-height: 120px;
}
.dp-grab { width: 44px; height: 4px; border-radius: 2px; background: var(--dp-line); margin: 0 auto 14px; }
.dp-desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--dp-body); overflow-wrap: anywhere; text-align: start; }
.dp-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dp-pill {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--dp-pill);
  border: 1px solid transparent; color: var(--dp-text); font-size: 13px; font-weight: 600;
}
.dp-pill small { color: var(--dp-muted); font-weight: 400; font-size: 13px; }
.dp-pill[aria-pressed="true"] { border-color: var(--dp-accent-text); }
.dp-pill[aria-pressed="true"] .dp-heart { fill: var(--dp-accent-text); }
.dp-pill[aria-disabled="true"] { cursor: default; }
.dp-num { unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.dp-rate { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dp-lbl { min-width: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.dp[dir="rtl"] .dp-lbl { letter-spacing: 0; text-transform: none; font-size: 14px; font-weight: 700; }
.dp-stars { display: flex; gap: 2px; direction: ltr; }
.dp-star { width: 44px; height: 44px; border: 0; background: none; padding: 0; color: var(--dp-star-off); display: flex; align-items: center; justify-content: center; }
.dp-star.on { color: var(--dp-accent-text); }
.dp-row {
  margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px;
  background: var(--dp-surface-2); border: 0; color: var(--dp-text); text-align: start; min-height: 56px;
}
.dp-row b { font-size: 13px; }
.dp-row small { display: block; color: var(--dp-muted); font-size: 12px; margin-top: 2px; }
.dp-all { color: var(--dp-accent-text); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; flex: none; }
.dp[dir="rtl"] .dp-all { letter-spacing: 0; font-size: 13px; }

/* ---------- sticky bottom bar ---------- */
.dp-bar {
  position: absolute; z-index: 4; inset: auto 0 0 0; min-height: var(--dp-bar-h); padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  background: var(--dp-bg); border-top: 1px solid var(--dp-line); display: flex; align-items: center; gap: 12px;
}
.dp.no-bar .dp-bar { display: none; }
.dp-qty { display: flex; align-items: center; height: 56px; border-radius: 28px; border: 1px solid var(--dp-line); flex: none; }
.dp-qty button { width: 48px; height: 54px; border: 0; background: none; color: var(--dp-text); font-size: 22px; padding: 0; }
.dp-qty button:disabled { opacity: 0.4; cursor: default; }
.dp-qty span { min-width: 22px; text-align: center; font-size: 16px; font-weight: 800; }
.dp-add {
  flex: 1 1 0; min-width: 0; min-height: 56px; border: 0; border-radius: 28px; background: var(--dp-accent); color: var(--dp-on-accent);
  font-size: 14px; font-weight: 900; letter-spacing: 0.03em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 18px;
}
.dp-add > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-add > span:last-child { flex: none; }
.dp[dir="rtl"] .dp-add { letter-spacing: 0; text-transform: none; font-size: 16px; font-weight: 700; }
.dp-paused { flex: 1 1 0; min-width: 0; }
.dp-paused b { display: block; font-size: 13px; }
.dp-paused small { display: block; color: var(--dp-muted); font-size: 12px; }
.dp-book {
  flex: 0 1 auto; min-height: 56px; padding: 0 22px; border-radius: 28px; border: 1px solid var(--dp-accent-text); background: none; color: var(--dp-accent-text);
  font-size: 14px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center;
}
.dp[dir="rtl"] .dp-book { letter-spacing: 0; text-transform: none; font-weight: 700; }
.dp.reviews-open .dp-bar { visibility: hidden; }
@media (max-width: 359.98px) {
  .dp-bar { gap: 8px; padding-inline: 14px; }
  .dp-qty button { width: 40px; }
  .dp-add { padding: 0 12px; font-size: 12.5px; letter-spacing: 0.01em; gap: 6px; }
  .dp-book { padding: 0 14px; font-size: 13px; }
}

/* ---------- reviews sheet (replaces the main scroller while open) ---------- */
.dp-rv {
  position: absolute; z-index: 5; inset: 56px 0 0 0; background: var(--dp-surface); border-radius: 28px 28px 0 0; display: none; flex-direction: column;
  box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.5);
}
.dp.reviews-open .dp-rv { display: flex; }
.dp-rv-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch; padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
}
.dp-rv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dp-rv h2 { margin: 0; font-family: var(--bf-heading, inherit); font-size: 20px; font-weight: 900; text-transform: uppercase; color: var(--dp-text); }
.dp[dir="rtl"] .dp-rv h2 { text-transform: none; font-weight: 700; }
.dp-rv .dp-x { background: var(--dp-pill); border-color: var(--dp-line); color: var(--dp-text); }
.dp-sum { margin-top: 14px; display: flex; gap: 18px; align-items: center; padding: 16px; border-radius: 18px; background: var(--dp-surface-2); }
.dp-n { font-size: 44px; font-weight: 900; line-height: 1; color: var(--dp-accent-text); }
.dp-sum-count { font-size: 12px; color: var(--dp-muted); margin-top: 6px; }
.dp-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dp-bars div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dp-muted); direction: ltr; }
.dp-bars i { flex: 1; height: 6px; border-radius: 3px; background: var(--dp-line); overflow: hidden; }
.dp-bars u { display: block; height: 6px; background: var(--dp-accent); text-decoration: none; }
.dp-cap { margin-top: 16px; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dp-muted); }
.dp[dir="rtl"] .dp-cap { letter-spacing: 0; text-transform: none; font-size: 13px; }
.dp textarea {
  display: block; width: 100%; margin-top: 6px; resize: none; border-radius: 14px; border: 1px solid var(--dp-line); background: var(--dp-bg); color: var(--dp-text);
  padding: 12px; font-family: inherit; font-size: 16px; /* 16px: iOS does not zoom on focus */ line-height: 1.4;
}
.dp textarea::placeholder { color: var(--dp-muted); opacity: 1; }
.dp-err { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: #3a1414; color: #ffb3b3; font-size: 13px; line-height: 1.4; border: 1px solid #7a2a2a; }
.dp-sub {
  margin-top: 10px; width: 100%; min-height: 52px; border: 0; border-radius: 26px; background: var(--dp-accent); color: var(--dp-on-accent);
  font-size: 14px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase;
}
.dp-sub:disabled { opacity: 0.7; cursor: default; }
.dp[dir="rtl"] .dp-sub { letter-spacing: 0; text-transform: none; font-weight: 700; font-size: 15px; }
.dp-cm { margin-top: 8px; border-radius: 14px; background: var(--dp-surface-2); padding: 14px; }
.dp-cm-h { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 800; }
.dp-cm-h > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.dp-cm-stars { color: var(--dp-accent-text); letter-spacing: 0.1em; flex: none; }
.dp-cm p { margin: 6px 0 0; font-size: 13px; color: var(--dp-body); line-height: 1.5; overflow-wrap: anywhere; text-align: start; white-space: pre-wrap; }
.dp-none { margin: 10px 0 0; color: var(--dp-muted); font-size: 13px; }

/* dish effects (steam / glow / zoom) are drawn by dish-fx.css on [data-fx]; the photo box just has to clip them */
.dp-photo[data-fx] { overflow: hidden; }
