/*
 * 全ページ統一ヘッダー（pcw-header）スタイル
 *
 * view/header.php の $force_unified_header フラグが true のとき、
 * フロントページ・home_2系・contact以外の<header>に .pcdo-unified-header クラスが付き、本ファイルのスタイルが適用される。
 *
 * 戻し方:
 *   1. view/header.php の $force_unified_header を false にする
 *   2. もしくは functions/pcw-header-enqueue.php の wp_enqueue_style('pcdo-pcw-header', ...) 行を削除/コメントアウトする
 *
 * 出典: assets/css/home_2.css の pcw-header-stack 系ブロック（100-378行）+ レスポンシブ部
 *       下層ページではfixedではなくstatic配置にして、本文との被りを防ぐ
 */

header.pcdo-unified-header {
  --pcw-header-blue: #1368b7;
  --pcw-header-navy: #13304d;
  --pcw-header-green: #20a363;
  --pcw-header-amber: #f2b705;
  --pcw-header-border: #d9e3ec;
  --pcw-header-muted: #5c6f82;
  --pcw-header-text: #182638;
  display: block;
  width: 100%;
  color: var(--pcw-header-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
}

header.pcdo-unified-header * {
  box-sizing: border-box;
}

header.pcdo-unified-header .pcw-header-stack {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  background: #fff;
}

/* fixed化に伴う本文の被り回避: 統一ヘッダー直後の <main> にヘッダー分の余白を追加 */
header.pcdo-unified-header ~ main {
  padding-top: 214px;
}

@media screen and (max-width: 1023px) {
  header.pcdo-unified-header ~ main {
    padding-top: 200px;
  }
}

@media screen and (max-width: 834px) {
  header.pcdo-unified-header ~ main {
    padding-top: 88px;
  }
}

header.pcdo-unified-header .pcw-shell {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
}

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

header.pcdo-unified-header .pcw-topbar {
  background: var(--pcw-header-navy);
  color: #fff;
  font-size: 13px;
}

header.pcdo-unified-header .pcw-topbar__inner,
header.pcdo-unified-header .pcw-store-header__inner,
header.pcdo-unified-header .pcw-category-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

header.pcdo-unified-header .pcw-topbar p {
  margin: 0;
  font-weight: 700;
}

header.pcdo-unified-header .pcw-topbar__message {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

header.pcdo-unified-header .pcw-topbar__banner {
  display: block;
  flex: 0 1 auto;
  line-height: 0;
}

header.pcdo-unified-header .pcw-topbar__banner img {
  display: block;
  width: auto;
  max-width: min(320px, 32vw);
  height: 30px;
}

header.pcdo-unified-header .pcw-topbar a {
  color: inherit;
  text-decoration: none;
}

header.pcdo-unified-header .pcw-topbar__links {
  display: flex;
  gap: 18px;
  white-space: nowrap;
}

header.pcdo-unified-header .pcw-store-header {
  background: #fff;
  border-bottom: 1px solid var(--pcw-header-border);
  padding: 18px 0;
}

header.pcdo-unified-header .pcw-logo {
  display: block;
  width: 220px;
  flex: 0 0 auto;
}

header.pcdo-unified-header .pcw-logo img {
  display: block;
  width: 100%;
  height: auto;
}

header.pcdo-unified-header .pcw-search-area {
  flex: 1 1 520px;
  max-width: 610px;
}

header.pcdo-unified-header .pcw-search {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 2px solid var(--pcw-header-blue);
  border-radius: 8px;
  overflow: hidden;
}

header.pcdo-unified-header .pcw-search input,
header.pcdo-unified-header .pcw-search button {
  border: 0;
  font: inherit;
}

header.pcdo-unified-header .pcw-search input {
  min-width: 0;
  padding: 12px 14px;
}

header.pcdo-unified-header .pcw-search button {
  min-width: 82px;
  padding: 0 18px;
  background: var(--pcw-header-blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

header.pcdo-unified-header .pcw-phone {
  text-align: right;
  line-height: 1.35;
}

header.pcdo-unified-header .pcw-phone span,
header.pcdo-unified-header .pcw-phone small {
  display: block;
  color: var(--pcw-header-muted);
  font-size: 12px;
}

header.pcdo-unified-header .pcw-phone a {
  display: block;
  color: var(--pcw-header-navy);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

header.pcdo-unified-header .pcw-mobile-menu {
  display: none;
}

header.pcdo-unified-header .pcw-category-nav {
  position: relative;
  z-index: 20;
  background: var(--pcw-header-blue);
  color: #fff;
  box-shadow: 0 2px 12px rgba(19, 48, 77, .14);
}

header.pcdo-unified-header .pcw-category-nav__inner {
  justify-content: center;
  overflow: visible;
}

header.pcdo-unified-header .pcw-category-nav a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 104px;
  min-height: 60px;
  padding: 9px 14px;
  color: inherit;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

header.pcdo-unified-header .pcw-category-nav a:hover,
header.pcdo-unified-header .pcw-category-nav a:focus-visible {
  background: rgba(255, 255, 255, .16);
}

header.pcdo-unified-header .pcw-category-nav a.pcw-nav-cta {
  flex-direction: row;
  gap: 8px;
  min-width: 132px;
  min-height: 46px;
  align-self: center;
  margin-left: 4px;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 3px 0 rgba(19, 48, 77, .2);
}

header.pcdo-unified-header .pcw-category-nav a.pcw-nav-cta--business {
  background: var(--pcw-header-amber);
  color: var(--pcw-header-navy);
}

header.pcdo-unified-header .pcw-category-nav a.pcw-nav-cta--contact {
  background: var(--pcw-header-green);
  color: #fff;
}

header.pcdo-unified-header .pcw-category-nav a.pcw-nav-cta:hover,
header.pcdo-unified-header .pcw-category-nav a.pcw-nav-cta:focus-visible {
  filter: brightness(.96);
  transform: translateY(1px);
}

/* タブレット以下：ストアヘッダーを縦並びに */
@media screen and (max-width: 1023px) {
  header.pcdo-unified-header .pcw-store-header__inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  header.pcdo-unified-header .pcw-search-area,
  header.pcdo-unified-header .pcw-search {
    max-width: none;
    width: 100%;
  }

  header.pcdo-unified-header .pcw-phone {
    text-align: left;
  }
}

/* スマホ：トップバーとカテゴリーナビ非表示、ハンバーガー表示 */
@media screen and (max-width: 834px) {
  header.pcdo-unified-header .pcw-shell {
    width: min(100% - 40px, 1180px);
  }

  header.pcdo-unified-header .pcw-topbar {
    display: none;
  }

  header.pcdo-unified-header .pcw-store-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  header.pcdo-unified-header .pcw-store-header .pcw-search-area,
  header.pcdo-unified-header .pcw-store-header .pcw-phone,
  header.pcdo-unified-header .pcw-category-nav {
    display: none;
  }

  header.pcdo-unified-header .pcw-mobile-menu {
    display: block;
    position: relative;
    margin-left: auto;
  }

  header.pcdo-unified-header .pcw-mobile-menu summary {
    width: 46px;
    height: 46px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid var(--pcw-header-blue);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    list-style: none;
  }

  header.pcdo-unified-header .pcw-mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  header.pcdo-unified-header .pcw-mobile-menu summary span {
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--pcw-header-blue);
    transition: transform .18s ease, opacity .18s ease;
  }

  header.pcdo-unified-header .pcw-mobile-menu[open] summary span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  header.pcdo-unified-header .pcw-mobile-menu[open] summary span:nth-child(2) {
    opacity: 0;
  }

  header.pcdo-unified-header .pcw-mobile-menu[open] summary span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  header.pcdo-unified-header .pcw-mobile-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    width: min(88vw, 370px);
    padding: 16px;
    border: 1px solid var(--pcw-header-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(19, 48, 77, .18);
  }

  header.pcdo-unified-header .pcw-mobile-search {
    width: 100%;
    grid-template-columns: 1fr auto;
  }

  header.pcdo-unified-header .pcw-mobile-search input,
  header.pcdo-unified-header .pcw-mobile-search button {
    min-height: 42px;
  }

  header.pcdo-unified-header .pcw-mobile-menu__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  header.pcdo-unified-header .pcw-mobile-menu__links a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 10px;
    border-radius: 6px;
    background: #edf6ff;
    color: var(--pcw-header-navy);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
  }

  header.pcdo-unified-header .pcw-mobile-menu__links a.pcw-mobile-menu__cta {
    grid-column: span 2;
    justify-content: center;
    min-height: 46px;
    font-weight: 900;
    box-shadow: 0 3px 0 rgba(19, 48, 77, .14);
  }

  header.pcdo-unified-header .pcw-mobile-menu__links a.pcw-mobile-menu__cta--business {
    background: var(--pcw-header-amber);
    color: var(--pcw-header-navy);
  }

  header.pcdo-unified-header .pcw-mobile-menu__links a.pcw-mobile-menu__cta--contact {
    background: var(--pcw-header-green);
    color: #fff;
  }

  header.pcdo-unified-header .pcw-mobile-menu__phone {
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    background: var(--pcw-header-navy);
    color: #fff;
    line-height: 1.35;
  }

  header.pcdo-unified-header .pcw-mobile-menu__phone span,
  header.pcdo-unified-header .pcw-mobile-menu__phone small {
    display: block;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
  }

  header.pcdo-unified-header .pcw-mobile-menu__phone a {
    display: block;
    margin: 3px 0;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    text-decoration: none;
  }
}

@media screen and (max-width: 480px) {
  header.pcdo-unified-header .pcw-shell {
    width: min(100% - 22px, 1180px);
  }

  header.pcdo-unified-header .pcw-logo {
    width: 162px;
  }
}
