/* ═══════════════════════════════════════════
   Ngọc Vị · Bản Vị — Thực đơn nhà hàng
   Ngôn ngữ thiết kế: nền trắng, sidebar tối giản,
   lưới masonry bo góc, bảng chi tiết dạng thông số.
═══════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --muted: #8f8f8f;
  --line: #ececec;
  --card-line: #e6e6e6;
  --soft: #f5f5f5;
  --pink: #e0338a;
  /* Typography: Cormorant Garamond (tiêu đề, thương hiệu, slogan) + Be Vietnam Pro (nội dung, menu, nút)
     — cả hai hỗ trợ đầy đủ dấu tiếng Việt. Chỉ dùng: sans 400/500/600, serif 500/600 + nghiêng 500. */
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --gold: #b5642c;
  --side: 248px;
  --info: 300px;
  --radius: 10px;
  --gap: 12px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
em { font-family: var(--serif); font-style: italic; font-weight: 500; }
/* tiêu đề: không để một chữ lẻ loi ở dòng cuối */
h1, h2, h3 { text-wrap: balance; }
/* Cormorant mặc định dùng số kiểu cổ (1 trông như ı) → số thẳng hàng */
:is(h1, h2, h3, em, .group__title, .modal__title, .branch__name) { font-variant-numeric: lining-nums; }
html:lang(ja) { --serif: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; --sans: "Be Vietnam Pro", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif; }
html:lang(ko) { --serif: "Cormorant Garamond", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", serif; --sans: "Be Vietnam Pro", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
html:lang(zh-Hans) { --serif: "Cormorant Garamond", "Songti SC", "STSong", "Noto Serif SC", serif; --sans: "Be Vietnam Pro", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
/* chữ nghiêng kiểu serif chỉ đẹp với chữ Latin → tiếng Nhật/Hàn/Trung dùng chữ thường */
html:is(:lang(ja), :lang(ko), :lang(zh-Hans)) em { font-family: var(--sans); font-style: normal; }

/* ═════════ SIDEBAR ═════════ */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--side);
  padding: 18px 16px 18px 16px;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.sidebar__top { display: flex; align-items: center; gap: 8px; margin-bottom: 34px;
  /* hiệu ứng trượt vào tạo lớp riêng cho cả thanh trên lẫn mục lục → đặt thanh trên cao hơn
     để menu ngôn ngữ xổ xuống không bị mục lục đè lên */
  position: relative; z-index: 3; }
.sidebar__top .logo { margin-right: auto; }

/* ═════════ CHỌN NGÔN NGỮ ═════════ */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 13px 7px 10px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .03em; line-height: 1.3; color: #fff8ef;
  /* nút nổi khối 3D màu đồng: mặt trên sáng, cạnh dưới đậm, bóng đổ */
  background: linear-gradient(180deg, #d98a4c 0%, #b5642c 55%, #9a4f1f 100%);
  border: 1px solid #8a4418;
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, .55), inset 0 -2px 0 rgba(0, 0, 0, .12),
              0 3px 0 #7a3a12, 0 6px 14px -2px rgba(122, 58, 18, .45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
  transform: translateY(0); transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .2s;
}
/* vòng sáng lan nhẹ để khách để ý tới nút */
.lang summary::before {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(217, 138, 76, .55); animation: langPulse 2.6s ease-out infinite;
}
@keyframes langPulse { 0% { box-shadow: 0 0 0 0 rgba(217, 138, 76, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(217, 138, 76, 0); } }
.lang summary::after { /* mũi tên xổ xuống */
  content: ""; width: 6px; height: 6px; margin: -3px 0 0 1px;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg); transition: transform .2s var(--ease);
}
.lang[open] summary::after { transform: translateY(3px) rotate(225deg); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { filter: brightness(1.06); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, .55), inset 0 -2px 0 rgba(0, 0, 0, .12),
              0 4px 0 #7a3a12, 0 9px 18px -3px rgba(122, 58, 18, .5); }
.lang summary:active, .lang[open] summary { transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, .4), inset 0 2px 4px rgba(0, 0, 0, .18),
              0 1px 0 #7a3a12, 0 2px 5px -1px rgba(122, 58, 18, .4); }
.lang[open] summary::before { animation: none; }
.lang summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); animation: langSpin 9s linear infinite; }
@keyframes langSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lang summary::before, .lang summary svg { animation: none; } }
/* menu nằm dưới <body>, vị trí top/left do JS tính theo nút; z-index trên mọi thứ trừ trình xem ảnh */
.lang__menu {
  position: fixed; top: 60px; left: 12px; z-index: 150;
  min-width: 150px; padding: 5px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 12px 32px -8px rgba(0, 0, 0, .22);
  display: none;
}
.lang__menu.is-open { display: grid; animation: langIn .18s var(--ease); }
@keyframes langIn { from { opacity: 0; transform: translateY(-4px); } }
.lang__menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border-radius: 8px; font-size: 14px; text-align: left;
}
.lang__menu button:hover { background: var(--soft); }
.lang__menu button[aria-checked="true"] { font-weight: 500; }
.lang__menu button[aria-checked="true"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b5642c; }

/* logo Vị (PNG nền trong suốt) */
.logo { display: block; }
.logo__mark { display: block; height: 40px; width: auto; }
.pill {
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid #e4e4e4; border-radius: 999px;
  padding: 4px 12px; font-size: 14px; line-height: 1.45;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .04);
  transition: background .2s, border-color .2s;
}
.pill:hover { background: var(--soft); }

.menu__label { color: #b9b9b9; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; line-height: 24px; margin-bottom: 0; }
.menu ul { list-style: none; margin-bottom: 26px; }
.menu__item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14.5px; font-weight: 500; line-height: 26px; color: #8c8c8c;
  transition: color .2s;
}
.menu__item:hover { color: var(--ink); }
.menu__item.is-active { color: var(--ink); }
.menu__item.is-active::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
}
/* gạch chân nét cọ vẽ tay */
.tag-new {
  font: 400 13px var(--sans); color: var(--pink);
  padding: 0 2px 4px; margin-left: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8' preserveAspectRatio='none'%3E%3Cpath d='M1 3.2C10 2 24 1.6 39 2.4M4 6.6C14 4.9 26 4.6 34 5.2' fill='none' stroke='%23e0338a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / 100% 7px;
}

.sidebar__foot { margin-top: auto; display: flex; gap: 18px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.sidebar__foot a { color: var(--ink-2); }
.sidebar__foot a:hover { color: var(--ink); }

.menu-toggle { display: none; }

/* ═════════ MAIN ═════════ */
.main { margin-left: var(--side); padding: 14px 16px 0 0; min-height: 100vh; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.intro__kicker { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.intro__text { margin-top: 10px; max-width: 56ch; color: var(--ink-2); font-size: 14px; line-height: 1.75; }
.intro__stats { display: flex; gap: 22px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.intro__stats b { color: var(--ink); font-weight: 500; margin-right: 4px; }

/* ═════════ NHÓM ═════════ */
/* tiêu đề nhóm kín đáo — cùng ngôn ngữ với nhãn "Duyệt" ở sidebar */
.group { scroll-margin-top: 0; padding-bottom: 16px; }
.group:first-child .group__head { padding-top: 4px; }
.group__head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: baseline; gap: 8px;
  padding: 14px 2px 8px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
}
.group__title { font: 600 clamp(19px, 1.2vw + 13px, 24px)/1.15 var(--serif); color: var(--ink); letter-spacing: .005em; }
.group__count { font-size: 14.5px; color: #c2c2c2; }
.group__note { margin-left: auto; font-size: 13px; color: #b0b0b0; text-align: right; }
.group__line {
  position: absolute; left: 2px; right: 0; bottom: 0; height: 1px; background: #f0f0f0;
  transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease);
}
.group__head.is-in .group__line { transform: none; }
.group__head > :not(.group__line) { opacity: 0; transform: translateY(8px); transition: opacity .6s, transform .7s var(--ease); }
.group__head.is-in > :not(.group__line) { opacity: 1; transform: none; }
.group__head.is-in .group__count { transition-delay: .08s; }
.group__head.is-in .group__note { transition-delay: .16s; }

/* ═════════ LƯỚI MASONRY ═════════ */
/* lưới theo hàng: thứ tự đọc trái → phải đúng như thứ tự trang menu */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); align-items: start; padding-top: 4px; }

.grid--masonry { display: block; columns: 3 230px; column-gap: var(--gap); }
.grid--masonry .card { break-inside: avoid; margin-bottom: var(--gap); }
.card {
  position: relative; display: block;
  border-radius: var(--radius); overflow: hidden;
  background: var(--soft);
  cursor: pointer;
  isolation: isolate;
  opacity: 0; transform: translateY(28px) scale(.98);
  transition: opacity .7s var(--ease), transform .8s var(--ease);
}
.card.is-in { opacity: 1; transform: none; }
/* viền mảnh vẽ đè lên ảnh: thấy trên thẻ sáng, chìm vào thẻ tối */
.card::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .09);
}
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.card__media { position: relative; overflow: hidden; }
.card__media img { display: block; width: 100%; height: auto; }
.card__media > img, .card__media > .ov { transition: transform .9s var(--ease); }
.card:hover .card__media > img, .card:hover .card__media > .ov { transform: scale(1.03); }

.card__avatar {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 9.5px var(--sans); letter-spacing: -.02em; color: #fff;
  box-shadow: 0 0 0 1.5px #fff, 0 1px 4px rgba(0, 0, 0, .25);
}
/* avatar là logo: nền trắng, logo nằm gọn trong vòng tròn
   (padding cố định — % sẽ tính theo bề rộng thẻ chứ không theo avatar) */
.is-logo { background: #fff; padding: 5px; }
.is-logo img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.card__arrow {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(40, 40, 40, .5); color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  transition: background .25s, transform .4s var(--ease);
}
.card__arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; }
.card:hover .card__arrow { background: var(--ink); transform: scale(1.1); }
.card__chip {
  position: absolute; left: 10px; top: 10px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(120, 120, 120, .45); color: #fff; font-size: 12px;
  backdrop-filter: blur(6px);
}
.card__count {
  position: absolute; right: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(70, 70, 70, .55); color: #fff; font-size: 12px;
}
/* chú thích hiện khi rê chuột */
.card__hover {
  position: absolute; left: 44px; right: 44px; bottom: 13px;
  font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s;
}
.card:hover .card__hover { opacity: 1; transform: none; }

/* ═════════ KHUYẾN MÃI: ảnh trung tâm + combo ═════════ */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px; align-items: center;
  padding: 6px 0 34px;
}
.card--feature { border-radius: 14px; box-shadow: 0 24px 50px -28px rgba(60, 30, 10, .55); }
.feature__title { font: 600 clamp(30px, 2.4vw + 18px, 44px)/1.05 var(--serif); letter-spacing: 0; }
.feature__lede { margin: 10px 0 22px; color: var(--ink-2); font-size: 15px; line-height: 1.75; max-width: 42ch; }
.tier { padding: 14px 0; border-top: 1px solid var(--line); }
.tier:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tier__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.tier__head b { font-weight: 500; font-size: 20px; color: #b5642c; letter-spacing: -.01em; }
.tier__meals { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tier__meals button {
  padding: 4px 11px; border-radius: 999px; font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--card-line); background: #fff;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tier__meals button:hover { background: #b5642c; color: #fff; box-shadow: none; }

.subhead { display: flex; align-items: baseline; gap: 8px; margin: 6px 2px 12px; font: 500 14.5px var(--sans); color: var(--muted); }
.subhead span:first-child { color: var(--ink); font-weight: 500; }
.subhead__count { color: #c2c2c2; }
.subhead ~ .grid { margin-bottom: 30px; }
/* Không gian: câu giới thiệu khu vực */
.subhead__lede { max-width: 640px; margin: -4px 2px 14px; font: 400 14px/1.75 var(--sans); color: var(--ink-2); }

/* thẻ combo có lời giới thiệu bên dưới ảnh */
.card--captioned { background: #fff; }
.card__caption { padding: 12px 14px 14px; }
.card__caption .card__title { font: 600 19px/1.2 var(--serif); }
.card__tagline { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.card__price { margin-top: 8px; color: var(--muted); font-size: 13px; }
.card__price b { color: #b5642c; font-weight: 500; }

/* ═════════ CHỮ DỊCH PHỦ LÊN ẢNH ═════════ */
.ov { position: relative; container-type: inline-size; }
.ov img { display: block; width: 100%; height: auto; }
.ov__layer { position: absolute; inset: 0; pointer-events: none; }
.ov__t {
  position: absolute; box-sizing: content-box;
  display: flex; align-items: center; white-space: nowrap;
  padding: 0 .35em; margin-left: -.35em; min-width: max-content;
  background: var(--bg); border-radius: .25em;
  /* mép nhoè cùng màu nền để nhãn hoà vào ảnh */
  box-shadow: 0 0 .3em .3em var(--bg);
  font-family: var(--sans); font-weight: 500; line-height: 1; letter-spacing: -.005em;
}
.ov__t.is-dark { color: #f7ecdc; }
.ov__t.is-light { color: #3d2412; }
.ov__t.is-title { font-weight: 600; }
.ov__t.is-note { font-style: italic; font-weight: 400; }
.ov__t.is-cell { min-width: 0; justify-content: center; text-align: center; margin-left: 0; padding: 0; white-space: normal; line-height: 1.05; }
/* tiêu đề cỡ lớn: mép nhoè hẹp lại để không lấn sang nhãn giá bên dưới */
.ov__t.is-title { box-shadow: 0 0 .12em .12em var(--bg); }
.ov__t.is-right { justify-content: flex-end; min-width: 0; }
/* tên món / câu chữ xuống nhiều dòng như bản gốc */
.ov__t.is-multi { min-width: 0; white-space: normal; line-height: 1.12; align-items: flex-start; flex-direction: column; justify-content: center; }
/* tiêu đề cách điệu Ngọc Vị: chữ mảnh in hoa, giãn chữ như bản gốc */
.ov__t.is-deco { font-weight: 400; text-transform: uppercase; letter-spacing: .06em; line-height: 1.08; }
.ov__t.is-multi.is-right { align-items: flex-end; text-align: right; }
.ov__t.is-serif { font-family: var(--serif); font-weight: 500; letter-spacing: 0; }
html:is(:lang(ja), :lang(ko), :lang(zh-Hans)) .ov__t.is-note { font-style: normal; }
/* "Xem ảnh gốc" → ẩn chữ phủ trong bảng chi tiết */
.modal.show-original .slide .ov__layer { display: none; }
.ov-toggle { margin-top: 14px; padding: 5px 13px; font-size: 13px; }
.ov-toggle[hidden] { display: none; }

/* ═════════ LIÊN HỆ ═════════ */
/* ═════════ GIỚI THIỆU ═════════ */
.about { padding: 72px 4px 56px; border-top: 1px solid var(--line); }
.about__body { max-width: 62ch; margin-top: 18px; display: grid; gap: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.about__body b { color: var(--ink); font-weight: 500; }
.about__motto { margin-top: 26px; font-size: clamp(24px, 1.6vw + 16px, 32px); line-height: 1.25; color: #b5642c; }
.about__thanks { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.about .intro__stats { margin-top: 26px; }

/* ═════════ LIÊN HỆ ═════════ */
.contact { padding: 64px 4px 64px; border-top: 1px solid var(--line); }
.branches { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin-top: 28px; max-width: 760px; }
.branch {
  border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: inset 0 0 0 1px var(--card-line);
}
.branch__name { color: var(--ink-2); font: 600 22px/1.2 var(--serif); }
.branch__phone { display: block; margin: 2px 0 14px; font: 500 24px/1.25 var(--sans); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.branch__phone:hover { color: #b5642c; }
.branch__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contact__address { margin-top: 16px; color: var(--muted); font-size: 14px; }
.contact__title { font: 600 clamp(30px, 2.6vw + 16px, 46px)/1.08 var(--serif); letter-spacing: 0; }
.contact__title em { font-size: 1em; color: #b5642c; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.contact__actions:empty { display: none; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--card-line); font-size: 14px; font-weight: 500;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--soft); }
.btn--dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--dark:hover { background: #333; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.btn--zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.btn--zalo:hover { background: #0057d6; }
.btn--fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn--fb:hover { background: #1366d6; }
.btn--fb svg { fill: currentColor; stroke: none; }

/* hiệu ứng chung khi cuộn tới */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-12px); } }
.sidebar__top, .menu, .sidebar__foot { animation: fadeIn .7s var(--ease) both; }
.menu { animation-delay: .08s; }
.sidebar__foot { animation-delay: .16s; }

/* ═════════ MODAL ═════════ */
.modal { position: fixed; inset: 0 0 0 var(--side); z-index: 40; visibility: hidden; }
.modal.is-open { visibility: visible; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(243, 243, 243, .86);
  backdrop-filter: blur(24px) saturate(.8);
  opacity: 0; transition: opacity .35s;
}
.modal.is-open .modal__backdrop { opacity: 1; }

.modal__info {
  position: absolute; inset: 0 auto 0 0; width: var(--info);
  background: #fff;
  padding: 16px 18px 40px;
  overflow-y: auto; text-align: center;
  opacity: 0; transform: translateX(-16px);
  transition: opacity .35s, transform .5s var(--ease);
}
.modal.is-open .modal__info { opacity: 1; transform: none; }
.modal__bar { display: flex; justify-content: space-between; margin-bottom: 18px; }
.modal__nav { display: flex; gap: 6px; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #efefef;
  transition: background .2s;
}
.icon-btn:hover { background: #e2e2e2; }
.icon-btn svg { width: 13px; height: 13px; fill: none; stroke: #9a9a9a; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] svg { fill: var(--ink); stroke: var(--ink); }

.modal__avatar {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; color: #fff; font: 600 13px var(--sans);
}
.modal__avatar.is-logo { padding: 9px; box-shadow: inset 0 0 0 1px var(--card-line); }
.modal__cat { color: #8c8c8c; font-size: 15px; line-height: 1.3; }
.modal__title { font: 600 24px/1.2 var(--serif); margin: 4px 0 12px; }
.modal__desc { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; text-wrap: pretty; padding: 0 2px; }
.modal__date { color: #8c8c8c; font-size: 14px; margin: 14px 0 26px; }

.dishes { text-align: left; margin-top: 16px; }
.dishes:empty { display: none; }
.dishes__head { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.dishes ul { list-style: none; border-top: 1px solid var(--line); }
.dishes li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.35;
}
.dish__name small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.dishes li b { font-weight: 600; color: #b5642c; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dishes__hint { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.meta { text-align: left; font-size: 14.5px; line-height: 1.3; }
.meta div { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; border-bottom: 1px solid #e8e8e8; }
.meta div:last-child { border-bottom: 0; }
.meta dt { color: var(--muted); white-space: nowrap; }
.modal__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.modal__links .btn { padding: 5px 13px; font-size: 13px; }
.meta dd { text-align: right; }

/* Vùng ảnh = dải trượt ngang: vuốt / cuộn trái-phải để xem trang trước-sau,
   scroll-snap giữ mỗi lần dừng đúng một ảnh */
.modal__media {
  position: absolute; inset: 0 0 0 var(--info);
  display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  opacity: 0; transform: scale(.97) translateY(14px);
  transition: opacity .45s .08s, transform .6s .08s var(--ease);
}
.modal__media::-webkit-scrollbar { display: none; }
.modal.is-open .modal__media { opacity: 1; transform: none; }
/* flex (không dùng grid): để max-height:100% của ảnh tính theo chiều cao slide */
.slide {
  flex: 0 0 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  scroll-snap-align: center; scroll-snap-stop: always;
  perspective: 1100px;            /* chiều sâu cho hiệu ứng lật trang 3D */
  contain: layout paint;
}
.slide > * {
  backface-visibility: hidden;
  max-width: min(100%, 760px); max-height: 100%;
  width: auto; height: auto;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  background: var(--soft);
}
/* Lật trang 3D chạy bằng CSS theo vị trí cuộn (scroll-driven animation) — trên luồng đồ hoạ,
   luôn khớp ngón tay. 0% = trang nằm hẳn bên phải, 50% = ở giữa, 100% = đã sang hẳn bên trái. */
@keyframes page-turn {
  0%   { transform: translateZ(-180px) rotateY(-42deg) scale(.94); transform-origin: left center; opacity: .55; }
  50%  { transform: none; transform-origin: center; opacity: 1; }
  100% { transform: translateZ(-180px) rotateY(42deg) scale(.94); transform-origin: right center; opacity: .55; }
}
@supports (animation-timeline: view()) {
  .slide { view-timeline: --page inline; }
  .slide > * { animation: page-turn linear both; animation-timeline: --page; animation-range: cover 0% cover 100%; }
}
/* ảnh có chữ phủ: khung bọc không tự co theo ảnh → tính bề rộng theo tỉ lệ cao/rộng (--ar) */
.slide > .ov { width: min(760px, 100%, calc((100vh - 80px) / var(--ar))); overflow: hidden; }

/* bộ đếm trang "12 / 75" */
.modal__count {
  position: absolute; top: 16px; left: calc(var(--info) + (100% - var(--info)) / 2); z-index: 2;
  transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--card-line);
  font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  pointer-events: none; opacity: 0; transition: opacity .3s .2s;
}
.modal.is-open .modal__count { opacity: 1; }

/* ═════════ RESPONSIVE ═════════ */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 860px) {
  :root { --side: 0px; }
  .sidebar {
    inset: 0 0 auto 0; width: 100%; height: 56px;
    padding: 13px 16px; overflow: hidden;
    border-bottom: 1px solid var(--line);
    transition: height .45s var(--ease);
  }
  body.menu-open .sidebar { height: 100vh; height: 100dvh; }
  .sidebar__top { margin-bottom: 28px; gap: 10px; }
  /* hiệu ứng trượt (transform) biến thanh trên thành khung chứa → menu bị cắt trong thanh cao 56px */
  .sidebar__top { animation: none; }
  .menu-toggle { display: grid; gap: 5px; width: 30px; height: 30px; place-content: center; }
  .logo__mark { height: 30px; }
  .menu-toggle span { width: 16px; height: 1.5px; background: var(--ink); transition: transform .3s; }
  body.menu-open .menu-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  body.menu-open .menu-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .menu__item { font-size: 22px; font-weight: 500; line-height: 1.45; letter-spacing: -.01em; }
  .menu__label { font-size: 13px; }
  .tag-new { font-size: 15px; }

  .main { padding: 56px 12px 0; }
  .group__head { top: 56px; }
  .group__note { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid--masonry { columns: 2; column-gap: 10px; }
  .feature { grid-template-columns: 1fr; gap: 20px; padding-bottom: 26px; }
  .card__caption { padding: 10px 10px 12px; }
  .card__caption .card__title { font-size: 17px; }
  .card__tagline { font-size: 12.5px; }
  .card__price { font-size: 12px; }
  .grid--masonry .card { margin-bottom: 10px; }
  .contact, .about { padding: 48px 4px 44px; }
  .branch__phone { font-size: 22px; }
  .branch__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .branch__actions .btn { justify-content: center; padding: 8px 4px; font-size: 13px; gap: 5px; }

  .modal { inset: 0; }
  .modal__info { inset: auto 0 0 0; width: auto; max-height: 52vh; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .08); transform: translateY(30px); padding-top: 12px; }
  .modal__media { inset: 0 0 auto 0; height: 48vh; }
  .slide { padding: 48px 16px 12px; }
  .slide > .ov { width: min(100%, calc((48vh - 60px) / var(--ar))); }
  .modal__count { left: 50%; top: 14px; backdrop-filter: none; background: #fff; }
  /* bỏ làm mờ nền toàn màn hình trên điện thoại: GPU phải ghép lại mỗi khung hình khi vuốt */
  .modal__backdrop { backdrop-filter: none; background: #f1f1f1; }
  /* lưới phía sau bị che kín khi mở bảng chi tiết → ngừng vẽ để GPU chỉ lo dải ảnh */
  body.modal-open .main, body.modal-open .sidebar { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card, .reveal, .group__head > * { opacity: 1 !important; transform: none !important; }
}

/* ═════════ XEM ẢNH TOÀN MÀN HÌNH + PHÓNG TO ═════════ */
.slide > * { cursor: zoom-in; }
.zoom {
  position: fixed; inset: 0; z-index: 200;
  background: #0e0a08;
  opacity: 0; transition: opacity .25s;
  touch-action: none;              /* cử chỉ chụm / kéo do JS xử lý */
  overscroll-behavior: contain;
}
.zoom[hidden] { display: none; }
.zoom.is-open { opacity: 1; }
.zoom__stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.zoom.is-zoomed .zoom__stage { cursor: grab; }
.zoom.is-zoomed .zoom__stage:active { cursor: grabbing; }
/* ảnh vừa khít màn hình (giữ tỉ lệ), phóng to bằng transform để mượt */
.zoom__pic {
  width: min(100vw, calc(100dvh / var(--ar, 1.414)));
  will-change: transform; transform-origin: center;
  user-select: none; -webkit-user-select: none;
}
.zoom__pic img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.zoom__pic > .ov { width: 100%; }
.zoom.show-original .ov__layer { display: none; }
.zoom__close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 14, 10, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); backdrop-filter: blur(8px);
  transition: background .2s;
}
.zoom__close:hover { background: rgba(20, 14, 10, .75); }
.zoom__close svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
/* thanh trên: số thứ tự + tên trang */
.zoom__bar {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 70px;
  display: flex; align-items: center; gap: 10px; min-height: 42px;
  color: #fff; pointer-events: none;
}
.zoom__count {
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-variant-numeric: tabular-nums;
  background: rgba(20, 14, 10, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.zoom__title { font: 600 20px/1.2 var(--serif); font-variant-numeric: lining-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
/* nút ← → hai bên */
.zoom__nav {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 14, 10, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); backdrop-filter: blur(8px);
  transition: background .2s, opacity .3s;
}
.zoom__nav:hover { background: rgba(20, 14, 10, .8); }
.zoom__nav--prev { left: 14px; }
.zoom__nav--next { right: 14px; }
.zoom__nav svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.zoom.is-zoomed :is(.zoom__nav, .zoom__bar, .zoom__orig) { opacity: 0; pointer-events: none; }
/* "Xem ảnh gốc" (trang có chữ dịch) */
.zoom__orig {
  position: absolute; left: 50%; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 40px); translate: -50% 0;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap;
  background: rgba(181, 100, 44, .9); transition: opacity .3s;
}
.zoom__orig[hidden] { display: none; }
@media (max-width: 860px) {
  .zoom__nav { width: 38px; height: 38px; top: auto; bottom: calc(max(18px, env(safe-area-inset-bottom)) - 4px); translate: none; }
  .zoom__title { font-size: 17px; }
}
.zoom__hint {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 6px 14px; border-radius: 999px;
  background: rgba(20, 14, 10, .6); color: rgba(255, 255, 255, .9);
  font-size: 12.5px; white-space: nowrap; pointer-events: none;
  transition: opacity .3s;
}
.zoom.is-zoomed .zoom__hint { opacity: 0; }


.notfound { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.notfound img { width: 64px; height: auto; margin-bottom: 8px; }
.notfound h1 { font: 600 32px/1.15 var(--serif); }
.notfound p { color: var(--muted); max-width: 36ch; }
.notfound .btn { margin-top: 8px; }
