/* Sample 05: the full menu and a touch-friendly, pinned detail toolbar. */
:root {
  --cream: #fff6e7;
  --paper: #fffdf7;
  --ink: #3b2824;
  --muted: #765d50;
  --line: #e4cbae;
  --red: #c51f2b;
  --wood: #98623f;
  --soft: #f6e5cd;
  --toolbar-height: 62px;
}
html { scroll-padding-top: calc(var(--header-height) + var(--toolbar-height) + 14px); }
body { background-image: url("assets/clouds-red.svg?v=775921110b05"); background-size: 680px 480px; }
.preview-ribbon { background: #c51f2b; color: #fff6e7; letter-spacing: .5px; }
.preview-dot { background: #ffe1b5; }
.site-header { background: rgba(255,246,231,.97); border-bottom-color: #dec09c; }
.brand-zh, .footer-brand { color: #c51f2b; }
.brand-mark { background: var(--red); color: #fff6e7; }
.brand-en { color: #765d50; }
.languages { border-color: #dfc1a1; background: #fffbf3; }
.nav-link.active { color: var(--red); }
.nav-link::after { background: var(--red); }
.hero { padding-block: 54px 58px; }
.hero h1 { color: var(--red); }
.hero-subtitle { color: #98623f; }
.hero-figure::before { border-color: #c51f2b; border-width: 2px; }
.photo-frame { box-shadow: 0 15px 40px -24px #80503a45; border: 1px solid #dfc1a1; }
.seal { color: #fff6e7; background: #c51f2b; border-color: #c51f2b; }
.button-primary { background: var(--red); }
.button-primary:hover { background: #a51923; }
.menu-background { background: #faecd8 url("assets/clouds-red.svg?v=775921110b05") 160px 35px / 680px 480px; border-color: #e4cbae; }
.menu-section { padding-block: 46px 48px; }
.menu-title-row { margin-bottom: 19px; }
.menu-title-row h2 { font-size: 35px; color: #3b2824; }
.menu-subtitle { margin-top: 7px; }
.menu-count strong { font-size: 43px; color: var(--red); }
.menu-search-row { display: flex; justify-content: flex-end; margin: 0 0 14px; }
.search-box { flex: 0 1 400px; border-color: #dfc1a1; background: #fffbf3; padding-block: 9px; }
.search-box svg, .search-box input::placeholder { color: #80675a; }
.menu-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 16;
  min-height: var(--toolbar-height);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  background: #faecd8;
  border-top-color: #e0c4a2;
  border-bottom-color: #e0c4a2;
}
.filter-group { flex: 1; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #d8b99b transparent; padding-bottom: 3px; }
.filter-group::-webkit-scrollbar { height: 3px; }
.filter-group::-webkit-scrollbar-thumb { background: #d8b99b; border-radius: 3px; }
.filter { flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; color: #67463a; min-height: 39px; }
.filter-count { font-family: var(--sans); font-size: 10px; opacity: .75; font-variant-numeric: tabular-nums; }
.filter:hover { background: #f2dcc0; }
.filter.active { background: var(--red); }
.view-toggle { display: flex; flex-shrink: 0; gap: 2px; padding: 2px; border: 1px solid #dfc1a1; border-radius: 5px; background: #fffbf3; }
.view-toggle button { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 3px; background: transparent; color: #80675a; }
.view-toggle button[aria-pressed=true] { background: var(--red); color: #fff6e7; }
.view-toggle svg { width: 19px; height: 19px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.menu-meta { padding: 13px 0; color: #765d50; }
.menu-meta p { min-width: 0; }
.menu-meta > span { flex-shrink: 0; }
#menu-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; align-items: stretch; }
.menu-group-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 17px 0 8px; border-bottom: 1px solid var(--line); }
.menu-group-heading:first-child { padding-top: 0; }
.menu-group-heading h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--red); }
.menu-group-heading > span { flex-shrink: 0; font-size: 11px; color: var(--muted); }
#menu-grid .dish-card { border-color: #e4cbae; border-radius: 6px; background: #fffdf7; }
#menu-grid .dish-image { display: block; flex: 0 0 auto; width: 100%; aspect-ratio: 744 / 468; background: #fff; border-bottom: 1px solid #f0e4d5; }
#menu-grid .dish-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
#menu-grid .dish-card:hover { border-color: #c51f2b; box-shadow: 0 10px 25px -18px #71352d35; }
#menu-grid .dish-copy { min-width: 0; padding: 15px 17px 13px; }
#menu-grid .dish-name { font-size: 20px; margin-bottom: 4px; }
html[lang="zh-CN"] #menu-grid .dish-name[lang="zh-CN"],
html[lang="zh-CN"] .detail-copy h2[lang="zh-CN"] { font-weight: 700; }
#menu-grid .dish-name-secondary { color: #765d50; }
#menu-grid .dish-bottom { margin-top: auto; padding-top: 12px; min-height: 40px; }
#menu-grid .dish-price { font-size: 24px; color: #c51f2b; font-variant-numeric: tabular-nums; }
#menu-grid .dish-detail-label { color: #98623f; }
.menu-footnote { color: #765d50; margin-top: 19px; }
.visit-section { background: var(--red); border-top: 4px solid #e4cbae; }
.visit-section::before { inset: 0; width: 100%; background: url("assets/clouds-cream.svg?v=028ee9edf02b") center / 680px 480px; }
.visit-inner { padding-block: 47px; }
.contact-actions .button-cream { background: #fff6e7; color: #c51f2b; }
.contact-actions .button-cream:hover { background: #fffdf7; }
.contact-actions .button-outline { border-color: #edb7a1; }
.detail-price strong { color: var(--red); }
.detail-price strong.market-price { font-family: var(--sans); font-size: 24px; font-weight: 600; line-height: 1.5; }
#menu-grid .dish-price.market-price { font-family: var(--sans); font-size: 17px; font-weight: 600; line-height: 1.5; }
.detail-pricing-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 6px; }
.site-footer { min-height: 111px; }
.mobile-actions { display: none; }

/* The optional list keeps all three names visible while using smaller photos. */
#menu-grid[data-view=list] { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#menu-grid[data-view=list] .dish-card { display: grid; grid-template-columns: 120px minmax(0,1fr); padding: 12px; gap: 14px; align-items: start; }
#menu-grid[data-view=list] .dish-image { width: 120px; border-radius: 4px; align-self: center; }
#menu-grid[data-view=list] .dish-copy { padding: 0; }
#menu-grid[data-view=list] .dish-name { font-size: 17px; margin-bottom: 3px; }
#menu-grid[data-view=list] .dish-name-secondary[lang=en] { font-size: 11px; }
#menu-grid[data-view=list] .dish-name-secondary[lang=km] { font-size: 14px; line-height: 1.65; margin-top: 2px; }
#menu-grid[data-view=list] .dish-bottom { padding-top: 6px; }
#menu-grid[data-view=list] .dish-price { font-size: 19px; }
#menu-grid[data-view=list] .image-expand { display: none; }

@media(max-width:900px) {
  #menu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
  #menu-grid[data-view=list] { grid-template-columns: 1fr; }
  #menu-grid[data-view=list] .dish-card { grid-template-columns: 110px minmax(0,1fr); gap: 16px; }
  #menu-grid[data-view=list] .dish-image { width: 110px; }
}

@media(max-width:650px) {
  :root { --header-height: 64px; --toolbar-height: 58px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body, .menu-background, .visit-section::before { background-size: 510px 360px; }
  .wrap { width: calc(100% - 32px); }
  .preview-ribbon { min-height: 23px; font-size: 10px; padding-block: 2px; }
  .header-inner { display: flex; min-height: var(--header-height); padding-block: 8px; gap: 14px; }
  .brand-zh { font-size: 24px; line-height: 1.2; letter-spacing: 3px; }
  .brand-en { font-size: 7px; letter-spacing: 1.25px; }
  .primary-nav { display: none; }
  .languages { padding: 2px; }
  .languages button { padding: 5px 9px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding-block: 26px 29px; }
  .hero h1 { font-size: 36px; line-height: 1.32; margin-top: 12px; }
  .hero-subtitle { font-size: 15px; margin-top: 12px; letter-spacing: 2px; }
  .hero-description { display: none; }
  .hero-actions { margin-top: 18px; gap: 24px; }
  .hero-actions .button { min-height: 44px; padding: 10px 21px; }
  .hero-figure figcaption { padding-top: 8px; }
  html[lang=en] .hero h1 { font-size: 40px; }
  html[lang=km] .hero h1 { font-size: 30px; line-height: 1.6; }
  html[lang=km] .hero-subtitle { font-size: 15px; }
  .menu-section { padding-block: 25px 28px; }
  .menu-title-row { gap: 16px; margin-bottom: 14px; }
  .menu-title-row h2 { font-size: 28px; margin-top: 4px; }
  html[lang=km] .menu-title-row h2 { font-size: 24px; line-height: 1.6; }
  .menu-title-row .eyebrow { font-size: 9px; }
  .menu-subtitle { display: none; }
  .menu-count { gap: 0; }
  .menu-count strong { font-size: 30px; }
  .menu-count span { margin-top: 3px; }
  .menu-search-row { margin-bottom: 10px; }
  .search-box { flex: 1; min-height: 42px; padding: 7px 11px; }
  .search-box input { font-size: 12px; }
  .menu-toolbar { min-height: var(--toolbar-height); gap: 8px; padding-block: 7px; }
  .filter-group { justify-content: flex-start; gap: 3px; }
  .filter { padding: 8px 11px; min-height: 39px; font-size: 12px; }
  .filter-count { font-size: 9px; }
  html[lang=km] .filter { padding-inline: 9px; }
  html[lang=en] .filter { padding-inline: 8px; font-size: 11px; }
  .view-toggle button { width: 34px; height: 36px; padding: 7px; }
  .view-toggle svg { width: 18px; height: 18px; }
  .menu-meta { padding: 10px 0; font-size: 10px; gap: 10px; }
  .menu-group-heading { padding-top: 14px; }
  .menu-group-heading h3 { font-size: 17px; }
  .menu-group-heading > span { font-size: 10px; }
  #menu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: stretch; }
  #menu-grid .dish-card { border-radius: 5px; transform: none; box-shadow: none; }
  #menu-grid .dish-image { aspect-ratio: 744/468; }
  #menu-grid .dish-copy { padding: 9px 9px 8px; }
  #menu-grid .dish-name { font-size: 15px; line-height: 1.4; margin-bottom: 4px; }
  #menu-grid .dish-name[lang=en] { font-size: 15px; line-height: 1.35; }
  #menu-grid .dish-name[lang=km] { font-size: 15px; line-height: 1.65; }
  #menu-grid .dish-name-secondary[lang=zh-CN] { font-size: 12px; line-height: 1.5; margin-top: 1px; }
  #menu-grid .dish-name-secondary[lang=en] { font-size: 11px; line-height: 1.45; margin-top: 1px; }
  #menu-grid .dish-name-secondary[lang=km] { font-size: 13px; line-height: 1.65; margin-top: 3px; }
  #menu-grid .dish-bottom { padding-top: 9px; gap: 6px; }
  #menu-grid .dish-bottom { min-height: 33px; }
  #menu-grid .dish-price { font-size: 20px; }
  #menu-grid .dish-price span { font-size: 8px; margin-left: 4px; letter-spacing: .3px; }
  #menu-grid .dish-detail-label { font-size: 0; gap: 0; }
  #menu-grid .dish-detail-label svg { width: 15px; height: 15px; }
  #menu-grid .image-expand { display: none; }
  #menu-grid[data-view=list] { grid-template-columns: 1fr; gap: 9px; }
  #menu-grid[data-view=list] .dish-card { grid-template-columns: 91px minmax(0,1fr); gap: 12px; padding: 10px; }
  #menu-grid[data-view=list] .dish-image { width: 91px; }
  #menu-grid[data-view=list] .dish-copy { padding: 0; }
  #menu-grid[data-view=list] .dish-name { font-size: 15px; line-height: 1.4; margin-bottom: 3px; }
  #menu-grid[data-view=list] .dish-name[lang=km] { line-height: 1.65; }
  #menu-grid[data-view=list] .dish-name-secondary[lang=en] { font-size: 11px; line-height: 1.45; }
  #menu-grid[data-view=list] .dish-name-secondary[lang=km] { font-size: 13px; line-height: 1.65; margin-top: 2px; }
  #menu-grid[data-view=list] .dish-bottom { padding-top: 5px; }
  #menu-grid[data-view=list] .dish-price { font-size: 18px; }
  .menu-footnote { font-size: 10px; margin-top: 16px; }
  .visit-inner { padding-block: 31px; gap: 25px; }
  .visit-copy h2 { font-size: 29px; }
  .site-footer { min-height: 102px; }
  .mobile-actions {
    position: fixed;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    left: 0; right: 0; bottom: 0;
    z-index: 22;
    min-height: 64px;
    gap: 6px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #fff6e7;
    border-top: 1px solid #e4cbae;
    box-shadow: 0 -3px 15px #58262010;
  }
  .mobile-actions a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; min-height: 44px; border-radius: 5px; font-size: 12px; color: #67463a; }
  .mobile-actions svg { width: 18px; height: 18px; }
  .mobile-actions .quick-menu { background: var(--red); color: #fff6e7; }
  html[lang=km] .mobile-actions a { font-size: 12px; gap: 6px; }
}

@media(max-width:360px) {
  .wrap { width: calc(100% - 24px); }
  .brand-zh { font-size: 22px; }
  .brand-en { font-size: 6px; }
  .languages button { padding-inline: 7px; }
  .hero h1 { font-size: 34px; }
  html[lang=en] .hero h1 { font-size: 37px; }
  html[lang=km] .hero h1 { font-size: 28px; }
  #menu-grid { gap: 8px; }
  #menu-grid .dish-copy { padding-inline: 8px; }
  #menu-grid[data-view=list] .dish-card { grid-template-columns: 81px minmax(0,1fr); gap: 10px; }
  #menu-grid[data-view=list] .dish-image { width: 81px; }
  .mobile-actions { padding-inline: 12px; }
}

/* The close control has its own row, outside the scrollable photo and text. */
#dish-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#dish-dialog .dialog-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px 10px 22px; min-height: 64px; background: var(--paper); border-bottom: 1px solid var(--line); }
.dialog-toolbar p { font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--muted); }
#dish-dialog .dialog-close { position: static; inset: auto; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0; margin: 0; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 50%; background: var(--cream); color: var(--red); line-height: 1; touch-action: manipulation; }
#dish-dialog .dialog-close svg { display: block; width: 20px; height: 20px; margin: 0; stroke-width: 2; pointer-events: none; }
#dish-dialog .dialog-close:hover { border-color: var(--red); background: #faecd8; }
#dish-dialog .detail-layout { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#dish-dialog .detail-image-wrap { padding-top: 0; }
#dish-dialog .text-link svg { width: 15px; height: 15px; }
@media(max-width:650px) {
  #dish-dialog .dialog-toolbar { padding: 8px 12px 8px 20px; min-height: 60px; }
  #menu-grid .dish-price.market-price { font-size: 14px; }
  .detail-price strong.market-price { font-size: 22px; }
}
