/* ============ Hana — cuốn menu lật trang (menu.html) ============
   Trang là ảnh xuất từ PDF menu in. Bố cục theo trang menu cũ của Hana (hana.hethongpos.com):
   cuốn menu chiếm trọn chiều cao màn hình trên nền gỗ, mũi tên mảnh sát hai mép,
   mọi điều hướng ẩn trong bảng trượt từ trái — mở bằng nút nhỏ ở góc trái.
   Màu xanh navy + cam và font Montserrat lấy đúng từ PDF menu. */
:root {
  --menu-navy: #012753;
  --menu-orange: #F08020;
  --font-menu: "Montserrat", system-ui, sans-serif;
}

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

/* trang menu không cuộn: lăn chuột = lật trang (js/menu-book.js) */
html:has(> body.menu-page) { height: 100%; overflow: hidden; overscroll-behavior: none; }
.menu-page {
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #C9B28C url("../assets/images/site/menu-bg-go.jpg") center / cover fixed;
  font-family: var(--font-menu);
}

/* ---------- cuốn menu: trọn chiều cao màn hình (kích thước do js/flipbook.js tính) ---------- */
.book-stage { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100svh; }
.fb { position: relative; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.fb-stage {
  position: absolute; inset: 0;
  perspective: 2600px;
  transition: transform .45s cubic-bezier(.2, .7, .3, 1);   /* bìa trước/sau tự căn giữa */
  cursor: grab;
  touch-action: none;
}
.fb-stage.is-dragging { cursor: grabbing; }
.fb.is-single .fb-stage { overflow: hidden; }

/* nền + bóng đổ dưới trang đang mở */
.fb-under { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--menu-navy); box-shadow: 0 6px 16px rgba(40, 25, 5, .28); }
.fb-under-l { left: 0; }
.fb-under-r { right: 0; }
.fb.is-single .fb-under { width: 100%; }

.fb-leaf { position: absolute; top: 0; height: 100%; transform-origin: left center; transform-style: preserve-3d; will-change: transform; }
.fb-face {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--menu-navy);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.fb-back { transform: rotateY(180deg); }
.fb-face img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

/* tờ đang bay: tối dần khi nghiêng + bóng đổ theo độ nhấc (--lift = 0…1) */
.fb-shade { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.fb-front .fb-shade { background: linear-gradient(to right, rgba(0, 0, 0, .55), rgba(0, 0, 0, .18) 45%, rgba(0, 0, 0, .08)); }
.fb-back .fb-shade { background: linear-gradient(to left, rgba(0, 0, 0, .55), rgba(0, 0, 0, .18) 45%, rgba(0, 0, 0, .08)); }
.fb-leaf.is-moving .fb-face { box-shadow: 0 0 calc(var(--lift) * 36px) rgba(0, 0, 0, calc(var(--lift) * .4)); }

/* Bóng gáy sách như menu cũ (đo từ ảnh chụp hana.hethongpos.com):
   trang trái — vệt sáng rồi tối dần vào nếp gáy (~20% bề rộng) + mép ngoài sáng nhẹ;
   trang phải — tối ở nếp gáy rồi một vệt sáng mờ (~14%). Bìa cứng không có bóng. */
.fb-face::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.fb-left:not(.fb-hard)::after {
  background:
    linear-gradient(to left,
      rgba(0, 0, 0, .22) 0%, rgba(0, 0, 0, .1) 4%, rgba(0, 0, 0, 0) 7%,
      rgba(255, 255, 255, .06) 11%, rgba(255, 255, 255, .05) 15%, rgba(255, 255, 255, 0) 21%),
    linear-gradient(to right, rgba(255, 255, 255, .025) 0%, rgba(255, 255, 255, 0) 45%);
}
.fb-right:not(.fb-hard)::after {
  background: linear-gradient(to right,
    rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .06) 3%, rgba(0, 0, 0, 0) 5%,
    rgba(255, 255, 255, .015) 7%, rgba(255, 255, 255, .015) 10%, rgba(255, 255, 255, 0) 14%);
}
/* điện thoại (từng trang): chỉ một dải tối mảnh ở mép gáy bên trái, như menu cũ */
.fb-single:not(.fb-hard)::after {
  background: linear-gradient(to right, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, .08) 3%, rgba(0, 0, 0, 0) 7%);
}

.book-arrow {
  position: fixed; top: 50%; z-index: 5;
  display: grid; place-items: center;
  width: 48px; height: 96px; margin-top: -48px;
  border: 0; background: transparent; color: #fff;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45));
}
.book-arrow svg { width: 22px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.book-arrow:hover { color: var(--menu-orange); }
.book-arrow:disabled { opacity: .2; cursor: default; color: #fff; }
.book-arrow-prev { left: 6px; }
.book-arrow-next { right: 6px; }

/* ---------- nút mở bảng điều hướng ---------- */
.panel-toggle {
  position: fixed; top: 12px; left: 12px; z-index: 20;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(1, 39, 83, .85); color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: background-color .15s;
}
.panel-toggle:hover { background: var(--menu-navy); }
.panel-toggle svg, .panel-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- bảng điều hướng ---------- */
.menu-panel {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  display: flex; flex-direction: column;
  width: min(320px, 86vw);
  padding: 14px 20px 24px;
  overflow-y: auto;
  background: var(--menu-navy); color: #fff;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .35);
  transform: translateX(-100%);
  visibility: hidden;          /* ẩn cả với phím Tab / trình đọc màn hình khi đóng */
  transition: transform .25s ease, visibility .25s;
}
.menu-panel.is-open { transform: none; visibility: visible; }
.panel-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .35); }
.panel-backdrop[hidden] { display: none; }

.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-logo img { display: block; width: 132px; height: auto; padding: 6px 10px; border-radius: 8px; background: #fff; }
.panel-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; cursor: pointer; }

.panel-site { display: flex; flex-direction: column; margin-top: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.panel-site a { padding: 7px 0; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none; }
.panel-site a:hover { color: var(--menu-orange); }

.panel-label { margin: 16px 0 4px; font: 700 20px var(--font-menu); color: var(--menu-orange); }
.panel-toc { display: flex; flex-direction: column; }
.panel-toc .tab {
  padding: 8px 0 8px 12px;
  border: 0; border-left: 3px solid transparent;
  background: none; color: rgba(255, 255, 255, .8);
  font: 400 15px var(--font-menu);
  text-align: left; text-transform: none; letter-spacing: 0;
  cursor: pointer;
}
.panel-toc .tab:hover { color: #fff; }
.panel-toc .tab[aria-current="true"] { color: #fff; font-weight: 500; border-left-color: var(--menu-orange); }

.panel-counter { margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, .65); }
.panel-sound {
  align-self: flex-start; margin-top: 10px; padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  background: transparent; color: #fff; font: 400 13px var(--font-menu); cursor: pointer;
}
.panel-sound[aria-pressed="false"] { color: rgba(255, 255, 255, .6); border-style: dashed; }
.menu-panel :focus-visible, .panel-toggle:focus-visible, .book-arrow:focus-visible { outline: 2px solid var(--menu-orange); outline-offset: 2px; }

.data-error { margin: 24px auto; max-width: 600px; padding: 16px; background: #FBE1DC; }

@media (max-width: 600px) {
  /* điện thoại: từng trang một (js/flipbook.js), lật bằng vuốt */
  .book-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-panel, .panel-toggle { transition: none; }
}
