/* ============================================================
   Period Selector Modal (.bj-period-modal)
   コース／トピックページ CTA → 周期選択 → チェックアウト直行
   .bj20-page プレフィックスで詳細度を確保（button リセット対策）
   ============================================================ */
.bj-period-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.bj-period-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bj-period-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 27, 58, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.bj20-page .bj-period-modal__content {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 480px;
  background: #F9F8F5;
  border-radius: 12px;
  padding: 36px 28px 28px;
  text-align: center;
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bj20-page .bj-period-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6C6B68;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}
.bj20-page .bj-period-modal__close:hover { color: #2D2B28; }

/* ヘッダー: 漢字 + コース名 + サブタイトル */
.bj-period-modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 24px;
}
.bj20-page .bj-period-modal__kanji {
  font-family: 'Noto Serif JP', 'YuMincho', serif;
  font-size: 44px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2D2B28;
}
.bj20-page .bj-period-modal__label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: none;
  color: #BB935D;
  margin-top: 4px;
}
.bj20-page .bj-period-modal__title {
  font-family: 'Noto Serif JP', 'YuMincho', serif;
  font-size: 14px;
  margin-top: 8px;
  color: #2D2B28;
}

/* 選択肢: 2カード横並び */
.bj-period-modal__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.bj20-page .bj-period-modal__option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #EFEEE7;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  text-align: center;
}
.bj20-page .bj-period-modal__option:hover {
  border-color: #9498A6;
}
.bj20-page .bj-period-modal__option.is-selected {
  border-color: #3A6B8C;
  background: rgba(58, 107, 140, 0.06);
  box-shadow: 0 0 0 1px #3A6B8C;
}

.bj20-page .bj-period-modal__option-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  letter-spacing: 0.08em;
  background: #B78E4E;
  color: #fff;
  padding: 2px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.bj20-page .bj-period-modal__option-period {
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #2D2B28;
}

.bj20-page .bj-period-modal__option-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2D2B28;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.bj20-page .bj-period-modal__option-price small {
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #9C9A95;
  display: block;
  margin-top: 4px;
}

.bj20-page .bj-period-modal__option-note {
  font-size: 12px;
  color: #6C6B68;
}

/* 送信ボタン — 商品ページ CTA と同じ紺ベース */
.bj20-page .bj-period-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Noto Serif JP', 'YuMincho', serif;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #F9F8F5;
  background: #111B3A;
  border: 1px solid #111B3A;
  padding: 15px 36px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, gap 0.3s ease;
  width: 100%;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}
.bj20-page .bj-period-modal__submit:hover {
  background: #585F75;
  border-color: #585F75;
  gap: 12px;
}

/* ========== モバイル: 縦積み + コンパクト横レイアウト ========== */
@media (max-width: 767px) {
  .bj20-page .bj-period-modal__content {
    padding: 32px 20px 24px;
  }
  .bj-period-modal__header {
    margin-bottom: 20px;
  }
  .bj20-page .bj-period-modal__kanji {
    font-size: 36px;
  }
  /* 選択肢: 1列縦積み */
  .bj-period-modal__options {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 24px;
  }
  /* カード: 2列グリッド（左: ラベル、右: 価格） */
  .bj20-page .bj-period-modal__option {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    padding: 16px 20px;
    gap: 4px 12px;
    text-align: left;
  }
  /* バッジ: 左上に配置 */
  .bj20-page .bj-period-modal__option-badge {
    left: 20px;
    transform: none;
  }
  /* 期間ラベル: 左列、全行にまたがって垂直中央 */
  .bj20-page .bj-period-modal__option-period {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
  }
  /* 価格: 右列1行目 */
  .bj20-page .bj-period-modal__option-price {
    grid-column: 2;
    text-align: right;
    font-size: 20px;
  }
  .bj20-page .bj-period-modal__option-price small {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
  /* 年額注記: 右列2行目 */
  .bj20-page .bj-period-modal__option-note {
    grid-column: 2;
    text-align: right;
    font-size: 11px;
  }
  /* 送信ボタン */
  .bj20-page .bj-period-modal__submit {
    padding: 14px 24px;
    font-size: 14px;
  }
}
