/* =========================================================
   ハッピーデザイン 共通ヘッダー
   cairn-style.css からヘッダー関連ルールのみを抽出したもの
   （オレンジ系のカラー変数もここで定義）
   ========================================================= */
:root {
  --primary-orange: #FF6B35;
  --secondary-orange: #FF8C61;
  --dark-orange: #E55A2B;
  --light-orange: #FFB59A;
  --pale-orange: #FFF4F0;
  --dark-gray: #2A2A2A;
  --medium-gray: #666666;
  --light-gray: #F8F8F8;
  --white: #FFFFFF;
  --beige: #F5F2ED;
}

/* 固定ヘッダー分、アンカー遷移時の位置を補正 */
html { scroll-padding-top: 100px; }

/* ===== スクロール進捗バー ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--grad, linear-gradient(90deg, #ff6b35 0%, #ffb347 100%));
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 10005;
  pointer-events: none;
}

/* ========== ヘッダー ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10001;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  overflow: visible;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 25px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 10001;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-orange);
  text-decoration: none;
  letter-spacing: 0.5px;
  display: inline-block;
  position: relative;
  z-index: 10001;
  flex-shrink: 0;
}

.logo img {
  height: 40px;
  width: auto;
  max-width: 100%;
}

.nav {
  display: flex;
  gap: clamp(24px, 3vw, 50px);
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 10000;
}

.nav a {
  text-decoration: none;
  color: var(--dark-gray);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: color 0.3s;
  position: relative;
}

.nav a:hover {
  color: var(--primary-orange);
}

.nav .btn-header {
  background: var(--primary-orange);
  color: var(--white);
  padding: 10px 25px;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s;
}

.nav .btn-header:hover {
  background: var(--dark-orange);
  transform: translateY(-2px);
}

/* 階層メニュー（PC） */
.nav-item-with-submenu {
  position: relative;
}

.nav-item-with-submenu > a::after {
  content: '▼';
  font-size: 10px;
  margin-left: 5px;
  transition: transform 0.3s;
}

.nav-item-with-submenu:hover > a::after {
  transform: rotate(180deg);
}

.nav-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 10001;
  margin-top: 10px;
}

.nav-item-with-submenu:hover .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-submenu a {
  display: block;
  padding: 10px 20px;
  color: var(--dark-gray);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-submenu a:hover {
  background: var(--pale-orange);
  color: var(--primary-orange);
  padding-left: 25px;
}

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

.menu-toggle span {
  width: 100%;
  height: 3px;
  background: var(--dark-gray);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 10000;
  padding-top: 0;
  overflow: hidden;
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out, visibility 0.3s;
}

.mobile-nav.active {
  visibility: visible;
  transform: translateX(0);
}

/* モバイルメニュー閉じるボタン */
.mobile-nav-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10002;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.mobile-nav-close span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--dark-gray);
  border-radius: 3px;
  transition: all 0.3s ease;
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
  overflow: visible;
}

.mobile-nav-close span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.mobile-nav-close span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-nav-close:hover span {
  background: var(--primary-orange);
}

.mobile-nav-content {
  max-width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 96px 30px 40px;
}

.mobile-nav a {
  display: block;
  padding: 20px 0;
  text-decoration: none;
  color: var(--dark-gray);
  font-size: 18px;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: color 0.3s;
}

.mobile-nav a:hover {
  color: var(--primary-orange);
}

.mobile-nav .btn-header {
  background: var(--primary-orange);
  color: var(--white);
  padding: 18px 30px;
  border-radius: 50px;
  text-align: center;
  margin-top: 20px;
  border: none;
}

.mobile-nav .btn-header:hover {
  background: var(--dark-orange);
}

/* モバイル階層メニュー */
.mobile-nav-item {
  position: relative;
}

.mobile-nav-main {
  position: relative;
}

.mobile-nav-main::after {
  content: '▼';
  font-size: 12px;
  margin-left: 8px;
  transition: transform 0.3s;
  display: inline-block;
}

.mobile-nav-item.active .mobile-nav-main::after {
  transform: rotate(180deg);
}

.mobile-nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 20px;
}

.mobile-nav-item.active .mobile-nav-submenu {
  max-height: 500px;
}

.mobile-nav-submenu a {
  padding: 15px 0;
  font-size: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

/* マテリアルアイコン */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 40px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -moz-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 右側固定ボタン ========== */
.fixed-side-buttons {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fixed-side-button {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  font-size: 11px;
  color: var(--white);
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

.fixed-side-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.fixed-side-button.instagram {
  background: linear-gradient(135deg, #E4405F 0%, #C13584 50%, #833AB4 100%);
}

.fixed-side-button.recruit {
  background: linear-gradient(135deg, #2A2A2A 0%, #1A1A1A 100%);
}

.fixed-side-button.x {
  background: #000;
}

.fixed-side-button .icon {
  font-size: 28px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fixed-side-button.x .icon {
  font-weight: 700;
}

.fixed-side-button .icon .material-icons {
  font-size: 28px;
}

.fixed-side-button .text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ========== タブレット：1200px以下はハンバーガーメニュー ========== */
/* js/main.js の mobileMenuViewport と切り替え幅をそろえる */
@media (max-width: 1200px) {
  .header-container {
    padding: 20px 30px;
  }

  .nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .mobile-nav {
    display: block;
  }
}

/* ========== スマートフォン（〜768px） ========== */
@media (max-width: 768px) {
  .header {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .header-container {
    max-width: 100% !important;
    padding: 15px 15px !important;
    position: relative;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    overflow: hidden;
  }

  .logo {
    z-index: 10001;
    flex: 0 1 auto;
    max-width: calc(100vw - 60px) !important;
    min-width: 0;
    overflow: hidden;
    margin-right: 10px;
  }

  .logo img {
    height: 30px !important;
    max-width: 100%;
    object-fit: contain;
  }

  .menu-toggle {
    display: flex !important;
    z-index: 10002;
    flex: 0 0 30px !important;
    margin-left: 0 !important;
    min-width: 30px !important;
    width: 30px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }

  .fixed-side-buttons {
    display: none;
  }
}

/* ========== 画面下部固定ボタン（スマートフォンのみ表示） ========== */
.sp-bottom-bar {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12);
}

.sp-bottom-bar__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.sp-bottom-bar__icon {
  font-size: 20px;
  font-weight: 700;
}

.sp-bottom-bar__item.x {
  background: #000;
}

.sp-bottom-bar__item.instagram {
  background: linear-gradient(135deg, #E4405F 0%, #C13584 50%, #833AB4 100%);
}

.sp-bottom-bar__item.line {
  background: #06C755;
}

.sp-bottom-bar__item.contact {
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--dark-orange) 100%);
}

@media (max-width: 768px) {
  /* 右側固定ボタンの代わりに画面下部へ固定 */
  .sp-bottom-bar {
    display: grid;
  }

  /* 下部バーでフッターが隠れないように余白を確保 */
  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* ========== モダン化の追加スタイル ==========
   - スクロールで縮むヘッダー（JSが .is-scrolled を付与）
   - ナビリンクの下線グロー
   ============================================ */
.header-container {
  transition: padding .35s ease;
}
.header.is-scrolled {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(12, 18, 34, .08);
}
.header.is-scrolled .header-container {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* ナビリンク：左から伸びる下線 */
.nav > a:not(.btn-header)::before,
.nav-item-with-submenu > a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary-orange), #ffb347);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}
.nav > a:not(.btn-header):hover::before,
.nav-item-with-submenu:hover > a::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* お問い合わせボタン：グラデーション＋浮き */
.nav .btn-header {
  background: linear-gradient(90deg, var(--primary-orange), #ff8c47);
  box-shadow: 0 6px 18px rgba(255, 107, 53, .35);
}
.nav .btn-header:hover {
  background: linear-gradient(90deg, var(--dark-orange), var(--primary-orange));
  box-shadow: 0 10px 24px rgba(255, 107, 53, .45);
}

/* ロゴのマイクロインタラクション */
.logo img {
  transition: transform .3s ease;
}
.logo:hover img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .header-container,
  .nav > a::before,
  .nav-item-with-submenu > a::before,
  .logo img {
    transition: none;
  }
}
