/* =========================================================================
   ATHLETA Taiwan — 球隊團購申請（/team-sales）ページ固有スタイル
   レイアウトはサイト共通の .page-grid（左 .sidebar ＋ 本文 .product-field）に統一。
   ・ヒーロー = 共有 .doc-hero
   ・各ステップ = カード（.ts-step：枠＋余白＋淡い影。contact-card と同じ作法）
   ・入力欄 = 共有 .form-grid / .field
   ・鞋款カード = 共有 .p-card に寄せた「選べるカード」
   ・左サイドバーの申請流程 = 縦線タイムライン＋スクロールで現在地ハイライト（terms 流用）
   依存トークン: design-base.css の :root 変数。
   ========================================================================= */

/* ページ内アンカー移動は design-chrome.js の共通 AthletaScroll（横取り）に統一。
   旧 `html{scroll-behavior:smooth}`（このページだけの上書き＝遅い browser 既定速度）は
   サイト統一のため撤去（2026-06-09）。 */

/* 必須マーク（contact と同じ作法の小さな青）。 */
.req-mark { color: var(--blue); font-weight: 700; }

/* 見出し直下の補足文。 */
.ts-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.7; }
.ts-note .req-mark { font-size: inherit; }
.ts-prefill-note { color: var(--blue); }

/* ── 左サイドバー ──────────────────────────────────────────────────────
   サイドバー内のタイポ階層を整える：見出し 11px（共有）→ 注記 12.5px →
   流れ 13px → 選擇件数 19px。以前の 26px は浮いていたので落とした。 */
.side-note { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.7; }
.side-note a { color: var(--blue); font-weight: 700; }

/* 申請流程＝縦線で繋ぐタイムライン。スクロール位置に応じて現在地を強調（JS が
   .is-active / .is-done を付与）。通過済みは線・丸が青、現在地は青丸＋淡い輪。 */
/* 左 padding 5px は、現在地の丸に付く外側のハロー（box-shadow 4px）が
   サイドバー左端（overflow:auto）で見切れないための逃がし。 */
.ts-flow { counter-reset: step; list-style: none; margin: 2px 0 0; padding: 0 0 0 5px; }
.ts-flow li { position: relative; display: flex; align-items: baseline; gap: 8px; padding: 0 0 16px 32px; }
.ts-flow li:last-child { padding-bottom: 0; }
.ts-flow li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 11px; font-weight: 400;
  z-index: 1;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.ts-flow li::after {
  content: ""; position: absolute; left: 11px; top: 22px; bottom: -1px; width: 2px;
  transform: translateX(-1px); background: var(--line);
  transition: background .16s ease;
}
.ts-flow li:last-child::after { display: none; }
.ts-flow li > a {
  display: block; padding-top: 2px;
  color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.45;
  transition: color .16s ease;
}
.ts-flow li > a:hover { color: var(--ink); }
.ts-flow li.is-done::before,
.ts-flow li.is-active::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.ts-flow li.is-done::after { background: var(--blue); }
.ts-flow li.is-active::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent); }
.ts-flow li.is-active > a { color: var(--ink); font-weight: 700; }

/* 申請流程ステップ②に統合した選擇件数（render() が #selectedCount を更新）。
   旧「目前選擇」独立ブロックは廃止し、流れの中に 0/5 として溶かした。 */
.ts-flow .ts-count {
  margin-left: auto; flex: none;
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.ts-flow .ts-count b { color: var(--ink); font-size: 13px; font-weight: 700; }
.ts-flow li.has-picks .ts-count b { color: var(--blue); }

/* ── 本文：ステップカード ──────────────────────────────────────────────
   各ステップを枠＋余白の白カードに（＝フォーム感）。影は contact-card と同じ淡さ。 */
.ts-step {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 24px 26px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02), 0 22px 48px -34px rgba(20, 22, 26, .30);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.ts-step + .ts-step { margin-top: 18px; }
.ts-step__head { margin-bottom: 20px; }
.ts-step__head h2 { margin: 0; color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.ts-step__head .ts-note { margin: 6px 0 0; }
.ts-step__head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; }
.ts-step__head--row > div { min-width: 0; }

/* ヒーロー（.doc-hero の下罫線）と最初のカードが密着しないよう余白を確保。 */
#teamSalesForm { margin-top: 22px; }

/* 入力欄 grid はカード幅いっぱいに（共有 .form-grid の max-width:720 を解除）。 */
#teamSalesForm .form-grid { max-width: none; }

/* select の矢印を OS 標準から細い chevron に置換（ブランドに馴染ませる）。
   いまは team-sales 限定。良ければ共有 .field select へ昇格できる。 */
#teamSalesForm .field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23626873' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px 8px;
}
#teamSalesForm .field select:focus { border-color: var(--blue); }

/* 「選擇鞋款」見出しの右に置く検索。 */
.ts-search {
  height: 40px; min-width: min(100%, 240px);
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  padding: 0 16px; font: inherit; font-size: 13px; font-weight: 400;
}
.ts-search::placeholder { color: var(--muted); }
.ts-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); }

/* 鞋款分類タブ（売場サイドバーの分類言語に近い丸ピル）。 */
.ts-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ts-tab {
  min-height: 34px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 400; cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.ts-tab:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); color: var(--ink); }
.ts-tab.is-active { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); color: var(--blue); }

/* ── 鞋款カード（共有 .p-card に寄せた「選べるカード」）───────────────────
   .p-card の見た目（media→cat→title→price）をそのまま使い、button 化＋選択状態を足す。 */
.ts-card {
  text-align: left; border: 0; background: none; color: inherit;
  cursor: pointer; padding: 0;
  grid-template-rows: auto 18px 44px 46px minmax(74px, auto);
  align-self: start;
  align-content: start;
  gap: 8px;
  /* 書体指定は撤去（2026-08-13 Noto Sans TC 一本化）。売場全体と同じ書体を body から継承する。 */
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.ts-card .p-card__media { transition: box-shadow .14s ease; }
.ts-card:hover .p-card__media { box-shadow: 0 16px 34px -28px rgba(12, 18, 24, .45); }
.ts-card .p-card__cat,
.ts-card .p-card__title,
.ts-card .p-card__price,
.ts-card .ts-sizes {
  font-family: inherit;
  line-height: 1.35;
  letter-spacing: 0;
}
.ts-card .p-card__cat {
  display: flex;
  align-items: center;
  min-height: 18px;
  font-size: 11px;
  font-weight: 400;
}
.ts-card .p-card__title {
  display: flex;
  align-items: flex-start;
  min-height: 44px;
  font-size: 13px;
  font-weight: 400;
}

/* 選択チェック（media 右上の丸）。未選択=細枠の空丸／選択=青塗り＋白チェック。 */
.ts-check {
  position: absolute; top: 9px; right: 9px;
  width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  transition: background .14s ease, border-color .14s ease;
}
.ts-check::after {
  content: ""; position: absolute; left: 8px; top: 8px;
  width: 9px; height: 5px;
  border-left: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  opacity: 0; transition: opacity .12s ease;
}
.ts-card.is-selected .p-card__media { box-shadow: inset 0 0 0 2px var(--blue); }
.ts-card.is-selected .ts-check { border-color: var(--blue); background: var(--blue); }
.ts-card.is-selected .ts-check::after { border-color: #fff; opacity: 1; }

.ts-price {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 46px;
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.ts-price__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.ts-price__label {
  flex: none;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.ts-price__value {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: inherit;
  text-align: right;
}
.ts-price.has-discount .ts-price__row--regular .ts-price__value {
  color: var(--muted);
  font-weight: 700;
  text-decoration: line-through;
}
.ts-price__row--sale .ts-price__value { color: var(--blue); }

.ts-sizes {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 74px;
  min-width: 0;
}
.ts-sizes__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}
.ts-sizes__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.ts-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--muted));
  border-radius: 999px;
  background: color-mix(in srgb, var(--fill) 55%, var(--surface));
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ts-size--muted {
  color: var(--muted);
  min-width: auto;
}

/* 読み込み中／空（グリッド全幅の控えめなプレースホルダ）。 */
.ts-loading, .ts-empty {
  grid-column: 1 / -1;
  display: grid; place-items: center; min-height: 120px;
  border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-size: 13px; font-weight: 400;
}

/* ── ③ 送出ステップ（注記＋ボタンの行カード）──────────────────────────── */
.ts-step--submit {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap;
}
.ts-step--submit .ts-note { flex: 1 1 280px; margin: 0; }
.ts-step--submit .btn { flex: 0 0 auto; min-width: 190px; }
.ts-step--submit .btn[aria-busy="true"] { opacity: .65; pointer-events: none; }

/* ── 送信完了（contact の .done-mark / .done-acts と同じ作法）──────────── */
.ts-done { text-align: center; padding: 28px 8px 8px; margin-top: 18px; }
.ts-done .done-mark {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, var(--surface));
}
.ts-done .done-mark::after {
  content: ""; width: 22px; height: 12px;
  border-left: 3px solid var(--blue); border-bottom: 3px solid var(--blue);
  transform: rotate(-45deg) translate(1px, -2px); border-radius: 1px;
}
.ts-done h2 { margin: 18px 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.ts-done p { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.8; }
.done-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ── 入力エラー（共有 .field の文脈内オーバーライド＝再定義ではない）────── */
#teamSalesForm .field.is-error input,
#teamSalesForm .field.is-error select,
#teamSalesForm .field.is-error textarea {
  border-color: var(--danger, #d23b3b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #d23b3b) 13%, transparent);
}
#teamSalesForm .field-msg { margin: 0; color: var(--danger, #d23b3b); font-size: 11.5px; font-weight: 700; }

/* ── レスポンシブ ───────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .ts-step { padding: 20px 18px; border-radius: 14px; }
  .ts-step--submit .btn { width: 100%; }
}
