/* ===== SP ドロワーメニュー =====
   PC（1000px以上）では既存の .menu を使用。
   SP/TB（999px以下）では新ドロワーを使用し、旧チェックボックス式を無効化。
================================================= */

/* PCでは新SP要素を非表示 */
.sp-menu-trigger,
.sp-menu-drawer,
.sp-menu-overlay {
  display: none;
}

/* ===== SP/TB（999px以下） ===== */
@media (max-width: 999px) {

  /* 旧チェックボックス式ハンバーガーを無効化 */
  #menu-toggle,
  .menu-button-container {
    display: none !important;
  }
  /* 旧 .menu（PC/TBリスト）をSPでは非表示 */
  .head_menu-flex.menu {
    display: none !important;
  }

  /* ---- ハンバーガートリガーボタン ---- */
  .sp-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    z-index: 200;
  }
  .sp-menu-trigger img {
    width: 48px;
    height: auto;
    display: block;
  }

  /* ---- 背景オーバーレイ ---- */
  .sp-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 36, 67, 0.45);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sp-menu-overlay.is-open {
    opacity: 1;
    pointer-events: all;
  }

  /* ---- ドロワー本体 ---- */
  .sp-menu-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sp-menu-drawer.is-open {
    transform: translateX(0);
  }

  /* 水紋アニメーション用背景ラッパー（ガラスモーフィズム） */
  .menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 50, 210, 0.80);
    -webkit-backdrop-filter: blur(22px) saturate(1.6) brightness(0.88);
    backdrop-filter: blur(22px) saturate(1.6) brightness(0.88);
    z-index: 0;
  }

  /* ---- メニューコンテンツ ---- */
  .sp-menu-content {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: auto;
    padding: 0 0 48px;
    -webkit-overflow-scrolling: touch;
  }

  /* ---- ドロワーヘッダー（ロゴ + クローズボタン） ---- */
  .sp-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    min-height: 70px;
  }
  .sp-menu-logo img {
    width: 140px;
    height: auto;
    display: block;
  }

  /* ---- クローズボタン（×） ---- */
  .sp-menu-close {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
  }
  .sp-menu-close span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    position: absolute;
    border-radius: 1px;
  }
  .sp-menu-close span:first-child {
    transform: rotate(45deg);
  }
  .sp-menu-close span:last-child {
    transform: rotate(-45deg);
  }

  /* ---- メニューリスト ---- */
  .sp-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* 各メニュー項目 */
  .sp-menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  .sp-menu-item:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* 項目行（リンク + ＋ボタン） */
  .sp-menu-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
  }

  /* メインリンクテキスト */
  .sp-menu-link {
    display: block;
    flex: 1;
    padding: 18px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.05em;
    line-height: 1.4;
  }
  .sp-menu-link.-contact {
    color: #fff;
    opacity: 0.85;
  }

  /* アコーディオンボタン（＋ / ×） */
  .sp-menu-acc-btn {
    background: none;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 20px;
    cursor: pointer;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 200;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sp-menu-acc-btn span {
    display: inline-block;
    line-height: 1;
  }

  /* ---- サブメニュー（アコーディオン） ---- */
  .sp-menu-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
  }
  .sp-menu-sub.is-open {
    max-height: 600px;
  }
  .sp-menu-sub li {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }
  .sp-menu-sub a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 14px 32px;
    font-size: 0.81rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    letter-spacing: 0.03em;
  }
  .sp-menu-sub a::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid rgba(255, 255, 255, 0.7);
    border-right: 1.5px solid rgba(255, 255, 255, 0.7);
    transform: rotate(45deg);
  }
}
