/* =========================================================================
   KANRI SUSHI — 3D Flipbook CSS (Premium Redesigned v4)
   Giao diện thực đơn lật trang cao cấp, tối sẫm huyền bí, sang trọng và phản hồi mượt mà.
   ========================================================================= */

:root {
  --book-bg: #090706;
  --paper-bg: #151210;
  /* Giấy tối mỹ thuật sần sẫm */
  --paper-text: #f5efe6;
  /* Chữ vàng kem dịu mắt */
  --cover-bg: #180d07;
  /* Gỗ mun hoàng gia sẫm */
  --shadow-color: rgba(0, 0, 0, 0.7);
  --gold: #d4af37;
  /* Vàng kim cổ điển */
  --gold-dark: #b89327;
  --gold-bright: #f3e5ab;
  --burgundy: #db4343;
  /* Đỏ chu sa sang trọng */
  --border-gold: rgba(212, 175, 55, 0.25);
  
  --charcoal: #110d0a;
  --charcoal-2: #1e1814;
  --charcoal-3: #2a221d;
  --white-soft: #f5efe6;
  --line-soft: rgba(212, 175, 55, 0.15);
  --muted: #a4988e;
  --muted-2: #6c6055;
  --radius-lg: 12px;
  --radius: 6px;
  --ease: cubic-bezier(0.25, 1, 0.35, 1);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', sans-serif;
}

html {
  overflow: hidden;
  height: 100svh;
  background: var(--charcoal);
}

body.menu-3d-page {
  background: var(--charcoal);
  color: var(--white-soft);
  margin: 0;
  padding: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Nền mờ ảo không gian nhà hàng KANRI SUSHI */
body.menu-3d-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(10, 8, 7, 0.92), rgba(10, 8, 7, 0.92)),
    url('https://res.cloudinary.com/dnymoihmp/image/upload/f_auto,q_auto,w_1800/v1783057959/ph%E1%BB%A5c_v%E1%BB%A5_cho_kh%C3%A1ch_hrtsyc.jpg') center/cover no-repeat;
  filter: blur(14px) brightness(0.25);
  transform: scale(1.15);
  pointer-events: none;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(0, 0, 0, 0.9) 100%);
}

/* =========================================================================
   HEADER & NAVIGATION TABS
   ========================================================================= */
.menu-3d-header {
  position: relative;
  z-index: 100;
  background: rgba(15, 13, 12, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.menu-3d-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--white-soft);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s;
}

.btn-back:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.08);
}

.brand {
  text-align: center;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name small {
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}

.swipe-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
}

.swipe-icon {
  animation: waveHand 2.2s infinite ease-in-out;
  display: inline-block;
  font-size: 1.1rem;
}

@keyframes waveHand {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg) translateX(-4px); }
}

/* Quick Jump Container */
.quick-jump-container {
  position: relative;
  z-index: 99;
  background: rgba(15, 13, 12, 0.5);
  border-bottom: 1px solid var(--line-soft);
  padding-block: 8px;
}

.quick-jump-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.quick-jump-nav::-webkit-scrollbar {
  display: none;
}

.quick-jump-chip {
  flex: none;
  background: rgba(30, 24, 20, 0.7);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  transition: all 0.25s var(--ease);
  cursor: pointer;
}

.quick-jump-chip:hover {
  color: var(--white-soft);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.05);
}

.quick-jump-chip.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

/* =========================================================================
   3D BOOK ENGINE (VIEWPORT & PERSPECTIVE)
   ========================================================================= */
.book-viewport {
  flex-grow: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  perspective: 2500px;
  padding: 24px;
  overflow: hidden;
  background: transparent;
}

.book-container {
  position: relative;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.35, 1);
  will-change: transform;
}

.book {
  position: relative;
  transform-style: preserve-3d;
  box-shadow:
    0 35px 90px rgba(0, 0, 0, 0.95),
    0 15px 30px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  width: 960px;
  height: 640px;
}

/* Bóng đổ ở giữa gáy sách chia đôi hai trang (Desktop) */
.book-spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 40px;
  transform: translateX(-50%) translateZ(2px);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 100;
  pointer-events: none;
}

/* =========================================================================
   PAGE SHEET & 3D TRANSFORMS
   ========================================================================= */
.page-sheet {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.35, 1), opacity 0.5s ease;
  z-index: 2;
  cursor: pointer;
}

.page-sheet.flipped {
  transform: rotateY(-180deg);
}

.page-sheet.peel-hover {
  transform: rotateY(-8deg);
}

/* Mặt trước và mặt sau của tờ thực đơn */
.page-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border-radius: 0 6px 6px 0;
  box-shadow: inset -1px 0 12px rgba(0, 0, 0, 0.3);

  /* Tạo vân giấy mỹ thuật sần tối cao cấp */
  background-color: var(--paper-bg);
  background-image:
    radial-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 0),
    radial-gradient(rgba(212, 175, 55, 0.02) 1.5px, transparent 0);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;

  color: var(--paper-text);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
}

/* Biện pháp chống nhấp nháy 3D (Z-fighting) cho Front và Back */
.page-face.front {
  transform: translateZ(1px);
}

.page-face.back {
  transform: rotateY(180deg) translateZ(1px);
  border-radius: 6px 0 0 6px;
}

/* Viền chỉ vàng kép trên trang giấy thực đơn */
.page-inner-border {
  position: absolute;
  inset: 16px;
  border: 1px solid var(--border-gold);
  pointer-events: none;
  z-index: 2;
}

.page-inner-border::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(212, 175, 55, 0.12);
}

/* Lớp phủ shadow tạo độ cong và chiều sâu cho trang */
.page-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.8s;
  z-index: 10;
}

.page-face.front::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0%, rgba(212, 175, 55, 0.01) 80%, transparent 100%);
}

.page-face.back::after {
  background: linear-gradient(-90deg, rgba(0, 0, 0, 0.15) 0%, rgba(212, 175, 55, 0.01) 80%, transparent 100%);
}

/* =========================================================================
   PAGE LAYOUTS (COVER, INTRO, MENU PAGES, BACK COVER)
   ========================================================================= */

/* 1. Trang Bìa (Menu Cover) */
.page-face.cover {
  background:
    radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.08) 0%, transparent 75%),
    linear-gradient(135deg, #1d120a 0%, #0a0604 100%);
  border: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.cover-border {
  border: 1px solid rgba(212, 175, 55, 0.5);
  padding: 48px 24px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

.cover-border::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(212, 175, 55, 0.25);
}

.cover-badge {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
  position: relative;
  z-index: 3;
}

.cover-title {
  font-family: var(--serif);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--gold-bright);
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
  margin-block: 28px 8px;
  position: relative;
  z-index: 3;
  letter-spacing: 0.02em;
}

.cover-subtitle {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--white-soft);
  opacity: 0.85;
  position: relative;
  z-index: 3;
}

.cover-decor {
  font-size: 1.3rem;
  color: var(--gold);
  margin-block: 20px;
  letter-spacing: 0.25em;
  position: relative;
  z-index: 3;
}

.cover-prompt {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: auto;
  animation: pulsePrompt 2s infinite ease-in-out;
  position: relative;
  z-index: 3;
}

@keyframes pulsePrompt {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 2. Trang Lời Ngỏ (Intro) & Cảm Ơn (Thankyou) */
.page-header {
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 8px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  position: relative;
  z-index: 3;
}

.page-header h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--gold-bright);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.page-num {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.intro-page-content, .thankyou-page-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  box-sizing: border-box;
}

.intro-body, .thankyou-body {
  margin-bottom: auto;
}

.intro-headline, .thankyou-headline {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold);
  margin-top: 10px;
  margin-bottom: 14px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
}

.intro-text, .thankyou-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--muted);
  text-align: justify;
  font-weight: 500;
  margin: 0;
}

.paper-featured-dish {
  margin-top: auto;
  border-top: 1px dashed var(--line-soft);
  padding-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.featured-img-wrap {
  width: 140px;
  aspect-ratio: 16/10;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.featured-img-wrap image-slot {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.paper-featured-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.paper-featured-tag {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.featured-sub {
  font-size: 0.8rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

/* Lời Cảm Ơn */
.contact-info-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(212, 175, 55, 0.04);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 55, 0.08);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.contact-text {
  font-size: 0.84rem;
  color: var(--white-soft);
  font-weight: 500;
}

.thankyou-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

.thankyou-actions .btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.78rem;
}

/* Trang trống nghệ thuật (Blank) */
.blank-page-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: rgba(212, 175, 55, 0.2);
  gap: 16px;
}

.blank-logo {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  font-weight: 600;
}

.blank-decor {
  font-size: 1.1rem;
}

/* =========================================================================
   GRID LAYOUT FOR DISH CARDS (Premium Luxury Style)
   ========================================================================= */
.page-menu-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  flex-grow: 1;
  position: relative;
  z-index: 3;
  align-content: start;
}

/* Thẻ món ăn mini nằm ngang, ảnh tròn viền vàng, nhãn giá đỏ */
.paper-menu-card-horizontal-mini {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.28s var(--ease);
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.paper-menu-card-horizontal-mini:hover {
  background: rgba(212, 175, 55, 0.06);
  transform: translateY(-2px);
  border-bottom-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.p-mini-image-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  border: 1.5px solid var(--gold);
  transition: all 0.3s;
  background: #1e1814;
}

.paper-menu-card-horizontal-mini:hover .p-mini-image-wrap {
  transform: scale(1.08) rotate(5deg);
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.p-mini-image-wrap image-slot {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-mini-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.p-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.p-mini-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white-soft);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.paper-menu-card-horizontal-mini:hover .p-mini-name {
  color: var(--gold-bright);
}

.p-mini-price-badge {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--burgundy);
  padding: 2px 10px;
  border-radius: 99px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 5px rgba(219, 67, 67, 0.3);
}

.p-mini-desc {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================================
   TEXT-ONLY LIST LAYOUT (Thêm & Nước)
   ========================================================================= */
.page-menu-list-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 36px;
  flex-grow: 1;
  position: relative;
  z-index: 3;
  align-content: start;
}

.paper-menu-list-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
}

.paper-menu-list-item:hover {
  background: rgba(212, 175, 55, 0.04);
  padding-inline: 8px;
  margin-inline: -8px;
  border-radius: var(--radius);
}

.p-list-item-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

.p-list-item-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white-soft);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-menu-list-item:hover .p-list-item-name {
  color: var(--gold-bright);
}

/* Dấu nối chấm thanh lịch kiểu cổ điển giữa tên và giá */
.p-list-item-dots {
  flex-grow: 1;
  border-bottom: 1.5px dotted rgba(212, 175, 55, 0.25);
  margin-inline: 10px;
  position: relative;
  top: -4px;
}

.p-list-item-price {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.paper-menu-list-item:hover .p-list-item-price {
  color: var(--gold-bright);
  transform: scale(1.03);
}

/* =========================================================================
   3. TRANG BÌA SAU (BACK COVER)
   ========================================================================= */
.page-face.back-cover {
  background:
    radial-gradient(circle at 50% 60%, rgba(212, 175, 55, 0.06) 0%, transparent 75%),
    linear-gradient(135deg, #180d07 0%, #0a0402 100%);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.15);
  color: var(--white-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.back-cover-inner {
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 36px 24px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

.back-cover-inner::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(212, 175, 55, 0.18);
}

.back-cover-logo {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold-bright);
  position: relative;
  z-index: 3;
  letter-spacing: 0.1em;
}

.back-cover-decor {
  font-size: 1.1rem;
  color: var(--gold);
  margin-block: 10px;
  position: relative;
  z-index: 3;
}

.back-cover-info {
  margin-block: auto;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 3;
  line-height: 1.6;
}

.back-cover-info strong {
  color: var(--white-soft);
}

.back-cover-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 220px;
  position: relative;
  z-index: 3;
  margin-top: 16px;
}

.back-cover-actions .btn {
  padding: 12px 18px;
  font-size: 0.8rem;
  font-weight: 700;
}

.back-cover-note {
  font-size: 0.72rem;
  color: var(--muted-2);
  margin: 0;
  margin-top: 14px;
  font-style: italic;
}

/* =========================================================================
   NAVIGATION BUTTONS & FOOTER
   ========================================================================= */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(20, 16, 14, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  color: var(--white-soft);
  display: grid;
  place-items: center;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  z-index: 100;
}

.nav-btn:hover {
  background: var(--gold);
  color: #241606;
  border-color: transparent;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.nav-btn.prev {
  left: 24px;
}

.nav-btn.next {
  right: 24px;
}

/* Book Footer */
.book-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding-block: 10px 24px;
  background: linear-gradient(to top, rgba(10, 8, 7, 0.8), transparent);
  flex: 0 0 auto;
}

.page-indicator {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* =========================================================================
   DISH MODAL STYLING (Luxury Dark Popup)
   ========================================================================= */
.dish-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  visibility: hidden;
  transition: visibility 0.4s;
}

.dish-modal.open {
  visibility: visible;
}

.dm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.dish-modal.open .dm-overlay {
  opacity: 1;
}

.dm-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--charcoal-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
  overflow: hidden;
}

.dish-modal.open .dm-card {
  transform: scale(1);
  opacity: 1;
}

.dm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
  color: var(--white-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s;
}

.dm-close:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-bright);
  border-color: var(--gold);
}

.dm-media {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
}

.dm-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-body {
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.dm-cat {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 8px;
}

.dm-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.dm-name {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--white-soft);
  margin: 0;
  font-weight: 700;
}

.dm-price {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold-bright);
  font-weight: 700;
}

.dm-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 20px;
  font-weight: 500;
}

.dm-ing-wrap {
  background: var(--charcoal-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
}

.dm-ing-title {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 700;
}

.dm-ing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
}

.dm-ing li {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--white-soft);
  font-weight: 500;
}

.dm-ing .ic {
  color: var(--gold);
}

/* =========================================================================
   RESPONSIVE LAYOUT (MOBILE VS DESKTOP)
   ========================================================================= */

/* Mobile Portrait (max-width: 900px) */
@media (max-width: 900px) {
  .menu-3d-header .header-inner {
    height: 56px;
    gap: 8px;
    padding-inline: 10px;
  }

  .btn-back {
    flex: 0 0 auto;
    gap: 5px;
    padding: 7px 10px;
    font-size: .7rem;
  }

  .btn-back span { white-space: nowrap; }
  .btn-back svg { width: 16px; height: 16px; }

  .menu-3d-header .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-name {
    white-space: nowrap;
    font-size: 1.05rem;
    letter-spacing: .06em;
  }

  .brand-name small {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .4rem;
    letter-spacing: .18em;
  }

  .swipe-hint {
    flex: 0 0 auto;
    gap: 0;
    font-size: 0;
  }

  .swipe-hint .swipe-icon { font-size: 1rem; }
  .swipe-hint > span:last-child { display: none; }
  .swipe-hint::after { content: "Vuốt"; font-size: .62rem; color: var(--muted); }

  .book-viewport {
    padding: 12px;
  }

  .nav-btn {
    display: none;
  }

  .book {
    width: 360px;
    height: 540px;
    max-width: none;
    max-height: none;
  }

  .page-sheet {
    width: 100%;
    transition: transform .36s cubic-bezier(.22, 1, .36, 1), opacity .22s ease;
    transform-style: flat; /* Disable 3D context on mobile */
    transform-origin: center center;
  }

  /* On mobile: flipped pages slide out to the left cleanly */
  .page-sheet.flipped {
    transform: translateX(-110%) scale(0.9);
    opacity: 0;
    pointer-events: none;
  }

  .page-sheet.peel-hover {
    transform: none;
  }

  .page-face {
    padding: 26px 24px;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.15);
  }

  /* Mặt sau không dùng trên mobile */
  .page-face.back {
    display: none;
  }

  .page-inner-border {
    inset: 12px;
  }

  .page-header {
    margin-bottom: 18px;
  }

  .page-header h2 {
    font-size: 1.45rem;
  }

  /* Trên di động, grid 2 hàng chập thành 1 hàng dọc (1 cột) */
  .page-menu-grid-2col {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .paper-menu-card-horizontal-mini {
    padding: 6px 8px;
    gap: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.06);
  }

  .p-mini-image-wrap {
    width: 56px;
    height: 56px;
  }

  .p-mini-name {
    font-size: 0.98rem;
  }

  .p-mini-desc {
    font-size: 0.74rem;
  }

  .page-menu-list-2col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cover-title {
    font-size: 2.5rem;
    margin-block: 22px 6px;
  }

  .cover-border {
    padding: 36px 18px;
  }

  .paper-featured-dish {
    padding-top: 14px;
    gap: 12px;
  }

  .featured-img-wrap {
    width: 100px;
  }

  .intro-headline, .thankyou-headline {
    font-size: 1.25rem;
    margin-bottom: 8px;
  }

  .intro-text, .thankyou-text {
    font-size: 0.8rem;
    line-height: 1.6;
  }

  .contact-info-list {
    margin-top: 14px;
    padding: 10px 14px;
    gap: 8px;
  }

  .thankyou-actions {
    margin-top: 16px;
    gap: 8px;
  }

  .thankyou-actions .btn {
    padding: 8px 10px;
  }

  .back-cover-logo {
    font-size: 1.7rem;
  }

  .back-cover-inner {
    padding: 28px 16px;
  }

  .back-cover-info {
    font-size: 0.78rem;
    gap: 8px;
  }

  .back-cover-actions {
    max-width: 100%;
  }

  .dish-modal {
    padding: 12px;
  }

  .dm-card {
    max-height: calc(100vh - 24px);
  }

  .dm-card {
    max-height: 94vh;
    overflow-y: auto;
  }

  .dm-body {
    padding: 16px;
  }

  .dm-name {
    font-size: 1.35rem;
  }

  .dm-price {
    font-size: 1.25rem;
  }

  .dm-desc {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .dm-ing {
    grid-template-columns: 1fr;
  }
}

/* Màn hình siêu nhỏ */
@media (max-width: 370px) {
  .book {
    height: 480px;
  }

  .page-face {
    padding: 20px 18px;
  }

  .page-inner-border {
    inset: 10px;
  }

  .page-header h2 {
    font-size: 1.3rem;
  }

  .p-mini-image-wrap {
    width: 46px;
    height: 46px;
  }

  .p-mini-name {
    font-size: 0.9rem;
  }

  .p-mini-price-badge {
    font-size: 0.65rem;
    padding: 1px 8px;
  }

  .p-mini-desc {
    display: none; /* Ẩn mô tả nếu màn hình quá chật */
  }

  .featured-img-wrap {
    display: none; /* Ẩn hình phụ để tránh chật chội */
  }
}

/* =========================================================================
   EDITORIAL REFRESH — cover artwork and readable menu items
   ========================================================================= */
.page-face.cover{
  background:
    linear-gradient(135deg,rgba(119,22,12,.26),transparent 28%),
    linear-gradient(315deg,rgba(210,164,70,.12),transparent 30%),
    repeating-linear-gradient(135deg,rgba(212,175,55,.035) 0 1px,transparent 1px 13px),
    radial-gradient(circle at 50% 42%,rgba(212,175,55,.14),transparent 42%),
    linear-gradient(145deg,#21130d 0%,#090605 100%);
}
.page-face.cover::before,.page-face.cover::after{
  content:""; position:absolute; pointer-events:none; z-index:1; opacity:.7;
}
.page-face.cover::before{
  inset:0;
  background:
    linear-gradient(135deg,transparent 0 8%,rgba(148,35,24,.5) 8.2% 9%,transparent 9.2% 14%,rgba(148,35,24,.28) 14.2% 14.7%,transparent 15%),
    linear-gradient(315deg,transparent 0 8%,rgba(212,175,55,.18) 8.2% 9%,transparent 9.2% 14%,rgba(212,175,55,.12) 14.2% 14.7%,transparent 15%);
  mix-blend-mode:screen;
}
.page-face.cover::after{
  inset:24px; border:1px solid rgba(212,175,55,.18); box-shadow:inset 0 0 0 5px rgba(212,175,55,.035),inset 0 0 50px rgba(0,0,0,.75);
}
.cover-border{ padding:30px 24px 26px; border-color:rgba(212,175,55,.56); z-index:2; }
.cover-border::before{ inset:5px; border-color:rgba(212,175,55,.22); }
.cover-pattern{ position:absolute; z-index:3; color:rgba(245,229,171,.72); font-family:var(--serif); font-size:.62rem; letter-spacing:.28em; writing-mode:vertical-rl; text-transform:uppercase; }
.cover-pattern-top{ top:28px; right:22px; }
.cover-pattern-top::before{ content:""; display:block; height:26px; width:1px; margin:0 auto 9px; background:var(--burgundy); }
.cover-badge{ letter-spacing:.32em; }
.cover-lockup{ position:relative; z-index:3; text-align:center; }
.cover-title{ font-size:clamp(2.5rem,4vw,3.5rem); margin:12px 0 5px; }
.cover-subtitle{ letter-spacing:.3em; font-size:.62rem; }
.cover-image-frame{ position:relative; z-index:3; width:min(76%,260px); aspect-ratio:1/1.08; margin:14px auto 2px; display:grid; place-items:center; border:1px solid rgba(212,175,55,.48); background:rgba(9,6,4,.5); box-shadow:0 18px 35px rgba(0,0,0,.36),inset 0 0 26px rgba(212,175,55,.06); }
.cover-image-frame::before,.cover-image-frame::after{ content:""; position:absolute; width:24px; height:24px; border-color:var(--gold); border-style:solid; opacity:.8; }
.cover-image-frame::before{ top:-5px; left:-5px; border-width:1px 0 0 1px; }
.cover-image-frame::after{ right:-5px; bottom:-5px; border-width:0 1px 1px 0; }
.cover-image-frame image-slot{ width:calc(100% - 18px); height:calc(100% - 18px); border:1px solid rgba(212,175,55,.16); }
.cover-image-caption{ position:absolute; bottom:18px; z-index:4; padding:5px 9px; color:rgba(245,239,230,.7); font-size:.55rem; letter-spacing:.16em; text-transform:uppercase; pointer-events:none; }
.cover-image-frame image-slot[data-filled] + .cover-image-caption{ display:none; }
.cover-decor{ position:relative; z-index:3; display:flex; align-items:center; gap:12px; color:var(--gold); font-size:.92rem; letter-spacing:.2em; }
.cover-decor span{ font-family:var(--serif); font-size:1.12rem; color:var(--gold-bright); }
.cover-prompt{ margin-top:5px; font-size:.6rem; letter-spacing:.14em; }
.page-menu-grid-2col{ gap:10px 24px; grid-auto-rows:minmax(78px,auto); }
.paper-menu-card-horizontal-mini{ align-items:flex-start; gap:12px; padding:9px 7px; border-bottom-color:rgba(212,175,55,.12); }
.paper-menu-card-horizontal-mini:focus-visible,.paper-menu-list-item:focus-visible{ outline:1px solid var(--gold); outline-offset:2px; }
.p-mini-image-wrap{ width:62px; height:50px; margin-top:2px; border-radius:5px 13px 5px 13px; border:1px solid rgba(212,175,55,.36); box-shadow:0 5px 14px rgba(0,0,0,.32); }
.paper-menu-card-horizontal-mini:hover .p-mini-image-wrap{ transform:translateY(-2px) scale(1.03); border-color:var(--gold-bright); box-shadow:0 5px 15px rgba(212,175,55,.22); }
.p-mini-header{ display:block; }
.p-mini-name{ display:block; min-width:0; white-space:normal; overflow:visible; text-overflow:clip; font-size:.91rem; line-height:1.12; }
.p-mini-price-badge{ display:inline-flex; align-items:center; margin-top:5px; border-radius:4px; background:transparent; color:var(--gold-bright); border:1px solid rgba(212,175,55,.35); padding:3px 7px; box-shadow:none; font-size:.66rem; }
.p-mini-desc{ display:none; }
.p-list-item-name{ white-space:normal; overflow:visible; text-overflow:clip; line-height:1.2; }
.p-list-item-dots{ opacity:.55; }
@media (max-width:900px){
  .cover-image-frame{ width:min(74%,230px); }
  .cover-pattern-top{ right:14px; }
}
@media (max-width:600px){
  .cover-border{ padding:24px 15px 20px; }
  .cover-title{ font-size:2.35rem; }
  .cover-image-frame{ width:70%; aspect-ratio:1/.96; margin-block:10px 0; }
  .cover-image-caption{ font-size:.48rem; letter-spacing:.1em; }
  .p-mini-image-wrap{ width:54px; height:44px; }
  .p-mini-name{ font-size:.86rem; }
  .p-mini-price-badge{ font-size:.6rem; padding:2px 6px; }
}

/* RESPONSIVE MENU FIT — full prices and safe page density */
@media (min-width: 901px) {
  .page-menu-grid-2col {
    align-content: stretch;
    grid-auto-rows: minmax(92px, 1fr);
  }

  .paper-menu-card-horizontal-mini {
    height: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 900px) {
  .page-face {
    padding: 22px 18px;
  }

  .page-menu-grid-2col {
    grid-template-columns: 1fr;
    align-content: start;
    grid-auto-rows: minmax(76px, auto);
    gap: 8px;
  }

  .paper-menu-card-horizontal-mini {
    padding: 7px 4px;
    gap: 10px;
  }

  .p-mini-image-wrap {
    width: 52px;
    height: 42px;
  }

  .p-mini-name {
    font-size: .84rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .p-mini-price-badge {
    margin-top: 4px;
    font-size: .63rem;
    padding: 3px 6px;
  }

  .page-menu-list-2col {
    grid-template-columns: 1fr;
    gap: 9px;
  }
}

/* =========================================================================
   STATIC PAGE IMAGE (v5) — full-bleed menu photo per page face
   ========================================================================= */

/* The image fills the entire face absolutely (ignores flex + padding) */
.page-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;          /* show full page — no cropping */
  object-position: center;
  z-index: 1;
  display: block;
  opacity: 0;
  transition: opacity 0.55s ease;
  border-radius: inherit;
  background: #0a0806;          /* dark bg while image loads */
}

/* Fade in once loaded */
.page-img.loaded {
  opacity: 1;
}

/* Decorative gold border sits on top of photo */
.page-inner-border {
  z-index: 3 !important;
}

/* Shimmer loading placeholder */
.page-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  background: transparent;
}

.page-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.08) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer-page 2.2s infinite linear;
}

@keyframes shimmer-page {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.ph-icon {
  font-size: 2rem;
  opacity: 0.1;
  position: relative;
  z-index: 1;
}

.ph-label {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 1rem;
  font-weight: 600;
  color: rgba(212, 175, 55, 0.28);
  letter-spacing: 0.12em;
  position: relative;
  z-index: 1;
}

.ph-hint {
  font-family: var(--sans, 'Montserrat', sans-serif);
  font-size: 0.58rem;
  color: rgba(212, 175, 55, 0.16);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* Stop shimmer once image has loaded */
.page-face.face-loaded .page-placeholder {
  display: none;
}

/* ─── Smoother flip transition override ─────────────────────────────────── */
.page-sheet {
  transition:
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.5s  ease;
}

/* Slightly lighten flipped pages to differentiate stack depth */
.page-sheet.flipped .page-face.front {
  filter: brightness(0.92);
}

/* Readable Vietnamese type for the flipbook. Decorative serif remains only
   on editorial headings; food names and controls need a stable sans face. */
:root{
  --serif:"Playfair Display", Georgia, serif;
  --sans:"Be Vietnam Pro", "Helvetica Neue", Arial, sans-serif;
  --book-bg:#171311;
  --paper-bg:#211b17;
  --paper-text:#fff8ed;
  --cover-bg:#211b17;
  --gold:#b78635;
  --gold-dark:#956725;
  --gold-bright:#f0d49b;
  --burgundy:#ad432f;
  --border-gold:rgba(183,134,53,.28);
  --charcoal:#171311;
  --charcoal-2:#211b17;
  --charcoal-3:#302720;
  --white-soft:#fff8ed;
  --line-soft:rgba(240,212,155,.16);
  --muted:#b8aa9c;
  --muted-2:#82766b;
}
body.menu-3d-page{
  font-family:var(--sans);
  font-synthesis:none;
  letter-spacing:0;
}
.brand-name{ letter-spacing:.045em; }
.brand-name small{ letter-spacing:.13em; }
.btn-back,.swipe-hint,.quick-jump-nav button{ letter-spacing:0; }
.cover-title,.paper-page-title,.p-detail-title,.p-list-title{ letter-spacing:-.02em; }
.p-mini-name,.p-list-item-name,.p-detail-name{
  font-family:var(--sans);
  font-weight:600;
  letter-spacing:-.012em;
  overflow-wrap:anywhere;
}
.p-mini-name{ line-height:1.28; }
.p-list-item-name{ line-height:1.34; }
.p-mini-price-badge,.p-list-item-price,.p-detail-price{
  font-family:var(--sans);
  font-weight:700;
  letter-spacing:-.015em;
}
.p-mini-desc,.p-list-item-desc,.p-detail-desc{ line-height:1.55; letter-spacing:0; }
@media (max-width:680px){
  .brand-name{ font-size:1.08rem; letter-spacing:.025em; }
  .brand-name small{ font-size:.46rem; letter-spacing:.09em; }
  .p-mini-name{ font-size:.88rem; line-height:1.3; }
  .p-list-item-name{ font-size:.9rem; line-height:1.36; }
  .p-mini-price-badge{ font-size:.63rem; }
}
