#header.main-header {
  background-color: #ffffff;
  padding: 0px 64px;
  position: relative;
  transition: all 0.3s ease;
}

#header.main-header.scrolled {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

#header .header-container {
  margin: 0 auto;
  display: flex;
  height: 118px;
  justify-content: space-between;
  align-items: center;
}

/* ロゴ・会社名セクション */
#header .logo-section {
  display: flex;
  align-items: center;
  width: 140px;
  gap: 16px;
}

/* ナビゲーション・CTAセクション */
#header .nav-section {
  display: flex;
  align-items: center;
  gap: 32px;
}

#header .main-nav {
  display: flex;
  gap: 24px;
}

#header .nav-link {
  font-family: var(--font-figtree);
  font-size: var(--font-size-xs);
}

#header .nav-link:hover {
  color: #666666;
}

#header .contact-btn {
  font-family: var(--font-figtree);
  font-size: var(--font-size-xs);
  padding: 12px 26px;
  border: 1px solid var(--bk);
  border-radius: 5px;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

#header .contact-btn:hover {
  background-color: #f8f8f8;
  border-color: #d0d0d0;
}

/* ハンバーガーメニューボタン */
#header .hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 50px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  position: relative;
}

#header .hamburger-line {
  position: absolute;
  left: 0;
  right: 0; /* 中央寄せ */
  margin: 0 auto;
  width: 46px;
  height: 2px;
  background-color: #333333;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

#header .mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 400px;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-items: flex-start;
  padding: 30px;
  gap: 20px;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

#header .mobile-nav.active {
  right: 0;
  pointer-events: auto;
}

/* オーバーレイ背景 */
#header .mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}

#header .mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#header .mobile-nav-link {
  font-family: var(--font-figtree);
  font-size: 16px;
  color: var(--bk);
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: 1px solid var(--bk);
  padding-bottom: 10px;
  width: 100%;
}

#header .mobile-nav-link:hover {
  color: #666666;
}

#header .mobile-contact-btn {
  font-family: var(--font-figtree);
  font-size: 16px;
  padding: 12px 26px;
  border: 1px solid var(--bk);
  border-radius: 5px;
  background-color: #ffffff;
  color: #333333;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: 20px;
}

#header .mobile-contact-btn:hover {
  background-color: #f8f8f8;
  border-color: #d0d0d0;
}

@media (max-width: 1060px) {
  #header .nav-section {
    display: none;
  }

  #header .hamburger-menu {
    display: flex;
  }

  #header .mobile-nav {
    display: flex;
  }

  #header .mobile-nav-overlay {
    display: block;
  }

  /* 初期配置：上下は中央からY移動で作る */
  #header .hamburger-line:nth-child(1) {
    transform: translateY(-14px);
  }
  #header .hamburger-line:nth-child(2) {
    transform: translateY(0);
  }
  #header .hamburger-line:nth-child(3) {
    transform: translateY(14px);
  }

  /* アクティブ時：全員を中央に集めてから回転 */
  #header .hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(0) rotate(45deg);
  }
  #header .hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateY(0);
  }
  #header .hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
  }

  /* ボタンは位置の基準に */
  #header .hamburger-menu {
    position: relative;
    width: 50px;
    height: 30px;
    display: flex; /* そのままでもOK */
    justify-content: center; /* 念のため中央寄せ */
    align-items: center;
  }
}

@media (max-width: 768px) {
  #header.main-header {
    background-color: #ffffff;
    padding: 0px 16px;
  }

  #header .header-container {
    height: 80px;
}

#header .logo-section {
  width: 110px;
}

#header .hamburger-line {
  width: 36px;
}

#header .mobile-nav-link {
  font-size: 14px;
}

}

