/* ============================================================
   エンクルー ヘッダー CSS v2.1
   プレフィックス hd- で既存CSSと完全分離
   ============================================================ */

/* ─── CSS変数 ─── */
:root {
  --hd-orange:      #ff6b35;
  --hd-orange-d:    #e05a25;
  --hd-green:       #00c300;
  --hd-green-d:     #009900;
  --hd-dark:        #1a1a2e;
  --hd-text:        #333333;
  --hd-border:      #f0f0f0;
  --hd-bg:          #ffffff;
  --hd-ease:        0.25s ease;
  --hd-z-header:    1000;
  --hd-z-overlay:   1100;
  --hd-z-mobile:    1200;
  --hd-z-fixed:     900;
}

/* ────────────────────────────────────────
   ① ヘッダー本体
──────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: var(--hd-z-header);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: box-shadow var(--hd-ease);
}

#site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
}

/* ────────────────────────────────────────
   ② 上部バー
──────────────────────────────────────── */
.hd-top { background: #ffffff; }

.hd-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  min-height: 66px;
}

/* ────────────────────────────────────────
   ③ ロゴ
──────────────────────────────────────── */
.hd-logo { flex-shrink: 0; }

.hd-logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.hd-logo img {
  height: 80px;
  width: auto;
  max-width: 200px;
  display: block;
}

.hd-logo__text {
  display: flex;
  flex-direction: column;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--hd-orange);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* 画像ロゴ */
.hd-logo__img {
  display: block;
  height: 80px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.hd-mobile-nav__brand-img {
  display: block;
  height: 60px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.hd-logo__tagline {
  display: block;
  font-size: 0.52rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 3px;
}

.hd-logo__sub {
  display: none;
}

/* ────────────────────────────────────────
   ④ 電話（900px超のみ表示）
──────────────────────────────────────── */
.hd-tel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hd-tel__label {
  font-size: 0.67rem;
  color: #999;
  letter-spacing: 0.03em;
}

.hd-tel__number {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--hd-orange);
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: opacity var(--hd-ease);
}
.hd-tel__number:hover { opacity: 0.75; color: var(--hd-orange); }

.hd-tel__hours { font-size: 0.61rem; color: #bbb; }

/* ────────────────────────────────────────
   ⑤ CTAボタン（768px超のみ表示）
──────────────────────────────────────── */
.hd-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hd-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.87rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
  transition: transform var(--hd-ease), box-shadow var(--hd-ease), background var(--hd-ease);
}
.hd-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.hd-cta__btn--tel  { background: var(--hd-orange); color: #fff; }
.hd-cta__btn--tel:hover  { background: var(--hd-orange-d); color: #fff; }

.hd-cta__btn--line { background: var(--hd-green);  color: #fff; }
.hd-cta__btn--line:hover { background: var(--hd-green-d);  color: #fff; }

/* ────────────────────────────────────────
   ⑥ ハンバーガー（768px以下のみ表示）
──────────────────────────────────────── */
.hd-hamburger {
  display: none;          /* PCでは非表示 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--hd-ease);
}
.hd-hamburger:hover { background: #f5f5f5; }

.hd-hamburger__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform var(--hd-ease), opacity var(--hd-ease), width var(--hd-ease);
  transform-origin: center;
}

.hd-hamburger.is-open .hd-hamburger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hd-hamburger.is-open .hd-hamburger__bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hd-hamburger.is-open .hd-hamburger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ────────────────────────────────────────
   ⑦ グローバルナビ（768px超のみ表示）
──────────────────────────────────────── */
.hd-nav {
  background: #ffffff;
  border-top: 1px solid var(--hd-border);
}

.hd-nav__list {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.hd-nav__list li {
  position: relative;
}

/* 全アイテム共通 */
.hd-nav__list li a {
  display: flex;
  align-items: center;
  padding: 12px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color var(--hd-ease);
}

/* ホバーアンダーライン（最終アイテム除く） */
.hd-nav__list li:not(:last-child) a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--hd-orange);
  border-radius: 2px 2px 0 0;
  transition: width var(--hd-ease);
}

.hd-nav__list li:not(:last-child) a:hover,
.hd-nav__list li:not(:last-child).current-menu-item a {
  color: var(--hd-orange);
}

.hd-nav__list li:not(:last-child) a:hover::after,
.hd-nav__list li:not(:last-child).current-menu-item a::after {
  width: 70%;
}

/* 最終アイテム（お問い合わせ）を強調ボタン化 */
.hd-nav__list li:last-child {
  margin-left: 8px;
  display: flex;
  align-items: center;
}

.hd-nav__list li:last-child a {
  background: var(--hd-orange);
  color: #ffffff;
  border-radius: 5px;
  padding: 8px 18px;
  font-size: 0.87rem;
  box-shadow: 0 3px 10px rgba(255,107,53,0.3);
  transition: background var(--hd-ease), transform var(--hd-ease), box-shadow var(--hd-ease);
}
.hd-nav__list li:last-child a:hover {
  background: var(--hd-orange-d);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(255,107,53,0.38);
}

/* ────────────────────────────────────────
   ⑧ オーバーレイ
   ※ display の切り替えを visibility+opacity に変更
      → CSSアニメーションが確実に動作する
──────────────────────────────────────── */
.hd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: var(--hd-z-overlay);
  /* 初期: 非表示 */
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--hd-ease), visibility var(--hd-ease);
}

.hd-overlay.is-active {
  visibility: visible;
  opacity: 1;
}

/* ────────────────────────────────────────
   ⑨ モバイルナビ（スライドイン）
   ※ display:none を使わず visibility+transform で制御
      → スライドアニメーションが確実に動作する
      ※ PCでも DOM に存在するが完全に非表示
──────────────────────────────────────── */
.hd-mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 90vw);
  height: 100%;
  height: 100dvh;
  background: #ffffff;
  z-index: var(--hd-z-mobile);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: -6px 0 32px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
  /* 初期: 右外に退避 + 非表示 */
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), visibility 0.3s;
}

.hd-mobile-nav.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* ナビヘッダー */
.hd-mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hd-border);
  flex-shrink: 0;
}

.hd-mobile-nav__brand {
  font-size: 1rem;
  font-weight: 900;
  color: var(--hd-orange);
}

.hd-mobile-nav__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #555;
  transition: background var(--hd-ease), color var(--hd-ease);
}
.hd-mobile-nav__close:hover {
  background: #ffe8df;
  color: var(--hd-orange);
}

/* リスト */
.hd-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  flex: 1;
}

.hd-mobile-nav__item {
  border-bottom: 1px solid #f5f5f5;
}

.hd-mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  font-size: 0.97rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: color var(--hd-ease), background var(--hd-ease), padding-left var(--hd-ease);
  -webkit-tap-highlight-color: rgba(255,107,53,0.08);
}

.hd-mobile-nav__link:hover,
.hd-mobile-nav__item--current .hd-mobile-nav__link {
  color: var(--hd-orange);
  background: #fff8f5;
  padding-left: 24px;
}

.hd-mobile-nav__link svg {
  color: #ccc;
  flex-shrink: 0;
  transition: transform var(--hd-ease), color var(--hd-ease);
}
.hd-mobile-nav__link:hover svg {
  transform: translateX(3px);
  color: var(--hd-orange);
}

/* モバイルCTA */
.hd-mobile-nav__cta {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--hd-border);
  flex-shrink: 0;
}

.hd-mobile-nav__cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.97rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 50px;
  transition: opacity var(--hd-ease), transform var(--hd-ease);
  -webkit-tap-highlight-color: transparent;
}
.hd-mobile-nav__cta-btn:active {
  opacity: 0.82;
  transform: scale(0.98);
}

.hd-mobile-nav__cta-btn--tel  { background: var(--hd-orange); color: #fff; box-shadow: 0 3px 12px rgba(255,107,53,0.28); }
.hd-mobile-nav__cta-btn--line { background: var(--hd-green);  color: #fff; box-shadow: 0 3px 12px rgba(0,195,0,0.22); }
.hd-mobile-nav__cta-btn--form { background: #f2f2f2; color: #333; border: 1px solid #e0e0e0; }

/* 会社情報 */
.hd-mobile-nav__info {
  padding: 16px 20px;
  border-top: 1px solid var(--hd-border);
  background: #fafafa;
  flex-shrink: 0;
}
.hd-mobile-nav__info-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #555;
  margin: 0 0 3px;
}
.hd-mobile-nav__info-addr,
.hd-mobile-nav__info-hours {
  font-size: 0.74rem;
  color: #999;
  margin: 0 0 2px;
}

/* ────────────────────────────────────────
   ⑩ 固定CTA（スマホ画面最下部）
   ※ PCでは常に非表示（display:none）
      スマホ768px以下で display:flex に切り替え
      + スクロール後に is-visible で浮上
──────────────────────────────────────── */
.hd-fixed-cta {
  /* デフォルト: 完全非表示 */
  display: none;
}

/* スマホのみ flex で表示 */
@media (max-width: 768px) {
  .hd-fixed-cta {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--hd-z-fixed);
    background: #ffffff;
    box-shadow: 0 -2px 14px rgba(0,0,0,0.12);
    /* 初期: 画面外に隠す */
    transform: translateY(100%);
    transition: transform 0.3s ease;
    /* safe-area対応 */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .hd-fixed-cta.is-visible {
    transform: translateY(0);
  }
}

.hd-fixed-cta__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  min-height: 58px;
  transition: opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.hd-fixed-cta__btn:active { opacity: 0.72; }

.hd-fixed-cta__btn--tel  { background: var(--hd-orange); color: #fff; }
.hd-fixed-cta__btn--line { background: var(--hd-green);  color: #fff; }
.hd-fixed-cta__btn--form { background: var(--hd-dark);   color: #fff; }

/* ────────────────────────────────────────
   ⑪ レスポンシブ
──────────────────────────────────────── */

/* タブレット 900px 以下 */
@media (max-width: 900px) {
  .hd-tel { display: none; }
  .hd-nav__list li a { padding: 11px 9px; font-size: 0.8rem; }
  .hd-nav__list li:last-child a { padding: 7px 12px; }
  .hd-cta__btn { padding: 8px 12px; font-size: 0.8rem; }
}

/* 1024px 以下で電話非表示 */
@media (max-width: 1024px) {
  .hd-tel { display: none; }
}

/* スマホ 768px 以下 */
@media (max-width: 768px) {
  .hd-cta { display: none; }
  .hd-nav  { display: none; }
  .hd-hamburger { display: flex; }

  /* コンテンツが固定CTAに隠れないようにpadding */
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

/* 小型スマホ 480px 以下 */
@media (max-width: 480px) {
  .hd-top__inner { padding: 11px 0; min-height: 54px; }
  .hd-logo__text { font-size: 1.15rem; }
}

/* スクロール時のヘッダー縮小 */
#site-header.is-scrolled .hd-top__inner {
  padding: 10px 0;
  min-height: 56px;
}

/* ────────────────────────────────────────
   ⑫ 印刷時
──────────────────────────────────────── */
@media print {
  .hd-hamburger,
  .hd-mobile-nav,
  .hd-overlay,
  .hd-fixed-cta { display: none !important; }
}

/* ── ロゴ + テキスト 横並び ── */
.hd-logo__link {
  display: flex !important;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* テキストブロック: ロゴと同じ高さ(80px)に合わせて垂直中央 */
.hd-logo__name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 80px;
  line-height: 1.2;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #ff6b35;
  letter-spacing: -0.01em;
}

.hd-logo__tagline {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
