/* カテゴリのストア（js/category-store.js と対・2026-10-07）
 *
 * 見本（葉太承認済み）: https://claude.ai/artifact/Ha254aZ3HdHCU6KQpvjsXZ
 * 上から: ブランド広告の棚（横スワイプ・背景が切り替わる）→ 型 A なら通販サイト風のストア /
 *         型 B なら今のホームと同じ 2×2。
 *
 * 色: 白地・黒の太字・セール価格は赤。角はほぼ四角（Section 9-3: カード 8px 以内）。
 * 味付け（cs-flavor-*）は色と背景だけを変える。操作の形はどのカテゴリも同じ（Section 9-0）。
 */

/* ストアの間はフィードを広げる（ホームの 560px は 2×2 用）。型 B の 2×2 は .cs-b-wrap で今の幅に戻す */
.home-feed.is-category-store { max-width: 1100px; }
.cs-b-wrap { max-width: 560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; }

/* カテゴリのストアでは一番上の共通バナーを出さない（広告の棚が店の顔になる） */
body.is-category-store #dashboard-hero { display: none !important; }

/* ---- ブランド広告の棚 ---- */
.cs-ad-shelf {
    --cs-card-w: min(310px, 80vw);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0 -4px 8px;
    padding: 78px 0 22px;
    background: #2b2b30;
}
.cs-ad-bg { position: absolute; inset: 0; z-index: -3; opacity: 0; transition: opacity 300ms ease; }
.cs-ad-bg.is-on { opacity: 1; }
.cs-ad-bg-photo {
    position: absolute; inset: -40px;
    background-size: cover; background-position: center;
    filter: blur(22px) saturate(1.2);
    transform: scale(1.1);
}
.cs-ad-bg-tint {
    position: absolute; inset: 0; opacity: .72;
    background: linear-gradient(180deg, var(--cs-accent, #3a3340) 0%, color-mix(in srgb, var(--cs-accent, #3a3340) 70%, #000) 100%);
}
.cs-ad-bg-word {
    position: absolute; left: 0; right: 0; top: 16px;
    text-align: center; white-space: nowrap; overflow: hidden;
    font-family: var(--font-num, "Space Grotesk", sans-serif);
    font-weight: 700; letter-spacing: .06em; line-height: 1;
    font-size: 52px; color: rgba(255, 255, 255, .55);
}
.cs-ad-bg-word.is-serif { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; }
.cs-ad-shelf::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: -1;
    background: linear-gradient(rgba(255, 255, 255, 0), var(--cs-store-bg, #ffffff));
}

.cs-ad-rail {
    display: flex; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px; padding: 0 16px 4px;
    scrollbar-width: none;
}
.cs-ad-rail::-webkit-scrollbar { display: none; }
.cs-ad-card {
    flex: 0 0 var(--cs-card-w); width: var(--cs-card-w);
    aspect-ratio: 340 / 440; max-width: 100%;
    position: relative; overflow: hidden; border-radius: 8px;
    scroll-snap-align: start; text-decoration: none; color: #fff;
    background: #222; box-shadow: 0 6px 22px rgba(0, 0, 0, .3);
}
.cs-ad-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cs-ad-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .72) 100%); }
.cs-ad-card:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.cs-ad-pr {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    font-size: 11px; font-weight: 700; color: #111;
    background: rgba(255, 255, 255, .92); padding: 2px 7px; border-radius: 2px;
}
.cs-ad-text { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2; }
.cs-ad-sub { display: inline-block; margin: 0 0 8px; padding: 2px 8px; border-radius: 2px; font-size: 11.5px; font-weight: 700; background: rgba(0, 0, 0, .45); }
.cs-ad-name {
    margin: 0 0 6px; line-height: 1.1;
    font-family: var(--font-num, "Space Grotesk", "Noto Sans JP", sans-serif);
    font-weight: 700; font-size: 25px; letter-spacing: .04em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-ad-name.is-serif { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; font-size: 28px; letter-spacing: .02em; }
.cs-ad-copy { margin: 0 0 12px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.cs-ad-btn { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 4px; background: #fff; color: #111; font-size: 13px; font-weight: 700; }

.cs-ad-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.cs-ad-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(17, 17, 17, .25); transition: width 200ms, background 200ms; }
.cs-ad-dots i.is-on { width: 18px; border-radius: 3px; background: #111; }

.cs-ad-arrow { display: none; }
@media (min-width: 768px) {
    .cs-ad-shelf { --cs-card-w: 340px; padding: 140px 0 28px; margin: 0 0 8px; }
    .cs-ad-bg-word { font-size: 120px; top: 8px; }
    .cs-ad-rail { gap: 16px; scroll-padding-inline: 40px; padding: 0 40px 4px; }
    .cs-ad-arrow {
        display: grid; place-items: center;
        position: absolute; top: 55%; z-index: 4;
        width: 40px; height: 40px; border: 0; border-radius: 50%;
        background: #fff; color: #111; font-size: 20px; cursor: pointer;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    }
    .cs-ad-arrow.is-prev { left: 12px; }
    .cs-ad-arrow.is-next { right: 12px; }
    .cs-ad-arrow:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
}

/* ---- 型 A: 通販サイト風のストア ---- */
.cs-store { background: var(--cs-store-bg, #ffffff); color: #111; padding: 8px 0 28px; font-family: "Noto Sans JP", sans-serif; }
.cs-sec { margin: 0 0 34px; }
.cs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 16px 14px; }
.cs-title { margin: 0; font-family: "Noto Sans JP", sans-serif; font-size: 22px; font-weight: 900; color: #111; }
.cs-more-link { flex: 0 0 auto; font-size: 12.5px; color: #6b6b6b; text-decoration: none; }
.cs-more-link:hover { text-decoration: underline; }

/* 入口タイル（2 段・横スクロール） */
.cs-tiles, .cs-chips {
    display: grid; grid-auto-flow: column; grid-auto-columns: 46%;
    gap: 8px; overflow-x: auto; padding: 4px 16px 0; scrollbar-width: none;
}
.cs-chips { padding-top: 8px; }
.cs-tiles::-webkit-scrollbar, .cs-chips::-webkit-scrollbar, .cs-row::-webkit-scrollbar,
.cs-tabs::-webkit-scrollbar, .cs-hist::-webkit-scrollbar { display: none; }
.cs-tile {
    position: relative; overflow: hidden; height: 96px;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 10px; border: 1px solid #e3e3e3; border-radius: 4px;
    background: #f4f4f2; color: #111; text-decoration: none; text-align: left;
    font: inherit; cursor: pointer;
}
.cs-tile img {
    position: absolute; right: 0; bottom: 0; width: 55%; height: 100%; object-fit: cover;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
    mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.cs-tile b { position: relative; font-family: var(--font-num, "Space Grotesk", "Noto Sans JP", sans-serif); font-size: 22px; font-weight: 900; line-height: 1; }
.cs-tile span { position: relative; margin-top: 6px; font-size: 12.5px; font-weight: 700; }
.cs-tile.is-dark { background: #111; border-color: #111; color: #fff; }
.cs-tile:focus-visible, .cs-chip:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
.cs-chip {
    display: flex; align-items: center; gap: 10px; height: 52px;
    padding: 0 12px 0 6px; border: 1px solid #e3e3e3; border-radius: 4px;
    background: #fff; color: #111; font: inherit; font-size: 14px; font-weight: 700;
    white-space: nowrap; cursor: pointer; text-align: left;
}
.cs-chip img { width: 38px; height: 38px; object-fit: cover; border-radius: 2px; flex: 0 0 auto; }
.cs-chip span { overflow: hidden; text-overflow: ellipsis; }

/* 横に流れる商品の列 */
.cs-row {
    display: grid; grid-auto-flow: column; grid-auto-columns: 36%;
    gap: 8px; overflow-x: auto; padding: 0 16px; scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.cs-card { position: relative; min-width: 0; scroll-snap-align: start; }
.cs-card-link { display: block; color: #111; text-decoration: none; }
.cs-card-ph { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #f2f2f2; }
.cs-card-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-card-tag { position: absolute; left: 0; bottom: 8px; padding: 2px 6px; background: #E8875E; color: #fff; font-size: 10.5px; font-weight: 700; }
.cs-card-tag.is-new { background: #111; }
.cs-card-rank {
    position: absolute; left: 0; top: 0; min-width: 26px; height: 26px; padding: 0 6px;
    display: grid; place-items: center; background: #111; color: #fff;
    font-family: var(--font-num, "Space Grotesk", sans-serif); font-size: 14px; font-weight: 700;
}
.cs-card-brand { margin: 9px 0 2px; font-size: 12.5px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-card-name {
    margin: 0; min-height: 2.9em; font-size: 12.5px; line-height: 1.45; color: #333;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cs-card-was { margin: 6px 0 0; font-family: var(--font-num, "Space Grotesk", sans-serif); font-size: 12px; color: #8a8a8a; }
.cs-card-was s { margin-right: 4px; }
.cs-card-was b { color: #111; font-size: 15px; }
.cs-card-price { margin: 2px 0 0; font-family: var(--font-num, "Space Grotesk", sans-serif); font-size: 16px; font-weight: 700; color: #111; }
.cs-card-price.is-sale { color: #C8102E; }
.cs-card-link:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
/* ハートは写真の右下に重ねる。リンク（a）の中にボタンは置けないので、カードの上に重ねて置き、
 * 高さは「カード幅 × 写真の縦横比」で求める（--cs-ph-ratio は味付けごとに変わる） */
.cs-card { container-type: inline-size; --cs-ph-ratio: 1.3333; }
.cs-heart {
    position: absolute; right: 2px; top: calc(var(--cs-ph-ratio) * 100cqw - 36px);
    width: 34px; height: 34px; padding: 0; border: 0; background: transparent;
    display: grid; place-items: center; cursor: pointer;
}
.cs-heart svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.cs-heart.is-on svg { fill: #E0245E; stroke: #E0245E; }
.cs-heart:focus-visible { outline: 2px solid #111; outline-offset: 0; border-radius: 4px; }

/* タイムセールの残り時間 */
.cs-timer { margin: 0 16px 14px; padding: 12px; background: #f4f4f4; text-align: center; font-size: 13px; color: #555; }
.cs-timer b { font-family: var(--font-num, "Space Grotesk", sans-serif); font-size: 17px; color: #111; font-variant-numeric: tabular-nums; }
.cs-more-btn {
    display: block; margin: 16px 16px 0; padding: 12px;
    border: 1.5px solid #111; color: #111; text-align: center; text-decoration: none;
    font-size: 14px; font-weight: 700; letter-spacing: .08em;
}
.cs-more-btn:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* ランキングのタブ */
.cs-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 14px; scrollbar-width: none; }
.cs-tabs button {
    flex: 0 0 auto; padding: 7px 14px; border: 1px solid #ddd; border-radius: 999px;
    background: #fff; color: #444; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.cs-tabs button[aria-pressed="true"] { background: #111; border-color: #111; color: #fff; }
.cs-tabs button:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* 新着: 3 列 */
.cs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 6px; padding: 0 16px; }

/* 2% の帯（黒の細帯） */
.cs-band { margin: 0 16px 34px; padding: 14px 16px; background: #111; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cs-band p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.cs-band p b { font-size: 14px; }
.cs-band strong { font-family: var(--font-num, "Space Grotesk", sans-serif); font-size: 28px; line-height: 1; }

/* 商品がまだ無いカテゴリ */
.cs-empty { margin: 8px 16px 28px; padding: 32px 16px; text-align: center; border: 1px dashed #d4d4d8; }
.cs-empty-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #111; }
.cs-empty-sub { margin: 0; font-size: 13px; color: #6b6b6b; }

/* 最近見た商品 */
.cs-hist { display: grid; grid-auto-flow: column; grid-auto-columns: 22%; gap: 6px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.cs-hist-item { display: block; }
.cs-hist-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f2f2f2; }

@media (min-width: 768px) {
    .cs-head, .cs-timer { margin-left: 40px; margin-right: 40px; }
    .cs-title { font-size: 26px; }
    .cs-tiles { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 40px 0; }
    .cs-chips { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px 40px 0; }
    .cs-row { grid-auto-columns: calc((100% - 40px) / 6); padding: 0 40px; }
    .cs-tabs { padding: 0 40px 16px; }
    .cs-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 10px; padding: 0 40px; }
    .cs-band { margin: 0 40px 34px; }
    .cs-hist { grid-auto-columns: calc((100% - 54px) / 10); padding: 0 40px; }
    .cs-more-btn { max-width: 360px; margin: 18px auto 0; }
}

/* ---- 味付け: 食品（生成りの地・正方形の写真・広告は生産者） ---- */
.home-feed.cs-flavor-food { --cs-store-bg: #F7F3EA; }
.cs-flavor-food .cs-card-ph { aspect-ratio: 1 / 1; border-radius: 4px; }
.cs-flavor-food .cs-card { --cs-ph-ratio: 1; }
.cs-flavor-food .cs-card-tag { background: #2F6B3A; }
.cs-flavor-food .cs-card-tag.is-new { background: #111; }
.cs-flavor-food .cs-tile:not(.is-dark), .cs-flavor-food .cs-chip { background: #FFFDF7; border-color: #E6DCC8; }
.cs-flavor-food .cs-timer { background: #EFE7D6; }
.cs-flavor-food .cs-ad-name { font-family: "Noto Sans JP", sans-serif; font-weight: 900; }
.cs-flavor-food .cs-ad-bg-word { font-family: "Noto Sans JP", sans-serif; font-weight: 900; letter-spacing: .04em; font-size: 42px; top: 22px; }

/* ---- 味付け: 家・園芸（部屋の写真・少し横長） ---- */
.home-feed.cs-flavor-home { --cs-store-bg: #FBFAF8; }
.cs-flavor-home .cs-card-ph { aspect-ratio: 4 / 5; }
.cs-flavor-home .cs-card { --cs-ph-ratio: 1.25; }
.cs-flavor-home .cs-tile:not(.is-dark), .cs-flavor-home .cs-chip { background: #fff; }

/* ---- 味付け: ゲーム・ホビー（暗い画面・光る縁・ドット文字）----
 * DotGothic16 は Google Fonts。新しい Web フォントは原則足さないが、このカテゴリだけ
 * 例外として葉太が承認（2026-10-07・CLAUDE.md Section 9-2）。読み込みは buyer-dashboard.html。 */
.home-feed.cs-flavor-game { --cs-store-bg: #0A0C12; background: #0A0C12; }
.cs-flavor-game .cs-ad-shelf { background: #07090D; }
.cs-flavor-game .cs-ad-bg-tint { opacity: .55; }
.cs-flavor-game .cs-ad-bg-word,
.cs-flavor-game .cs-ad-name {
    font-family: "DotGothic16", monospace; font-weight: 400; font-style: normal; letter-spacing: .06em;
    color: #7DFFD8; text-shadow: 0 0 12px rgba(34, 211, 238, .6);
}
.cs-flavor-game .cs-ad-bg-word { color: rgba(125, 255, 216, .55); }
.cs-flavor-game .cs-ad-card { border: 1px solid #22D3EE; box-shadow: 0 0 0 1px rgba(34, 211, 238, .35), 0 0 22px rgba(34, 211, 238, .35); }
.cs-flavor-game .cs-ad-card::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
}
.cs-flavor-game .cs-ad-btn, .cs-flavor-game .cs-ad-pr { background: #7DFFD8; color: #04110D; }
.cs-flavor-game .cs-ad-dots i { background: rgba(125, 255, 216, .3); }
.cs-flavor-game .cs-ad-dots i.is-on { background: #7DFFD8; }
/* 型 B の 2×2（js/home-shelves.js）を暗い画面に合わせる */
.cs-flavor-game .home-block-title { color: #E9F6F4; font-family: "DotGothic16", monospace; font-weight: 400; letter-spacing: .04em; }
.cs-flavor-game .home-pick-ph { background: #111621; border-color: #233040; }
.cs-flavor-game .home-pick-name { color: #B8C6CC; }
.cs-flavor-game .home-pick-price { color: #7DFFD8; }
.cs-flavor-game .home-pick-was { color: #6F8088; }
.cs-flavor-game .home-section-more { color: #7DFFD8; }
.cs-flavor-game .continue-card { background: #111621; border-color: #233040; }
.cs-flavor-game .continue-card-title { color: #E9F6F4; }
.cs-flavor-game .continue-card-more { color: #7DFFD8; }
.cs-flavor-game .plant-shelf::before { background: linear-gradient(to bottom, rgba(10, 12, 18, .2), #0A0C12); }

@media (prefers-reduced-motion: reduce) {
    .cs-ad-bg, .cs-ad-dots i { transition: none; }
}
