/*
 * EC-CUBE / WordPress 共通ヘッダー
 * 既存の配色・フォント・固定ヘッダーの見え方を引き継ぎ、操作だけを整理する。
 */
.global-header,
.global-header * {
  box-sizing: border-box;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.global-header {
  position: fixed;
  z-index: 99;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 0 4px 0 rgba(81, 67, 54, .45);
  font-family: "source-han-sans-japanese", sans-serif;
  transition: top .5s ease;
}

.global-header__campaign {
  min-height: 29px;
  padding: 5px 12px;
  background: #ffd700;
  color: #342d28;
  font-style: normal;
  font-weight: 300;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.global-header__campaign a {
  color: inherit;
  text-decoration: none;
}

.global-header__inner {
  display: grid;
  grid-template-columns: 144px minmax(250px, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: 980px;
  min-height: 78px;
  margin: 0 auto;
}

.global-header__logo {
  margin: 0;
  line-height: 0;
}

.global-header__logo a,
.global-header__logo img {
  display: block;
}

.global-header__logo img {
  width: 136px;
  height: auto;
}

.global-header__search {
  display: flex;
  min-width: 0;
  min-height: 42px;
  margin: 0;
}

.global-header__search select,
.global-header__search input,
.global-header__search button {
  min-height: 42px;
  border: 1px solid #c9cdd1;
  border-radius: 0;
  color: #20252a;
  font: inherit;
}

.global-header__search select {
  width: 108px;
  padding: 0 26px 0 11px;
  background: #f6f7f8;
  font-size: 13px;
  font-weight: 700;
}

.global-header__search select[data-header-search-category] {
  width: 144px;
  border-left: 0;
  font-weight: 400;
}

.global-header__search input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 12px;
  border-left: 0;
  font-size: 14px;
}

.global-header__search input::placeholder {
  color: #747a80;
}

.global-header__search button {
  display: inline-flex;
  flex: 0 0 62px !important;
  width: 62px !important;
  min-width: 62px !important;
  max-width: none !important;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: #32383f;
  border-radius: 0 4px 4px 0;
  background: #32383f;
  color: #fff;
  word-break: keep-all;
  white-space: nowrap;
  cursor: pointer;
}

.global-header__search button .global-header__icon--search {
  display: none;
}

.global-header__search button .global-header__search-submit-label {
  display: inline !important;
  width: auto !important;
  min-width: 2em;
  line-height: 1;
  word-break: keep-all;
  white-space: nowrap;
  writing-mode: horizontal-tb !important;
}

.global-header__search button:hover,
.global-header__search button:focus {
  background: #1f252b;
}

.global-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.global-header__member-links {
  display: flex;
  gap: 4px;
}

.global-header__member-link,
.global-header__cart {
  min-height: 42px;
  border: 1px solid #c9cdd1;
  border-radius: 4px;
  color: #20252a;
  text-decoration: none;
}

.global-header__member-link {
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  background: #fff;
  font-size: 12px;
  gap: 4px;
  white-space: nowrap;
}

.global-header__member-link.global-header__mobile-member-link {
  display: none;
}

.global-header__member-link--primary {
  border-color: #83ad89;
  background: #fff;
  color: #4e8e59;
}

.global-header__member-link:hover,
.global-header__member-link:focus {
  border-color: #32383f;
  color: #20252a;
}

.global-header__member-link--primary:hover,
.global-header__member-link--primary:focus {
  border-color: #5e9466;
  background: #f5faf5;
  color: #3e7747;
}

.global-header__member-link.is-favorite .global-header__legacy-icon {
  display: none;
}

.global-header__member-link.is-favorite::after {
  color: #c53f43;
  content: "♥";
  font-family: Arial, sans-serif;
  font-size: 17px;
  line-height: 1;
}

.global-header__favorite-count {
  color: #c53f43;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.global-header__cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 4px 10px;
  border-color: #efc9cb;
  background: #fff0f0;
  color: #c53f43;
}

.global-header__cart:hover,
.global-header__cart:focus {
  border-color: #d98d91;
  background: #fff0f0;
  color: #c53f43;
}

.global-header__cart-copy {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 4px;
  row-gap: 1px;
  line-height: 1;
}

.global-header__cart-title {
  font-size: 11px;
  color: #20252a;
}

.global-header__cart-count {
  font-size: 16px;
  font-weight: 700;
  color: #c53f43;
}

.global-header__cart-note {
  grid-column: 1 / -1;
  color: #6c737a;
  font-size: 10px;
}

.global-header__cart-count--mobile {
  display: none;
}

.global-header__icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.global-header__legacy-icon {
  display: block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.global-header__legacy-icon[hidden] {
  display: none !important;
}

.global-header__icon--search::before {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.global-header__icon--search::after {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 8px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
  transform-origin: right center;
}

.global-header__icon--member::before {
  position: absolute;
  top: 1px;
  left: 5px;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  content: "";
}

.global-header__icon--member::after {
  position: absolute;
  right: 2px;
  bottom: 1px;
  left: 2px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  content: "";
}

.global-header__icon--cart::before {
  position: absolute;
  top: 4px;
  left: 1px;
  width: 14px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  content: "";
}

.global-header__icon--cart::after {
  position: absolute;
  bottom: 0;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  box-shadow: 8px 0 0 currentColor;
  background: currentColor;
  content: "";
}

.global-header__mobile-toggle {
  display: none;
}

/* 旧ヘッダーとメニューオーバーレイは表示させない。HTMLの削除はリリース前の整理で行う。 */
body > .header,
body > .main > .overlay {
  display: none !important;
}

.global-header ~ .main {
  margin-top: 123px;
}

@media screen and (max-width: 1020px) and (min-width: 768px) {
  .global-header__inner {
    grid-template-columns: 128px minmax(210px, 1fr) auto;
    gap: 10px;
    width: 95%;
  }

  .global-header__logo img {
    width: 122px;
  }

  .global-header__search select {
    width: 92px;
  }

  .global-header__search select[data-header-search-category] {
    width: 112px;
  }

  .global-header__member-link {
    padding: 0 7px;
    font-size: 11px;
  }

  .global-header__cart {
    min-width: 62px;
    padding: 4px 8px;
  }
}

@media screen and (max-width: 767px) {
  .global-header__campaign {
    min-height: 30px;
    padding: 5px 34px;
    font-size: 10px;
    line-height: 1.4;
  }

  .global-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 64px;
    height: 64px;
    padding: 0 8px 0 14px;
    gap: 0;
  }

  .global-header__logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .global-header__logo img {
    width: 122px;
  }

  .global-header__mobile-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #32383f;
    font: inherit;
    font-size: 9px;
    cursor: pointer;
  }

  .global-header__mobile-toggle[aria-expanded="true"] {
    color: #1f252b;
  }

  .global-header__mobile-toggle--search,
  .global-header__mobile-toggle--member {
    flex: 0 0 43px;
    width: 43px;
  }

  .global-header__mobile-toggle--search {
    margin-right: 4px;
  }

  .global-header__search {
    position: absolute;
    z-index: 1;
    top: 64px;
    right: 0;
    left: 0;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid #d9dde0;
    border-bottom: 1px solid #c9cdd1;
    background: #fff;
    box-shadow: 0 8px 15px rgba(32, 37, 42, .15);
  }

  .global-header.is-search-open .global-header__search {
    display: flex;
  }

  .global-header__search select,
  .global-header__search input {
    min-height: 43px;
    border: 1px solid #c9cdd1;
  }

  .global-header__search select {
    flex: 0 0 calc(50% - 4px);
    width: calc(50% - 4px);
    order: 1;
  }

  .global-header__search input {
    flex: 0 0 100%;
    width: 100%;
    order: 3;
  }

  .global-header__search select[data-header-search-category] {
    flex: 0 0 100%;
    width: 100%;
    border-left: 1px solid #c9cdd1;
    order: 3;
  }

  .global-header__search select[data-header-search-category] + .screen-reader-text + input {
    order: 4;
  }

  .global-header__search button {
    flex-basis: 62px;
    width: 62px !important;
    min-width: 62px !important;
    min-height: 43px;
    border-radius: 4px;
    order: 2;
  }

  .global-header__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
  }

  .global-header__member {
    display: flex;
    flex: 0 0 auto;
    height: 42px;
    align-items: center;
    gap: 4px;
  }

  .global-header__member-links {
    display: none;
  }

  .global-header__member-link.global-header__mobile-member-link {
    display: inline-flex;
    justify-content: center;
    min-height: 42px;
    height: 42px;
    min-width: 62px;
    padding: 0 5px;
    border-color: #c9cdd1;
    background: #fff;
    color: #20252a;
    font-size: 10px;
  }

  .global-header__member-link.global-header__mobile-member-link.global-header__member-link--primary {
    min-width: 82px;
    padding: 0 4px;
    border-color: #83ad89;
    color: #4e8e59;
    font-size: 9px;
  }

  .global-header__member-link.global-header__mobile-member-link .global-header__legacy-icon {
    width: 14px;
    height: 14px;
  }

  .global-header__member-link.global-header__mobile-member-link:hover,
  .global-header__member-link.global-header__mobile-member-link:focus {
    border-color: #32383f;
    background: #fff;
    color: #20252a;
  }

  .global-header__member-link.global-header__mobile-member-link.global-header__member-link--primary:hover,
  .global-header__member-link.global-header__mobile-member-link.global-header__member-link--primary:focus {
    border-color: #5e9466;
    background: #f5faf5;
    color: #3e7747;
  }

  .global-header__cart {
    display: inline-flex;
    flex: 0 0 58px;
    width: 58px;
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #efc9cb;
    border-radius: 4px;
    background: #fff0f0;
  }

  .global-header__cart-copy {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
  }

  .global-header__cart-count {
    position: static;
    min-width: 0;
    padding: 0;
    background: transparent;
    color: #c53f43;
    font-size: 18px;
  }

  .global-header__cart-title,
  .global-header__cart-note,
  .global-header__cart-count--desktop {
    display: none;
  }

  .global-header__cart-count--mobile {
    display: block;
  }

  .global-header__cart:hover,
  .global-header__cart:focus {
    border-color: #efc9cb;
    background: #fff0f0;
    color: #c53f43;
  }

  .global-header ~ .main {
    margin-top: 104px;
  }
}
