/* 商品詳細（views/products/show.ejs・_show-buy.ejs）: 写真と小さな一覧・右の購入の欄。
   帯・物語・レビュー・組み合わせ・スマホの購入の帯は product-more.css */
@view-transition { navigation: auto; }

/* 写真は画面の高さに収め、右の欄は「カートに入れる」までをひと目で（よくある PC の 1280×720 でもスクロールなし） */
.pd-page { padding-bottom: 0; }
.it { display: grid; grid-template-columns: minmax(0, 600px) minmax(340px, 460px); justify-content: center; column-gap: clamp(28px, 4vw, 64px); align-items: start; }

/* 写真 */
.it-gal { min-width: 0; position: sticky; top: calc(var(--hd) + env(safe-area-inset-top, 0px) + 20px); }
.gm { position: relative; aspect-ratio: 1; width: min(100%, calc(100svh - var(--hd) - 120px)); overflow: hidden; background: var(--mist); }
.gm img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: saturate(.88) contrast(1.04); transition: opacity var(--t-3) var(--ease), transform 1.4s var(--ease); }
.gm img[data-hero] { view-transition-name: pd-hero; }
.gm img.is-out { opacity: 0; transform: scale(1.06); }
.gm.is-empty::after { content: "写真の準備中"; position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); letter-spacing: .2em; color: var(--ink-3); }
.gm .pc-bdg { top: 12px; left: 12px; }
.thumbs { display: flex; gap: 6px; margin-top: 8px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { position: relative; flex: none; width: 60px; aspect-ratio: 1; padding: 0; border: 0; background: var(--mist); cursor: pointer; opacity: .5; transition: opacity var(--t-2); }
.thumbs button:hover { opacity: .8; }
.thumbs button[aria-current="true"] { opacity: 1; }
.thumbs button[aria-current="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px; background: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* 右の欄 */
.it-info { padding-bottom: 32px; min-width: 0; }
.it-info .crumb { margin-bottom: 14px; }
.it-mk { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; color: var(--ink-2); text-decoration: none; }
.it-mk:hover { color: var(--ink); }
.it-mk img, .it-mk__ic { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--mist); flex: none; }
.it-mk__ic { display: grid; place-items: center; color: var(--moss); }
.it-nm { margin-top: 6px; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: .1em; line-height: 1.4; }
.it-rt { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--ink-2); text-decoration: none; }
.it-rt:hover { color: var(--ink); }
.it-pr { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; }
.it-pr b { font-family: var(--f-min); font-weight: 600; font-size: 28px; letter-spacing: .02em; }
.it-pr small { font-size: 12px; color: var(--ink-2); letter-spacing: .08em; }
.save { display: inline-block; padding: 2px 8px; font-size: 11px; letter-spacing: .06em; color: var(--surface); background: var(--moss); animation: pd-in .5s var(--ease); }
@keyframes pd-in { from { opacity: 0; transform: translateY(6px); } }
.lbl { display: block; margin: 16px 0 8px; font-size: 11px; letter-spacing: .2em; color: var(--ink-2); }
.it-lead { margin-top: 18px; font-size: 14px; line-height: 1.9; }
.it-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* 規格の札（.choice を元に、1行に詰め、おとく額と残りを足す） */
.vcards { gap: 6px; }
/* 規格が4つ以上なら、PC では2列にして「カートに入れる」を最初の画面に残す */
@media (min-width: 900px) { .vcards:has(> .choice:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vcards .choice { padding: 10px 14px; }
.vc b { font-size: 14px; font-weight: 500; letter-spacing: .06em; }
.vc .choice__aside { font-size: 16px; }
.vc .choice__desc { font-size: 11px; }
.vc .choice__desc .tnum { margin-left: 4px; }
.tg { display: inline-block; margin-left: 8px; padding: 1px 6px; font-size: 10px; line-height: 1.7; letter-spacing: .06em; white-space: nowrap; vertical-align: 1px; color: var(--surface); background: var(--moss); }
.tg--low { color: var(--warn); background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tg--off { color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

/* 数量・カートに入れる・お気に入り（1行） */
.buy { display: flex; gap: 8px; margin-top: 14px; }
.buy .stepper { flex: none; height: 50px; }
.buy .stepper button { width: 38px; }
@media (pointer: coarse) { .buy .stepper button { width: 44px; } }   /* 指で押す画面（タブレットも）は 44px 以上 */
.buy .stepper input { width: 40px; font-size: 16px; }
.buy .btn { flex: 1; min-width: 0; min-height: 50px; justify-content: space-between; gap: 10px; padding: 0 18px; letter-spacing: .12em; }
.buy .btn [data-buy-label] { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.buy .btn.is-done { justify-content: center; }
.buy .fav--line { flex: none; width: 50px; height: 50px; }
.qnote { margin-top: 6px; font-size: var(--fs-xs); color: var(--warn); }
.eta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.eta svg { color: var(--moss); flex: none; }
.eta b { font-weight: 500; color: var(--ink); }

/* 受け取り方（選ぶのは購入手続き。ここでは知らせるだけ） */
.ship { border-top: 1px solid var(--rule); }
.ship__row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.ship__row > svg { color: var(--moss); }
.ship__row b { font-size: 13px; font-weight: 500; letter-spacing: .06em; }
.ship__fee { font-size: 12px; white-space: nowrap; }
.ship__row small { grid-column: 2 / -1; font-size: 11px; color: var(--ink-2); letter-spacing: .04em; line-height: 1.6; }

/* 開け閉めする説明 */
.accs { margin-top: 20px; }
.prose > * + * { margin-top: 1em; }
.prose :where(h1, h2, h3, h4) { font-size: 15px; color: var(--ink); }
.prose :where(ul, ol) { padding-left: 1.2em; list-style: disc; }
.prose img { margin-block: 8px; }
.prose table { width: 100%; font-size: 13px; }
.prose :where(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; }
.prose a { color: var(--ink); }
.spec > div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.spec > div:first-child { padding-top: 0; }
.spec dt { font-size: 12px; letter-spacing: .1em; color: var(--ink-2); }
.spec dd { margin: 0; color: var(--ink); }
.acc__in > p + p, .acc__in > p + table, .acc__in > table + p { margin-top: 10px; }
.ship-tbl { margin-top: 12px; font-size: 13px; }
.ship-tbl th { position: static; padding: 8px 10px; }
.ship-tbl td { padding: 10px; }
.ship-tbl td:last-child, .ship-tbl th:last-child { text-align: right; white-space: nowrap; }
.gm-list { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
.gm-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
.gm-list img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

@media (max-width: 899px) {
  .it { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .it-gal { position: static; margin-left: calc(var(--g) * -1); margin-right: calc(var(--gr) * -1); }
  .gm { width: 100%; aspect-ratio: 4 / 3; max-height: 52svh; }
  .thumbs { padding-inline: var(--g) var(--gr); }
  .it-info { padding-bottom: 0; }
  .it-info .crumb { margin-bottom: 10px; }
  .it-nm { font-size: 24px; }
  .it-pr b { font-size: 26px; }
}
/* 狭いスマホでは2段にする（上: 数量とお気に入り、下: 幅いっぱいのカートに入れる）。1行だとボタンが細くなり、小計の金額が切れる */
@media (max-width: 599px) {
  .buy { flex-wrap: wrap; }
  .buy .stepper { flex: 1 1 auto; justify-content: space-between; }
  .buy .stepper button { width: 48px; }
  .buy .btn { order: 3; flex-basis: 100%; }
}
