/* =========================================================================
   box-kaitori.css — BOX買取相場 /box-kaitori/（通販サイト風の商品一覧）
   値は var(--ds-*) のみ（生hex/生px禁止）。kakaku.css の後に読む。
   ========================================================================= */

.kb-page .main > .container { max-width: var(--ds-kb-width); } /* 記事幅の外枠を一覧だけ広げる */
.kakaku.kb { max-width: none; }

/* BOX買取の3ページはヘッダーを追尾させる（スクロールしても右上のカートの点数が見える） */
.kb-page .header { position: sticky; top: 0; }

/* BOX買取の3ページは、ロゴの印（ホロの四角）を文字の左に置く */
.kb-page .header__logo-row { flex-direction: row-reverse; }

/* ---------- ヘッダー右上のカート（通販サイトと同じ位置。BOX買取の3ページ共通） ---------- */
.header__cart {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--ds-space-inline-xs);
  order: 3; /* PC はナビの右（いちばん右上） */
  padding: var(--ds-space-inline-xs) var(--ds-space-inline-sm);
  font-size: var(--ds-text-body-sm-size);
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text);
  text-decoration: none;
  border-radius: var(--ds-radius-button);
}
.header__cart:hover { color: var(--ds-color-text); text-decoration: none; background: var(--ds-color-bg-subtle); opacity: 1; }
.header__cart ~ .header__nav { margin-left: auto; }
.header__cart-icon { flex: none; }
.header__cart-label { margin-left: var(--ds-space-inline-sm); } /* 点数の丸と重ならないようにあける */
.header__cart-count {
  position: absolute;
  top: 0;
  left: var(--ds-kb-hcart-badge-x);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ds-kb-hcart-badge);
  height: var(--ds-kb-hcart-badge);
  padding: 0 var(--ds-space-inline-xs);
  font-size: var(--ds-text-micro-size);
  line-height: 1;
  color: var(--ds-color-text-inverse);
  background: var(--ds-kb-cart-bg);
  border-radius: var(--ds-radius-chip);
  font-variant-numeric: tabular-nums;
}
.header__cart.is-empty .header__cart-count { background: var(--ds-color-text-muted); }
.header__cart.is-bump .header__cart-count { animation: kb-cart-bump .5s ease; }
@media (max-width: 820px) { /* style.css のヘッダーの切り替え幅と同じ */
  .header__cart { order: 0; margin-left: auto; padding: var(--ds-space-inline-xs); } /* SP はいちばん右 */
  .kb-page .header__menu-btn, .kb-page .header__nav { display: none; } /* BOX買取の SP はメニュー（三本線）を出さない。右上はカートだけ */
  .header__cart-label { position: absolute; width: var(--ds-border-width); height: var(--ds-border-width); overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 374px) { .kb-page .header__logo-text { font-size: var(--ds-kb-logo-sp); } } /* 「トレカプロBOX買取」＋カート＋メニューを1行に収める */

/* ---------- 見出し（白地に文字だけ。枠・黒地・チップは置かない） ---------- */
.kb-hero { margin: 0 0 var(--ds-space-stack-md); }
.kb-hero__shop {
  margin: 0 0 var(--ds-space-inline-xs);
  font-size: var(--ds-text-caption-size);
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text-muted);
}
.kb-hero__title {
  margin: 0;
  font-size: var(--ds-text-h1-size);
  font-weight: var(--ds-text-h1-weight);
  line-height: 1.25;
}

/* 価格一覧を先頭に保ち、買取条件は下へまとめる。 */
.kb-guide-nav { display: flex; flex-wrap: wrap; gap: var(--ds-space-inline-sm) var(--ds-space-inline-md); margin-top: var(--ds-space-stack-sm); font-size: var(--ds-text-body-sm-size); }
.kb-section-title, .kb-guide h2 { margin: 0 0 var(--ds-space-stack-sm); font-size: var(--ds-text-h2-size); font-weight: var(--ds-text-h2-weight); color: var(--ds-color-text); }
.kb-guide { max-width: var(--ds-container-article); margin-top: var(--ds-space-stack-lg); font-size: var(--ds-text-body-sm-size); line-height: 1.8; }
.kb-guide section { margin-top: var(--ds-space-stack-lg); scroll-margin-top: var(--ds-space-stack-xl); }
.kb-guide p, .kb-guide ol { margin: var(--ds-space-stack-sm) 0; }
.kb-guide ol { list-style: decimal; padding-left: var(--ds-space-stack-md); }
.kb-guide li + li { margin-top: var(--ds-space-inline-sm); }
.kb-guide a, .kb-guide-nav a { text-decoration: underline; text-underline-offset: .2em; }
.kb-guide__terms { margin: 0; }
.kb-guide__terms > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 4fr); gap: var(--ds-space-inline-md); padding: var(--ds-space-stack-sm) 0; border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-guide__terms dt { font-weight: var(--ds-text-h3-weight); }
.kb-guide__terms dd { margin: 0; }
.kb-guide details { padding: var(--ds-space-stack-sm) 0; border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-guide summary { cursor: pointer; font-weight: var(--ds-text-h3-weight); }
@media (max-width: 600px) { .kb-guide__terms > div { grid-template-columns: 1fr; gap: var(--ds-space-inline-xs); } }
.kb-hero__lead {
  margin: var(--ds-space-inline-sm) 0 0;
  font-size: var(--ds-text-body-sm-size);
  line-height: 1.6;
  color: var(--ds-color-text-muted);
}

/* ---------- ご利用の流れ（1行の文字。1 → 2 → 3） ---------- */
.kb-flow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-inline-xs) var(--ds-space-inline-sm);
  margin: var(--ds-space-inline-sm) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--ds-text-body-sm-size);
  font-weight: var(--ds-text-h3-weight);
  line-height: 1.6;
  counter-reset: kb-step;
}
.kb-flow li { counter-increment: kb-step; }
.kb-flow li::before { content: counter(kb-step) ". "; }
.kb-flow li:not(:last-child)::after { content: "\00a0\00a0→"; color: var(--ds-color-text-muted); } /* 矢印は行末に付ける（折り返しても行頭に来ない） */

/* ---------- ツールバー（検索・シリーズ・並べ替え） ---------- */
.kb-toolbar {
  display: grid;
  gap: var(--ds-space-inline-sm);
  margin: 0 0 var(--ds-space-stack-sm);
}
.kb-toolbar .kk-search__q { margin: 0; }
.kb-cats {
  display: flex;
  gap: var(--ds-space-inline-xs);
  margin: 0;
  padding: 0 0 var(--ds-space-inline-xs);
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}
.kb-cats::-webkit-scrollbar { display: none; }
.kb-cat {
  appearance: none;
  cursor: pointer;
  flex: none;
  min-height: var(--ds-kb-chip-h);
  padding: 0 var(--ds-space-inline-md);
  font: inherit;
  font-size: var(--ds-text-caption-size);
  font-weight: var(--ds-text-h3-weight);
  white-space: nowrap;
  color: var(--ds-color-text);
  background: var(--ds-color-bg-paper);
  border: var(--ds-border-width) solid var(--ds-color-border);
  border-radius: var(--ds-radius-chip);
}
.kb-cat span { margin-left: var(--ds-space-inline-xs); font-weight: normal; color: var(--ds-color-text-muted); }
.kb-cat.is-active {
  color: var(--ds-color-text-inverse);
  background: var(--ds-color-bg-inverse);
  border-color: var(--ds-color-bg-inverse);
}
.kb-cat.is-active span { color: inherit; opacity: .75; }

.kb-resultbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-inline-sm);
  padding: var(--ds-space-inline-sm) 0;
  border-top: var(--ds-border-width) solid var(--ds-color-border);
}
.kb-resultbar__count { margin: 0; white-space: nowrap; font-size: var(--ds-text-body-sm-size); color: var(--ds-color-text-muted); }
.kb-resultbar__count strong { font-size: var(--ds-text-body-size); color: var(--ds-color-text); }
.kb-sort { display: inline-flex; align-items: center; min-width: 0; white-space: nowrap; gap: var(--ds-space-inline-xs); font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
.kb-sort select {
  min-width: 0;
  max-width: 100%;
  min-height: var(--ds-kb-select-h);
  padding: 0 var(--ds-space-inline-md);
  font: inherit;
  font-size: var(--ds-text-body-size); /* 16px 以上で iOS のズームを防ぐ */
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text);
  background: var(--ds-color-bg-paper);
  border: var(--ds-border-width) solid var(--ds-color-border-strong);
  border-radius: var(--ds-radius-input);
}

/* ---------- 商品グリッド ---------- */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ds-space-inline-sm);
  margin: 0 0 var(--ds-space-stack-md);
  padding: 0;
  list-style: none;
}
@media (min-width: 601px) { .kb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-inline-md); } }
@media (min-width: 900px) { .kb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1140px) { .kb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.kb-item {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  background: var(--ds-color-bg-paper);
  border: var(--ds-border-width) solid var(--ds-color-border);
  border-radius: var(--ds-radius-card);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kb-item[hidden] { display: none; }
.kb-item__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: var(--ds-color-text);
  text-decoration: none;
}
.kb-item__link:hover { color: var(--ds-color-text); text-decoration: none; }
@media (hover: hover) {
  .kb-item:hover {
    transform: translateY(var(--ds-kb-card-lift));
    border-color: var(--ds-color-border-strong);
    box-shadow: var(--ds-shadow-popover);
  }
}
.kb-item__link:focus-visible { outline: var(--ds-kk-focus-ring) solid var(--ds-color-text); outline-offset: var(--ds-border-width); }

.kb-item__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  padding: var(--ds-space-inline-sm);
  background: var(--ds-kb-thumb-bg);
}
.kb-item__img { position: absolute; inset: var(--ds-space-inline-sm); display: block; width: calc(100% - var(--ds-space-inline-sm) * 2); height: calc(100% - var(--ds-space-inline-sm) * 2); object-fit: contain; }
.kb-item__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ds-text-micro-size);
  color: var(--ds-color-text-subtle);
}
.kb-item__badge {
  position: absolute;
  top: var(--ds-space-inline-sm);
  left: var(--ds-space-inline-sm);
  padding: 0 var(--ds-space-inline-sm);
  font-size: var(--ds-text-micro-size);
  font-weight: var(--ds-text-h3-weight);
  line-height: 1.7;
  color: var(--ds-kb-badge-new-text);
  background: var(--ds-kb-badge-new-bg);
  border-radius: var(--ds-radius-input);
}
.kb-item__code {
  position: absolute;
  top: var(--ds-space-inline-sm);
  right: var(--ds-space-inline-sm);
  padding: 0 var(--ds-space-inline-xs);
  font-size: var(--ds-text-micro-size);
  line-height: 1.7;
  color: var(--ds-color-text-muted);
  background: var(--ds-color-bg-paper);
  border: var(--ds-border-width) solid var(--ds-color-border);
  border-radius: var(--ds-radius-input);
}

.kb-item__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--ds-kk-tile-gap-tight);
  padding: var(--ds-space-inline-sm) var(--ds-space-inline-md);
}
.kb-item__body p { margin: 0; }
.kb-item__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: var(--ds-text-body-sm-size);
  font-weight: var(--ds-text-h3-weight);
  line-height: 1.4;
}
.kb-item__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--ds-space-inline-xs);
  margin-top: auto !important;
  padding-top: var(--ds-space-inline-sm);
}
.kb-item__price small { flex-basis: 100%; font-size: var(--ds-text-micro-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-text-muted); }
.kb-item__price strong {
  font-size: var(--ds-text-h3-size);
  line-height: 1.2;
  color: var(--ds-color-price);
  font-variant-numeric: tabular-nums;
}
.kb-item__price strong span { font-size: var(--ds-text-body-sm-size); }
/* 強化前の金額（取り消し線）。一覧・商品詳細・関連BOX・カートで、強化後の金額の前に置く */
.kb-was {
  margin-right: var(--ds-space-inline-xs);
  font-size: var(--ds-text-caption-size);
  font-weight: normal;
  color: var(--ds-color-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--ds-color-price);
  font-variant-numeric: tabular-nums;
}
.kb-pdp__price-value .kb-was { font-size: var(--ds-text-h3-size); }
/* カードの下の個数（− 数字 ＋）。変えたその場でカートに入る */
.kb-item__foot { display: flex; flex-direction: column; gap: var(--ds-space-inline-xs); padding: 0 var(--ds-space-inline-md) var(--ds-space-inline-md); }
.kb-item__stepper { display: flex; width: 100%; height: var(--ds-kb-btn-h); border-color: var(--ds-color-border-strong); }
.kb-item__stepper .kb-pdp__step-btn { flex: none; width: var(--ds-kb-btn-h); }
/* ＋ も − も赤地に白文字 */
.kb-item__stepper .kb-pdp__step-btn { color: var(--ds-color-text-inverse); background: var(--ds-kb-cart-bg); }
.kb-item__stepper .kb-pdp__step-btn:hover:not(:disabled) { background: var(--ds-kb-cart-bg-hover); }
.kb-item__stepper .kb-pdp__step-btn:disabled { color: var(--ds-color-text-muted); background: var(--ds-color-bg-subtle); opacity: 1; } /* 押せないとき（0個の −・99個の ＋）は灰色 */
.kb-item__stepper .kb-pdp__qty-input { flex: 1; width: auto; min-width: 0; }
/* カートに入っているカード: 赤の太い枠（外側に足すので、カードの大きさは変わらない） */
.kb-item.is-incart, .kb-item.is-incart:hover { border-color: var(--ds-kb-cart-bg); box-shadow: 0 0 0 var(--ds-kb-incart-ring) var(--ds-kb-cart-bg); }
.kb-item.is-incart .kb-item__stepper { border-color: var(--ds-kb-cart-bg); }
.kb-item.is-incart .kb-pdp__qty-input { color: var(--ds-color-price); background: var(--ds-kb-price-bg); }

/* ---------- 右のカート（一覧・PC だけ。カートに何か入ると右から出てくる） ---------- */
.kb-side { display: none; }
@media (min-width: 1100px) {
  /* 空の間は右の列の幅を 0 にして一覧を広く使う。入ったら列を広げ、カートを右から滑り込ませる。列の数は変えない（行が組み変わらない） */
  .kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 0px; gap: 0; align-items: start; }
  .kb-layout.has-cart { grid-template-columns: minmax(0, 1fr) var(--ds-kb-side-w); gap: var(--ds-space-stack-sm); }
  .kb-layout.is-ready { transition: grid-template-columns .3s ease, gap .3s ease; }
  .kb-layout .kb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kb-layout.has-cart .kb-side {
    position: sticky;
    top: var(--ds-kb-side-top); /* 追尾するヘッダーの下 */
    display: flex;
    flex-direction: column;
    justify-self: end;
    width: var(--ds-kb-side-w);
    max-height: calc(100vh - var(--ds-kb-side-top) - var(--ds-space-stack-sm));
    background: var(--ds-color-bg-paper);
    border: var(--ds-border-width) solid var(--ds-color-border);
    border-radius: var(--ds-radius-card);
    box-shadow: var(--ds-shadow-popover);
  }
  .kb-layout.is-ready.has-cart .kb-side { animation: kb-side-in .35s cubic-bezier(.2, .9, .3, 1.15); }
  /* 右のカートがあるので、画面下の合計の帯は出さない */
  .kb-total { display: none; }
  .kb--has-total { padding-bottom: 0; }
}
@keyframes kb-side-in { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kb-layout.is-ready { transition: none; } .kb-layout.is-ready.has-cart .kb-side { animation: none; } }
@media (min-width: 1280px) { .kb-layout .kb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kb-side p { margin: 0 !important; }
.kb-side__title { display: flex; align-items: baseline; justify-content: space-between; padding: var(--ds-space-inline-md); font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-side__count { font-size: var(--ds-text-caption-size); font-weight: normal; color: var(--ds-color-text-muted); }
.kb-side__foot[hidden] { display: none; }
.kb-side__list { flex: 1; min-height: 0; margin: 0; padding: 0 var(--ds-space-inline-md); overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.kb-side__item { display: grid; grid-template-columns: var(--ds-kb-side-thumb) minmax(0, 1fr) auto; gap: var(--ds-space-inline-sm); align-items: start; padding: var(--ds-space-inline-md) 0; border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-side__item:last-child { border-bottom: 0; }
.kb-side__thumb { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--ds-kb-thumb-bg); border-radius: var(--ds-radius-input); }
.kb-side__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.kb-side__body { display: flex; flex-direction: column; gap: var(--ds-space-inline-xs); min-width: 0; }
.kb-side__name { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); line-height: 1.4; }
.kb-side__row { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-inline-sm); }
.kb-side__stepper { height: var(--ds-kb-side-step); }
.kb-side__stepper .kb-pdp__step-btn { width: var(--ds-kb-side-step); font-size: var(--ds-text-body-size); }
.kb-side__stepper .kb-drawer__qty { min-width: var(--ds-kb-side-step); font-size: var(--ds-text-body-sm-size); }
.kb-side__price { font-size: var(--ds-text-body-sm-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-price); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb-side__gone { font-size: var(--ds-text-micro-size); color: var(--ds-color-text-muted); }
.kb-side__remove { width: var(--ds-kb-side-step); height: var(--ds-kb-side-step); margin: calc(var(--ds-space-inline-xs) * -1) calc(var(--ds-space-inline-xs) * -1) 0 0; padding: 0; font-family: inherit; font-size: var(--ds-text-body-size); line-height: 1; color: var(--ds-color-text-muted); background: none; border: 0; border-radius: var(--ds-radius-button); cursor: pointer; }
.kb-side__remove:hover { color: var(--ds-color-text); background: var(--ds-color-bg-subtle); }
.kb-side__foot { display: flex; flex-direction: column; gap: var(--ds-space-inline-sm); padding: var(--ds-space-inline-md); border-top: var(--ds-border-width) solid var(--ds-color-border); }
.kb-side__sum { display: flex; align-items: baseline; justify-content: space-between; font-size: var(--ds-text-caption-size); }
.kb-side__sum strong { font-size: var(--ds-text-h3-size); color: var(--ds-color-price); font-variant-numeric: tabular-nums; }

/* ---------- 「申し込みに進む」は青（赤は ＋・価格・枠で使っているので、最後の一押しだけ色を変える） ----------
   一覧の右のカート・画面下の合計の帯・右から出るカート・追加後の緑の枠の4か所。カート画面の LINE／Web のボタンは対象外 */
.kb-side__foot .kb-pdp__btn--cart,
.kb-total .kb-total__btn,
.kb-drawer__foot .kb-pdp__btn--cart,
.kb-pdp__added-link:not(.kb-pdp__added-link--more) { color: var(--ds-color-text-inverse); background: var(--ds-kb-go-bg); }
.kb-side__foot .kb-pdp__btn--cart:hover,
.kb-total .kb-total__btn:hover,
.kb-drawer__foot .kb-pdp__btn--cart:hover,
.kb-pdp__added-link:not(.kb-pdp__added-link--more):hover { color: var(--ds-color-text-inverse); background: var(--ds-kb-go-bg-hover); opacity: 1; }

/* ---------- 「あと◯BOXで着払いOK」のメーター（partials/box-ship-meter.php・数字は box-cart.js） ---------- */
.kb-ship { display: flex; flex-direction: column; gap: var(--ds-space-inline-xs); width: 100%; }
.kb-ship__msg { transform-origin: left center; margin: 0 !important; font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-text); }
.kb-ship__msg strong { color: var(--ds-color-price); font-variant-numeric: tabular-nums; }
.kb-ship.is-done .kb-ship__msg { color: var(--ds-color-state-positive-text); }
.kb-ship__track { position: relative; }
.kb-ship__bar { position: relative; height: var(--ds-kb-ship-bar-h); overflow: hidden; background: var(--ds-color-border); border-radius: var(--ds-radius-chip); }
.kb-ship__fill { position: relative; display: block; width: 0; height: 100%; overflow: hidden; background: var(--ds-color-positive); border-radius: inherit; transition: width .45s cubic-bezier(.2, .9, .3, 1.2); }
/* 増えたとき: 白い光の帯がバーの中を左から右へ走る */
.kb-ship__fill::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: var(--ds-color-text-inverse); opacity: 0; transform: skewX(-20deg); }
.kb-ship.is-up .kb-ship__fill::after { animation: kb-ship-shine .8s ease-out; }
/* バーの先で星が3つはじける（5BOX に届いたときは大きく、少し長く） */
.kb-ship__sparks { position: absolute; top: 50%; left: var(--kb-ship-pct, 0%); width: 0; height: 0; pointer-events: none; }
.kb-ship__spark { position: absolute; top: calc(var(--ds-kb-ship-spark) / -2); left: calc(var(--ds-kb-ship-spark) / -2); width: var(--ds-kb-ship-spark); height: var(--ds-kb-ship-spark); color: var(--ds-kb-ship-spark-color); opacity: 0; }
.kb-ship.is-up .kb-ship__spark { animation: kb-ship-spark .7s ease-out both; }
.kb-ship.is-up .kb-ship__spark:nth-child(1) { --dx: calc(var(--ds-kb-ship-spark) * -1); --dy: calc(var(--ds-kb-ship-spark) * -1.2); }
.kb-ship.is-up .kb-ship__spark:nth-child(2) { --dx: calc(var(--ds-kb-ship-spark) * .4); --dy: calc(var(--ds-kb-ship-spark) * -1.6); animation-delay: .08s; color: var(--ds-color-positive); }
.kb-ship.is-up .kb-ship__spark:nth-child(3) { --dx: calc(var(--ds-kb-ship-spark) * 1.2); --dy: calc(var(--ds-kb-ship-spark) * -.6); animation-delay: .16s; }
.kb-ship.is-reach .kb-ship__spark { animation-duration: 1s; --s: 1.5; }
.kb-ship.is-reach .kb-ship__msg { animation: kb-ship-pop .5s ease-out; }
@keyframes kb-ship-shine { 0% { left: -40%; opacity: .7; } 100% { left: 120%; opacity: 0; } }
@keyframes kb-ship-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0deg); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(var(--s, 1)) rotate(90deg); }
}
@keyframes kb-ship-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .kb-ship__fill { transition: none; }
  .kb-ship.is-up .kb-ship__fill::after, .kb-ship.is-up .kb-ship__spark, .kb-ship.is-reach .kb-ship__msg { animation: none; }
}
.kb-total__ship { max-width: var(--ds-kb-width); margin: 0 auto; padding: var(--ds-space-inline-sm) var(--ds-space-page-x) 0; }
.kb-total__ship + .kb-total__in { padding-top: var(--ds-space-inline-sm); }
.kb-drawer__foot .kb-ship { margin-bottom: var(--ds-space-inline-sm); }

/* ---------- 画面下の合計の帯（一覧。カートに入っている間だけ） ---------- */
.kb-total {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  background: var(--ds-color-bg-paper);
  border-top: var(--ds-border-width) solid var(--ds-color-border);
  box-shadow: var(--ds-kb-bar-shadow);
  animation: kb-total-in .25s ease;
}
.kb-total[hidden] { display: none; }
.kb-total__in {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ds-space-stack-sm);
  max-width: var(--ds-kb-width);
  margin: 0 auto;
  padding: var(--ds-space-inline-md) var(--ds-space-page-x) calc(var(--ds-space-inline-md) + env(safe-area-inset-bottom));
}
.kb-total__sum { display: flex; align-items: baseline; gap: var(--ds-space-inline-sm); margin: 0 !important; font-weight: var(--ds-text-h3-weight); color: var(--ds-color-price); }
.kb-total__sum small { font-size: var(--ds-text-caption-size); font-weight: normal; color: var(--ds-color-text-muted); }
.kb-total__label { font-size: var(--ds-text-body-size); }
.kb-total__sum { white-space: nowrap; }
.kb-total__sum strong { font-size: var(--ds-text-h2-size); line-height: 1.2; font-variant-numeric: tabular-nums; }
.kb-total .kb-total__btn { flex: none; width: auto; min-height: var(--ds-kb-qty-h); padding: 0 var(--ds-space-stack-md); white-space: nowrap; } /* .kb-pdp__btn--cart の width:100% に負けないようにする */
.kb--has-total { padding-bottom: var(--ds-kb-bar-space); }
@keyframes kb-total-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .kb-total { animation: none; } }
@media (max-width: 600px) {
  .kb-total__in { justify-content: space-between; gap: var(--ds-space-inline-sm); }
  .kb-total__sum { flex-wrap: wrap; gap: 0 var(--ds-space-inline-xs); }
  .kb-total__sum small { flex-basis: 100%; }
  .kb-total__sum strong { font-size: var(--ds-text-h3-size); }
  .kb-total .kb-total__btn { padding: 0 var(--ds-space-inline-md); font-size: var(--ds-text-body-sm-size); }
}

/* ---------- スマホ（2列） ---------- */
@media (max-width: 600px) {
  .kb-sort__label { position: absolute; width: var(--ds-border-width); height: var(--ds-border-width); overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* カートのボタンが入る分、文字は読み上げだけにする（kk-visually-hidden と同じ） */
  .kb-hero__title { font-size: var(--ds-text-h2-size); }
  .kb-item__body { padding: var(--ds-space-inline-sm); }
  .kb-item__foot { padding: 0 var(--ds-space-inline-sm) var(--ds-space-inline-sm); }
  .kb-item__name { font-size: var(--ds-text-caption-size); }
  .kb-item__price strong { font-size: var(--ds-text-body-size); }
  .kb-item__stepper { height: var(--ds-kb-btn-h-sp); }
  .kb-item__stepper .kb-pdp__step-btn { width: var(--ds-kb-btn-h-sp); }
}

/* =========================================================================
   商品詳細 /box-kaitori/irai/?box=<series_code>
   PC: 画像＋商品情報の2カラム。SP: 縦積みで、画面下に価格と依頼ボタンの帯を固定
   ========================================================================= */
.kb-pdp { display: flex; flex-direction: column; gap: var(--ds-space-stack-lg); }
.kb-pdp > .sc-disclosure,
.kb-pdp > .breadcrumb { margin: 0; }

.kb-pdp__main {
  display: grid;
  grid-template-columns: minmax(0, var(--ds-kb-pdp-gallery)) minmax(0, 1fr);
  gap: var(--ds-kb-pdp-gap);
  align-items: start;
}
.kb-pdp__gallery { display: flex; flex-direction: column; gap: var(--ds-space-stack-sm); } /* 画像の下に特長3つ */
.kb-pdp__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ds-kb-thumb-bg);
  border-radius: var(--ds-radius-lg);
}
.kb-pdp__img {
  position: absolute;
  inset: var(--ds-space-stack-md);
  width: calc(100% - var(--ds-space-stack-md) * 2);
  height: calc(100% - var(--ds-space-stack-md) * 2);
  object-fit: contain;
}
.kb-pdp__thumb .kb-item__badge { top: var(--ds-space-stack-sm); left: var(--ds-space-stack-sm); font-size: var(--ds-text-caption-size); }
.kb-pdp__back { display: none; }

.kb-pdp__info { display: flex; flex-direction: column; gap: var(--ds-space-stack-sm); min-width: 0; }
.kb-pdp__info p { margin: 0; }
.kb-pdp__series { font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
.kb-pdp__title { margin: 0; font-size: var(--ds-text-h1-size); line-height: 1.3; }
.kb-pdp__title span { font-size: var(--ds-text-body-size); font-weight: normal; color: var(--ds-color-text-muted); }
.kb-pdp__spec { display: flex; flex-wrap: wrap; gap: var(--ds-space-inline-xs) var(--ds-space-stack-sm); margin: 0; font-size: var(--ds-text-caption-size); }
.kb-pdp__spec div { display: flex; gap: var(--ds-space-inline-xs); }
.kb-pdp__spec dt { color: var(--ds-color-text-muted); }
.kb-pdp__spec dd { margin: 0; font-weight: var(--ds-text-h3-weight); }

.kb-pdp__price {
  padding: var(--ds-space-stack-sm) var(--ds-space-stack-md);
  background: var(--ds-kb-price-bg);
  border: var(--ds-border-width) solid var(--ds-kb-price-border);
  border-radius: var(--ds-radius-lg);
}
.kb-pdp__price-label { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-text-muted); }
.kb-pdp__price-value {
  font-size: var(--ds-kb-price-size);
  font-weight: var(--ds-text-h1-weight);
  line-height: 1.15;
  color: var(--ds-color-price);
  font-variant-numeric: tabular-nums;
}
.kb-pdp__price-value span { font-size: var(--ds-text-h3-size); }
.kb-pdp__price-note { margin-top: var(--ds-space-inline-xs) !important; font-size: var(--ds-text-micro-size); color: var(--ds-color-text-muted); }

.kb-pdp__qty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-inline-sm) var(--ds-space-inline-md);
}
.kb-pdp__qty-label { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); }
.kb-pdp__stepper {
  display: inline-flex;
  height: var(--ds-kb-qty-h);
  overflow: hidden;
  border: var(--ds-border-width) solid var(--ds-color-border);
  border-radius: var(--ds-radius-input);
}
.kb-pdp__step-btn {
  width: var(--ds-kb-qty-h);
  padding: 0;
  font-size: var(--ds-text-h3-size);
  line-height: 1;
  color: var(--ds-color-text);
  background: var(--ds-color-bg-subtle);
  border: 0;
  cursor: pointer;
}
.kb-pdp__step-btn:disabled { color: var(--ds-color-text-muted); cursor: default; opacity: .5; }
.kb-pdp__qty-input {
  width: var(--ds-kb-qty-input-w);
  padding: 0;
  font-size: var(--ds-text-body-size);
  font-weight: var(--ds-text-h3-weight);
  text-align: center;
  color: var(--ds-color-text);
  background: var(--ds-color-bg-paper);
  border: 0;
  border-inline: var(--ds-border-width) solid var(--ds-color-border);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.kb-pdp__qty-input::-webkit-inner-spin-button,
.kb-pdp__qty-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.kb-pdp__qty-total { margin: 0 0 0 auto !important; font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
.kb-pdp__qty-total strong { font-size: var(--ds-text-h3-size); color: var(--ds-color-price); font-variant-numeric: tabular-nums; }

.kb-pdp__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ds-kb-cta-h);
  padding: 0 var(--ds-space-stack-md);
  font-size: var(--ds-text-body-size);
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text-inverse);
  text-decoration: none;
  background: var(--ds-color-cta-line-bg);
  border-radius: var(--ds-radius-button);
  transition: background .15s ease;
}
.kb-pdp__btn:hover { color: var(--ds-color-text-inverse); text-decoration: none; background: var(--ds-color-cta-line-bg-hover); }
.kb-pdp__btn[hidden] { display: none; }
.kb-pdp__btn--cart { width: 100%; background: var(--ds-kb-cart-bg); border: 0; cursor: pointer; font-family: inherit; }
.kb-pdp__btn--cart:hover { background: var(--ds-kb-cart-bg-hover); }
.kb-pdp__btn--cart.is-added, .kb-pdp__btn--cart.is-added:hover { gap: var(--ds-space-inline-xs); background: var(--ds-kb-added-strong); }
.kb-pdp__btn--cart.is-added::before { content: ""; width: var(--ds-kb-added-icon); height: var(--ds-kb-added-icon); background: currentColor; -webkit-mask: var(--ds-kb-added-check) center / contain no-repeat; mask: var(--ds-kb-added-check) center / contain no-repeat; }
.kb-pdp__btn--sub {
  margin-top: var(--ds-space-inline-sm);
  color: var(--ds-color-text);
  background: var(--ds-color-bg-paper);
  border: var(--ds-border-width) solid var(--ds-color-border-strong);
}
.kb-pdp__btn--sub:hover { color: var(--ds-color-text); background: var(--ds-color-bg-subtle); }
/* 追加したことを返す枠（ボタン直下。カートに入っている間は出したまま） */
.kb-pdp__added {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-inline-xs);
  margin-top: var(--ds-space-inline-sm);
  padding: var(--ds-space-inline-md);
  color: var(--ds-kb-added-strong);
  background: var(--ds-kb-added-bg);
  border: var(--ds-border-width) solid var(--ds-kb-added-border);
  border-radius: var(--ds-radius-button);
}
.kb-pdp__added[hidden] { display: none; }
.kb-pdp__added p { margin: 0 !important; }
.kb-pdp__added-msg { display: flex; align-items: flex-start; gap: var(--ds-space-inline-xs); font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); line-height: 1.5; }
.kb-check path { stroke: var(--ds-color-text-inverse); }
.kb-check { flex: none; width: var(--ds-kb-added-icon); height: var(--ds-kb-added-icon); margin-top: .15em; }
.kb-pdp__added-sub { padding-left: calc(var(--ds-kb-added-icon) + var(--ds-space-inline-xs)); font-size: var(--ds-text-caption-size); color: var(--ds-color-text); }
.kb-pdp__added-sub strong { margin: 0 .15em; font-size: var(--ds-text-body-size); font-variant-numeric: tabular-nums; }
.kb-pdp__added-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ds-kb-qty-h);
  margin-top: var(--ds-space-inline-xs);
  font-size: var(--ds-text-body-size);
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text-inverse);
  text-decoration: none;
  background: var(--ds-kb-added-strong);
  border-radius: var(--ds-radius-button);
}
.kb-pdp__added-link:hover { color: var(--ds-color-text-inverse); text-decoration: none; opacity: .9; }
.kb-pdp__added-link--more, .kb-pdp__added-link--more:hover { margin-top: 0; color: var(--ds-kb-added-strong); background: var(--ds-color-bg-paper); border: var(--ds-border-width) solid var(--ds-kb-added-strong); }
.kb-pdp__added.is-flash { animation: kb-added-flash .9s ease; }
@keyframes kb-added-flash {
  0% { transform: scale(.97); box-shadow: 0 0 0 0 var(--ds-kb-added-border); }
  40% { transform: scale(1); box-shadow: 0 0 0 6px var(--ds-kb-added-border); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* 画面下の知らせ（30種類の上限で入らなかったとき。PC・SP とも出す） */
.kb-toast {
  position: fixed;
  right: var(--ds-space-page-x);
  bottom: var(--ds-space-stack-md);
  left: var(--ds-space-page-x);
  z-index: 901;
  max-width: var(--ds-kk-sheet-width);
  margin: 0 auto;
  padding: var(--ds-space-inline-md);
  color: var(--ds-color-text-inverse);
  background: var(--ds-color-bg-inverse);
  border-radius: var(--ds-radius-button);
  box-shadow: var(--ds-shadow-modal);
}
.kb-toast[hidden] { display: none; }
.kb-toast p { margin: 0 !important; }
.kb-toast__msg { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); line-height: 1.5; }
.kb-toast.is-in { animation: kb-toast-in .25s ease; }
@keyframes kb-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 右から出るカート（追加した直後に出す。中身・合計・申込へのボタン） */
.kb-drawer { position: fixed; inset: 0; z-index: 1000; }
.kb-drawer[hidden] { display: none; }
.kb-drawer-open { overflow: hidden; }
.kb-drawer__mask { position: absolute; inset: 0; background: var(--ds-color-scrim-modal); animation: kb-drawer-fade .2s ease; }
.kb-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(var(--ds-kb-drawer-w), 92vw);
  background: var(--ds-color-bg-paper);
  box-shadow: var(--ds-shadow-modal);
  outline: 0;
  animation: kb-drawer-in .25s ease;
}
.kb-drawer p { margin: 0 !important; }
.kb-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-inline-sm);
  padding: var(--ds-space-inline-md) var(--ds-space-stack-sm);
  border-bottom: var(--ds-border-width) solid var(--ds-color-border);
}
.kb-drawer__title { display: flex; align-items: center; gap: var(--ds-space-inline-xs); font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-kb-added-strong); }
.kb-drawer__title .kb-check { margin-top: 0; }
.kb-drawer__close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--ds-kb-qty-h);
  height: var(--ds-kb-qty-h);
  padding: 0;
  color: var(--ds-color-text);
  background: none;
  border: 0;
  border-radius: var(--ds-radius-button);
  cursor: pointer;
}
.kb-drawer__more { width: 100%; font-family: inherit; cursor: pointer; }
.kb-drawer__close:hover { background: var(--ds-color-bg-subtle); }
.kb-drawer .kb-drawer__list { flex: 1; overflow-y: auto; padding: 0 var(--ds-space-stack-sm); border-top: 0; overscroll-behavior: contain; }
.kb-drawer .kb-drawer__list .kb-cart__item { grid-template-columns: var(--ds-kb-drawer-thumb) minmax(0, 1fr); }
.kb-drawer .kb-drawer__list .kb-cart__item.is-new {
  margin: var(--ds-space-inline-sm) calc(var(--ds-space-inline-sm) * -1) 0;
  padding: var(--ds-space-inline-md) var(--ds-space-inline-sm);
  background: var(--ds-kb-added-bg);
  border: var(--ds-border-width) solid var(--ds-kb-added-border);
  border-radius: var(--ds-radius-card);
}
.kb-drawer__qty { display: flex; align-items: center; justify-content: center; min-width: var(--ds-kb-qty-h); font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); line-height: 1; background: var(--ds-color-bg-paper); border-inline: var(--ds-border-width) solid var(--ds-color-border); font-variant-numeric: tabular-nums; } /* 数字は − ＋ と同じ高さの真ん中に置く */
.kb-drawer__foot {
  display: flex;
  flex-direction: column;
  padding: var(--ds-space-inline-md) var(--ds-space-stack-sm) calc(var(--ds-space-inline-md) + env(safe-area-inset-bottom));
  border-top: var(--ds-border-width) solid var(--ds-color-border);
}
.kb-drawer__sum { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--ds-space-inline-sm) !important; font-size: var(--ds-text-caption-size); }
.kb-drawer__sum strong { font-size: var(--ds-text-h2-size); color: var(--ds-color-price); font-variant-numeric: tabular-nums; }
@keyframes kb-drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes kb-drawer-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kb-pdp__added.is-flash, .kb-toast.is-in, .kb-pdp__bar-cart.is-bump, .header__cart.is-bump .header__cart-count, .kb-drawer__panel, .kb-drawer__mask { animation: none; } }
.kb-pdp__cta-note { margin-top: var(--ds-space-inline-xs) !important; font-size: var(--ds-text-micro-size); text-align: center; color: var(--ds-color-text-muted); }
.kb-pdp__cta--solo { max-width: var(--ds-kk-sheet-width); margin: var(--ds-space-stack-sm) auto 0; }

.kb-pdp__points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ds-space-inline-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
.kb-pdp__points li span { display: inline-block; } /* 狭い幅では語の切れ目で折り返す */
.kb-pdp__points li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: var(--ds-space-inline-sm);
  font-size: var(--ds-text-caption-size);
  font-weight: var(--ds-text-h3-weight);
  text-align: center;
  background: var(--ds-color-bg-subtle);
  border-radius: var(--ds-radius-card);
}

.kb-pdp__section { display: flex; flex-direction: column; gap: var(--ds-space-stack-sm); }
.kb-pdp__h2 { margin: 0; font-size: var(--ds-text-h3-size); }
.kb-pdp__flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ds-space-inline-md);
  margin: 0;
  padding: 0;
  list-style: none;
}
.kb-pdp__flow li { padding: var(--ds-space-stack-sm); border: var(--ds-border-width) solid var(--ds-color-border); border-radius: var(--ds-radius-lg); }
.kb-pdp__flow p { margin: 0; }
.kb-pdp__step { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-price); }
.kb-pdp__flow-title { margin-top: var(--ds-space-inline-xs) !important; font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); }
.kb-pdp__flow-text { margin-top: var(--ds-space-inline-xs) !important; font-size: var(--ds-text-body-sm-size); line-height: 1.6; color: var(--ds-color-text-muted); }
.kb-pdp__friend { margin: 0; font-size: var(--ds-text-caption-size); line-height: 1.7; color: var(--ds-color-text-muted); }

.kb-pdp__related {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ds-space-inline-md);
  margin: 0;
  padding: 0;
  list-style: none;
}
.kb-pdp__related a {
  display: flex;
  flex-direction: column;
  gap: var(--ds-kk-tile-gap-tight);
  height: 100%;
  box-sizing: border-box;
  padding: var(--ds-space-inline-sm);
  color: var(--ds-color-text);
  text-decoration: none;
  border: var(--ds-border-width) solid var(--ds-color-border);
  border-radius: var(--ds-radius-card);
}
.kb-pdp__related a:hover { color: var(--ds-color-text); text-decoration: none; border-color: var(--ds-color-border-strong); }
.kb-pdp__related-thumb { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--ds-kb-thumb-bg); border-radius: var(--ds-radius-input); }
.kb-pdp__related-thumb img { position: absolute; inset: var(--ds-space-inline-xs); width: calc(100% - var(--ds-space-inline-xs) * 2); height: calc(100% - var(--ds-space-inline-xs) * 2); object-fit: contain; }
.kb-pdp__related-name { margin-top: var(--ds-space-inline-xs); font-size: var(--ds-text-body-sm-size); font-weight: var(--ds-text-h3-weight); line-height: 1.4; }
.kb-pdp__related-price { margin-top: auto; font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-price); font-variant-numeric: tabular-nums; }
.kb-pdp__related-price small { font-size: var(--ds-text-micro-size); }

/* 価格チャート（partials/box-price-chart.php をそのまま使う。外側の余白だけ詰める） */
.kb-pdp__chart { display: flex; flex-direction: column; gap: var(--ds-space-inline-sm); margin-top: var(--ds-space-inline-sm); }
.kb-pdp__chart .box-chart { margin: 0; }

/* このBOXの当たりカード */
.kb-pdp__hits {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--ds-space-inline-md);
  margin: 0;
  padding: 0;
  list-style: none;
}
.kb-pdp__hit {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--ds-kk-tile-gap-tight);
  padding: var(--ds-space-inline-sm);
  border: var(--ds-border-width) solid var(--ds-color-border);
  border-radius: var(--ds-radius-card);
}
.kb-pdp__hit-rank {
  position: absolute;
  top: var(--ds-space-inline-xs);
  left: var(--ds-space-inline-xs);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ds-kb-step-num);
  height: var(--ds-kb-step-num);
  font-size: var(--ds-text-caption-size);
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text-inverse);
  background: var(--ds-color-bg-inverse);
  border-radius: var(--ds-radius-chip);
}
.kb-pdp__hit-thumb { display: block; }
.kb-pdp__hit-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 215 / 300; object-fit: cover; border-radius: var(--ds-radius-input); }
.kb-pdp__hit-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: var(--ds-space-inline-xs);
  font-size: var(--ds-text-body-sm-size);
  font-weight: var(--ds-text-h3-weight);
  line-height: 1.4;
}
.kb-pdp__hit-meta { font-size: var(--ds-text-micro-size); color: var(--ds-color-text-muted); }
.kb-pdp__hit-price { margin-top: auto; font-size: var(--ds-text-body-size); font-weight: var(--ds-text-h3-weight); color: var(--ds-color-price); font-variant-numeric: tabular-nums; }
.kb-pdp__hit-price small { font-size: var(--ds-text-micro-size); }
.kb-pdp__note { margin: 0; font-size: var(--ds-text-micro-size); line-height: 1.7; color: var(--ds-color-text-muted); }

.kb-pdp__bar { display: none; }

@media (max-width: 900px) {
  .kb-pdp__main { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-stack-sm); }
  .kb-pdp__related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kb-pdp__hits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- SP: 縦積み＋下部固定帯 ---------- */
@media (max-width: 600px) {
  .kb-pdp { gap: var(--ds-space-stack-md); }
  .kb-pdp--has-bar { padding-bottom: var(--ds-kb-bar-space); }
  .kb-pdp__thumb { aspect-ratio: 4 / 3; border-radius: var(--ds-radius-card); } /* 価格と個数を1画面目に収めるため横長にする */
  .kb-pdp__img {
    inset: var(--ds-space-inline-md);
    width: calc(100% - var(--ds-space-inline-md) * 2);
    height: calc(100% - var(--ds-space-inline-md) * 2);
  }
  .kb-pdp__main { gap: var(--ds-space-inline-md); }
  .kb-pdp__gallery,
  .kb-pdp__info { gap: var(--ds-space-inline-sm); }
  .kb-pdp__points li { padding: var(--ds-space-inline-xs) var(--ds-space-inline-sm); }
  .kb-pdp__back {
    position: absolute;
    top: var(--ds-space-inline-md);
    right: var(--ds-space-inline-md);
    display: inline-flex;
    align-items: center;
    min-height: var(--ds-kb-chip-h);
    padding: 0 var(--ds-space-inline-md);
    font-size: var(--ds-text-caption-size);
    font-weight: var(--ds-text-h3-weight);
    color: var(--ds-color-text);
    text-decoration: none;
    background: var(--ds-color-bg-paper);
    border: var(--ds-border-width) solid var(--ds-color-border);
    border-radius: var(--ds-radius-chip);
  }
  .kb-pdp__title { font-size: var(--ds-text-h2-size); }
  .kb-pdp__price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--ds-space-inline-sm); padding: var(--ds-space-inline-md); }
  .kb-pdp__price-value { font-size: var(--ds-text-h1-size); }
  .kb-pdp__price-note { flex-basis: 100%; }
  .kb-pdp__info > .kb-pdp__cta { display: none; } /* 依頼ボタンは下部固定帯に出す */
  .kb-pdp__flow { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-inline-sm); }
  .kb-pdp__flow li { padding: var(--ds-space-inline-md); }
  .kb-pdp__related {
    display: flex;
    gap: var(--ds-space-inline-sm);
    margin: 0 calc(var(--ds-space-page-x) * -1);
    padding: 0 var(--ds-space-page-x) var(--ds-space-inline-xs);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .kb-pdp__related li { flex: none; width: var(--ds-kb-related-w-sp); }
  .kb-pdp__hits { gap: var(--ds-space-inline-sm); }
  .kb-pdp__hit-name { font-size: var(--ds-text-caption-size); }

  .kb-pdp__bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: var(--ds-space-inline-md);
    padding: var(--ds-space-inline-md) var(--ds-space-page-x) calc(var(--ds-space-inline-md) + env(safe-area-inset-bottom));
    background: var(--ds-color-bg-paper);
    border-top: var(--ds-border-width) solid var(--ds-color-border);
    box-shadow: var(--ds-kb-bar-shadow);
  }
  .kb-pdp__bar-price {
    flex: none;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-size: var(--ds-text-h3-size);
    font-weight: var(--ds-text-h3-weight);
    line-height: 1.2;
    color: var(--ds-color-price);
    font-variant-numeric: tabular-nums;
  }
  .kb-pdp__bar-price small { font-size: var(--ds-text-micro-size); font-weight: normal; color: var(--ds-color-text-muted); }
  .kb-pdp__bar .kb-pdp__btn { flex: 1; min-height: var(--ds-kb-cta-h); }
  .kb-pdp__bar-cart {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: var(--ds-kb-cta-h);
    min-height: var(--ds-kb-cta-h);
    font-size: var(--ds-text-micro-size);
    font-weight: var(--ds-text-h3-weight);
    line-height: 1.2;
    color: var(--ds-color-text);
    text-decoration: none;
    border: var(--ds-border-width) solid var(--ds-color-border-strong);
    border-radius: var(--ds-radius-button);
  }
  .kb-pdp__bar-cart[hidden] { display: none; }
  .kb-pdp__bar-cart.is-bump { animation: kb-cart-bump .5s ease; }
  .kb-pdp--has-bar .kb-toast { bottom: calc(var(--ds-kb-bar-space) + env(safe-area-inset-bottom)); }
  .kb-pdp__bar-cart span { font-size: var(--ds-text-body-size); color: var(--ds-kb-cart-bg); }
}

@keyframes kb-cart-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); border-color: var(--ds-kb-added-strong); } 100% { transform: scale(1); } }

/* ---------- カート（/box-kaitori/cart/） ---------- */
.kb-cart { display: flex; flex-direction: column; gap: var(--ds-space-stack-md); }
.kb-cart p { margin: 0; }
.kb-cart__title { margin: 0; font-size: var(--ds-text-h1-size); }
.kb-cart__lead { margin-top: var(--ds-space-inline-xs) !important; font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
.kb-cart__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ds-kb-cart-side);
  gap: var(--ds-kb-pdp-gap);
  align-items: start;
}
.kb-cart__body[hidden], .kb-cart__empty[hidden] { display: none; }
.kb-cart__table { min-width: 0; }
.kb-cart__cols,
.kb-cart__item {
  display: grid;
  grid-template-columns: var(--ds-kb-cart-cols);
  gap: var(--ds-space-inline-md);
  align-items: center;
}
.kb-cart__cols {
  padding: var(--ds-space-inline-sm) 0;
  font-size: var(--ds-text-caption-size);
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text-muted);
  border-bottom: var(--ds-border-width) solid var(--ds-color-border-strong);
}
.kb-cart__cols span:nth-child(n+2) { text-align: right; }
.kb-cart__cols span:nth-child(3) { text-align: center; }
.kb-cart__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.kb-cart__item { padding: var(--ds-space-inline-md) 0; border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-cart__prod { display: flex; align-items: center; gap: var(--ds-space-inline-md); min-width: 0; }
.kb-cart__thumb {
  position: relative;
  flex: none;
  display: block;
  width: var(--ds-kb-cart-thumb);
  aspect-ratio: 1 / 1;
  max-width: 100%;
  overflow: hidden;
  background: var(--ds-kb-thumb-bg);
  border-radius: var(--ds-radius-card);
}
.kb-cart__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; padding: var(--ds-space-inline-xs); object-fit: contain; }
.kb-cart__info { display: flex; flex-direction: column; gap: var(--ds-space-inline-xs); min-width: 0; }
.kb-cart__name { font-weight: var(--ds-text-h3-weight); color: var(--ds-color-text); text-decoration: none; }
.kb-cart__name:hover { text-decoration: underline; }
.kb-cart__meta { font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
.kb-cart__unit, .kb-cart__sub { text-align: right; font-variant-numeric: tabular-nums; }
.kb-cart__sub { font-weight: var(--ds-text-h3-weight); color: var(--ds-color-price); }
.kb-cart__qty { display: flex; justify-content: center; }
.kb-cart__label { display: none; }
.kb-cart__item.is-ended .kb-cart__name { color: var(--ds-color-text-muted); }
.kb-cart__remove {
  justify-self: end;
  padding: 0;
  font-family: inherit;
  font-size: var(--ds-text-caption-size);
  color: var(--ds-color-text-muted);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}
.kb-cart__remove:hover { color: var(--ds-color-text); }
.kb-cart__side {
  position: sticky;
  top: var(--ds-space-stack-md);
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-inline-sm);
  padding: var(--ds-space-stack-sm);
  background: var(--ds-color-bg-subtle);
  border-radius: var(--ds-radius-lg);
}
.kb-cart__sum { display: flex; flex-direction: column; gap: var(--ds-space-inline-xs); padding-bottom: var(--ds-space-inline-sm); border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-cart__sum-row, .kb-cart__sum-total { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--ds-text-caption-size); }
.kb-cart__sum-total strong { font-size: var(--ds-text-h2-size); color: var(--ds-color-price); font-variant-numeric: tabular-nums; }
.kb-cart__choose { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); }
.kb-cart__way {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-inline-xs);
  padding: var(--ds-space-inline-md);
  color: var(--ds-color-text-inverse);
  text-decoration: none;
  border-radius: var(--ds-radius-button);
}
.kb-cart__way:hover { color: var(--ds-color-text-inverse); text-decoration: none; }
.kb-cart__way--line { background: var(--ds-color-cta-line-bg); }
.kb-cart__way--line:hover { background: var(--ds-color-cta-line-bg-hover); }
.kb-cart__way--web { background: var(--ds-kb-cart-bg); }
.kb-cart__way--web:hover { background: var(--ds-kb-cart-bg-hover); }
.kb-cart__way.is-disabled { pointer-events: none; opacity: .5; }
.kb-cart__way--off {
  width: 100%;
  font-family: inherit;
  text-align: left;
  color: var(--ds-color-text-muted);
  background: var(--ds-color-bg-paper);
  border: var(--ds-border-width) dashed var(--ds-color-border-strong);
  cursor: not-allowed;
}

/* PC で LINE を選んだときの QR コード */
.kb-qr {
  width: min(var(--ds-kb-qr-dialog), calc(100% - var(--ds-space-stack-md) * 2));
  padding: 0;
  color: var(--ds-color-text);
  background: var(--ds-color-bg-paper);
  border: 0;
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-modal);
}
.kb-qr::backdrop { background: var(--ds-kb-qr-backdrop); }
.kb-qr__box { display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-inline-sm); padding: var(--ds-space-stack-md); text-align: center; }
.kb-qr__title { margin: 0; font-size: var(--ds-text-h3-size); }
.kb-qr__text { font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
.kb-qr__code { width: var(--ds-kb-qr-size); max-width: 100%; aspect-ratio: 1 / 1; }
.kb-qr__code svg { display: block; width: 100%; height: auto; }
.kb-qr__items { display: flex; justify-content: center; align-items: flex-start; gap: var(--ds-space-inline-sm); width: 100%; margin: 0; padding: var(--ds-space-inline-sm) 0; list-style: none; border-top: var(--ds-border-width) solid var(--ds-color-border); border-bottom: var(--ds-border-width) solid var(--ds-color-border); }
.kb-qr__item { display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-inline-xs); width: var(--ds-kb-qr-item); min-width: 0; }
.kb-qr__item-img { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; background: var(--ds-color-bg-subtle); border-radius: var(--ds-radius-input); }
.kb-qr__item-img img { position: absolute; inset: 0; width: 100%; height: 100%; padding: var(--ds-space-inline-xs); object-fit: contain; }
.kb-qr__item-qty { position: absolute; right: 0; bottom: 0; padding: 0 var(--ds-space-inline-xs); font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); font-variant-numeric: tabular-nums; color: var(--ds-color-text-inverse); background: var(--ds-color-text); border-radius: var(--ds-radius-input); }
.kb-qr__item-price { font-size: var(--ds-text-caption-size); font-weight: var(--ds-text-h3-weight); font-variant-numeric: tabular-nums; color: var(--ds-color-price); white-space: nowrap; }
.kb-qr__item--more { align-self: center; width: auto; font-weight: var(--ds-text-h3-weight); color: var(--ds-color-text-muted); }
.kb-qr__sum { font-weight: var(--ds-text-h3-weight); font-variant-numeric: tabular-nums; }
.kb-qr__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--ds-space-inline-md); margin-top: var(--ds-space-inline-xs); }
.kb-qr__pc { font-size: var(--ds-text-caption-size); }
.kb-qr__close {
  min-height: var(--ds-kb-select-h);
  padding: 0 var(--ds-space-stack-sm);
  font-family: inherit;
  font-weight: var(--ds-text-h3-weight);
  color: var(--ds-color-text);
  background: var(--ds-color-bg-subtle);
  border: 0;
  border-radius: var(--ds-radius-button);
  cursor: pointer;
}
.kb-cart__way-title { font-weight: var(--ds-text-h3-weight); }
.kb-cart__way-text { font-size: var(--ds-text-micro-size); }
.kb-cart__notes { margin: 0; padding-left: var(--ds-space-stack-sm); font-size: var(--ds-text-micro-size); color: var(--ds-color-text-muted); }
.kb-cart__empty { display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-stack-sm); padding: var(--ds-space-stack-lg) 0; }
.kb-cart__empty .kb-pdp__btn { width: auto; }

@media (max-width: 900px) {
  .kb-cart__body { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-stack-sm); }
  .kb-cart__side { position: static; }
}
/* SP: 1行目に商品、2行目に買取価格・個数・小計を横並び */
@media (max-width: 600px) {
  .kb-cart__cols { display: none; }
  .kb-cart__list { border-top: var(--ds-border-width) solid var(--ds-color-border); }
  .kb-cart__item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "prod prod" "qty sub" "unit del";
    gap: var(--ds-space-inline-sm) var(--ds-space-inline-md);
  }
  .kb-cart__prod { grid-area: prod; }
  .kb-cart__unit { grid-area: unit; text-align: left; font-size: var(--ds-text-caption-size); color: var(--ds-color-text-muted); }
  .kb-cart__qty { grid-area: qty; justify-content: flex-start; }
  .kb-cart__sub { grid-area: sub; }
  .kb-cart__remove { grid-area: del; }
  .kb-cart__label { display: inline; margin-right: var(--ds-space-inline-xs); font-size: var(--ds-text-micro-size); font-weight: normal; color: var(--ds-color-text-muted); }
  .kb-cart__thumb { width: var(--ds-kb-cart-thumb-sp); }
}
