
.Main,
#main,
#main.Main,
#main.Main__popup {
  margin-top: 160px !important;
}

.Header {
  height: 160px;
}

.Header__inner {
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  padding: 0;
}

.Header__body {
  width: 100%;
  display: grid;
  grid-template-areas: "logo utility" "category category";
  grid-template-columns: max-content 1fr;
  grid-template-rows: 70px auto;
}

.header-logo {
  grid-area: logo;
  display: grid;
  place-content: center;
  padding-left: 16px;
}

.header-logo > a {
  display: grid;
  place-content: center;
}

.header-logo > a > img {
  width: 172px;
}

.header-utility {
  grid-area: utility;
  padding-right: 16px;
}

.header-utility-list {
  margin: 5px 0;
}

.header-utility-list > li > [class*="__type"] {
  font-size: clamp(1.5rem, 1.2vw, 1.6rem);
}

.header-utility-list > li:first-child {
  border-left: none;
}

.header-utility-list > li:last-child {
  border-right: none;
}

.header-category {
  grid-area: category;
  height: max-content;
  min-height: 0;
}

.header-category__list {
  height: 90px;
  margin: 0;
  border-block: 2px solid #01A369;
}

.header-category__list > li {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 2px;
  flex: 1 1;
  margin-left: 0;
  font-size: clamp(16px, 1.25vw, 24px);
  background-color: #EDF9F6;
  
  &::after {
    content: "";
    border-right: 2px solid #01A369;
    height: 100%;
  }

  &:last-child::after {
    border-right: none;
  }
}

.header-category__list > li > .header-category__type {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  padding-inline: 8px;
  transition: padding-inline 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s,
    column-gap 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s,
    font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-category__list > li > .header-category__type::before {
  display: none;
}

.header-category__list > li > .header-category__type:hover {
  opacity: 0.7;
  text-decoration: none;
}

.header-category__list > li > .header-category__type > img {
  max-height: 22px;
  width: auto;
}

.header-utility-other {
  gap: 4px;
}

.header-utility-other > * > [class*="__type"] {
  width: 48px;
  height: 48px;
  background-color: #01a369;
  border-radius: 4px;
  color: #fff;
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s;
}

.header-utility-other > * > [class*="__type"]:hover {
  background-color: #007238;
}

.header-utility-other > * > * > [class*="__text"], 
.header-utility-other > * > *:hover > [class*="__text"] {
  color: #fff;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s;
}

.header-utility-login > [class*="__type"] {
  display: block;
  position: relative;
  padding: 0;
  padding-top: 33px;
  z-index: 5;
}

.header-utility-login > [class*="__type"]:before {
  width: 22px;
  height: 22px;
  position: absolute;
  top: 7px;
  left: 50%;
  margin-left: -10px;
  background: url("/img/head_login.svg") no-repeat left top/contain;
  content: "";
}

.header-utility-login__text {
  display: block;
  color: #333;
  font-size: 1rem;
  font-weight: 700;
}

.header-utility-chat {
  margin-left: 0;
}

.header-utility-chat > [class*="__type"]:before {
  background: url("/img/head_chat.svg") no-repeat left top/contain;
}

.header-utility-chat > [class*="__type"]:hover:before {
  background-image: url("/img/head_chat.svg");
}

.header-utility-search {
  margin-left: 0;
}

.header-utility-search.is-active > [class*="__type"]:hover:before, 
.header-utility-search.is-active > [class*="__type"]:hover:after {
  background-color: #fff;
}

.header-utility-search__type > [class*="__text"]:before {
  background: url("/img/head_search.svg") no-repeat left top/contain;
}

.header-utility-search__type:hover > [class*="__text"]:before {
  background-image: url("/img/head_search.svg");
}

.header-utility-menu > .header-utility-menu__type {
  background-color: #007238;
}

.header-utility-menu > .header-utility-menu__type:hover {
  background-color: #004120;
}

.header-utility-menu .header-utility-menu__type::before,
.header-utility-menu .header-utility-menu__type::after, 
.header-utility-menu .header-utility-menu__text::before,
.header-utility-menu .header-utility-menu__type:hover::before,
.header-utility-menu .header-utility-menu__type:hover::after, 
.header-utility-menu .header-utility-menu__type:hover .header-utility-menu__text::before {
  background-color: #fff;
}

.header-gnav__list__type--blank::after {
  width: 12px;
  height: 12px;
  display: inline-block;
  position: relative;
  left: 10px;
  overflow: hidden;
  background: no-repeat 0 0;
  background-image: url(/app-files/img/sprite/icon.svg#blank-usage);
  background-position: center center !important;
  background-size: contain !important;
  content: "";
  text-indent: 100%;
  vertical-align: middle;
  white-space: nowrap;
}

.main-login__box__button__type--blank {
  position: relative;
}

.main-login__box__button__type--blank::after {    
  display: inline-block;
  position: absolute;
  top: 50%;
  right: 1.1em;
  width: 12px;
  height: 12px;
  overflow: hidden;
  transform: translateY(-50%);
  background: no-repeat 0 0;
  background-image: url(/app-files/img/sprite/icon.svg#blank2-usage);
  background-position: center center !important;
  background-size: contain !important;
  content: "";
  text-indent: 100%;
  vertical-align: middle;
  white-space: nowrap;
}

/*
 * is-fixedが存在する時
 */

body.is-header-fixed {
  .Header__inner {
    padding-top: 0;
  }

  .Header__body {
    display: grid;
    grid-template-areas: "logo category utility";
    grid-template-columns: max-content 1fr max-content;
    grid-template-rows: 70px;
    gap: 16px;
  }

  .header-utility {
    margin-top: 0;
  }

  .header-category {
    height: 100%;
    margin-right: 0;
  }

  .header-category__list {
    max-width: max-content;
    height: 70px;
    border-block: none;
    margin-left: auto;
  }
  
  .header-category__list > li {
    flex-basis: max-content;
    font-size: 16px;
    align-items: center;
    grid-template-columns: 1fr 2px;

    &::after {
      height: 48px;
    }
  }

  .header-category__list > li > .header-category__type {
    padding-inline: 16px;
    column-gap: 6px;
    font-size: clamp(1.2rem, calc(-0.813rem + 1.676vw), 1.6rem);
    transition: padding-inline 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s,
      column-gap 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s,
      font-size 0s ease-in 0s;
  }

  .header-category__list > li > .header-category__type > img {
    max-height: 14px;
  }
}

/*
 * Header ログインパネル
 */

.header-utility-login__type:has(+ .header-login.is-active) {
  background-color: #e6f8f3;
  z-index: 1000;

  &::before {
    display: none;
  }

  &:hover {
    background-color: #007238;

    .header-utility-login__text {
      color: #fff;

      &::before,
      &::after {
        background-color: #e6f8f3;
      }
    }
  }

  .header-utility-login__text {
    color: #007238;
    
    &::before,
    &::after {
      position: absolute;
      top: 55%;
      left: 50%;
      height: 2px;
      background-color: #007238;
      transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s;
      content: "";
      width: 20px;
      margin-top: -10px;
      margin-left: -10px;
    }

    &::before {
      transform: rotate(45deg);
    }

    &::after {
      transform: rotate(-45deg);
    }
  }
}

.header-login {
  position: absolute;
  width: 100dvw;
  height: 100dvh;
  top: 0;
  left: 0;
  display: none;
  z-index: 999;
}

.header-login-overlay {
  position: absolute;
  top: 0px;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
}

.header-login__inner {
  position: absolute;
  top: 80px;
  right: 30px;
}

.header-login__bubble {
  position: relative;
  width: 40px;
  height: 18px;
  background-color: #EDF9F6;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.header-login__content {
  width: 100%;
  background-color: #EDF9F6;
  border-radius: 10px;
  padding: 24px 30px;
}

.header-login-box {
  display: none;
  gap: 30px;

  &[data-id="tab-kojin"] {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  }

  &[data-id="tab-hojin"] {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(0, 1fr);
  }
}

.header-login-box.is-active {
  display: grid;
}

.header-login-box__lead {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 24px;
  font-weight: 700;
}

.header-login-box__lead img {
  width: auto;
}

.main-login__box__link {
  margin-top: 1em;
  text-align: center;
}

.main-login__box__link__type {
  padding-left: 1.25em;
}

.header-login-box__divider {
  width: 1px;
  height: 100%;
  background-color: #ccc;
}

/*
 * TB, SP
 */

@media only screen and (max-width: 1260.98px) {
  .Main,
  #main,
  #main.Main,
  #main.Main__popup {
    margin-top: 64px !important;
  }

  .Header {
    height: 64px;
  }

  .Header__body,
  body.is-header-fixed .Header__body {
    column-gap: 16px;
    grid-template-rows: auto;
    grid-template-columns: auto;
    grid-template-areas: "logo utility";
    justify-content: space-between;
    align-items: center;
  }

  .header-logo > a > img {
    width: 105px;
  }

  .header-login {
    top: 64px;
  }

  .header-overlay {
    top: 64px;
  }

  .header-login__inner {
    width: calc(100% - 30px);
    right: 15px;
    top: 10px;
  }

  .header-login__content {
    max-width: none;
    max-height: calc(100vh - 50px - 80px); /* ヘッダー高さ+TOP */
    overflow-y: scroll;
  }

  .header-login-box[data-id="tab-kojin"] {
    grid-template-columns: auto;
    grid-template-rows: max-content 1px max-content;
  }

  .header-login-box[data-id="tab-hojin"] {
    grid-template-columns: auto;
    grid-template-rows: max-content 1px max-content 1px max-content;
    gap: 8px;
  }

  .header-utility-login > [class*="__type"] {
    padding: 31px 3px 3px;
  }

  .header-login-box[data-id="tab-kojin"] .header-login-box__card:first-child {
    order: 3;
  }

  .header-login-box[data-id="tab-kojin"] .header-login-box__card:last-child {
    order: 1;
  }
  
  .header-login-box__divider {
    width: 100%;
    height: 1px;
  }

  .header-login-box[data-id="tab-kojin"] .header-login-box__divider {
    order: 2;
  }

  .header-login-box[data-id="tab-hojin"] .header-login-box__lead {
    font-size: 16px;
  }

  .header-login-box[data-id="tab-hojin"] .main-login__box__link {
    margin-bottom: 0;
  }

  .header-search,
  .header-menu {
    top: 64px;
  }

  .header-menu-box {
    display: none;
  }

  .header-menu-box.is-active {
    display: block;
  }

  .header-column-v3 {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .header-column-v3__item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .header-lead-v3 {
    font-size: 1.4rem;
    font-weight: 700;
  }

  .header-lead-v3 > [class*="__text"] {
    margin: 0;
  }

  .header-button-v4 {
    width: 100%;
  }

  .header-button-v4 > [class*="__type"] {
    display: block;
    position: relative;
    width: 100%;
    padding: 0.875em 14px 0.625em;
    border-radius: 99px;
    background-color: #007238;
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    font-size: 1.4rem;
    text-align: center;
    color: #fff;
  }

  .header-button-v4 > [class*=__type--blank]:before {
    display: inline-block;
    position: absolute;
    top: 50%;
    right: 1.1em;
    width: 12px;
    height: 12px;
    overflow: hidden;
    background: no-repeat 0 0;
    background-image: url(/app-files/img/sprite/icon.svg#blank2-usage);
    background-position: center center !important;
    background-size: contain !important;
    content: "";
    text-indent: 100%;
    vertical-align: middle;
    white-space: nowrap;
    transform: translateY(-50%);
  }

  .header-link-text {
    margin: 0;
  }

  .header-snav__item:nth-last-child(-n+3) {
    border-bottom: 1px solid #ddd;
  }

  .header-snav__item:nth-last-child(-n+1) {
    border-bottom: none;
  }

  .header-column-v4 {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    border-radius: 15px;
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.2);
    padding: 20px 12px;
  }

  .header-column-v4__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
  }

  .header-column-v4__item {
    width: 100%;
    padding-block: 8px;
    border-bottom: 1px solid #ddd;
  }

  .header-column-v4__item:first-child {
    padding-top: 0;
  }

  .header-column-v4__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }

  .header-column-v4__type {
    position: relative;
    padding-left: 32px;
    text-decoration: underline;
    font-weight: 700;
  }

  .header-column-v4__type::before {
    position: absolute;
    top: 0.1em;
    left: 0;
    width: 10px;
    height: 10px;
    display: inline-block;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-top: 1px solid #00a469;
    border-right: 1px solid #00a469;
    content: "";
    vertical-align: middle;
    transform: rotate(45deg);
  }

  .header-column-v4__type > span {
    text-decoration: underline;
  }
}

/*
 * SP
 */

@media screen and (max-width: 768.98px) {
  .main-login__box__link > [class*=__type]:before {
    margin-right: 4px;
  }  
}