/* TPH Subscription — Frontend CSS */

/* ── 全要素 box-sizing ─────────────────────────────────────────────────────── */
.tph-pricing-wrap,
.tph-pricing-wrap *,
.tph-pricing-wrap *::before,
.tph-pricing-wrap *::after {
  box-sizing: border-box;
}

/* ── ラッパー ──────────────────────────────────────────────────────────────── */
.tph-pricing-wrap {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 20px;
  font-family: inherit;
}

/* ── 日本語の改行制御（2026-07-18）──────────────────────────────────────────
   料金カードは幅が狭く「振付コ/ース」のような変な位置で折り返されていた。
   短いラベル類は nowrap＋clamp で1行に収め、説明文は文節で折る。      */
/* 1行固定＋自動縮小（プラン名・価格・カテゴリ見出し・ボタン類） */
.tph-plan-name,
.tph-plan-price,
.tph-category-title,
.tph-category-sub,
.tph-plan-badge,
.tph-summary-line > span:first-child,
.tph-total-price,
.tph-pricing-wrap .tph-btn,
.tph-trial-wrap .tph-btn,
.tph-trial-special,
.tph-strike {
  white-space: nowrap;
}
.tph-plan-name   { font-size: clamp(0.78rem, 2.6vw, 0.9rem); }
.tph-plan-price  { font-size: clamp(1rem, 3.4vw, 1.25rem); }
.tph-category-title { font-size: clamp(0.82rem, 2.8vw, 0.95rem); }
.tph-category-sub   { font-size: clamp(0.65rem, 2.2vw, 0.75rem); }
/* 合計・決済ボタン（「プランを選択してください」が長いので強めに縮小） */
.tph-total-price { font-size: clamp(0.8rem, 3.2vw, 1.4rem); }
.tph-pricing-wrap .tph-btn,
.tph-trial-wrap .tph-btn { font-size: clamp(0.82rem, 3.4vw, 1rem); }
/* 体験レッスンの申込ボタンはラベルが最長（「体験レッスンを申し込む（¥1,000）」）で
   nowrap化(2026-07-19)により枠から27pxはみ出したため、さらに強めに縮小＋余白圧縮 */
.tph-trial-wrap .tph-btn {
  font-size: clamp(0.72rem, 3.0vw, 1rem);
  padding-left: 0.9em;
  padding-right: 0.9em;
  max-width: 100%;
  box-sizing: border-box;
  /* センター配置（2026-07-19 Masamiさん指定）。
     .tph-btn-coral側の display:inline-block !important に勝つため!important必須 */
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: fit-content;
}
/* 説明文・注記は通常の折返し（2026-07-18 keep-all廃止:
   狭いカード内だと「受講後、」等の短い行が量産され右端スカスカで崩れて見える。
   見出し系(.tph-pricing-subtitle)のみBudouX文節折りを維持 */
.tph-pricing-subtitle {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.tph-pricing-subtitle {
  font-size: 0.88rem;
  color: #3a2010;
  line-height: 1.7;
  margin-bottom: 2rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--tph-wood-dark);
  background: rgba(242,232,208,0.6);
  border-radius: 0 6px 6px 0;
}

.tph-pricing-step {
  margin-bottom: 2.5rem;
}

.tph-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.9rem;
  border-left: 4px solid var(--tph-wood-dark);
  border-bottom: none;
  border-radius: 0 6px 6px 0;
  background: rgba(242,232,208,0.8);
  color: #2a1500;
}

/* ── カテゴリブロック ──────────────────────────────────────────────────────── */
.tph-category {
  margin-bottom: 1.8rem;
}

.tph-category-title {
  display: flex !important;
  align-items: baseline !important;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2a1500;
  margin: 0 0 0.8rem 0;
  padding: 0.3rem 0.7rem;
  background: rgba(242,232,208,0.7);
  border-radius: 4px;
}

.tph-category-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6b4226;
}

/* ── プランカードグリッド ───────────────────────────────────────────────────── */
.tph-plan-grid {
  display: grid !important;
  gap: 1rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 3列グリッド（定額プラン・振付） */
.tph-grid-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* 2列グリッド（回数券・単発） */
.tph-grid-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* ── プランカード ──────────────────────────────────────────────────────────────
   テーマが label に display:inline を当てるため !important で上書き必須。    */
.tph-plan-card {
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
  border: 2px solid var(--tph-wood);
  border-radius: var(--tph-radius-md);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  background: var(--tph-sand);
  float: none !important;
  width: 100% !important;
}

/* ラジオボタン本体は非表示 */
.tph-plan-card input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* カード内コンテンツ */
.tph-plan-inner {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.4rem;
  padding: 1rem;
  position: static !important;
  float: none !important;
  width: auto !important;
}

.tph-plan-card:hover {
  border-color: var(--tph-wood);
  box-shadow: 0 4px 16px rgba(189,154,94,0.2);
  transform: translateY(-2px);
}

.tph-plan-card.is-selected {
  border-color: var(--tph-wood-dark);
  background: var(--tph-sand-dark);
  box-shadow: 0 4px 20px rgba(143,111,67,0.25);
}

.tph-plan-card.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  background: #f5f5f5;
}

/* 注記テキスト（定額プランのみ等） */
.tph-plan-note {
  display: block !important;
  font-size: 0.72rem;
  color: var(--tph-coral);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.tph-plan-name {
  display: block !important;
  /* 2026-07-19: さらに拡大＋デザイン性（コーラルの短いアクセントバー付き。
     ページ題名(custom.css)と同じデザイン言語） */
  font-size: clamp(1.2rem, 5.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #2a1500;
}
.tph-plan-name::after {
  content: '';
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--tph-coral, #C8503A);
  margin-top: 0.4rem;
}

.tph-plan-price {
  display: block !important;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tph-teal);
  line-height: 1.2;
}

.tph-plan-price small {
  font-size: 0.72rem;
  font-weight: 400;
  color: #666;
}

.tph-plan-desc {
  display: block !important;
  font-size: 0.78rem;
  color: #4a2e10;
  line-height: 1.5;
}

/* バッジ共通 */
.tph-plan-badge {
  display: inline-block !important;
  background: var(--tph-wood);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--tph-radius-pill);
  margin-top: 0.3rem;
  align-self: flex-start;
}

/* おすすめバッジ */
.tph-badge-recommend {
  background: var(--tph-coral);
  order: -1; /* カード内の先頭に表示 */
  margin-bottom: 0.2rem;
}

/* ── 合計・クーポン・ボタン ─────────────────────────────────────────────────── */
.tph-pricing-summary {
  background: var(--tph-white);
  border: 1px solid var(--tph-sand-dark);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.tph-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #2d2d2d;
}

.tph-total-price {
  /* 2026-07-18: スマホでは縮小（「プランを選択してください」がデカすぎた）。
     PCは従来どおり1.4rem上限 */
  font-size: clamp(1rem, 4.2vw, 1.4rem);
  font-weight: 800;
  color: var(--tph-teal);
}

.tph-coupon-row {
  margin-bottom: 1rem;
  width: 100%;
}

.tph-coupon-input {
  display: block !important;
  width: 100% !important;
  min-width: 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: var(--tph-radius-sm);
  font-size: 0.9rem;
}

/* ── ボタン ────────────────────────────────────────────────────────────────── */
.tph-btn {
  display: block !important;
  width: 100% !important;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--tph-radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-align: center;
  text-decoration: none;
}

.tph-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.tph-btn-primary {
  background: var(--tph-coral);
  color: #fff;
}

.tph-btn-primary:hover:not(:disabled) {
  background: var(--tph-coral-dark);
  transform: translateY(-1px);
}

.tph-btn-coral {
  display: inline-block !important;
  width: auto !important;
  background: var(--tph-coral);
  color: #fff;
  padding: 0.8rem 2rem;
}

.tph-btn-coral:hover:not(:disabled) {
  background: var(--tph-coral-dark);
}

.tph-note {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.8rem;
  text-align: center;
  line-height: 1.5;
}

/* ── 体験レッスン ──────────────────────────────────────────────────────────── */
.tph-trial-wrap {
  background: var(--tph-white);
  border: 2px solid var(--tph-coral);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
}

.tph-trial-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.tph-strike {
  text-decoration: line-through;
  color: #999;
  font-size: 1rem;
}

.tph-trial-special {
  font-size: 1.1rem;
  color: var(--tph-coral);
}

.tph-trial-desc {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

/* 体験レッスンが対象外の場合（サブスク契約中・回数券保有・体験済み）2026-07-18 */
.tph-trial-wrap.is-disabled { opacity: 0.92; }
.tph-trial-blocked {
  background: rgba(200, 169, 110, 0.14);
  border-left: 3px solid var(--tph-wood);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--tph-text);
}
.tph-trial-wrap .tph-btn:disabled,
.tph-trial-wrap .tph-btn[aria-disabled="true"] {
  background: #cfc7bb !important;
  color: #fff !important;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}
.tph-trial-wrap .tph-btn:disabled:hover {
  background: #cfc7bb !important;
  transform: none;
}

/* ── 通知 ─────────────────────────────────────────────────────────────────── */
.tph-notice {
  padding: 1rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.tph-notice-info {
  background: rgba(10,61,92,0.07);
  border-left: 4px solid var(--tph-teal-light);
  color: var(--tph-text);
}

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

@media (max-width: 700px) {
  .tph-grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .tph-grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .tph-pricing-summary,
  .tph-trial-wrap {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .tph-plan-inner {
    padding: 0.8rem;
  }
  .tph-plan-price {
    font-size: 1.1rem;
  }
  .tph-pricing-summary {
    padding: 1rem;
  }
  .tph-pricing-wrap {
    padding: 0 12px;
  }
}

@media (max-width: 360px) {
  .tph-grid-3,
  .tph-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ── 体験の予約一体型フロー（2026-07-20 P0） ─────────────────────────────── */
.tph-trial-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2a1500;
  margin: 1.6rem 0 0.7rem;
  padding-left: 0.6rem;
  border-left: 4px solid var(--tph-coral, #C8503A);
}
.tph-trial-selected {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: rgba(10, 61, 92, 0.06);
  font-size: 0.9rem;
  color: #555;
}
.tph-trial-selected.is-selected {
  background: #eaf6ef;
  border: 1.5px solid var(--tph-teal, #0A3D5C);
  color: #14503a;
  font-weight: 600;
}
