/* ============================================================================
   curiomart-popunk.css — v0.8.3.g
   Pop Pink design system port from Curiomart.html prototype.
   Loaded AFTER curiomart.css to override colors, typography, and layout while
   leaving existing JS-bound DOM structure intact.
   ============================================================================ */

.curiomart-body {
    --cm-bg:         #fff5f8;
    --cm-bg-2:       #ffe8ef;
    --cm-surface:    #ffffff;
    --cm-surface-2:  #fff0f5;
    --cm-ink:        #1a0c14;
    --cm-ink-2:      #6b4e5a;
    --cm-ink-3:      #a08791;
    --cm-accent:     #d6075e;
    --cm-accent-2:   #ff4d8d;
    --cm-accent-soft:#ffd9e6;
    --cm-gold:       #c79324;
    --cm-line:       rgba(28, 12, 20, 0.08);
    --cm-line-2:     rgba(214, 7, 94, 0.22);
    --cm-chip-bg:    #ffffff;
    --cm-shadow:     0 1px 0 rgba(28,12,20,0.04), 0 8px 24px -12px rgba(214,7,94,0.25);
    --cm-radius:     18px;
    --cm-radius-sm:  10px;
    --cm-radius-pill:999px;
    --cm-font-head:  "Zen Kaku Gothic New", "Zen Maru Gothic", "Noto Sans JP", system-ui, sans-serif;
    --cm-font-body:  "Zen Kaku Gothic New", "Zen Maru Gothic", "Noto Sans JP", system-ui, sans-serif;
    --cm-font-mono:  "JetBrains Mono", ui-monospace, monospace;

    background: var(--cm-bg);
    color: var(--cm-ink);
    font-family: var(--cm-font-body);
    font-feature-settings: "palt";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    /* v0.8.3.h: 旧 curiomart.css に残っていた padding-top:88px (旧 position:fixed
       ヘッダー用の余白確保) を打ち消す。Pop Pink では top bar が sticky で
       自前スペースを取るため、上余白は不要。 */
    padding-top: 0;
    margin-top: 0;
}

/* Hero is dropped per design — main scroll starts at sticky toolbar + grid. */
.curiomart-hero { display: none !important; }

/* v0.8.3.h: ブラウザ既定の body margin と html scroll-padding をリセット。
   "謎の上スペース" の二次予防として明示的に 0 にしておく。 */
html.curiomart-html,
body.curiomart-body {
    margin: 0;
}

/* ============================== HEADER ============================== */
.curiomart-top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px 24px;
    background: color-mix(in oklab, var(--cm-bg) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--cm-line);
    box-shadow: none;
    border-top: 0;
}

.curiomart-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 0;
    padding: 4px 6px;
    text-decoration: none;
}

.curiomart-logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--cm-accent), var(--cm-accent-2));
    color: #fff;
    box-shadow: 0 2px 0 color-mix(in oklab, var(--cm-accent) 60%, black);
    font-size: 0;
}
.curiomart-logo-mark svg { width: 20px; height: 20px; }

.curiomart-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-align: left;
}
.curiomart-logo-en {
    font-family: var(--cm-font-head);
    font-weight: 800;
    letter-spacing: .02em;
    font-size: 15px;
    color: var(--cm-ink);
}
.curiomart-logo-ja {
    font-size: 10px;
    color: var(--cm-ink-2);
    margin-top: 3px;
    letter-spacing: .08em;
}

/* Centered search slot (added in HTML) */
.curiomart-header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    background: var(--cm-surface);
    color: var(--cm-ink-2);
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}
.curiomart-header-search input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 14px;
    min-width: 0;
    color: var(--cm-ink);
}
.curiomart-header-search kbd {
    font-family: var(--cm-font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid var(--cm-line);
    border-radius: 4px;
    color: var(--cm-ink-3);
    background: var(--cm-bg);
}

.curiomart-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tone-down existing action buttons to iconbtn pill look. */
.curiomart-top-actions .curiomart-favorite-toggle,
.curiomart-top-actions .curiomart-purchased-toggle,
.curiomart-top-actions .curiomart-points-link,
.curiomart-top-actions .curiomart-history-link,
.curiomart-top-actions .curiomart-cart-btn,
.curiomart-top-actions .curiomart-login-btn,
.curiomart-top-actions .curiomart-logout-btn {
    position: relative;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--cm-ink);
    border-radius: var(--cm-radius-pill);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: none;
    transform: none;
}

.curiomart-top-actions .curiomart-favorite-toggle:hover,
.curiomart-top-actions .curiomart-purchased-toggle:hover,
.curiomart-top-actions .curiomart-points-link:hover,
.curiomart-top-actions .curiomart-history-link:hover,
.curiomart-top-actions .curiomart-cart-btn:hover,
.curiomart-top-actions .curiomart-login-btn:hover,
.curiomart-top-actions .curiomart-logout-btn:hover {
    background: var(--cm-surface-2);
    transform: none;
    box-shadow: none;
}

/* v0.8.3.h: アクティブ時 (購入済 / お気に入りトグル) はアクセント色で塗る */
.curiomart-top-actions .curiomart-favorite-toggle.active,
.curiomart-top-actions .curiomart-purchased-toggle.active {
    background: var(--cm-accent-soft);
    color: var(--cm-accent);
}
.curiomart-purchased-count,
.curiomart-favorite-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--cm-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--cm-bg);
}
/* 「履歴ページで再ダウンロード」リンクのバナー内表示 */
.curiomart-filter-banner-text a {
    color: var(--cm-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.curiomart-top-actions .curiomart-login-btn {
    border-color: var(--cm-line);
}

/* The primary accent CTA — kept for the "出品する" entry added in HTML. */
.curiomart-cta-accent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--cm-radius-pill);
    background: var(--cm-accent);
    color: #fff;
    border: 1px solid var(--cm-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease;
}
.curiomart-cta-accent:hover {
    background: color-mix(in oklab, var(--cm-accent) 85%, black);
}

/* Cart badge */
.curiomart-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--cm-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--cm-bg);
}
.curiomart-favorite-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--cm-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--cm-bg);
}

/* v0.8.3.j: ヘッダー内の [hidden] 要素を確実に隠す。
   .curiomart-user-info / .curiomart-login-btn 等が display:inline-flex 指定を持つため
   [hidden] 属性 (UA の display:none) を上書きしてしまい、ログインボタンとログアウト
   (user-info) が同時表示される bug を起こしていた (cf. v0.8.2.c modal)。 */
.curiomart-top-actions [hidden] { display: none !important; }

.curiomart-user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 0 10px;
    height: 38px;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    background: var(--cm-surface);
    box-shadow: none;
}
.curiomart-user-name {
    background: none;
    border: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-ink);
    cursor: pointer;
}
.curiomart-user-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--cm-accent-soft);
    color: var(--cm-accent);
    font-size: 12px;
    font-weight: 700;
}
.curiomart-user-points img { width: 12px; height: 12px; }

/* Header responsive: hide search + ghost label on phones (drives bottom-nav UX). */
@media (max-width: 720px) {
    .curiomart-top-bar { padding: 10px 14px; gap: 8px; }
    .curiomart-header-search { display: none; }
    .curiomart-cta-accent span,
    .curiomart-login-btn span,
    .curiomart-favorite-toggle span,
    .curiomart-history-link span,
    .curiomart-points-link span { display: none; }
}

/* ============================== MAIN LAYOUT ============================== */
.curiomart-main {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px 120px;
    background: transparent;
}
@media (max-width: 720px) {
    .curiomart-main { padding: 12px 14px 100px; }
}

/* ============================== STICKY TOOLBAR ============================== */
.curiomart-sticky-toolbar {
    position: sticky;
    top: 70px;
    z-index: 10;
    background: color-mix(in oklab, var(--cm-bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0 8px;
    margin: 0 -6px 12px;
    padding-left: 6px;
    padding-right: 6px;
    border-bottom: 1px solid var(--cm-line);
}

/* Type tabs — pill segment control (画像 / 動画 / すべて) */
.curiomart-sticky-toolbar #curiomartTypeChips {
    display: inline-flex;
    gap: 4px;
    background: var(--cm-surface);
    padding: 4px;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    margin-bottom: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.curiomart-sticky-toolbar #curiomartTypeChips .curiomart-price-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: transparent;
    border: 0;
    border-radius: var(--cm-radius-pill);
    cursor: pointer;
    color: var(--cm-ink-2);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .12s ease, color .12s ease;
}
.curiomart-sticky-toolbar #curiomartTypeChips .curiomart-price-chip.is-active {
    background: var(--cm-accent);
    color: #fff;
}

/* Tag/price/category pill row — horizontal scroll, no scrollbar */
.curiomart-tagrow {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.curiomart-tagrow::-webkit-scrollbar { display: none; }

.curiomart-sticky-toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Tag/price/category pills inside scrollable row */
.curiomart-sticky-toolbar .curiomart-tagrow .curiomart-price-chip {
    flex: none;
    padding: 6px 12px;
    background: var(--cm-chip-bg);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    font-size: 12px;
    color: var(--cm-ink);
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    box-shadow: none;
    transform: none;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.curiomart-sticky-toolbar .curiomart-tagrow .curiomart-price-chip:hover {
    border-color: var(--cm-line-2);
    transform: none;
    box-shadow: none;
}
.curiomart-sticky-toolbar .curiomart-tagrow .curiomart-price-chip.is-active {
    background: var(--cm-accent);
    color: #fff;
    border-color: var(--cm-accent);
}
.curiomart-sticky-toolbar .curiomart-tagrow .curiomart-chip-count {
    background: rgba(255,255,255,0.18);
    color: inherit;
}

/* Sort select on the right */
.curiomart-sticky-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
    margin-left: auto;
}
.curiomart-sticky-toolbar-right .curiomart-product-count {
    font-family: var(--cm-font-mono);
    font-size: 11px;
    color: var(--cm-ink-2);
    letter-spacing: .04em;
}
.curiomart-toolbar-sort,
.curiomart-sort-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    background: var(--cm-surface);
}
.curiomart-toolbar-sort .curiomart-sort-label,
.curiomart-sort-select-wrap span {
    font-size: 11px;
    color: var(--cm-ink-2);
}
.curiomart-toolbar-sort .curiomart-sort-select,
.curiomart-sort-select-wrap select {
    appearance: none;
    background: transparent;
    border: 0;
    outline: none;
    padding-right: 12px;
    font-size: 12px;
    color: var(--cm-ink);
    box-shadow: none;
    transform: none;
    cursor: pointer;
}

/* Hide legacy big toolbar (free search input) — search moves to header */
.curiomart-main > .curiomart-toolbar {
    display: none;
}

/* Filter banners (favorites / broadcaster) stay legible on new bg */
.curiomart-filter-banner {
    background: var(--cm-surface);
    border: 1px solid var(--cm-line-2);
    border-radius: var(--cm-radius-sm);
    box-shadow: none;
}
.curiomart-filter-banner-clear {
    background: transparent;
    border: 1px solid var(--cm-line);
    color: var(--cm-ink);
    border-radius: var(--cm-radius-pill);
}
.curiomart-filter-banner-clear:hover {
    background: var(--cm-accent);
    color: #fff;
    border-color: var(--cm-accent);
}

/* ============================== SECTION HEADERS ============================== */
.curiomart-section { margin-bottom: 36px; }
.curiomart-section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    border-bottom: 0;
}
.curiomart-section-header::after { display: none; }
.curiomart-section-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    line-height: 1;
}
.curiomart-section-en {
    font-family: var(--cm-font-mono);
    font-size: 11px;
    letter-spacing: .18em;
    color: var(--cm-accent);
    text-transform: uppercase;
    font-weight: 700;
}
.curiomart-section-ja {
    font-family: var(--cm-font-head);
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 700;
    color: var(--cm-ink);
    letter-spacing: -.01em;
}

/* ============================== DENSE PRODUCT GRID ============================== */
.curiomart-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--cm-cols, 7), minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 1200px) { .curiomart-product-grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }
@media (max-width: 1000px) { .curiomart-product-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 820px)  { .curiomart-product-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; } }
@media (max-width: 600px)  { .curiomart-product-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; } }
@media (max-width: 380px)  { .curiomart-product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Compact product card */
.curiomart-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.curiomart-product-card:hover {
    transform: translateY(-3px);
    border-color: var(--cm-line-2);
    box-shadow: var(--cm-shadow);
}

.curiomart-product-thumbnail {
    position: relative;
    /* v0.8.3.j: サムネ縦幅を従来 (3/4) の約半分に (3/2 = 高さ 2/3 幅 ≒ 旧 4/3 幅の半分) */
    aspect-ratio: 3 / 2;
    background:
        repeating-linear-gradient(135deg,
            color-mix(in oklab, var(--cm-accent) 10%, var(--cm-surface)) 0 14px,
            color-mix(in oklab, var(--cm-accent) 18%, var(--cm-surface)) 14px 28px);
}
.curiomart-product-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.curiomart-product-thumbnail-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--cm-ink-3);
}
.curiomart-product-thumbnail-placeholder svg { width: 32px; height: 32px; opacity: .35; }

.curiomart-product-type-badge {
    position: absolute;
    left: 5px;
    bottom: 5px;
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-family: var(--cm-font-mono);
    letter-spacing: .04em;
    box-shadow: none;
    border: 0;
}
.curiomart-product-purchased-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--cm-accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--cm-font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
}
.curiomart-product-favorite-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    color: var(--cm-ink);
    border: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: none;
    transform: none;
}
.curiomart-product-favorite-btn:hover {
    transform: none;
    box-shadow: none;
}
.curiomart-product-favorite-btn svg { width: 12px; height: 12px; }
.curiomart-product-favorite-btn.favorited { color: var(--cm-accent); }

.curiomart-product-info {
    padding: 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.curiomart-product-title {
    font-family: var(--cm-font-head);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    margin: 0;
    color: var(--cm-ink);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.curiomart-product-broadcaster {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--cm-ink-2);
}
.curiomart-product-broadcaster-avatar {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    flex: none;
}
.curiomart-product-broadcaster-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.curiomart-product-price {
    font-family: var(--cm-font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--cm-accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
.curiomart-product-price img { width: 11px; height: 11px; }
.curiomart-product-sales { display: none; }
.curiomart-product-soldout {
    background: var(--cm-ink);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    display: inline-block;
    margin-top: 4px;
}

/* Ultra-tight: drop the creator row */
@media (max-width: 600px) {
    .curiomart-product-broadcaster { display: none; }
    .curiomart-product-info { padding: 6px 6px 7px; }
    .curiomart-product-title { font-size: 10px; }
    .curiomart-product-price { font-size: 12px; }
}

/* ============================== RANKING ============================== */
.curiomart-ranking-list {
    display: grid;
    gap: 8px;
    background: transparent;
    border: 0;
    padding: 0;
}
.curiomart-ranking-row {
    display: grid;
    grid-template-columns: 56px 80px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-sm);
    cursor: pointer;
    transition: border-color .12s ease;
    box-shadow: none;
    transform: none;
}
.curiomart-ranking-row:hover { border-color: var(--cm-line-2); }
.curiomart-ranking-position {
    font-family: var(--cm-font-head);
    font-size: 28px;
    font-weight: 800;
    color: var(--cm-accent);
    line-height: 1;
    text-shadow: none;
}
.curiomart-ranking-position.gold { color: var(--cm-gold); }
.curiomart-ranking-position.silver { color: var(--cm-ink-3); }
.curiomart-ranking-position.bronze { color: #b87333; }
/* v0.8.3.h: 新着商品セクションの "NEW" バッジ */
.curiomart-ranking-new {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--cm-accent);
    color: #fff;
    font-family: var(--cm-font-mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}
@media (max-width: 720px) {
    .curiomart-ranking-new { font-size: 9px; padding: 2px 6px; }
}
.curiomart-ranking-avatar {
    aspect-ratio: 4/5;
    border-radius: 6px;
    overflow: hidden;
    background: color-mix(in oklab, var(--cm-accent) 12%, var(--cm-surface-2));
    border: 0;
}
.curiomart-ranking-name {
    font-family: var(--cm-font-head);
    font-weight: 600;
    font-size: 14px;
    color: var(--cm-ink);
    text-shadow: none;
}
.curiomart-ranking-sub {
    color: var(--cm-ink-2);
    font-size: 11px;
}
.curiomart-ranking-cat {
    background: var(--cm-accent-soft);
    color: var(--cm-accent);
    font-weight: 700;
}
.curiomart-ranking-points {
    font-family: var(--cm-font-head);
    font-weight: 700;
    color: var(--cm-accent);
    font-size: 13px;
    background: transparent;
    border: 0;
}
.curiomart-ranking-points img { width: 11px; height: 11px; }
@media (max-width: 720px) {
    .curiomart-ranking-row { grid-template-columns: 36px 56px 1fr auto; gap: 10px; padding: 8px 10px; }
    .curiomart-ranking-position { font-size: 20px; }
}

.curiomart-ranking-filters {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.curiomart-ranking-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    padding: 6px 28px 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-ink);
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23d6075e' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.curiomart-ranking-select:hover { border-color: var(--cm-line-2); }

/* ============================== FOOTER ============================== */
.curiomart-footer {
    background: var(--cm-surface);
    border-top: 1px solid var(--cm-line);
    padding: 32px 24px 28px;
    margin-top: 36px;
}
.curiomart-footer-grid {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}
@media (max-width: 820px) {
    .curiomart-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
    .curiomart-footer-grid { grid-template-columns: 1fr; }
}
.curiomart-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.curiomart-footer-brand .curiomart-logo { padding: 0; }
.curiomart-footer-brand p {
    margin: 0;
    color: var(--cm-ink-2);
    font-size: 13px;
    line-height: 1.7;
}
.curiomart-footer-col h5 {
    margin: 0 0 12px;
    font-family: var(--cm-font-mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cm-ink-2);
    font-weight: 700;
}
.curiomart-footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.curiomart-footer-col a {
    color: var(--cm-ink);
    text-decoration: none;
    font-size: 13px;
}
.curiomart-footer-col a:hover { color: var(--cm-accent); }
.curiomart-footer-copy {
    max-width: 1320px;
    margin: 24px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--cm-line);
    text-align: center;
    color: var(--cm-ink-3);
    font-size: 12px;
    letter-spacing: .02em;
}
.curiomart-footer-links {
    display: none;
}

/* ============================== BOTTOM NAV (mobile) ============================== */
.curiomart-bottomnav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: color-mix(in oklab, var(--cm-bg) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--cm-line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
}
@media (max-width: 720px) {
    .curiomart-bottomnav { display: flex; }
}
.curiomart-bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px 10px;
    color: var(--cm-ink-2);
    border-radius: var(--cm-radius-sm);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: .05em;
}
.curiomart-bottomnav-item.is-active { color: var(--cm-accent); }
.curiomart-bottomnav-item svg { width: 20px; height: 20px; }
.curiomart-bottomnav-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
}
.curiomart-bottomnav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--cm-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--cm-bg);
}

/* Hide legacy curiomart-toolbar (search migrated to header). */
.curiomart-main .curiomart-toolbar { display: none; }

/* Legacy price-filter container: blend into sticky toolbar */
.curiomart-price-filter {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}
.curiomart-price-filter-row {
    display: contents;
}
.curiomart-price-filter-label {
    display: none;
}

/* Empty / loader inside the dense grid */
.curiomart-product-grid .curiomart-empty,
.curiomart-product-grid .hamster-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: var(--cm-ink-2);
}

/* Broadcaster header restyle: surface card, no bubblegum shadow. */
.curiomart-broadcaster-header {
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: none;
    overflow: hidden;
    margin-bottom: 18px;
}
.curiomart-broadcaster-banner {
    background: linear-gradient(135deg, var(--cm-accent-soft), color-mix(in oklab, var(--cm-accent) 22%, var(--cm-surface)));
}
.curiomart-broadcaster-name {
    font-family: var(--cm-font-head);
    color: var(--cm-ink);
    text-shadow: none;
}
.curiomart-broadcaster-bio { color: var(--cm-ink-2); }

/* Modals — keep but harmonize the surface */
.curiomart-modal-overlay { background: rgba(28, 12, 20, 0.6); }
.curiomart-modal-content,
.curiomart-modal-content-sm {
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: 0 18px 40px -16px rgba(214, 7, 94, 0.35);
}
.curiomart-modal-header {
    border-bottom: 1px solid var(--cm-line);
    background: var(--cm-surface);
}
.curiomart-modal-title {
    font-family: var(--cm-font-head);
    color: var(--cm-ink);
}
.curiomart-modal-close {
    color: var(--cm-ink-2);
    background: transparent;
    border: 0;
}
.curiomart-modal-close:hover { color: var(--cm-accent); }
.curiomart-login-submit,
.curiomart-cart-checkout-btn {
    background: var(--cm-accent);
    color: #fff;
    border: 1px solid var(--cm-accent);
    border-radius: var(--cm-radius-pill);
    box-shadow: none;
    transform: none;
}
.curiomart-login-submit:hover:not(:disabled),
.curiomart-cart-checkout-btn:hover:not(:disabled) {
    background: color-mix(in oklab, var(--cm-accent) 85%, black);
    transform: none;
    box-shadow: none;
}
.curiomart-login-field input,
.curiomart-login-field textarea {
    border: 1px solid var(--cm-line);
    background: var(--cm-surface);
    border-radius: var(--cm-radius-sm);
    box-shadow: none;
}
.curiomart-login-field input:focus,
.curiomart-login-field textarea:focus {
    border-color: var(--cm-accent);
    box-shadow: 0 0 0 3px var(--cm-accent-soft);
    outline: none;
}
.curiomart-signup-link {
    color: var(--cm-accent);
    background: transparent;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
}

/* Age gate — Pop Pink */
.curiomart-age-gate {
    background: rgba(28, 12, 20, 0.7);
}
.curiomart-age-gate-card {
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    box-shadow: 0 20px 60px -20px rgba(214, 7, 94, 0.45);
}
.curiomart-age-gate-title {
    font-family: var(--cm-font-head);
    color: var(--cm-ink);
    text-shadow: none;
}
.curiomart-age-gate-btn-yes {
    background: var(--cm-accent);
    color: #fff;
    border: 1px solid var(--cm-accent);
    border-radius: var(--cm-radius-pill);
    box-shadow: none;
}
.curiomart-age-gate-btn-yes:hover { background: color-mix(in oklab, var(--cm-accent) 85%, black); }
.curiomart-age-gate-btn-no {
    background: transparent;
    color: var(--cm-ink);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
}

/* Cart drawer: harmonize */
.curiomart-cart-drawer {
    background: var(--cm-surface);
    border-left: 1px solid var(--cm-line);
    box-shadow: -16px 0 40px -16px rgba(214, 7, 94, 0.25);
}
.curiomart-cart-drawer-header {
    background: var(--cm-surface);
    border-bottom: 1px solid var(--cm-line);
}
.curiomart-cart-drawer-title {
    font-family: var(--cm-font-head);
    color: var(--cm-ink);
}
.curiomart-cart-summary-total {
    color: var(--cm-accent);
    font-family: var(--cm-font-head);
    font-weight: 800;
}

/* ============================== LIST VIEW (購入済み / お気に入り) v0.8.3.j ============================== */
/* ヘッダーは固定のまま、main の中身を browse ↔ list view で入れ替える。 */
.curiomart-list-view-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.curiomart-list-view-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius-pill);
    background: var(--cm-surface);
    color: var(--cm-ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.curiomart-list-view-back:hover {
    background: var(--cm-surface-2);
    border-color: var(--cm-line-2);
}
.curiomart-list-view-back svg { width: 16px; height: 16px; }
.curiomart-list-view-title {
    font-family: var(--cm-font-head);
    font-size: 20px;
    font-weight: 800;
    color: var(--cm-ink);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.curiomart-list-view-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-ink-3);
}

/* 購入済みリスト (行) — 販売停止商品も再ダウンロード可能 */
.curiomart-purchase-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.curiomart-purchase-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--cm-surface);
    border: 1px solid var(--cm-line);
    border-radius: 12px;
    flex-wrap: wrap;
}
.curiomart-purchase-row-info { flex: 1; min-width: 200px; }
.curiomart-purchase-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--cm-ink);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.curiomart-purchase-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cm-accent-soft);
    color: var(--cm-accent);
}
.curiomart-purchase-row-meta {
    font-size: 12px;
    color: var(--cm-ink-3);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.curiomart-purchase-row-price {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--cm-accent);
    font-weight: 700;
}
.curiomart-purchase-row-price img { width: 12px; height: 12px; }
.curiomart-purchase-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.curiomart-purchase-dl-btn,
.curiomart-purchase-receipt-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--cm-radius-pill);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--cm-line);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.curiomart-purchase-dl-btn {
    background: var(--cm-accent);
    color: #fff;
    border-color: var(--cm-accent);
}
.curiomart-purchase-dl-btn:hover { box-shadow: var(--cm-shadow); transform: translateY(-1px); }
.curiomart-purchase-receipt-btn {
    background: var(--cm-surface);
    color: var(--cm-ink);
}
.curiomart-purchase-receipt-btn:hover { background: var(--cm-surface-2); }
.curiomart-purchase-dl-btn svg,
.curiomart-purchase-receipt-btn svg { width: 15px; height: 15px; }

@media (max-width: 600px) {
    .curiomart-purchase-row-actions { width: 100%; }
    .curiomart-purchase-dl-btn { flex: 1; justify-content: center; }
}
