:root {
  --wakufes-nav-height: 82px;
}

body {
  padding-bottom: calc(var(--wakufes-nav-height) + env(safe-area-inset-bottom, 0px));
}

/* ページ内に残っていた旧メニューは、固定メニューとの重複を避ける。 */
.wakufes-legacy-menu {
  display: none !important;
}

/* ホームは旧メニュー専用の外側セクションも余白ごと隠す。 */
body.wakufes-fixed-nav-ready.page-id-5
  .vkb-outer-9978118e-c9c2-4d90-9cf5-d913071e6f88 {
  display: none !important;
}

/* 写真側に元からある下部波形を、次セクションの水色にする。 */
body.wakufes-fixed-nav-ready.page-id-5
  .vkb-outer-399620d7-9502-401e-8fe0-f520f099a570
  > div
  > .vk_outer_separator-position-lower
  path {
  fill: #d9f0ff !important;
}

/* 次セクション側の上部波形は二重になるため隠す。 */
body.wakufes-fixed-nav-ready.page-id-5
  .vkb-outer-e0bf4dd4-99c8-491b-8b60-1fe634389a75
  > div
  > .vk_outer_separator-position-upper {
  display: none !important;
}

.wakufes-bottom-nav {
  position: fixed;
  z-index: 99999;
  right: 0;
  bottom: 0;
  left: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(247, 252, 255, 0.96);
  border-top: 1px solid rgba(49, 68, 82, 0.14);
  box-shadow: 0 -6px 24px rgba(31, 48, 60, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wakufes-bottom-nav__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: min(100%, 1080px);
  min-height: var(--wakufes-nav-height);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.wakufes-bottom-nav__item {
  min-width: 0;
}

.wakufes-bottom-nav__link {
  position: relative;
  display: flex;
  min-height: 82px;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 7px;
  color: #555f66;
  text-align: center;
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.wakufes-bottom-nav__item + .wakufes-bottom-nav__item .wakufes-bottom-nav__link::before {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 1px;
  background: rgba(49, 68, 82, 0.12);
  content: "";
}

.wakufes-bottom-nav__link:hover,
.wakufes-bottom-nav__link:focus-visible {
  color: #c8a400;
  background: rgba(255, 232, 130, 0.18);
}

.wakufes-bottom-nav__link[aria-current="page"] {
  color: #b99600;
  background: rgba(255, 232, 130, 0.28);
  font-weight: 700;
}

.wakufes-bottom-nav__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.wakufes-bottom-nav__label {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.82rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wakufes-bottom-nav__en {
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0.72;
}

@media (max-width: 600px) {
  :root {
    --wakufes-nav-height: 116px;
  }

  .wakufes-bottom-nav__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 58px);
    min-height: 116px;
  }

  .wakufes-bottom-nav__link {
    min-height: 58px;
    gap: 2px;
    padding: 5px 3px 4px;
  }

  .wakufes-bottom-nav__item + .wakufes-bottom-nav__item .wakufes-bottom-nav__link::before {
    top: 10px;
    bottom: 10px;
  }

  .wakufes-bottom-nav__item:nth-child(4) .wakufes-bottom-nav__link::before {
    display: none;
  }

  .wakufes-bottom-nav__item:nth-child(n + 4) .wakufes-bottom-nav__link {
    border-top: 1px solid rgba(49, 68, 82, 0.1);
  }

  .wakufes-bottom-nav__icon {
    font-size: 1.1rem;
  }

  .wakufes-bottom-nav__label {
    font-size: clamp(0.68rem, 3.2vw, 0.79rem);
  }

  .wakufes-bottom-nav__en {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wakufes-bottom-nav__link {
    transition: none;
  }
}
