/* ==========================
   header.css ヘッダー全体
========================== */
.site-header {
  width: 100%;
  background: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/**
 * 背面スクロール固定用の設定
 */
body.is-menu-open {
  overflow: hidden !important;
  height: 100vh !important;
}

/* ==========================
   上段 (PC) - ネイビーのグラデーション
========================= */
.header-top {
  background: linear-gradient(to bottom, #1e56a0 0%, #12458f 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  overflow: hidden;
}

@media (min-width: 769px) {
  .header-top.hide {
    margin-top: -90px;
    opacity: 0;
    pointer-events: none;
  }
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 90px;
  position: relative;
}

/* ==========================
   ロゴ (PC/共通)
========================== */
.header-brand {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
  z-index: 10;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 100%;
  cursor: pointer;
}

.brand-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 65px;
  pointer-events: none;
}

.brand-logo-wrapper img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* ==========================
   PC右側情報
========================== */
.header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
}

.breadcrumb ul {
  list-style: none;
  display: flex;
  gap: 15px;
  font-size: 13px;
  padding: 0;
  margin: 0;
}

.breadcrumb a {
  color: #fff;
  text-decoration: none;
  transition: 0.3s;
  opacity: 0.95;
}

.breadcrumb a:hover {
  color: #c5a059;
}

.breadcrumb .button-link {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.breadcrumb .button-link:hover {
  background: #fff;
  color: #12458f !important;
}

.header-tel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #fff;
}

.header-tel strong {
  font-size: 24px;
  font-family: "Georgia", serif;
  line-height: 1;
  color: #c5a059;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.header-tel a {
  color: inherit;
  text-decoration: none;
}

/* ==========================
   下段ナビ（PC）
========================== */
.header-nav {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #f0f4f9;
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.header-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.header-nav a {
  display: block;
  width: 100%;
  text-align: center;
  padding: 15px 5px;
  color: #12458f;
  font-weight: bold;
  text-decoration: none;
  transition: 0.3s;
  position: relative;
  white-space: nowrap;
}

.header-nav a span {
  display: block;
  font-size: 10px;
  color: #c5a059;
  font-family: serif;
  margin-top: 2px;
}

.header-nav a:hover {
  background: #fbfdff;
  color: #0d346d;
}

.header-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #c5a059;
  transition: 0.3s;
  transform: translateX(-50%);
}

.header-nav a:not(.nav-reserve-btn):hover::after {
  width: 40%;
}

.header-nav li.nav-reserve a {
  background: linear-gradient(135deg, #c5a059, #9e7d3a) !important;
  color: #fff !important;
}

.header-nav li.nav-reserve a span {
  color: #f3e3c4 !important;
}

/* --------------------------
   PC・タブレット ドロップダウン
-------------------------- */
@media (min-width: 769px) {
  .nav-has-child {
    position: relative;
  }

  .nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: max-content;
    min-width: 100%;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-top: 3px solid #c5a059;
    padding: 10px 0;
    z-index: 100;

    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s;
    display: block !important;
  }

  @media (min-width: 1025px) {
    .nav-has-child:hover .nav-dropdown {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
  }

  @media (max-width: 1024px) {
    .nav-has-child.is-open .nav-dropdown {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
  }

  .nav-dropdown li {
    width: 100%;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    box-sizing: border-box;
  }

  .nav-dropdown li:last-child {
    border-bottom: none;
  }

  .nav-dropdown > li > a {
    display: block !important;
    padding: 12px 25px !important;
    text-align: left !important;
    font-size: 14px !important;
    color: #333 !important;
    font-weight: normal !important;
    white-space: nowrap !important;
    transition: 0.3s ease !important;
  }

  .nav-dropdown > li > a::after {
    display: none !important;
  }

  .nav-dropdown > li > a:hover {
    background: #f8fafd !important;
    color: #c5a059 !important;
    padding-left: 32px !important;
  }

  /* 💡【修正箇所】3階層目外枠：文字量に100%ジャストフィットするように最適化 */
  .nav-sub-dropdown {
    display: block !important;
    list-style: none;
    padding: 5px 0 !important;
    margin: 0;
    background: #fff !important;
    width: max-content !important;        /* 文字数に完璧に追従し、右側の無駄な余白を完全に排除 */
    min-width: 150px !important;         /* 短すぎる単語の場合に崩れないための最小保証幅 */
    box-sizing: border-box !important;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1) !important;
    border-left: 1px solid #f0f0f0 !important;
    text-align: left !important;

    position: absolute;
    top: 0 !important;
    left: 100% !important;

    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    transform: translateX(8px) !important;

    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0.4s !important;
  }

  .nav-dropdown li.has-sub-level:hover .nav-sub-dropdown,
  .nav-dropdown li.is-sub-open .nav-sub-dropdown {
    max-height: 300px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
  }

  /* 💡【修正箇所】3階層目各行：横幅の広がりを各項目の最大文字数に制限する設定 */
  .nav-sub-dropdown li {
    display: block !important;
    flex: none !important;
    float: none !important;
    width: 100% !important;
    height: auto !important;
    border-bottom: 1px solid #f9f9f9 !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }

  .nav-sub-dropdown li:last-child {
    border-bottom: none !important;
  }

  /* 💡【修正箇所】3階層目文字リンク：左右のパディング内側に綺麗にアンダーバーを配置するための相対位置(relative)化 */
  .nav-sub-dropdown a {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 10px 20px 10px 18px !important; /* 右側のパディングを適正化し文字にフィット */
    font-size: 13px !important;
    color: #555 !important;
    background: #fff !important;
    white-space: nowrap !important;
    transition: 0.3s ease !important;
    box-sizing: border-box !important;
    position: relative !important;            /* アンダバーの絶対配置の基準にするため追加 */
  }

  /* 💡【修正箇所】大元「大浴場」のアンダーバー演出を遺伝：中央から伸びるゴールド下線の初期設定 */
  .nav-sub-dropdown a::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;                     /* 枠線の最下部に配置 */
    left: 50% !important;                     /* 中央から展開するための起点 */
    width: 0 !important;                      /* 初期状態の幅は0 */
    height: 2px !important;                   /* アンダバーの太さ */
    background: #c5a059 !important;            /* 統一されたゴールド */
    transform: translateX(-50%) !important;   /* 中央揃えの補正 */
    transition: width 0.3s ease !important;   /* なめらかな幅の拡幅アニメーション */
  }

  /* 💡【修正箇所】ホバー時：左右のパディング（18pxと20px）を除いた、純粋なテキスト幅いっぱい（100%）にアンダーバーを中央から一気に広げる設定 */
  .nav-sub-dropdown a:hover::after {
    width: calc(100% - 38px) !important;      /* 左右パディングの合算(38px)を引いた純粋な文字幅にシンクロ */
  }

  /* 💡【修正箇所】ホバー時の文字スライド挙動（パディング増）に合わせて線の中心位置と横幅の計算を美しく維持・追従 */
  .nav-sub-dropdown a:hover {
    background: #f8fafd !important;
    color: #c5a059 !important;
    padding-left: 24px !important;            /* ホバー時の美しい右スライド演出 */
  }

  .nav-sub-dropdown a:hover::after {
    left: calc(50% + 2px) !important;         /* 左余白が18pxから24px(+6px)に増えるため、右へのスライドずれを中間(2px)で絶妙に補正 */
    width: calc(100% - 44px) !important;      /* 移動後の左右パディング(24px+20px=44px)を引いた最新幅へ瞬時に同期 */
  }
}

/* ==========================
   SP共通パーツ
========================== */
.header-sp-controls {
  display: none;
}

.sp-btn,
.sp-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 48px;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid #fff;
  box-sizing: border-box;
}

.sp-tel,
.sp-menu-btn {
  width: 55px;
  background: #12458f;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
}

.sp-reserve-accent {
  width: 110px;
  background: linear-gradient(135deg, #c5a059, #9e7d3a);
  color: #fff !important;
  font-size: 11px;
  font-weight: bold;
}

.sp-menu-btn .line {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin-bottom: 5px;
  transition: 0.3s;
}

.sp-menu-btn .line:last-child { margin-bottom: 0; }

.sp-menu-btn.is-active .line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sp-menu-btn.is-active .line:nth-child(2) { opacity: 0; }
.sp-menu-btn.is-active .line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================
   SPメニュー本体
========================== */
.sp-menu {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: 0.4s;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.sp-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.sp-menu ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sp-menu li {
  width: 50%;
  border-bottom: 1px solid #e0e6ed;
  box-sizing: border-box;
}

.sp-menu li:nth-child(odd) {
  border-right: 1px solid #e0e6ed;
}

.sp-menu a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 22px 10px;
  color: #001a43;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.sp-menu a span {
  display: block;
  font-size: 11px;
  color: #a67c00;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sp-menu a:active {
  background-color: #f0f4f9;
}

.sp-menu-tel { 
  background: #12458f !important; 
  color: #fff !important; 
  padding: 25px 10px !important;
  border: 1px solid #fff;
  box-sizing: border-box;
}

.sp-menu-reserve { 
  background: linear-gradient(135deg, #c5a059, #9e7d3a) !important; 
  color: #fff !important; 
  padding: 25px 10px !important;
  border: 1px solid #fff;
  box-sizing: border-box;
}

/* 💡【修正・追加】CALL と RESERVE の文字色を PC 版（#f3e3c4）と同期 */
.sp-menu-tel span,
.sp-menu-reserve span {
  color: #f3e3c4 !important;
}

/* --------------------------
   SPアコーディオン（アニメーション＆位置調整）
-------------------------- */
@media (max-width: 768px) {
  .sp-nav-has-child {
    width: 100% !important;
  }

  .sp-menu-accordion-header {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
  }

  .sp-menu-accordion-header a {
    flex: 1;
    border: none !important;
  }

  .accordion-toggle {
    width: 70px;
    height: 70px;
    background: #f8fafd;
    border: none;
    border-left: 1px solid #e0e6ed;
    position: relative;
    cursor: pointer;
    outline: none;
    padding: 0;
  }

  .accordion-toggle::before,
  .accordion-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: #c5a059;
    transform: translate(-50%, -50%);
    transition: 0.3s;
  }
  .accordion-toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .sp-nav-has-child.is-active .accordion-toggle::after {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  /* SPドロップダウン：アニメーション設定 */
  .sp-dropdown {
    width: 100%;
    background: #f9fbff;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease-in-out;
  }

  /* クラスが付与されたら高さを最大にする */
  .sp-nav-has-child.is-active .sp-dropdown {
    max-height: 500px;
  }

  .sp-dropdown li {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #eef2f7;
  }

  .sp-dropdown a {
    padding: 18px 25px !important;
    font-size: 14px !important;
    text-align: left !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    font-weight: 600 !important;
    padding-left: 30% !important; 
  }

  /* 「・」を中黒として復活 */
  .sp-dropdown a::before {
    content: "・";
    margin-right: 8px;
    color: #c5a059;
    font-weight: bold;
    display: inline-block !important;
  }
}

/* ==========================
   レスポンシブ (SP全体)
========================== */
@media (max-width: 768px) {
  .site-header {
    height: 60px;
    background: #fff;
    border-bottom: 2px solid #12458f;
  }

  .header-inner {
    height: 60px;
    padding: 0 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
  }

  .header-brand {
    position: static;
    flex: 1 1 auto;
    max-width: calc(100% - 240px);
    transition: opacity 0.3s ease;
    z-index: 100;
    margin-right: 10px;
  }

  .site-header.is-menu-open .header-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    max-width: none;
    animation: hotelElegantFade 0.4s ease-out forwards;
  }

  @keyframes hotelElegantFade {
    0% { opacity: 0; transform: translate(-50%, -45%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
  }

  .brand-logo-wrapper {
    height: 45px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .brand-logo-wrapper img {
    max-width: 100%;
    height: auto;
    max-height: 45px;
    object-fit: contain;
  }

  .header-sp-controls {
    display: flex !important;
    gap: 5px;
    margin-left: auto;
    margin-right: 3px;
    flex-shrink: 0;
    z-index: 2;
  }

  .site-header.is-menu-open .sp-btn {
    display: none !important;
  }

  .pc-only { display: none !important; }

  /* 💡【論理最適化】元のmargin-topを撤廃し、固定ヘッダー(60px)分の高精度シールドへリプレイス */
  .main-visual {
    margin-top: 0;
    padding-top: 60px;
  }
}

.brand-logo-wrapper {
  height: 45px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.logo-mark {
  flex-shrink: 0;
}

.logo-type {
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ============================================================
   💡【追加・完全同期】固定ヘッダー割り込み防止・見切れ根本解決構造
   ============================================================ */
@media (min-width: 769px) {
  .main-visual {
    /* PC版ヘッダー総高（上段90px + 下段ナビ56px ＝ 146px）と完全同一のクッションを生成 */
    padding-top: 146px;
    margin-top: 0 !important;
  }
}

/* ============================================================
   タブレット（iPad 11インチなど）向けナビゲーション最適化
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* 全体の最大幅を画面いっぱいに広げ、左右に最小限の余白を作る */
  .nav-inner {
    max-width: 100%;
    padding: 0 10px;
  }

  /* フォントサイズを少し小さくし、文字の詰まりを調整 */
  .header-nav a {
    font-size: 13px; /* デフォルトより少し縮小 */
    padding: 15px 2px; /* 左右のパディングを極小に */
  }

  /* 英語のサブタイトル（ROOMSなど）も少し小さくして高さを抑える */
  .header-nav a span {
    font-size: 9px;
    transform: scale(0.95);
    display: block;
  }

  /* 右端の「ご宿泊プラン」ボタン内の文字サイズ調整 */
  .header-nav li.nav-reserve a {
    font-size: 12px;
  }
}