/* ヘッダースタイル */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  /* 視認性向上のため少し不透明度を上げる */
  backdrop-filter: blur(15px);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header .container {
  max-width: 100%;
  /* 横幅いっぱいに */
  padding: 0 var(--space-lg);
  /* 左右の余白を確保 */
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  width: 100%;
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-image {
  height: 52px;
  /* ロゴを大きく */
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover .logo-image {
  transform: scale(1.05);
  /* ホバー時に少し大きく */
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin-left: auto;
  /* 右端に寄せる */
}

.nav-menu a {
  color: var(--neutral-dark);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--accent);
}

.nav-menu a.active {
  color: var(--accent);
}

.nav-menu .nav-cta.active {
  color: white;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu .nav-cta::after {
  display: none;
}

/* ドロップダウンメニュー */
.nav-item {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: white;
  min-width: 180px;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown li {
  list-style: none;
}

.dropdown a {
  display: block;
  padding: 10px 20px;
  color: var(--neutral-dark);
  font-size: var(--text-sm);
  white-space: nowrap;
  transition: background 0.2s ease;
}

.dropdown a:hover {
  background: var(--background-alt);
  color: var(--accent);
}

.dropdown a::after {
  display: none;
  /* ドロップダウンリンクの下線アニメーションを無効化 */
}

/* スマートフォン向けの調整 */
@media (max-width: 768px) {
  .header .container {
    padding: 0 var(--space-sm);
  }

  .nav {
    justify-content: space-between;
  }

  .logo {
    display: flex;
  }

  .logo-image {
    content: url("../images/logo0.png");
    height: 64px;
  }

  .nav-menu {
    display: flex;
    justify-content: flex-end;
    width: auto;
    margin-left: auto;
    gap: 8px;
  }

  .nav-menu li {
    margin: 0;
  }

  .nav-menu a {
    font-size: 13px;
    padding: 5px 2px;
  }

  .nav-cta {
    padding: 6px 10px !important;
    font-size: 11px !important;
    white-space: nowrap;
    margin-left: 5px;
  }

  /* ドロップダウンはスマートフォンでは無効化 */
  .nav-item:hover .dropdown {
    display: none;
  }
}