/* =========================================================
   ヘッダー ＋ グローバルナビ（980px 以下はドロワー）
   開閉は js（ハンバーガー）
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 10px 30px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
}
.header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header__logo img { width: 244px; height: 59px; object-fit: contain; }

.header__right { display: flex; align-items: center; }

.gnav { display: flex; align-items: center; gap: 30px; }
.gnav__list {
  display: flex;
  align-items: center;
  gap: 35px;
  font-size: 16px;
  font-weight: 700;
  color: var(--main);
  white-space: nowrap;
}
.gnav__list a { transition: opacity .2s; }
.gnav__list a:hover { opacity: .6; }

.gnav__cta { display: flex; align-items: center; gap: 10px; }

/* ドロワー専用のパーツ（ホーム・閉じるボタン・下部ロゴ）は PC では出さない */
.gnav__home,
.gnav__close,
.gnav__logo { display: none; }

/* ハンバーガー */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--main);
  transition: transform .3s, opacity .3s;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .4);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .gnav__list { gap: 24px; }
  /* 幅が狭くなる分だけ、中身もまとめて縮める（基準 186×43 の 93%） */
  .gnav .btn-mini { --u: .93px; width: 160px; }
}

@media (max-width: 980px) {
  /* ドロワー化 */
  .hamburger { display: flex; }
  .gnav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 95;
    width: min(320px, 84vw);
    padding: 72px 28px 32px;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .35s ease;
    box-shadow: -4px 0 16px rgba(0, 0, 0, .12);
  }
  .gnav.is-open { transform: none; }

  /* 閉じるボタン（✕）：ドロワー右上 */
  .gnav__close { display: block; position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; }
  .gnav__close span {
    position: absolute;
    left: 10px;
    top: 21px;
    width: 24px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--text);
  }
  .gnav__close span:nth-child(1) { transform: rotate(45deg); }
  .gnav__close span:nth-child(2) { transform: rotate(-45deg); }

  .gnav__home { display: block; }

  /* 下部ロゴ：残りの余白を使って一番下に置く */
  .gnav__logo { display: block; margin-top: auto; padding-top: 24px; text-align: center; }
  /* 幅は CTA ボタン（ドロワー幅いっぱい）と同じに揃える */
  .gnav__logo img { width: 100%; height: auto; object-fit: contain; }
  .gnav__list { flex-direction: column; align-items: stretch; gap: 0; font-size: 17px; }
  .gnav__list li + li { border-top: 1px solid var(--bg-2); }
  .gnav__list a { display: block; padding: 16px 4px; }
  .gnav__cta { flex-direction: column; align-items: stretch; gap: 14px; }
  /* ドロワー内は横幅いっぱい。高さ 52px に合わせて中身も同じ比率で大きくする（43px の 121%） */
  .gnav .btn-mini { --u: 1.21px; width: 100%; }
  .gnav .btn-mini--white { border-color: var(--main); }
}

@media (max-width: 768px) {
  .header { padding: 8px 16px; }
  .header__logo img { width: 180px; height: auto; }
}
