/* ==========================================================================
   教材ショップの見た目。色と書体はテーマ（pzl-club）の :root の変数を使う。
   ========================================================================== */

/* テーマの .site-main は本文用に 760px で狭いので、ショップは全幅にして .inner で揃える */
.site-main.shop { max-width: none; padding: 40px 0 80px; }
.shop-narrow { max-width: 760px; }
.shop h2 { font-family: var(--serif, serif); color: var(--indigo-dark, #1a2550); letter-spacing: .06em; line-height: 1.5; }

/* --- はじめの説明・準備中のお知らせ --- */
.shop-intro { margin-bottom: 28px; }
.shop-intro p { margin-bottom: 12px; }
.shop-closed { background: #fff8e1; border: 1px solid #e9d48a; border-radius: 8px; padding: 14px 18px; color: #5b4700; }
.shop-closed a { font-weight: 700; }

/* --- 棚へのジャンプ --- */
.shop-shelfnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; scroll-margin-top: 90px; }
.shop-shelfnav a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: 1px solid var(--line, #e2dccd); border-radius: 999px; background: #fff; text-decoration: none; font-weight: 700; color: var(--indigo-dark, #1a2550); font-size: 16px; white-space: nowrap; }
.shop-shelfnav a:hover { border-color: var(--indigo, #25346b); }
.shop-shelfnav a.is-active { background: var(--indigo, #25346b); border-color: var(--indigo, #25346b); color: #fff; }
.shop-shelfnav span { font-size: 13px; color: var(--sub, #62605a); font-weight: 500; }
.shop-shelfnav a.is-active span { color: rgba(255, 255, 255, .8); }
/* スマホは1列に並べて横にスクロール */
@media (max-width: 640px) {
	.shop-shelfnav { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px 28px; padding: 0 20px 6px; }
}

/* --- 棚 --- */
.shop-shelf { padding: 36px 0 12px; border-top: 1px solid var(--line, #e2dccd); scroll-margin-top: 90px; }
.shop-shelf > h2 { font-size: 26px; margin-bottom: 8px; }
.shop-shelf-desc { color: var(--sub, #62605a); margin-bottom: 12px; }
.shop-series { margin: 20px 0 28px; }
.shop-series h3 { font-size: 18px; color: var(--ink, #2b2a28); margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.shop-series h3 span { font-size: 14px; font-weight: 500; color: var(--sub, #62605a); }

/* 一覧＝横長のサムネで、PC は4列・タブレット3列・スマホ2列 */
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
@media (min-width: 640px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; } }
@media (min-width: 960px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; } }

/* --- 商品カード --- */
.shop-card { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink, #2b2a28); }
.shop-card-thumb { display: block; aspect-ratio: 16 / 10; background: var(--paper-2, #f2ede1); border: 1px solid var(--line, #e2dccd); border-radius: 8px; overflow: hidden; margin-bottom: 10px; transition: box-shadow .2s, transform .2s; }
.shop-card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.shop-card:hover .shop-card-thumb { box-shadow: 0 6px 18px rgba(26, 37, 80, .14); transform: translateY(-2px); }
.shop-card-name { font-weight: 700; font-size: 16px; line-height: 1.5; flex: 1; word-break: auto-phrase; text-wrap: balance; }
.shop-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.shop-card-price { font-size: 16px; color: var(--rose-dark, #9a3150); font-weight: 700; }
.shop-card-more { font-size: 14px; font-weight: 700; color: var(--indigo, #25346b); white-space: nowrap; }
.shop-card-more::after { content: " \203A"; }
.shop-card:hover .shop-card-more { text-decoration: underline; }
@media (max-width: 639px) { .shop-card-more { display: none; } }
.shop-card-soon { position: absolute; top: 8px; right: 8px; background: rgba(43, 42, 40, .82); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }

/* 見本画像の無い商品＝生成り地に名前 */
/* --- マークと名前のサムネ（教材の中身は見せない） ---
   棚ごとの色＝--tc（濃い色）と --tc-bg（うすい地）。新しく作った棚は紺。 */
.shop-tcard { --tc: var(--indigo, #25346b); --tc-bg: #eef0f7; container-type: inline-size; position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; padding: 6% 7% 6% 9%; background: var(--tc-bg); color: var(--ink, #2b2a28); overflow: hidden; }
.shop-tcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3.2%; background: var(--tc); } /* 背表紙の帯 */
.shop-tcard::after { content: ""; position: absolute; right: -9%; bottom: -22%; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--tc); opacity: .14; } /* うすい円の飾り */
.shop-tcard[data-shelf="sansu"] { --tc: #2f56b5; --tc-bg: #edf1fa; }
.shop-tcard[data-shelf="keisan"] { --tc: #25346b; --tc-bg: #eceef5; }
.shop-tcard[data-shelf="puzzle"] { --tc: #b4521f; --tc-bg: #faefe7; }
.shop-tcard[data-shelf="kirie"] { --tc: #22773e; --tc-bg: #eaf4ec; }
.shop-tcard[data-shelf="bvt"] { --tc: #b35600; --tc-bg: #fff6ec; }
.shop-tcard[data-shelf="ohanashi"] { --tc: #8c46a6; --tc-bg: #f4eef7; }
.shop-tcard-brand { display: flex; align-items: center; gap: 2.5cqw; font-family: var(--serif, serif); font-weight: 700; font-size: clamp(11px, 4.6cqw, 16px); color: var(--indigo-dark, #1a2550); letter-spacing: .04em; }
.shop-tcard-brand img { width: 10cqw; height: auto; flex: none; }
.shop-tcard-brand img.is-bvt { width: 58cqw; }
.shop-tcard-title { flex: 1; display: flex; align-items: center; font-family: var(--serif, serif); font-weight: 700; font-size: clamp(16px, 9.6cqw, 38px); line-height: 1.35; color: var(--tc); letter-spacing: .02em; word-break: auto-phrase; }
.shop-tcard-shelf { align-self: flex-start; font-size: clamp(10px, 3.6cqw, 14px); font-weight: 700; color: #fff; background: var(--tc); padding: .2em .8em; border-radius: 999px; }
/* 教材ページの大きいサムネ */
.product-tcard { aspect-ratio: 16 / 10; border: 1px solid var(--line, #e2dccd); border-radius: 8px; overflow: hidden; }

/* --- 商品のページ --- */
.product-detail { display: grid; gap: 32px; }
@media (min-width: 900px) { .product-detail { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; } }
.product-gallery figure { margin: 0 0 16px; border: 1px solid var(--line, #e2dccd); border-radius: 8px; overflow: hidden; background: #fff; }
.product-gallery figure img { width: 100%; }
.product-gallery-note { font-size: 14px; color: var(--sub, #62605a); }
/* スマホ・タブレットは値段とボタンを先に出し、見本はその下で横にスライド */
@media (max-width: 899px) {
	.product-detail { gap: 28px; }
	.product-buy { order: -1; }
	.product-name { display: none; } /* 上の帯に同じ名前が出ているので */
	.product-shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; margin: 0 -20px; padding: 0 20px 4px; }
	.product-shots figure { flex: 0 0 78%; max-width: 360px; margin: 0; scroll-snap-align: start; }
	.product-gallery-note { margin-top: 8px; }
}
@media (min-width: 900px) { .product-buy { position: sticky; top: 100px; } }
.product-shelf { font-size: 14px; color: var(--sub, #62605a); font-weight: 700; }
.product-name { font-size: 28px; margin: 4px 0 12px; }
.product-price { font-size: 32px; font-weight: 700; color: var(--rose-dark, #9a3150); margin-bottom: 20px; line-height: 1.3; }
.product-price small { font-size: 16px; color: var(--sub, #62605a); margin-left: 4px; }
.product-buy-now { width: 100%; padding: 16px 26px; font-size: 18px; border: 0; cursor: pointer; }
.product-buy-now:disabled { background: var(--sub, #62605a); cursor: default; }
.product-buy-error { margin-top: 10px; color: #b32d2e; font-weight: 700; }
.product-add { width: 100%; margin-top: 12px; padding: 11px 18px; font-size: 15px; cursor: pointer; }
.product-add:disabled { color: var(--sub, #62605a); border-color: var(--line, #e2dccd); background: #fff; cursor: default; }
.product-added { margin-top: 10px; font-weight: 700; }
.product-soon { background: var(--paper-2, #f2ede1); border-radius: 8px; padding: 14px 18px; font-weight: 700; }
.product-notes { margin: 20px 0 0; padding: 16px 18px 16px 34px; background: var(--paper, #faf7f0); border-radius: 8px; font-size: 15px; color: var(--ink, #2b2a28); }
.product-notes li + li { margin-top: 6px; }
.product-desc { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line, #e2dccd); max-width: 760px; }
.product-desc h2 { font-size: 22px; margin-bottom: 12px; }
.product-series { margin-top: 40px; }
.product-series h2 { font-size: 20px; margin-bottom: 12px; }
.product-series-list { list-style: none; counter-reset: s; display: grid; gap: 8px; max-width: 760px; }
.product-series-list li { counter-increment: s; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line, #e2dccd); border-radius: 8px; background: #fff; }
.product-series-list li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--paper-2, #f2ede1); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.product-series-list li.is-current { border-color: var(--indigo, #25346b); background: var(--paper, #faf7f0); font-weight: 700; }
.product-series-list li.is-current::before { background: var(--indigo, #25346b); color: #fff; }
.product-series-list a { flex: 1; font-weight: 700; color: var(--indigo-dark, #1a2550); }
.product-series-list span { flex: 1; }
.product-series-list small { color: var(--sub, #62605a); font-size: 14px; }
.shop-back { margin-top: 40px; }
.shop-legal { margin-top: 40px; font-size: 14px; }

/* --- 画面下のカートのバー --- */
.shop-cartbar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: flex; align-items: center; gap: 16px; justify-content: space-between; max-width: 560px; margin: 0 auto; padding: 12px 18px; background: var(--indigo-dark, #1a2550); color: #fff; border-radius: 999px; text-decoration: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); font-size: 16px; }
.shop-cartbar[hidden] { display: none; }
.shop-cartbar b { font-size: 17px; }
.shop-cartbar-go { background: #fff; color: var(--indigo-dark, #1a2550); font-weight: 700; padding: 4px 16px; border-radius: 999px; }
body.has-cartbar .site-footer { padding-bottom: 88px; }
/* 860px 以下はテーマの下固定バー（LINE で相談／体験・お問い合わせ・高さ約52px）の上に出す */
@media (max-width: 860px) {
	.shop-cartbar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
	body.has-cartbar .site-footer { padding-bottom: 140px; }
}

/* --- カート --- */
.shop-cart-list { list-style: none; border-top: 1px solid var(--line, #e2dccd); }
.shop-cart-row { display: grid; grid-template-columns: 64px 1fr auto; grid-template-areas: "img name name" "img price rm"; gap: 4px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line, #e2dccd); }
@media (min-width: 640px) { .shop-cart-row { grid-template-columns: 64px 1fr auto auto; grid-template-areas: "img name price rm"; } }
.shop-cart-row img, .shop-cart-noimg { grid-area: img; width: 64px; height: 64px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line, #e2dccd); background: var(--paper-2, #f2ede1); display: block; }
.shop-cart-noimg { background: var(--paper, #faf7f0) url(img/logo_mark.png) center / 60% no-repeat; }
.shop-cart-row a { grid-area: name; font-weight: 700; color: var(--indigo-dark, #1a2550); }
.shop-cart-price { grid-area: price; font-weight: 700; }
.shop-cart-price small { display: block; color: #b32d2e; font-size: 14px; }
.shop-cart-row.is-ng a { color: var(--sub, #62605a); }
.shop-cart-remove { grid-area: rm; justify-self: end; background: none; border: 1px solid var(--line, #e2dccd); border-radius: 999px; padding: 4px 14px; font-size: 15px; cursor: pointer; color: var(--ink, #2b2a28); }
.shop-cart-total { text-align: right; font-size: 18px; margin: 18px 0; }
.shop-cart-total b { font-size: 26px; color: var(--rose-dark, #9a3150); }
.shop-cart-total small { display: block; font-size: 14px; color: var(--sub, #62605a); }
.shop-cart-go .btn { width: 100%; padding: 16px 20px; font-size: 18px; border: 0; cursor: pointer; }
.shop-cart-go .btn:disabled { background: var(--sub, #62605a); cursor: default; }
.shop-cart-error { margin-top: 12px; color: #b32d2e; font-weight: 700; }
.shop-cart-empty { margin-bottom: 16px; }

/* --- 購入完了 --- */
.shop-thanks > p { margin-bottom: 18px; }
.shop-dl { list-style: none; border-top: 1px solid var(--line, #e2dccd); }
.shop-dl li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line, #e2dccd); font-weight: 700; }
.shop-wait { font-weight: 700; padding: 18px; background: var(--paper, #faf7f0); border-radius: 8px; }

/* マークと名前のサムネが小さい時（スマホの2列など）は、店名の文字と棚の名前を省いて教材名を大きく */
@container (max-width: 220px) {
	.shop-tcard-brand span, .shop-tcard-shelf { display: none; }
	.shop-tcard-brand img { width: 14cqw; }
	.shop-tcard-brand img.is-bvt { width: 62cqw; }
	.shop-tcard-title { font-size: clamp(14px, 10.5cqw, 22px); }
}

/* 教材名：2行になる時は行の長さを揃える（1文字だけ次の行に落ちないように）。
   少し縮めれば1行に入る名前は shop.js が縮めて1行にする */
.shop-tcard-title > span { display: block; width: 100%; text-wrap: balance; }
