.menu {
  padding: 1em;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 80vh;
  transform: translateY(calc(-100% - 2em));
  user-select: none;
  z-index: var(--z-index-menu);
  pointer-events: none;
  transition: transform var(--layout-timing-extra-fast);
}

.menu:focus {
  outline: none;
}

.is-menu-open .menu {
  transform: translateY(0);
  user-select: auto;
}

.menu-area {
  background-color: rgb(var(--theme-color-01));
  border-radius: var(--theme-radius);
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: var(--layout-shadow-large);
  pointer-events: all;
  transition: background-color var(--layout-timing-extra-fast);
}

.is-edge .menu-area {
  background-color: rgba(var(--theme-color-01), 0.8);
}

.menu-nav {
  display: flex;
  flex-direction: row;
}

.menu-nav-area-tab {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  flex-grow: 1;
}

.menu-nav-area-close {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
}

.menu-nav:not(:last-child) {
  margin: 0;
}

.menu-content {
  padding: 0 1.5em;
}

.menu-content-area {
  display: grid;
  grid-template-columns: 1fr;
}

.menu-item {
  position: relative;
  z-index: 1;
}

.menu-item:not(:last-child) {
  border-bottom: var(--horizontal-rule);
}

.menu-item-header {
  padding: 2em 0;
}

.menu-item-header-text {
  margin-bottom: 0;
}

.menu-item-form {
  padding: 0 0 2em 2em;
}

.menu-nav-button {
  background-color: transparent;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 0;
  height: 3.25em;
  line-height: 1;
  flex-grow: 1;
}

.menu-nav-button:after,
.menu-nav-button:after {
  background-color: transparent;
  border-radius: 0;
}

.menu-nav-area-tab .menu-nav-button:first-child {
  border-radius: var(--theme-radius) 0 0 0;
}

.menu-nav-area-close .menu-nav-button {
  border-radius: 0 var(--theme-radius) 0 0;
}

@media (min-width: 550px) {
  .menu {
    width: 80vw;
  }

  .menu-nav-area-tab .menu-nav-button {
    flex-basis: 33.3333333333%;
    max-width: 33.3333333333%;
  }
}

@media (min-width: 700px) {
  .menu {
    width: 70vw;
    height: 100%;
    overflow-y: inherit;
    max-height: inherit;
  }

  .menu-area {
    overflow-y: inherit;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    justify-items: stretch;
    align-items: stretch;
  }

  .menu-content {
    padding: 0 3em;
    overflow-y: auto;
  }

  .menu-item {
    display: grid;
    grid-template-columns: 2fr 3fr;
    grid-template-rows: 1fr;
    align-items: flex-start;
    grid-gap: 2em;
  }

  .menu-item-header {
    padding: 2em 0;
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .menu-nav-area-tab .menu-nav-button {
    flex-basis: 50%;
    max-width: 50%;
  }

  .menu-item-form {
    padding: 2em 0;
    z-index: 2;
  }
}

@media (min-width: 900px) {
  .menu {
    width: 70vw;
  }

  .menu-item {
    grid-template-columns: 1fr 2fr;
  }

  .menu-nav-area-tab .menu-nav-button {
    flex-basis: 33.3333333333%;
    max-width: 33.3333333333%;
  }
}

@media (min-width: 1100px) {
  .menu-nav-area-tab .menu-nav-button {
    flex-basis: auto;
    max-width: inherit;
  }
}

@media (min-width: 1600px) {
  .menu {
    width: 50vw;
  }
}
