/* 咖啡小舖：3D 場景（cafe.html）和商品頁（product.html）共用 */
:root {
  --ink: #3a2a28;
  --ink-soft: #6f5d58;
  --cream: #f7f0e7;
  --paper: #fffaf4;
  --card: rgba(255, 250, 244, 0.94);
  --line: rgba(58, 42, 40, 0.12);
  --burgundy: #6e2f32;
  --burgundy-soft: #8a4346;
  --peach: #eba980;
  --sage: #9fb58c;
  --rose-bg: #c9b0ad;
  --shadow: 0 14px 36px rgba(70, 40, 40, 0.18);
  /* 浮在場景上的次要控制（樓層切換、操作說明）：半透明毛玻璃、淡淡的影子，不搶畫面 */
  --glass: rgba(255, 250, 244, 0.38);
  --glass-edge: rgba(255, 255, 255, 0.45);
  --shadow-soft: 0 6px 18px rgba(70, 40, 40, 0.08);
  --radius: 16px;
  --font: "Noto Sans TC", "PingFang TC", "Hiragino Sans", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Songti TC", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

kbd {
  font-family: inherit;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(58, 42, 40, 0.08);
  margin-right: 4px;
}

/* ================================================================ 3D 場景 */
.cafe-scene {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #e2cfcb 0%, #cdb4b0 55%, #b89c98 100%);
}

/* 4F 天文台切到星空時，背景換成夜色（疊在白天的漸層上淡入） */
.cafe-scene::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 30%, #414770 0%, #272c4c 55%, #171a31 100%);
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.cafe-scene.night::before { opacity: 1; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.grabbing { cursor: grabbing; }
#scene.pointing { cursor: pointer; }

#loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #d8c3bf;
  transition: opacity 0.6s ease;
}
#loading.done { opacity: 0; pointer-events: none; }
#loading p { margin: 0; font-size: 14px; letter-spacing: 0.12em; color: var(--ink-soft); }
.bean {
  width: 22px; height: 30px;
  border-radius: 50%;
  background: #6a4030;
  position: relative;
  animation: bob 1.1s ease-in-out infinite;
}
.bean::after {
  content: "";
  position: absolute;
  left: 50%; top: 4px; bottom: 4px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #3a2318;
  transform: rotate(8deg);
}
@keyframes bob {
  0%, 100% { transform: translateY(-6px) rotate(-12deg); }
  50% { transform: translateY(6px) rotate(12deg); }
}

/* 左上的店名：不用卡片，字直接放在背景上，安靜一點，不搶 3D 場景的戲 */
#titlebar {
  position: fixed;
  top: 22px; left: 24px;
  z-index: 10;
  pointer-events: none;
  transition: color 0.6s;
}
#titlebar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--burgundy);
  opacity: 0.85;
}
#titlebar p { margin: 3px 0 0; font-size: 12px; color: var(--ink-soft); opacity: 0.8; }
/* 星空時背景變深：字換成奶油色 */
.night #titlebar h1 { color: var(--paper); }
.night #titlebar p { color: var(--cream); opacity: 0.65; }
/* 星空時毛玻璃換成深色，字換成奶油色 */
.night #elevator, .night #hint { background: rgba(28, 30, 58, 0.35); border-color: rgba(255, 255, 255, 0.12); }
.night #elevator button, .night #hint { color: var(--cream); }
.night #elevator button span { color: rgba(247, 240, 231, 0.65); }
.night #elevator button:hover { background: rgba(255, 255, 255, 0.1); }
.night #elevator button.all { border-top-color: rgba(255, 255, 255, 0.12); }
.night #hint kbd { background: rgba(255, 255, 255, 0.12); }

#list-toggle {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--burgundy);
  color: var(--paper);
  font: 600 14px/1 var(--font);
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  cursor: pointer;
}
#list-toggle:hover { background: var(--burgundy-soft); }
#list-toggle:focus-visible, .tag-go:focus-visible, #drawer a:focus-visible, #drawer-close:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 2px;
}
#list-count {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.2);
  font-size: 12px;
}

#drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 20;
  width: min(360px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: -10px 0 40px rgba(70, 40, 40, 0.2);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#drawer.hidden { transform: translateX(105%); visibility: hidden; transition: transform 0.3s ease, visibility 0s 0.3s; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; color: var(--burgundy); }
#drawer-close {
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(58, 42, 40, 0.06);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
#drawer-body { overflow-y: auto; padding: 8px 12px 28px; }
#drawer h3 {
  margin: 20px 8px 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
#drawer h3 b { margin-right: 6px; color: var(--burgundy); }
.d-name small {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(200, 50, 58, 0.1);
  color: #a3262e;
  font-size: 11px;
}
#drawer ul { list-style: none; margin: 0; padding: 0; }
#drawer a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
#drawer a:hover { background: #f3e8dc; }
#drawer img { width: 56px; height: 56px; border-radius: 10px; background: #f1e6da; object-fit: contain; }
.d-name { font-size: 14px; line-height: 1.35; }
.d-price { font-size: 13px; font-weight: 600; color: var(--burgundy); white-space: nowrap; }

/* 樓層按鈕：像電梯面板，固定在右邊中間 */
#elevator {
  position: fixed;
  right: 20px;
  top: 50%;
  z-index: 11;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#elevator button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 64px;
  padding: 9px 8px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
#elevator button b { font-size: 17px; letter-spacing: 0.02em; }
#elevator button span { font-size: 11px; color: var(--ink-soft); letter-spacing: 0.06em; }
#elevator button:hover { background: rgba(255, 250, 244, 0.5); }
#elevator button[aria-pressed="true"] { background: rgba(110, 47, 50, 0.82); color: var(--paper); }
#elevator button[aria-pressed="true"] span { color: rgba(255, 250, 244, 0.8); }
#elevator button.all { border-top: 1px solid rgba(58, 42, 40, 0.08); border-radius: 0 0 14px 14px; padding-top: 10px; }
#elevator button.all b { font-size: 13px; }
#elevator button:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }

/* 樓梯口選單：浮在拱門上方，上樓／下樓兩顆大按鈕 */
#stairs {
  position: fixed;
  z-index: 16;
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 14px));
  animation: st-in 0.18s ease;
}
#stairs[hidden] { display: none; }
@keyframes st-in { from { opacity: 0; transform: translate(-50%, calc(-100% - 4px)); } }
#stairs::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -6px;
  width: 12px; height: 12px;
  margin-left: -6px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}
.st-title { margin: 0 2px 2px; font-size: 11px; letter-spacing: 0.14em; color: var(--ink-soft); }
#stairs button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--burgundy);
  color: var(--paper);
  font: 600 14px/1.2 var(--font);
  text-align: left;
  cursor: pointer;
}
#stairs button:hover { background: var(--burgundy-soft); }
#stairs button[hidden] { display: none; }
#stairs button b { font-size: 13px; }
#stairs .st-down { background: #f1e5d8; color: var(--ink); }
#stairs .st-down:hover { background: #ead9c8; }
#stairs button:focus-visible, #zoom-back:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }

/* 放大某個區塊時，上方中間的「回到整層」 */
#zoom-back {
  position: fixed;
  left: 50%; top: 96px;
  z-index: 12;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: 600 14px/1 var(--font);
  cursor: pointer;
}
#zoom-back[hidden] { display: none; }
#zoom-back:hover { color: var(--burgundy); }

/* 商品名牌：浮在商品上方 */
#tag {
  position: fixed;
  z-index: 15;
  display: grid;
  gap: 2px;
  min-width: 150px;
  max-width: 230px;
  padding: 10px 14px 12px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 12px)) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#tag::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -6px;
  width: 12px; height: 12px;
  margin-left: -6px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}
#tag.show { opacity: 1; transform: translate(-50%, calc(-100% - 12px)) scale(1); }
#tag.armed { pointer-events: auto; }
.tag-cat { font-size: 11px; letter-spacing: 0.14em; color: var(--ink-soft); }
.tag-name { font-size: 15px; line-height: 1.35; }
.tag-price { font-size: 14px; font-weight: 700; color: var(--burgundy); }
#tag.floor-tag .tag-price { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.tag-go {
  display: none;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--burgundy);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
#tag.armed .tag-go { display: block; }

#hint {
  position: fixed;
  left: 50%; bottom: 18px;
  z-index: 10;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 640px) {
  #titlebar { top: 18px; left: 18px; right: 148px; }
  #titlebar h1 { font-size: 16px; }
  #titlebar p { font-size: 11px; line-height: 1.45; }
  #list-toggle { top: 14px; right: 14px; padding: 10px 14px; }
  /* 手機：樓層按鈕縮成一排小膠囊，放在右邊偏下，拇指按得到 */
  #elevator { right: 12px; top: auto; bottom: 64px; transform: none; padding: 6px; gap: 4px; border-radius: 16px; }
  #elevator button { min-width: 52px; padding: 8px 6px 7px; border-radius: 11px; }
  #elevator button b { font-size: 15px; }
  #elevator button span { font-size: 10px; }
  #hint { gap: 10px; font-size: 12px; bottom: 14px; }
  #hint > span:nth-child(2), #hint > span:nth-child(4) { display: none; }
}

/* ================================================================ 商品跳窗（3D 場景裡） */
#product-modal {
  width: min(980px, calc(100% - 32px));
  max-width: none;
  max-height: min(88vh, 860px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(50, 25, 25, 0.35);
  overflow: hidden;
}
#product-modal[open] { animation: pm-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
#product-modal::backdrop {
  background: rgba(58, 36, 36, 0.42);
  backdrop-filter: blur(3px);
  animation: pm-fade 0.24s ease;
}
@keyframes pm-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes pm-fade { from { opacity: 0; } }

/* 內容填滿整個視窗：點到 dialog 本身就一定是在視窗外 */
.pm-body {
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 3.5vw, 40px);
}
.pm-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(70, 40, 40, 0.14);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.pm-close:hover { color: var(--burgundy); }
.pm-close:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }
#product-modal .p-hero { gap: clamp(20px, 4vw, 44px); }
#product-modal .p-info { padding-right: 28px; }     /* 讓出關閉鈕的位置 */
#product-modal .p-info h1 { font-size: clamp(24px, 2.6vw, 30px); }
#product-modal .p-related { margin-top: 40px; }
#product-modal .p-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

@media (max-width: 640px) {
  /* 手機：從下方滑上來的面板 */
  #product-modal {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }
  #product-modal[open] { animation: pm-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
  #product-modal .p-hero { grid-template-columns: 1fr; }
  #product-modal .p-info { padding-right: 0; }
  #product-modal .p-photo { aspect-ratio: 4 / 3; }
  /* 畫作要整幅看得到：直式畫在 4:3 的框裡會被切掉，改成正方形、用 vw 限高 */
  #product-modal .p-photo--art { aspect-ratio: 1; }
  #product-modal .p-photo--art img { max-height: 70vw; }
}
@keyframes pm-up { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #product-modal[open], #product-modal::backdrop { animation: none; }
}

/* ================================================================ 商品頁 */
.product-page {
  min-height: 100vh;
  background: var(--cream);
}

.p-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(247, 240, 231, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.p-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.p-back:hover { color: var(--burgundy); }
.p-brand { font-family: var(--serif); font-weight: 700; letter-spacing: 0.1em; color: var(--burgundy); }
.p-brand small { margin-left: 8px; font-family: var(--font); font-weight: 400; letter-spacing: 0.04em; color: var(--ink-soft); }

.p-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 48px) 40px;
}

.p-crumbs { margin: 0 0 20px; font-size: 13px; color: var(--ink-soft); }
.p-crumbs a { color: inherit; }

.p-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.p-photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 24px;
  background: radial-gradient(90% 80% at 50% 40%, #fbf3ea 0%, #efdfd2 70%, #e6d2c4 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.p-photo img { width: 92%; height: 92%; object-fit: contain; }
.p-photo .p-3d {
  position: absolute;
  left: 16px; bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(70, 40, 40, 0.12);
}
.p-photo .p-3d:hover { color: var(--burgundy); }
button.p-3d { border: 0; font-family: inherit; cursor: pointer; }

.p-cat {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(110, 47, 50, 0.08);
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.p-info h1 {
  margin: 14px 0 4px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.p-en { margin: 0; font-size: 14px; color: var(--ink-soft); letter-spacing: 0.02em; }
.p-tagline { margin: 18px 0 0; font-size: 17px; line-height: 1.6; }

.p-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 22px 0 0;
}
.p-price strong { font-size: 30px; color: var(--burgundy); letter-spacing: 0.01em; }
.p-price--label strong { font-size: 20px; }   /* 沒有價格的（貓、開發中）：顯示文字標籤 */
.p-sold {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(200, 50, 58, 0.1);
  color: #a3262e;
  font-size: 12px;
  font-weight: 600;
}
.p-sold::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c8323a; }
.p-artist { margin: 10px 0 0; font-size: 15px; font-weight: 600; }
.p-artist span { margin-left: 10px; font-weight: 400; color: var(--ink-soft); }

/* 畫作：像掛在牆上一樣，留白多一點、加一點陰影 */
.p-photo--art { background: #f4efe8; }
.p-photo--art img {
  width: auto; height: auto;
  max-width: 78%; max-height: 80%;
  box-shadow: 0 0 0 10px #c99a6a, 0 18px 40px rgba(60, 35, 30, 0.28);
}
.p-price span { font-size: 14px; color: var(--ink-soft); }

.p-notes { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.p-notes li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
}

.p-roast { margin: 18px 0 0; font-size: 13px; color: var(--ink-soft); }
.p-roast .dots { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: middle; }
.p-roast .dots i {
  width: 22px; height: 8px;
  border-radius: 4px;
  background: #e6d6c6;
}
.p-roast .dots i.on:nth-child(1) { background: #c9935f; }
.p-roast .dots i.on:nth-child(2) { background: #9a6338; }
.p-roast .dots i.on:nth-child(3) { background: #5e3a28; }

.p-buy { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; align-items: center; }
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 14px;
  border: 0;
  background: var(--burgundy);
  color: var(--paper);
  font: 600 15px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.p-btn:hover { background: var(--burgundy-soft); }
.p-btn[aria-disabled="true"] { background: #cdbcb2; color: #fffaf4; cursor: not-allowed; }
.p-btn:focus-visible, .p-back:focus-visible, .p-3d:focus-visible, .p-card:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 2px;
}
.p-buy-note { font-size: 13px; color: var(--ink-soft); }

.p-desc { margin: 28px 0 0; font-size: 15px; line-height: 1.85; color: #4b3a37; }

.p-specs { width: 100%; margin: 26px 0 0; border-collapse: collapse; font-size: 14px; }
.p-specs th, .p-specs td { padding: 11px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.p-specs th { width: 34%; font-weight: 500; color: var(--ink-soft); }

.p-related { margin-top: clamp(40px, 7vw, 80px); }
.p-related h2 { margin: 0 0 16px; font-family: var(--serif); font-size: 20px; }
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.p-card {
  display: grid;
  gap: 6px;
  padding: 12px 12px 16px;
  border-radius: 18px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.p-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(70, 40, 40, 0.1); }
.p-card img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #f3e8dc; }
.p-card span { font-size: 14px; line-height: 1.4; }
.p-card strong { font-size: 14px; color: var(--burgundy); }

.p-missing { text-align: center; padding: 80px 0; }
.p-missing h1 { font-family: var(--serif); }

.p-foot { padding: 32px 16px 40px; text-align: center; font-size: 12px; color: var(--ink-soft); }

@media (max-width: 760px) {
  .p-hero { grid-template-columns: 1fr; }
  .p-brand small { display: none; }
}

/* ---------------------------------------------------------------- 商品資料來源提示（API 讀不到、退回示範資料） */
#notice, .p-notice {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 12px;
  background: #3a2a28; color: #f7f0e7; font-size: 13px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(58, 42, 40, 0.25); z-index: 30;
}
.p-notice { position: static; transform: none; margin: 0 0 16px; max-width: none; }

/* WooCommerce 的描述是多段文字：保留換行 */
.p-desc { white-space: pre-line; }
.p-buy .p-link { text-decoration: underline; text-underline-offset: 3px; color: inherit; }
/* ================================================================ 1F 菜單（收銀台點開，用同一個跳窗） */
.menu-card { padding: 4px 4px 8px; }
.mc-head { text-align: center; padding: 6px 28px 22px; border-bottom: 1px dashed var(--line); }
.mc-kicker { margin: 0; font-size: 12px; letter-spacing: 0.12em; color: var(--ink-soft); }
.mc-title {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.08em;
  color: var(--burgundy);
  text-wrap: balance;
}
.mc-hours { margin: 0; font-size: 13px; color: var(--ink-soft); }
.mc-legend { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); }
.mc-legend .mc-chalk { margin: 0 6px 0 0; }

.mc-sections { columns: 2 300px; column-gap: 44px; padding-top: 22px; }
.mc-sec { break-inside: avoid; margin-bottom: 26px; }
.mc-sec h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--burgundy);
  font-family: var(--serif);
  font-size: 19px;
  color: var(--burgundy);
}
.mc-sec h3 small { font-family: var(--font); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.mc-sec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.mc-row { display: flex; align-items: baseline; gap: 8px; }
.mc-name { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.mc-dots { flex: 1; min-width: 16px; border-bottom: 2px dotted rgba(58, 42, 40, 0.25); transform: translateY(-4px); }
.mc-price { font-family: var(--serif); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.mc-en { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.02em; }
.mc-desc { margin: 3px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.mc-item--plus .mc-name { font-weight: 500; }
.mc-item--plus .mc-price { font-size: 14px; color: var(--ink-soft); }

/* 黑板上也有的品項：小小一塊黑板 */
.mc-chalk {
  display: inline-block;
  padding: 1px 7px 2px;
  border-radius: 5px;
  background: #3a3234;
  color: #f3ebdd;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.mc-more {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--burgundy);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mc-more:hover { color: var(--burgundy-soft); }

.mc-foot { border-top: 1px dashed var(--line); padding-top: 14px; }
.mc-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 12px; color: var(--ink-soft); }
.mc-foot li::before { content: "・"; color: var(--peach); }

/* 從菜單點進商品介紹時，上方的「回到菜單」 */
.pm-back {
  margin: 0 0 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
  font-size: 13px;
  color: var(--burgundy);
  cursor: pointer;
}
.pm-back:hover { background: #f3e8dc; }

/* ================================================================ 店貓的對話框（點貓咪時冒出來） */
#meow {
  position: fixed;
  z-index: 14;
  padding: 7px 13px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
  color: var(--burgundy);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px)) scale(0.6);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.24s cubic-bezier(0.3, 1.6, 0.5, 1);
}
#meow::after {                       /* 對話框下面的小尖角 */
  content: "";
  position: absolute;
  left: 50%; bottom: -6px;
  width: 12px; height: 12px;
  background: var(--paper);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 3px 0;
}
#meow.show { opacity: 1; transform: translate(-50%, calc(-100% - 10px)) scale(1); }
@media (prefers-reduced-motion: reduce) { #meow { transition: opacity 0.18s ease; } }

/* ---------------------------------------------------------------- 所有小屋的入口連結、版本號（引擎自己加上去） */
#titlebar .home {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  opacity: 0.75;
  text-decoration: none;
  pointer-events: auto;
}
#titlebar .home:hover { color: var(--burgundy); opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.night #titlebar .home { color: var(--cream); }
#hint .hint-ver { opacity: 0.55; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { #hint .hint-ver { display: none; } }
