/**
 * header-override.css
 * SWELLのスタイルをリセット＆本体(TCD MONAD)のヘッダーデザインを再現する
 * セレクタはIDで限定し、SWELLの既存スタイルとの競合を回避する
 */

/* ============================================================
   フォント・共通リセット（ヘッダー・お知らせバー内）
   ============================================================ */
#header_message,
#header,
#header *,
#drawer_overlay {
  box-sizing: border-box;
  font-family: "Noto Sans JP", "Yu Gothic", "游ゴシック", YuGothic, "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif;
}

/* SWELLデフォルトのヘッダー系をリセット */
.l-header,
.l-header__inner,
.l-headerMenu,
.l-headerMenu__inner {
  display: none !important;
}

/* ============================================================
   お知らせバー (#header_message)
   ============================================================ */
#header_message {
  background: #dd3333;
  color: #ffffff;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  line-height: 1.6;
  width: 100%;
  position: relative;
  z-index: 1000;
}

#header_message p {
  margin: 0;
  padding: 0;
  color: #ffffff;
  font-size: 13px;
}

#header_message a {
  color: #ffffff;
  text-decoration: underline;
}

/* ============================================================
   ヘッダー本体 (#header)
   ============================================================ */
#header {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 70px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   ロゴ (#header_logo)
   ============================================================ */
#header_logo {
  margin: 0;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

#header_logo a {
  display: block;
  text-decoration: none;
  border: none;
}

#header_logo img {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* PCロゴ表示 / SPロゴ非表示 */
#header_logo img.logo_image.pc {
  display: block;
  width: 350px;
  height: 53px;
}

#header_logo img.logo_image.mobile {
  display: none;
}

/* ============================================================
   グローバルナビ (#global_menu)
   ============================================================ */
#global_menu {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  margin: 0 16px 0 24px;
}

#menu-gnav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

#menu-gnav > .menu-item {
  position: relative;
  margin: 0;
  padding: 0;
}

#menu-gnav > .menu-item > a {
  display: block;
  padding: 0 12px;
  height: 70px;
  line-height: 70px;
  font-size: 16px;
  color: rgb(0, 0, 0);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  transition: color 0.2s, background 0.2s;
  font-weight: 500;
}

#menu-gnav > .menu-item > a:hover,
#menu-gnav > .menu-item:hover > a {
  color: rgb(123, 183, 146);
  background: rgba(123, 183, 146, 0.06);
}

/* ---- サブメニュー ---- */
#menu-gnav .sub-menu {
  display: none;
  position: absolute;
  top: 70px;
  left: 0;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-top: 2px solid rgb(123, 183, 146);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

#menu-gnav > .menu-item:hover > .sub-menu {
  display: block;
}



#menu-gnav .sub-menu li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #f0f0f0;
}

#menu-gnav .sub-menu li:last-child {
  border-bottom: none;
}

#menu-gnav .sub-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 12px;
  color: #333333;
  text-decoration: none;
  line-height: 1.5;
  transition: background 0.15s, color 0.15s;
}

#menu-gnav .sub-menu a:hover {
  background: rgba(123, 183, 146, 0.1);
  color: rgb(0, 0, 0);
  padding-left: 20px;
}

/* ============================================================
   電話番号 (#header_tel)
   ============================================================ */
#header_tel {
  flex-shrink: 0;
  margin-left: 12px;
}

#header_tel a.tel {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: rgb(123, 183, 146);
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border: none;
}

#header_tel a.tel:hover {
  opacity: 0.75;
}

#header_tel a.tel::before {
  content: "\260E";
  margin-right: 4px;
  font-size: 20px;
}

/* ============================================================
   SPハンバーガーボタン (#drawer_menu_button)
   ============================================================ */
#drawer_menu_button {
  display: none; /* PC時は非表示 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  z-index: 1002;
  position: relative;
}

#drawer_menu_button span {
  display: block;
  width: 26px;
  height: 2px;
  background: #333333;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}

/* ハンバーガー open 時 → ×に変形 */
#header.menu-open #drawer_menu_button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#header.menu-open #drawer_menu_button span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#header.menu-open #drawer_menu_button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   ドロワーオーバーレイ
   ============================================================ */
#drawer_overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

#drawer_overlay.active {
  display: block;
}

/* ============================================================
   レスポンシブ：SP（768px以下）
   ============================================================ */
@media screen and (max-width: 768px) {

  #header {
    padding: 0 16px;
    height: 60px;
  }

  /* SPロゴ切り替え */
  #header_logo img.logo_image.pc {
    display: none;
  }

  #header_logo img.logo_image.mobile {
    display: block;
    width: 200px;
    height: auto;
  }

  /* 電話番号：SP では非表示（本体と同じ挙動） */
  #header_tel {
    display: none;
  }

  /* PCナビ非表示 */
  #global_menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: #ffffff;
    overflow-y: auto;
    z-index: 999;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0;
    padding: 70px 0 40px;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  #global_menu.is-open {
    display: flex;
    transform: translateX(0);
  }

  #menu-gnav {
    flex-direction: column;
    width: 100%;
    gap: 0;
    align-items: stretch;
  }

  #menu-gnav > .menu-item {
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
  }

  #menu-gnav > .menu-item > a {
    height: auto;
    line-height: 1.5;
    padding: 14px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* サブメニュー開閉矢印 */
  #menu-gnav > .menu-item-has-children > a::after {
    content: "＋";
    font-size: 18px;
    color: #aaa;
    font-weight: 300;
    line-height: 1;
  }

  #menu-gnav > .menu-item-has-children.sub-open > a::after {
    content: "－";
  }

  /* SPサブメニュー（アコーディオン） */
  #menu-gnav .sub-menu {
    display: none;
    position: static;
    top: auto;
    left: auto;
    border: none;
    border-top: 1px solid #f0f0f0;
    box-shadow: none;
    background: #f8f8f8;
    padding: 0;
    min-width: 0;
    width: 100%;
  }

  #menu-gnav > .menu-item-has-children.sub-open > .sub-menu {
    display: block;
  }

  #menu-gnav .sub-menu a {
    padding: 12px 16px 12px 32px;
    font-size: 13px;
  }

  /* ハンバーガーボタン表示 */
  #drawer_menu_button {
    display: flex;
  }
}

/* ============================================================
   レスポンシブ：タブレット（769px〜1024px）
   ============================================================ */
@media screen and (min-width: 769px) and (max-width: 1024px) {

  #header {
    padding: 0 16px;
  }

  #menu-gnav > .menu-item > a {
    padding: 0 8px;
    font-size: 12px;
  }

  #header_logo img.logo_image.pc {
    width: 260px;
    height: auto;
  }

  #header_tel a.tel {
    font-size: 15px;
  }
}
