/* Header CTA — fix global img{width:100%} blow-up + Figma layout */

/* Logo: same size as LP on every page */
.header_logo,
.header .header_logo {
  width: 160px;
  max-width: 16rem;
  height: auto;
  margin: 0;
  flex-shrink: 0;
}

@media only screen and (max-width: 767px) {
  .header_logo,
  .header .header_logo {
    width: 15rem;
    max-width: 15rem;
  }
}

.header_logo a {
  display: block;
  line-height: 0;
}

.header_logo img,
.header .header_logo img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  display: block;
}

.header_menu {
  flex-wrap: nowrap !important;
  gap: 0;
}

.header_menu > li {
  flex-shrink: 0;
}

.header_menu > li.header_cta {
  margin-left: 1.2rem !important;
}

.header_menu > li.header_cta:nth-of-type(7) {
  margin-left: 2.4rem !important;
}

.header_menu > li.header_cta--login,
.header_menu > li:last-of-type {
  margin-left: 1.6rem !important;
}

.header_btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.6rem !important;
  font-weight: 700;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

/* Critical: override theme reset img { width: 100% } */
.header_btn img,
.header .header_btn img,
.header_menu .header_btn img,
.header_nav .header_btn img,
.sa-header .header_btn img {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  flex: 0 0 18px !important;
  display: inline-block !important;
  vertical-align: middle;
  object-fit: contain;
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none !important;
  background: none !important;
  border-radius: 0 !important;
}

.header_btn--login img,
.header .header_btn--login img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  flex: 0 0 16px !important;
}

/* Kill old arrow-span pseudo styles if any leftover */
.header_btn span,
.header_btn::after,
.header_btn::before {
  display: none !important;
}

.header_btn--consult {
  width: 13rem !important;
  min-width: 13rem;
  height: 4.5rem !important;
  padding: 0 1.4rem !important;
  background: #FFB700 !important;
  color: #3C3C3C !important;
  border: none !important;
  border-radius: 4px;
  font-size: 1.3rem;
}

.header_btn--consult:hover {
  background: #3C3C3C !important;
  color: #fff !important;
  opacity: 1 !important;
}

.header_btn--consult:hover img {
  filter: brightness(0) invert(1);
}

.header_btn--register {
  width: 13rem !important;
  min-width: 13rem;
  height: 4.5rem !important;
  padding: 0 1.4rem !important;
  background: #fff !important;
  color: #1880BB !important;
  border: 2px solid #1880BB !important;
  border-radius: 4px;
  font-size: 1.3rem;
}

.header_btn--register:hover {
  background: #1880BB !important;
  color: #fff !important;
  opacity: 1 !important;
}

.header_btn--register:hover img {
  filter: brightness(0) invert(1);
}

.header_btn--login {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0.5rem 0 !important;
  background: transparent !important;
  color: #1880BB !important;
  border: none !important;
  border-bottom: 2px solid #1880BB !important;
  border-radius: 0 !important;
  font-size: 1.3rem;
}

.header_btn--login:hover {
  color: #FFB700 !important;
  border-bottom-color: #FFB700 !important;
  opacity: 1 !important;
}

.header_btn--login:hover img {
  filter: invert(62%) sepia(79%) saturate(1200%) hue-rotate(360deg) brightness(102%) contrast(103%);
}

/* SP drawer */
.header_nav .header_btn--consult,
.header_nav .header_btn--register,
.header_nav .header_btn.is-sp-full {
  width: 100% !important;
  height: 5.6rem !important;
  font-size: 1.5rem;
}

.header_nav .header_btn--login.is-sp-link {
  display: inline-flex !important;
  width: auto !important;
  margin-top: 0.8rem;
}

.header_nav li:has(.header_btn--consult)::after,
.header_nav li:has(.header_btn--register)::after,
.header_nav li:has(.header_btn--login)::after {
  display: none !important;
}

.header_nav li:has(.header_btn) {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

@media screen and (max-width: 1200px) {
  .header_menu > li:not(.header_cta) {
    margin-left: 1.2rem !important;
    font-size: 1.2rem !important;
  }

  .header_btn--consult,
  .header_btn--register {
    width: 12rem !important;
    min-width: 12rem;
    padding: 0 1rem !important;
    height: 3.6rem !important;
    font-size: 1.2rem;
  }
}

/* ログイン中の管理バー分だけ固定ヘッダーを下げる */
body.admin-bar .header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .header {
    top: 46px;
  }
}

/* 600px以下では管理バーが固定表示ではなくなる */
@media screen and (max-width: 600px) {
  body.admin-bar .header {
    top: 0;
  }
}
