/* ========================================
   HEADER - プロフェッショナルデザイン (青・赤アクセント)
   ======================================== */
@layer base, layout, components, utilities, pages;

@layer components {

/* ========================================
   ヘッダーメインコンテナ
   ======================================== */

.im-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

/* 上部の2色アクセントライン */
.im-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 3px;
  background: var(--color-primary);
  z-index: 1;
}

.im-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 3px;
  background: var(--color-secondary);
  z-index: 1;
}

.im-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   ヘッダー内部
   ======================================== */

.im-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 3vw, 48px);
  min-height: 80px;
}

/* ========================================
   ブランドエリア（左側）
   ======================================== */

.im-header__brand {
  flex-shrink: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 運営会社バッジ */
.im-header__operator {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .im-header__operator {
    display: flex;
  }
}

.im-header__operator:hover {
  background: rgba(15, 23, 42, 0.08);
}

.im-header__operator-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.im-header__operator-logo {
  height: 14px;
  width: auto;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.im-header__operator:hover .im-header__operator-logo {
  opacity: 1;
}

.im-header__logo {
  display: inline-flex;
  align-items: center;
  position: relative;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.im-header__logo:hover {
  transform: scale(1.02);
}

.im-header__logo img {
  display: block;
  height: clamp(36px, 4vw, 48px);
  width: auto;
}

/* ========================================
   コントロールエリア（右側）
   ======================================== */

.im-header__controls {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  flex: 1;
  justify-content: flex-end;
}

/* ========================================
   デスクトップナビゲーション
   ======================================== */

.im-header__nav-inline {
  display: none;
}

@media (min-width: 1100px) {
  .im-header__nav-inline {
    display: block;
    flex: 1;
  }
}

.im-header__menu-inline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
  justify-content: flex-end;
}

.im-header__menu-inline .menu-item {
  margin: 0;
}

.im-header__menu-inline a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--color-text-strong);
  text-decoration: none;
  padding: 10px 0;
  transition: color 0.3s ease;
}

/* 英語サブテキスト */
.im-header__menu-inline .menu-item__en {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.7;
  transition: opacity 0.3s ease, color 0.3s ease;
}

/* 日本語メインテキスト */
.im-header__menu-inline .menu-item__ja {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-strong);
  transition: color 0.3s ease;
}

/* 下線エフェクト - 2色分割 */
.im-header__menu-inline a::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60%;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.im-header__menu-inline a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 40%;
  height: 2px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.im-header__menu-inline a:hover .menu-item__en {
  opacity: 1;
  color: var(--color-secondary);
}

.im-header__menu-inline a:hover .menu-item__ja {
  color: var(--color-primary);
}

.im-header__menu-inline a:hover::before,
.im-header__menu-inline a:hover::after {
  transform: scaleX(1);
}

.im-header__menu-inline a[aria-current="page"] .menu-item__en {
  opacity: 1;
  color: var(--color-secondary);
}

.im-header__menu-inline a[aria-current="page"] .menu-item__ja {
  color: var(--color-primary);
}

.im-header__menu-inline a[aria-current="page"]::before,
.im-header__menu-inline a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ========================================
   ヘッダーアクション（CTAボタン）
   ======================================== */

.im-header__actions {
  display: none;
  gap: 12px;
}

@media (min-width: 1200px) {
  .im-header__actions {
    display: flex;
  }
}

.im-header__cta {
  font-size: 14px;
  font-weight: 800;
  padding: 12px 24px;
  white-space: nowrap;
  border-radius: 0;
  transition: all 0.3s ease;
}

/* 資料DLボタン */
.im-header__actions > .btn:not(.btn--primary) {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.im-header__actions > .btn:not(.btn--primary):hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.2);
}

/* お問い合わせボタン */
.im-header__actions > .btn--primary {
  background: var(--color-secondary);
  color: #ffffff;
  border: none;
}

.im-header__actions > .btn--primary:hover {
  background: var(--color-secondary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.25);
}

/* ========================================
   モバイルメニュートグル
   ======================================== */

.im-header__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 2px solid var(--color-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1001;
}

@media (min-width: 1100px) {
  .im-header__toggle {
    display: none;
  }
}

.im-header__toggle:hover {
  background: var(--color-primary);
  transform: scale(1.05);
}

.im-header__burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  height: 18px;
}

.im-header__burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transition: all 0.3s ease;
}

.im-header__toggle:hover .im-header__burger span {
  background: #ffffff;
}

.im-header__toggle[aria-expanded="true"] .im-header__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--color-secondary);
}

.im-header__toggle[aria-expanded="true"] .im-header__burger span:nth-child(2) {
  opacity: 0;
}

.im-header__toggle[aria-expanded="true"] .im-header__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--color-secondary);
}

/* ========================================
   モバイルナビゲーション
   ======================================== */

.im-header__nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(90vw, 480px);
  background: #ffffff;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
}


.im-header__nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 3px;
  background: var(--color-primary);
}

.im-header__nav[aria-hidden="false"] {
  transform: translateX(0);
}

/* 閉じるボタン */
.im-header__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 2px solid var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.im-header__close:hover {
  background: var(--color-primary);
  transform: rotate(90deg);
}

.im-header__close-icon {
  position: relative;
  width: 24px;
  height: 24px;
}

.im-header__close-icon span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transition: background 0.3s ease;
}

.im-header__close:hover .im-header__close-icon span {
  background: #ffffff;
}

.im-header__close-icon span:nth-child(1) {
  transform: translateY(-50%) rotate(45deg);
}

.im-header__close-icon span:nth-child(2) {
  transform: translateY(-50%) rotate(-45deg);
}

/* ========================================
   モバイルメニューコンテンツ
   ======================================== */

.im-menu {
  padding: 80px 24px 40px;
  position: relative;
  background: #ffffff;
}

.im-menu__media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  opacity: 0.04;
  z-index: 0;
  pointer-events: none;
}

.im-menu__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.im-menu__panel {
  position: relative;
  z-index: 1;
}

/* メニューセクション */
.im-menu__section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5e7eb;
}

.im-menu__section:last-child {
  border-bottom: none;
}

.im-menu__section-title {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  position: relative;
  padding-bottom: 8px;
}

.im-menu__section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--color-secondary);
}

.im-menu__section-text {
  display: block;
}

/* メニューリスト */
.im-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.im-menu__item {
  margin: 0;
}

.im-menu__link {
  display: block;
  padding: 16px 12px;
  text-decoration: none;
  background: transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.im-menu__link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.im-menu__link:hover {
  background: rgba(30, 64, 175, 0.04);
  padding-left: 20px;
}

.im-menu__link:hover::before {
  transform: scaleY(1);
}

.im-menu__link[aria-current="page"] {
  background: rgba(30, 64, 175, 0.08);
  padding-left: 20px;
}

.im-menu__link[aria-current="page"]::before {
  transform: scaleY(1);
}

.im-menu__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.im-menu__text-en {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.im-menu__text-ja {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text-strong);
}

.im-menu__desc {
  font-size: 13px;
  color: var(--color-text-subtle);
  line-height: 1.5;
}

/* 注目メニュー項目 */
.im-menu__item--featured .im-menu__link {
  background: rgba(30, 64, 175, 0.05);
  border: 1px solid rgba(30, 64, 175, 0.15);
  padding: 20px 16px;
}

.im-menu__item--featured .im-menu__link:hover {
  background: rgba(30, 64, 175, 0.08);
  border-color: var(--color-primary);
  padding-left: 24px;
}

.im-menu__item--featured .im-menu__text-ja {
  font-size: 18px;
  color: var(--color-primary);
}

/* ========================================
   モバイルクイックアクション
   ======================================== */

.im-header__quick {
  padding: 24px;
  background: #f8f9fa;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
}

.im-header__quick .btn {
  flex: 1;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  padding: 16px 20px;
}

/* ========================================
   モバイルブランドパネル
   ======================================== */

.im-header__brandpanel {
  padding: 32px 24px;
  background: #0f172a;
  color: #ffffff;
  border-top: 3px solid var(--color-secondary);
}

.im-header__brandpanel-logo {
  display: inline-block;
  margin-bottom: 20px;
}

.im-header__brandpanel-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.im-header__brandpanel-name {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.im-header__address {
  font-style: normal;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.im-header__contact {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.im-header__tel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.im-header__tel:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

.im-header__tel-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.im-header__tel-number {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.02em;
}

/* 運営会社セクション */
.im-header__brandpanel-operator {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.im-header__brandpanel-operator-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.im-header__brandpanel-operator-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.im-header__brandpanel-operator-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.im-header__brandpanel-operator-link img {
  height: 24px;
  width: auto;
}

.im-header__brandpanel-operator-link svg {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}

.im-header__brandpanel-operator-link:hover svg {
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   オーバーレイ
   ======================================== */

.im-header__nav::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.im-header__nav[aria-hidden="false"]::after {
  opacity: 1;
  pointer-events: auto;
}

}
