/* =============================================
   Vo Roof – Menu Page
   foundation.css のデザイントークンを前提にする
   ============================================= */

/* --- Reset & base -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --menu-font-ja: "YakuHanJP", "Noto Sans JP", 游ゴシック, Yu Gothic, YuGothic,
    メイリオ, "Hiragino Kaku Gothic Pro", Verdana, sans-serif;
  --menu-font-latin: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  --menu-font-price: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
}

html {
  font-size: 62.5%;
  -webkit-text-size-adjust: 100%;
  font-family: var(--menu-font-ja);
  background: #edf1f3;
  color: var(--color-font-bk, #151515);
}

html[lang="vi"],
html[lang="en"] {
  font-family: var(--menu-font-latin);
}

html[lang="ja"] {
  font-family: var(--menu-font-ja);
}

html[lang="ja"] body,
html[lang="ja"] button {
  font-family: var(--menu-font-ja);
}

html[lang="vi"] body,
html[lang="vi"] button,
html[lang="vi"] .m-header,
html[lang="vi"] .m-header__title,
html[lang="vi"] .m-lang-switcher,
html[lang="vi"] .m-lang-switcher__toggle,
html[lang="vi"] .m-catnav,
html[lang="vi"] .m-catnav__item-name,
html[lang="vi"] .m-section__heading,
html[lang="vi"] .m-card,
html[lang="vi"] .m-card__name,
html[lang="vi"] .m-card__desc,
html[lang="vi"] .m-card__price,
html[lang="vi"] .m-notice,
html[lang="vi"] .m-dialog,
html[lang="vi"] .m-dialog__name,
html[lang="vi"] .m-dialog__subname,
html[lang="vi"] .m-dialog__desc,
html[lang="vi"] .m-dialog__price,
html[lang="en"] body,
html[lang="en"] button,
html[lang="en"] .m-header,
html[lang="en"] .m-header__title,
html[lang="en"] .m-lang-switcher,
html[lang="en"] .m-lang-switcher__toggle,
html[lang="en"] .m-catnav,
html[lang="en"] .m-catnav__item-name,
html[lang="en"] .m-section__heading,
html[lang="en"] .m-card,
html[lang="en"] .m-card__name,
html[lang="en"] .m-card__desc,
html[lang="en"] .m-card__price,
html[lang="en"] .m-notice,
html[lang="en"] .m-dialog,
html[lang="en"] .m-dialog__name,
html[lang="en"] .m-dialog__subname,
html[lang="en"] .m-dialog__desc,
html[lang="en"] .m-dialog__price {
  font-family: var(--menu-font-latin);
}

body {
  width: min(100%, 43rem);
  min-height: 100vh;
  margin: 0;
  margin-inline: auto;
  padding-top: 4.8rem; /* header height */
  background: #fff;
  box-shadow: 0 0 24px rgba(0 0 0 / 0.06);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Header -------------------------------------- */
.m-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 100;
  width: min(100%, 43rem);
  height: 4.8rem;
  transform: translateX(-50%);
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-inline: 1.2rem;
  background: rgba(255 255 255 / 0.96);
  border-bottom: 1px solid rgba(0 0 0 / 0.06);
  box-shadow: 0 2px 14px rgba(0 0 0 / 0.04);
  backdrop-filter: blur(14px);
  color: var(--color-font-bk, #151515);
}

.m-header__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f4f7f8;
  color: var(--color-font-bk, #151515);
  text-decoration: none;
}

.m-header__back svg {
  width: 2rem;
  height: 2rem;
}

.m-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 言語切替（menu.js 独自実装） */
.m-lang-switcher {
  position: relative;
  flex-shrink: 0;
  font-family: "Jost", sans-serif;
}

.m-lang-switcher__toggle {
  display: flex;
  align-items: center;
  min-width: 4rem;
  justify-content: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(0 0 0 / 0.08);
  border-radius: 999px;
  background: #f4f7f8;
  color: var(--color-font-bk, #151515);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  -webkit-tap-highlight-color: transparent;
}

.m-lang-switcher__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 6rem;
  background: var(--color-base, #fff);
  border-radius: 0.4rem;
  box-shadow: 0 4px 12px rgba(0 0 0 / 0.2);
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  z-index: 10;
}

.m-lang-switcher__menu .lang-switcher__option {
  display: block;
  width: 100%;
  padding: 0.6rem 1.2rem;
  text-align: center;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--color-font-bk, #151515);
  cursor: pointer;
  letter-spacing: 0.1em;
  -webkit-tap-highlight-color: transparent;
}

.m-lang-switcher__menu .lang-switcher__option:hover {
  background: rgba(26 79 113 / 0.08);
}

/* --- Category nav -------------------------------- */
.m-catnav {
  position: sticky;
  top: 4.8rem;
  z-index: 90;
  background: var(--color-base, #fff);
  border-bottom: 1px solid rgba(0 0 0 / 0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.8rem 1.4rem 1rem;
  display: flex;
  gap: 1rem;
}

.m-catnav::-webkit-scrollbar { display: none; }

.m-catnav__item {
  flex: 0 0 auto;
  width: 8.2rem;
  height: 10.6rem;
  background: linear-gradient(180deg, #fff 0%, #f7f8f8 100%);
  border-radius: 1.8rem;
  border: 1px solid rgba(0 0 0 / 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.85rem 0.7rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-font-bk, #151515);
  box-shadow: 0 3px 10px rgba(0 0 0 / 0.06);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.m-catnav__item.is-active {
  border-color: var(--color-main, #1a4f71);
  background: #eef6fa;
  box-shadow: 0 4px 12px rgba(26 79 113 / 0.16);
}

.m-catnav__item-name {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.22;
  letter-spacing: 0.02em;
  order: -1;
  word-break: keep-all;
  -webkit-hyphens: auto;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-catnav__item-img {
  width: 5.2rem;
  height: 4.8rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.m-catnav__item-img-placeholder {
  flex: 1;
  min-height: 0;
}

/* --- Main content -------------------------------- */
.m-main {
  padding-bottom: calc(3.2rem + env(safe-area-inset-bottom));
}

/* --- Notice -------------------------------------- */
.m-notice {
  margin: 1.2rem 1.4rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(216 147 58 / 0.22);
  border-radius: 1rem;
  background: #fff8e9;
  color: #5f421f;
  font-size: 1.05rem;
  line-height: 1.55;
}

/* --- Category section ---------------------------- */
.m-section {
  padding-top: 1.8rem;
  scroll-margin-top: calc(4.8rem + 11.6rem + 1.2rem); /* header + catnav + buffer */
}

.m-section__heading {
  font-size: 1.65rem;
  font-weight: 800;
  padding: 0 1.4rem 1rem;
  border-bottom: none;
  margin-bottom: 0;
  color: var(--color-font-bk, #151515);
  letter-spacing: 0.01em;
}

/* --- Card grid ----------------------------------- */
.m-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1.4rem;
  row-gap: 2.2rem;
  padding-inline: 1.4rem;
  padding-bottom: 0.8rem;
}

/* --- Card ---------------------------------------- */
.m-card {
  position: relative;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 1.2rem;
  overflow: visible;
  background: #fff;
  box-shadow: none;
  transition: transform 0.18s;
  width: 100%;
  color: inherit;
}

.m-card:active {
  transform: scale(0.985);
}

.m-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 0.78;
  background: #f5f7f7;
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0 0 0 / 0.04);
}

.m-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.m-card__img-wrap::after {
  content: "+";
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2f8b57;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0 0 0 / 0.18);
  font-size: 2.8rem;
  font-weight: 500;
  line-height: 1;
}

.m-card__labels {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.m-card__label {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.m-card__label--recommended { background: #d8933a; }
.m-card__label--popular { background: #b92f24; }
.m-card__label--sold-out { background: #888; }

.m-card__body {
  padding: 0.8rem 0 0;
}

.m-card__name {
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.32;
  margin-bottom: 0.3rem;
  color: var(--color-font-bk, #151515);
  display: -webkit-box;
  min-height: 3.45rem;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.m-card__desc {
  font-size: 1.05rem;
  line-height: 1.38;
  color: #747b80;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.m-card__price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-font-bk, #151515);
  font-family: var(--menu-font-price);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* --- Dialog -------------------------------------- */
.m-dialog {
  border: none;
  border-radius: 1.6rem 1.6rem 0 0;
  padding: 0;
  width: 100%;
  max-width: 48rem;
  margin: auto auto 0;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.m-dialog::backdrop {
  background: rgba(0 0 0 / 0.5);
  backdrop-filter: blur(2px);
}

.m-dialog__img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e8eff5;
  overflow: hidden;
}

.m-dialog__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.m-dialog__body {
  padding: 2rem 2rem calc(2rem + env(safe-area-inset-bottom));
}

.m-dialog__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.m-dialog__price {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-main, #1a4f71);
  font-family: var(--menu-font-price);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  margin-bottom: 0.8rem;
}

.m-dialog__name {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  color: var(--color-font-bk, #151515);
}

.m-dialog__subname {
  font-size: 1.4rem;
  color: #777;
  margin-bottom: 1.2rem;
  font-style: italic;
}

.m-dialog__desc {
  font-size: 1.4rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 2rem;
}

.m-dialog__close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: none;
  background: rgba(0 0 0 / 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.m-dialog__close svg {
  width: 1.8rem;
  height: 1.8rem;
}

.m-dialog__inner {
  position: relative;
}

/* --- Empty state --------------------------------- */
.m-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
  font-size: 1.4rem;
}

/* --- PC ----------------------------------------- */
@media (min-width: 768px) {
  body { padding-top: 4.8rem; }

  .m-header { height: 4.8rem; }

  .m-catnav {
    top: 4.8rem;
    padding-inline: 1.4rem;
  }

  .m-catnav__item {
    width: 8.2rem;
    min-width: 8.2rem;
  }

  .m-section { scroll-margin-top: calc(4.8rem + 11.6rem + 1.2rem); }

  .m-cards {
    grid-template-columns: repeat(2, 1fr);
    padding-inline: 1.4rem;
    column-gap: 1.4rem;
    row-gap: 2.2rem;
  }

  .m-notice { margin-inline: 1.4rem; }

  .m-section__heading { padding-inline: 1.4rem; }

  .m-dialog {
    border-radius: 1.6rem;
    margin: auto;
    bottom: unset;
  }
}
