/* ============================================
   sh-header: 新ヘッダー（Phase 2）
   プレフィックス sh-header で既存CSSと衝突回避
   ============================================ */

/* --- 変数 --- */
:root {
  --sh-primary: #007b8e;
  --sh-primary-light: #e5f8fc;
  --sh-border: #afc2c6;
  --sh-logo-icon: #009fb9;
  --sh-text: #424040;
  --sh-font: 'Noto Sans JP', sans-serif;
}

/* --- リセット --- */
.sh-header,
.sh-header *,
.sh-header *::before,
.sh-header *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* common.css のリンクスタイルを上書き（header.css は common.css の後に読み込まれる） */
.sh-header a,
.sh-header a:link,
.sh-header a:visited,
.sh-header a:hover,
.sh-header a:active {
  text-decoration: none;
  color: inherit;
}

/* .l-header（親コンテナ）の干渉を打ち消す */
.l-header.pageHeader {
  position: static;
  border-bottom: none;
}

/* 旧固定ヘッダー用の padding-top を解除（新ヘッダーは static のため不要） */
#pageContainer,
.l-contents {
  padding-top: 0 !important;
}

/* --- ヘッダー本体 ---
   既存サイトの z-index: 100000〜999999（検索パネル等）、
   toll-revision: 1000000（追従バナー）、1000001（モーダル）
   ヘッダーは追従バナーより前面に配置する */
.sh-header {
  font-family: var(--sh-font);
  width: 100%;
  position: relative;
  z-index: 1000002;
}

/* === PC: トップバー === */
.sh-header__top {
  background: #fff;
  height: 64px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 4;
}

.sh-header__top-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ロゴ */
.sh-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.sh-header__logo-icon {
  width: 35px;
  height: 32px;
  flex-shrink: 0;
}

.sh-header__logo-text {
  height: 22px;
  width: auto;
  flex-shrink: 0;
}

/* 右側ボタン群 */
.sh-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 首都高ドライバーズサイトボタン */
.sh-header__drivers-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 8px 0 12px;
  background: var(--sh-primary-light);
  border: 1px solid var(--sh-primary);
  border-radius: 3px;
  color: var(--sh-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.sh-header .sh-header__drivers-btn:link,
.sh-header .sh-header__drivers-btn:visited,
.sh-header .sh-header__drivers-btn:hover,
.sh-header .sh-header__drivers-btn:active {
  text-decoration: none;
  color: var(--sh-text);
}

.sh-header .sh-header__drivers-btn:hover {
  opacity: 0.8;
}

.sh-header__drivers-btn .sh-header__drivers-logo {
  height: 14px;
  width: auto;
}

.sh-header__drivers-btn .sh-header__arrow-sm {
  width: 5px;
  height: 8px;
  flex-shrink: 0;
}

/* Languageアコーディオン */
.sh-header__lang-wrap {
  position: relative;
}

.sh-header__lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--sh-primary);
  border-radius: 2px;
  color: var(--sh-primary);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}

.sh-header__lang-btn:hover {
  border-color: #1599ad;
  color: #1599ad;
}

.sh-header__lang-btn .sh-header__globe-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sh-header__lang-btn .sh-header__arrow-down {
  width: 8px;
  height: 5px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sh-header__lang-wrap--open .sh-header__lang-btn .sh-header__arrow-down {
  transform: rotate(180deg);
}

/* Language ドロップダウン */
.sh-header__lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--sh-primary);
  border-top: none;
  z-index: 10;
  overflow: hidden;
  padding: 10px 5%;
}

.sh-header__lang-wrap--open .sh-header__lang-dropdown {
  display: block;
}

.sh-header__lang-option {
  display: block;
  padding: 8px 16px 8px 1.35em;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  position: relative;
  line-height: 1.35;
}

/* リンク前の右向き矢印（shutoko.jp c-link-list準拠） */
.sh-header__lang-option::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  border-right: 1px solid var(--sh-primary);
  border-top: 1px solid var(--sh-primary);
  transform: rotate(45deg) translateY(-50%);
  transform-origin: top center;
}

.sh-header .sh-header__lang-option,
.sh-header .sh-header__lang-option:link,
.sh-header .sh-header__lang-option:visited,
.sh-header .sh-header__lang-option:active {
  color: var(--sh-primary);
  text-decoration: none;
}

.sh-header .sh-header__lang-option:hover {
  color: #1599ad;
  text-decoration: none;
}

.sh-header .sh-header__lang-option:hover::before {
  border-right-color: #1599ad;
  border-top-color: #1599ad;
}

/* === PC: ナビゲーションバー === */
.sh-header__nav {
  background: var(--sh-primary);
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  position: relative;
  z-index: 3;
}

.sh-header__nav-inner {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 1240px;
}

.sh-header__nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.sh-header .sh-header__nav-item:link,
.sh-header .sh-header__nav-item:visited,
.sh-header .sh-header__nav-item:hover,
.sh-header .sh-header__nav-item:active {
  color: #fff;
  text-decoration: none;
}

.sh-header .sh-header__nav-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sh-header__nav-item--active,
.sh-header .sh-header__nav-item--active:link,
.sh-header .sh-header__nav-item--active:visited,
.sh-header .sh-header__nav-item--active:hover,
.sh-header .sh-header__nav-item--active:active {
  background: #fff;
  color: var(--sh-primary);
  font-weight: 700;
}

/* サイト切替ナビ項目（2行・14px） */
.sh-header__nav-item--switch {
  font-size: 14px;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

/* SP: サイト切替ナビ項目（2行） */
.sh-header__sp-nav-item--switch {
  line-height: 1.6;
}

/* === SP: ハンバーガーボタン === */
.sh-header__hamburger {
  display: none; /* PCでは非表示 */
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 47px;
  background: #fff;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px 4px;
  z-index: 5;
}

.sh-header__hamburger-icon {
  width: 18px;
  height: 13px;
}

.sh-header__hamburger-label {
  font-family: var(--sh-font);
  font-size: 9px;
  font-weight: 500;
  color: var(--sh-primary);
  line-height: 1.3;
}

/* ハンバーガー開閉時の切り替え */
.sh-header__hamburger .sh-header__icon-menu { display: block; }
.sh-header__hamburger .sh-header__icon-close { display: none; }
.sh-header__hamburger .sh-header__label-menu { display: block; }
.sh-header__hamburger .sh-header__label-close { display: none; }

.sh-header__hamburger--open .sh-header__icon-menu { display: none; }
.sh-header__hamburger--open .sh-header__icon-close { display: block; }
.sh-header__hamburger--open .sh-header__label-menu { display: none; }
.sh-header__hamburger--open .sh-header__label-close { display: block; }

.sh-header__close-icon {
  width: 15px;
  height: 15px;
}

/* === SP: メニューパネル === */
.sh-header__sp-menu {
  display: none; /* PCでは非表示 */
}

.sh-header__sp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.sh-header__sp-panel {
  position: fixed;
  top: 48px;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 2;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.3s, visibility 0.3s;
  padding-bottom: 16px;
}

/* メニュー開閉 */
.sh-header__sp-menu--open .sh-header__sp-overlay {
  opacity: 1;
  visibility: visible;
}

.sh-header__sp-menu--open .sh-header__sp-panel {
  transform: translateY(0);
  visibility: visible;
}

/* SP: Language アコーディオン */
.sh-header__sp-lang-wrap {
  margin: 24px 17px 0;
}

.sh-header__sp-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #666;
  border-radius: 0;
  color: var(--sh-primary);
  font-size: 14px;
  font-family: var(--sh-font);
  cursor: pointer;
}

.sh-header__sp-lang-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sh-header__sp-lang-left .sh-header__globe-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sh-header__sp-lang-current {
  font-weight: 500;
  margin-left: 4px;
}

.sh-header__sp-lang .sh-header__arrow-down {
  width: 8px;
  height: 5px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sh-header__sp-lang-wrap--open .sh-header__sp-lang .sh-header__arrow-down {
  transform: rotate(180deg);
}

/* SP: Language ドロップダウン（shutoko.jp準拠） */
.sh-header__sp-lang-dropdown {
  display: none;
  border: 1px solid #666;
  border-top: none;
  background: #fff;
  padding: 5%;
  overflow: hidden;
}

.sh-header__sp-lang-wrap--open .sh-header__sp-lang-dropdown {
  display: block;
}

.sh-header__sp-lang-option {
  display: block;
  padding: 6px 0 6px 1.35em;
  font-size: 13px;
  font-weight: 400;
  position: relative;
  line-height: 1.35;
}

/* SP: リンク前の右向き矢印（shutoko.jp c-link-list準拠） */
.sh-header__sp-lang-option::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-right: 1px solid var(--sh-primary);
  border-top: 1px solid var(--sh-primary);
  transform: rotate(45deg) translateY(-50%);
  transform-origin: top center;
}

.sh-header .sh-header__sp-lang-option,
.sh-header .sh-header__sp-lang-option:link,
.sh-header .sh-header__sp-lang-option:visited,
.sh-header .sh-header__sp-lang-option:active {
  color: var(--sh-primary);
  text-decoration: none;
}

.sh-header__sp-lang-option + .sh-header__sp-lang-option {
  margin-top: 6%;
}

.sh-header .sh-header__sp-lang-option:hover {
  color: #1599ad;
  text-decoration: none;
}

.sh-header .sh-header__sp-lang-option:hover::before {
  border-right-color: #1599ad;
  border-top-color: #1599ad;
}

/* SP: ナビゲーション */
.sh-header__sp-nav {
  margin-top: 24px;
}

.sh-header__sp-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 20px;
  background: #fff;
  border-top: 1px solid var(--sh-border);
  border-bottom: 1px solid var(--sh-border);
  margin-bottom: -1px;
  color: var(--sh-primary);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.sh-header .sh-header__sp-nav-item:link,
.sh-header .sh-header__sp-nav-item:visited,
.sh-header .sh-header__sp-nav-item:active {
  text-decoration: none;
  color: var(--sh-primary);
}

.sh-header .sh-header__sp-nav-item:hover {
  background: var(--sh-primary-light);
}

.sh-header__sp-nav-item .sh-header__arrow-right {
  width: 9px;
  height: 14px;
  flex-shrink: 0;
}

/* SP: ドライバーズサイトボタン */
.sh-header__sp-drivers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 17px 0;
  height: 48px;
  padding: 0 8px 0 12px;
  background: var(--sh-primary-light);
  border: 1px solid var(--sh-primary);
  border-radius: 4px;
  color: var(--sh-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.sh-header .sh-header__sp-drivers:link,
.sh-header .sh-header__sp-drivers:visited,
.sh-header .sh-header__sp-drivers:active {
  text-decoration: none;
  color: var(--sh-text);
}

.sh-header .sh-header__sp-drivers:hover {
  opacity: 0.8;
}

.sh-header__sp-drivers-logo {
  width: 14px;
  height: 13px;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

.sh-header__sp-drivers .sh-header__arrow-right {
  width: 9px;
  height: 14px;
  flex-shrink: 0;
}

/* SP: 閉じるボタン */
.sh-header__sp-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 0;
  background: none;
  border: none;
  color: var(--sh-primary);
  font-family: var(--sh-font);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.sh-header__sp-close-btn:hover {
  opacity: 0.7;
}

.sh-header__sp-close-x {
  font-size: 16px;
}

/* ==============================
   レスポンシブ: SP (max-width: 979px)
   shutoko.jp準拠: 980px以上がPC、979px以下がSP
   ============================== */
@media (max-width: 979px) {
  .sh-header__top {
    height: 48px;
    border-bottom: 1px solid var(--sh-border);
  }

  .sh-header__top-inner {
    padding: 0 12px;
  }

  .sh-header__logo-icon {
    width: 24px;
    height: 22px;
  }

  .sh-header__logo-text {
    height: 15px;
  }

  /* PCナビ・右上ボタンを非表示 */
  .sh-header__actions {
    display: none;
  }

  .sh-header__nav {
    display: none;
  }

  /* ハンバーガーを表示 */
  .sh-header__hamburger {
    display: flex;
  }

  /* SPメニューを有効化 */
  .sh-header__sp-menu {
    display: block;
  }
}
