/* =========================================================================
   ATHLETA Taiwan — 店舗ページ (index.html) のスキン (shop.css)
   app.js が生成する実商品クラス(.product-card / .detail-… / .cart-… 等)を
   ※この説明文に「*」と「/」を続けて書かない：注釈がそこで終わり、続きが
     まるごと無効になる（2026-08-21 これで .ath-unverified が効いていなかった）。
   デザインシステムのトークン(design-base.css の :root)で再スキンする。
   旧 styles.css（深緑＋ライムの独立系）を置換。ヘッダー/ドックは共有クローム、
   ボタン等の汎用部品は design-components.css を併用。
   ========================================================================= */

/* ---- 未検証機能の一時非表示（管理者のみ後日プレビュー可） ----
   検証が済んでいない機能に .ath-unverified を付けると、通常ユーザーには
   完全に非表示（レイアウト・読み上げからも消える＝アクセス不可）。
   後日 <html> に ath-admin-preview を付けると管理者だけ再表示＋橙の点線枠で
   「未検証」と分かる。1つずつ検証→枠が消えたら .ath-unverified を外す運用。 */
.ath-unverified { display: none !important; }
html.ath-admin-preview .ath-unverified {
  display: revert !important;
  outline: 2px dashed #e08a2b;
  outline-offset: 4px;
  position: relative;
}

/* admin2から公開する商品サイズ表。仕様と同じく常時展開し、画像化しない。 */
.product-size-chart {
  margin-top: 20px;
}

.product-size-chart h3 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .04em;
}

.product-size-chart h3 span {
  color: var(--muted);
  font-weight: 400;
}

.product-size-chart__scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-size-chart table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12px;
  text-align: center;
}

.product-size-chart th,
.product-size-chart td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.product-size-chart tr:last-child th,
.product-size-chart tr:last-child td {
  border-bottom: 0;
}

.product-size-chart th:last-child,
.product-size-chart td:last-child {
  border-right: 0;
}

.product-size-chart thead th,
.product-size-chart tbody th {
  background: var(--surface-soft, #f4f5f2);
  font-weight: 700;
}
html.ath-admin-preview .ath-unverified::before {
  content: "未檢證（僅管理員可見）";
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #e08a2b;
}

/* ---- マスター/詳細レイアウト ---- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  min-height: calc(100vh - var(--header-h));
  max-width: var(--maxw);
  margin: 0 auto;
}

.catalog-panel { padding: 30px var(--padx); min-width: 0; }

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}
.catalog-toolbar h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ---- 検索・フィルター ---- */
.search-box,
.filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.search-box input,
.filters select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}
.search-box input { padding: 0 14px; }
.filters select { padding: 0 12px; }
.search-box input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
/* 分類・規格・排序の旧セレクトは UI から撤去（hidden）。author の display:grid が
   UA の [hidden]{display:none} を上書きしてしまうので明示的に隠す。
   app.js の状態源として DOM には残る（分類=サイドバー radio が駆動、排序=#sortPills が駆動）。 */
.filters[hidden] {
  display: none;
}

/* field-hero 右上の検索ボックス幅（index 統一後。狹い幅では下の @media で全幅化） */
.field-hero .search-box { width: min(340px, 42vw); }

/* ---- 左サイドバー絞り込み ---- */
/* 旧 `.sidebar button { font: inherit }` を削除。グローバルの `button { font: inherit }`
   でフォントファミリは既に継承される。ここで font ショートハンドを再指定すると、
   design-base.css のサイドバー用 font-size/weight（.side-link 13.5px/720・
   chip 12.5px/740・h2 11px/900…）まで握り潰し、文字が 16px に膨らんで太さの階調が
   消えていた（=「フォントの統一感がない」の主因）。サイズ/太さは base 側に一任する。 */

.filter-clear {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.filter-clear:not(:disabled):hover {
  border-color: var(--blue);
  color: var(--blue);
}

.filter-clear:disabled {
  cursor: default;
  opacity: .42;
}

/* サイドバー絞り込みの見た目（radio/chip/swatch/サマリー）は
   design-base.css に単一ソース化。ここは index 固有の補助のみ。 */

/* ---- サイドバー上端の「全部清除」（2026-08-19 本城さん指示／2026-08-20 上端へ移動） ----
   絞り込みの枠が 季節・年份 と増え、一覧の上の「全部清除」まで戻るのが遠いので、
   サイドバーにももう1つ置く。
   ・初版はサイドバー下端に貼り付く sticky の帯だった。しかし帯の背景（純白 --surface）が
     ページ地色 --paper(#fbfbfc) の上で「ボタンを囲む白い枠」に見えてしまう
     （2026-08-20 本城さん指摘）。背景を敷かないと下に流れる項目が裏で透けるため、
     貼り付け自体をやめてサイドバーの一番上（分類の見出しの上）へ移した。
     上端なら読み始めの位置＝最初から目に入るので、貼り付けなくても手が届く。
   ・何も選んでいない間は hidden（app-filters.js syncSidebarControls が出し入れ）。
   ・≤940 は下から出るシートの見出しに「重設」があるため出さない（二重を避ける）。 */
.sidebar-clear {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 14px;
}
/* author の display:flex は UA の [hidden]{display:none} を上書きしてしまうため、
   明示的に隠す（.filters[hidden] と同じ作法）。これが無いと「何も選んでいないのに
   ずっと出ている」状態になる＝白い帯が常時見えていた原因でもある。 */
.sidebar-clear[hidden] {
  display: none;
}
.sidebar-clear .filter-clear {
  min-height: 32px;
  padding: 0 14px;
}
@media (max-width: 940px) {
  .sidebar-clear { display: none; }
}


.result-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
/* 「358」件数：擬似ボールド(850)＋数字無処理が「旧式・serif気味」の原因だった。
   実在する太さ(700)＋価格と同じ lining/tabular で整える（上品ミニマル方針）。 */
/* 大きさは物差しの小見出し段 18px（20px は段の外だった）。 */
.result-row strong { color: var(--ink); font-size: 18px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }

/* 初回ロード中（is-loading）は実件数(0件)を隠し、控えめな「商品載入中…」だけを見せる。
   データが入った最初の描画で app-grid.js が is-loading を外す＝0件チラつき防止。 */
.result-row.is-loading #resultCount,
.result-row.is-loading .result-count-label { display: none; }
.result-row:not(.is-loading) .result-loading { display: none; }
.result-loading { color: var(--muted); }

/* 排序＝セグメント（採用案B）。連結バーで1つの操作系にまとめ、result-row の右端へ寄せる。
   見た目はセグメント、状態は隠した #sortFilter（index 末尾スクリプトが value 駆動）。 */
.sort-pills { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-pills-label { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: .08em; }
.sort-seg {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--surface);
}
.sort-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 0; border-left: 1px solid var(--line);
  padding: 0 14px; min-height: 32px;
  background: transparent; color: var(--ink);
  font-size: 12.5px; font-weight: 400;
}
.sort-seg button:first-child { border-left: 0; }
.sort-seg button:hover { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.sort-seg button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--blue); font-weight: 700;
}
.sort-seg .arr { font-size: 11px; line-height: 1; }

/* 狭い幅では件数行を折り返し、セグメントは全幅に均等割り。 */
@media (max-width: 700px) {
  .result-row { flex-wrap: wrap; }
  .sort-pills { margin-left: 0; width: 100%; }
  .sort-seg { width: 100%; }
  .sort-seg button { flex: 1 1 0; min-width: 0; padding: 0 8px; }
}

/* ---- 0 件になる選択肢は薄く＋押せない見た目に（分類・款式・季別で共通）。
       クリック自体は setSidebarFilter が aria-disabled で弾くので、ここは見た目だけ。
       🔴 .side-link だけに掛けていた頃は、款式と季別が 0 件でも普通の見た目のまま
          残っていた（2026-08-11 本城さん指摘）。件数を持つ選択肢は全部ここに並べる。 */
.side-link.is-count-zero,
.subcat-list button.is-count-zero {
  opacity: .38;
  cursor: default;
}
.side-link.is-count-zero b,
.subcat-list button.is-count-zero b { color: var(--muted); }

/* 押せないものは触っても反応を返さない＝指の手応えでも「これは選べない」と分かる。 */
.side-link.is-count-zero:hover,
.subcat-list button.is-count-zero:hover { background: transparent; }

/* 標籤など、0件なら行そのものを出さない選択肢。button の display:flex が
   UA の [hidden] より強いため、属性側を明示して確実に隠す。 */
.subcat-list button[hidden] { display: none; }

/* ---- スコープ表示：「今どこの中から探しているか」の1行。 ---- */
.scope-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* 検索を始めたときに絞り込みを外した合図＋元へ戻す道（同じ1行の続きに置く）。 */
.scope-undo {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}
.scope-undo button {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.scope-undo button:hover { opacity: 0.7; }

/* ---- 0 件の空状態（逃げ道ボタン付き）。行き止まりを作らない。 ---- */
.grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 56px 20px;
  text-align: center;
}
.grid-empty-title { color: var(--ink); font-size: 16px; font-weight: 700; }
.grid-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.grid-empty-btn,
.grid-empty-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 700; text-decoration: none;
  cursor: pointer;
}
.grid-empty-btn:hover,
.grid-empty-link:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
/* 主導線（お店全体で探す）は青く強調。 */
.grid-empty-link {
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--blue); font-weight: 700;
}

/* ---- 商品グリッド（実カード） ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  /* 縦は48px（2026-08-10 本城さん決定）。上下の商品がはっきり分かれ、棚が上質に見える。 */
  gap: 48px 18px;
}

/* ---- 分頁（ページネーション） ---- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 32px 0 8px;
}
.pagination[hidden] { display: none; }
.pagination .page-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.page-link:hover { border-color: var(--ink); }
.page-link:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--blue); }
.page-link.is-current {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper, #fff);
  cursor: default;
}
.page-link.is-disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  opacity: .5;
  pointer-events: none;
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  height: 38px;
  justify-content: center;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .page-link { transition: none; }
}
/* 左そろえ・カード自体は無装飾（枠/影/浮き上がりなし）。
   品番→名前→値段の頭が一直線に並ぶ組み（2026-08-10 本城さん決定。旧: 中央そろえ）。
   ホバーは画像ズームのみ、選択中はサムネに細い青リングで示す。 */
.product-card {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: start;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  /* カードは実 href の <a>（クローラブル＝SEO）。リンク既定の下線/青字は消し、
     クリックは JS が横取りしてドロワーを開く（修飾クリックは PDP へ素直に遷移）。 */
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.product-card.active .product-thumb {
  box-shadow: 0 0 0 2px var(--blue);
}
.product-card:focus-visible {
  outline: none;
}
.product-card:focus-visible .product-thumb {
  box-shadow: 0 0 0 2px var(--blue);
}

/* 画像フレーム：枠線なしで写真を大きくダイナミックに。角丸＋ズーム
   半径は外枠(18)−padding(6)=12 で同心円に揃える */
.product-thumb {
  position: relative;
  width: 100%;
  /* 商品画像は正方形（本来の比率。縦長だと上下に不要な余白が出るため）。角は控えめに硬めの 6px */
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  /* カードは純白。薄いグレーの面は敷かない（ユーザー希望 2026-06-07）。 */
  background: var(--surface);
}
.product-images {
  position: relative;
  /* 読込中の合図（.product-thumb::after）より前に出す。 */
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* pan-y単独だとピンチ拡大まで死ぬ。横パンだけ禁止し拡大は許す。 */
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.product-images:active {
  cursor: grabbing;
}
.product-image-track {
  display: flex;
  width: 100%;
  height: 100%;
}
/* will-change を常時付けると、写真が届いても描き直されず「読めているのに白いまま」に
   なることがある（マウスを乗せると出る症状の正体）。動かしている間だけ付ける。 */
.product-images.is-swiping .product-image-track {
  will-change: transform;
}
/* 読込中の合図：薄灰の面がゆっくり光る。写真が使えたら .is-ready で消える。 */
.product-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 65%) 50%, transparent 80%),
    var(--fill);
  background-size: 220% 100%, auto;
  animation: thumbShimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}
.product-thumb.is-ready::after {
  content: none;
}
@keyframes thumbShimmer {
  from { background-position: -60% 0, 0 0; }
  to { background-position: 160% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .product-thumb::after { animation: none; }
}
.product-image,
.image-missing {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 商品写真そのものに上下の白い余白が入っているため、枠側では余白を足さない
     （2026-08-10。旧: padding 10px で商品が小さく見えていた）。 */
  padding: 0;
  background: transparent;
  /* マウスを乗せた時にふわっと大きくなる動きは廃止（本城さん指示 2026-08-10）。 */
  transition: filter .25s ease, opacity .25s ease;
}
.product-image {
  position: relative;
  flex: 0 0 100%;
  display: block;
}
/* 色の数だけ写真を並べた1枚目。3色なら2×2で右下が空き、6色なら3×2
   （本城さん指示 2026-08-07）。横長の商品は縦に積む（同 2026-08-11）。
   列数・枡の形・面の幅は app-grid.js が商品の形から決めて渡す。 */
.product-mosaic {
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-mosaic-grid {
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols, 2), 1fr);
  gap: 4px;
  /* 商品どうしの間は詰め、並べた面の外周だけ余白を取る（縁ぎりぎりを避ける。
     2026-08-10 本城さん指示）。写真1枚だけの1枚目には付けない。 */
  width: var(--mosaic-width, 92%);
}
/* 1枡ぶんの窓。写真ごとの余白を詰めて寄せるので、はみ出しはここで切る。
   横長の商品では枡も横長にして、上下の空きを切り落とす。 */
.product-mosaic-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: var(--mosaic-cell, 1);
  overflow: hidden;
}
/* 写真の置き方は枡の形によらず正方形のまま（寄せる数字がそのまま使える）。
   平たい枡＝幅いっぱい、細長い枡＝高さいっぱい。はみ出しは枡の窓で切る。 */
.product-mosaic-cell img {
  flex: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  background: transparent;
}
.product-mosaic-grid.is-tall .product-mosaic-cell img {
  width: auto;
  height: 100%;
}
/* 旧形式の2枚目ホバーは、カルーセルを持たないカードだけで維持する。 */
.product-card.has-hover-image:not(.has-carousel) .product-image--primary { opacity: 0; }
.product-card.has-hover-image:not(.has-carousel) .product-image--secondary { opacity: 1; }
/* PCだけ：白背景に馴染む、線だけの最小限の送り操作。 */
.product-carousel-nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .product-carousel-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    place-items: center;
    width: 30px;
    height: 46px;
    color: color-mix(in srgb, var(--ink) 42%, transparent);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity .16s ease, color .16s ease, transform .16s ease;
    cursor: pointer;
  }
  .product-carousel-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    /* 商品写真と重なっても線が消えないよう、白のふちどりを回す（粒と同じ、ぼかさない硬い縁） */
    filter:
      drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
      drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff);
  }
  /* 写真とかぶらないよう、線は枠の端ぎりぎりへ寄せる（押せる範囲は広いまま。
     枠は overflow:hidden なので外へは出せず、中で端へ寄せている 2026-08-11）。 */
  .product-carousel-nav--prev { left: 0; justify-items: start; }
  .product-carousel-nav--next { right: 0; justify-items: end; }
  .product-carousel-nav--prev svg { transform: translateX(-4px); }
  .product-carousel-nav--next svg { transform: translateX(4px); }
  .product-card:hover .product-carousel-nav,
  .product-card:focus-within .product-carousel-nav {
    display: grid;
    opacity: 1;
    pointer-events: auto;
  }
  .product-carousel-nav:hover { color: var(--ink); }
  .product-carousel-nav--prev:hover { transform: translateY(-50%) translateX(-2px); }
  .product-carousel-nav--next:hover { transform: translateY(-50%) translateX(2px); }
  .product-carousel-nav:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
  }
}
.product-carousel-dots {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.product-card:hover .product-carousel-dots,
.product-card:focus-within .product-carousel-dots,
.product-images.is-carousel-revealed .product-carousel-dots {
  opacity: 1;
  transform: translateY(0);
}
.product-carousel-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 28%, transparent);
  /* 商品写真と重なっても粒が消えないよう、白のふちどりを回す */
  box-shadow: 0 0 0 1.5px rgb(255 255 255 / 88%);
  transition: width .18s ease, background .18s ease;
}
.product-carousel-dots i.is-current {
  width: 14px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
}
.image-missing {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--ink) 32%, white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

/* 售完：色相を残して彩度を落とし、色褪せた印象に＋中央ラベル */
.product-card.is-soldout .product-image { filter: grayscale(.35) saturate(.72); opacity: .58; }
.product-card.is-soldout.has-hover-image:hover .product-image--primary { opacity: 0; }
.product-card.is-soldout.has-hover-image:hover .product-image--secondary { opacity: .5; }
.product-card.has-carousel.is-soldout .product-image { opacity: .5; }
.soldout-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.soldout-label {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--surface);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  backdrop-filter: blur(2px);
}

/* O-Rei シリーズの紋章：写真の右下へ重ねる（本城さん指示 2026-08-20。以前は左上）。
   写真そのものには焼かず、カード側で重ねるだけ＝写真を差し替えても消えない。
   収藏ハート（右上 10px・z-index 3）・子ども札（左下 10px）と同じ 10px の余白でそろえる。
   url() は shop.css からの相対＝assets/orei-logo.svg。ページの住所が変わっても迷子にならない。
   紋章は .product-marks という1本の帯にまとめ、数が違う商品でも右端と下端がそろう。
   2026-08-20：一覧が混むため GRID SHELL の技術印はこの帯から外した（本城さん指示）。 */
.product-marks {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  /* 帯の高さ＝紋章の高さ。小さいカードでも潰れないよう下限を置く。 */
  height: clamp(20px, 13%, 36px);
  pointer-events: none;
}
.product-marks > i {
  display: block;
  height: 100%;
  background-position: right bottom;
  background-repeat: no-repeat;
  background-size: contain;
}
.product-brandmark {
  aspect-ratio: 44.6 / 26.6;
  background-image: url("orei-logo.svg");
}
/* upcycle の印は縦長（丸い矢印＋文字）。紋章と並べても背が高くなりすぎないよう、
   帯の高さより少しだけ大きくして目方をそろえる（2026-08-13）。 */
.brandmark--upcycle {
  aspect-ratio: 64 / 77.2;
  height: 125%;
  background-image: url("upcycle-logo.svg");
}
/* CAFÉ DO BRASIL の印も縦長（コーヒーの葉と実）。upcycle と同じ高さにそろえる（2026-08-13）。 */
.brandmark--cdb {
  aspect-ratio: 119.37 / 152;
  height: 125%;
  background-image: url("cdb-logo.svg");
}
.tech--orei { aspect-ratio: 44.6 / 26.6; background-image: url("orei-logo.svg"); }
.tech--upcycle { aspect-ratio: 64 / 77.2; background-image: url("upcycle-logo.svg"); }
/* 商品ページの面では文字入りの正式ロゴを使う（縦に余裕があるため。本城さん指示 2026-08-13）。
   写真へ重ねる小さい印（.brandmark--cdb）は文字なしのまま。 */
.tech--cdb { aspect-ratio: 119.37 / 199.34; background-image: url("cdb-logo-full.svg"); }
.tech--gs  { aspect-ratio: 27.9 / 50; background-image: url("tech/grid-shell.svg"); }
.tech--gs2 { aspect-ratio: 32 / 50;   background-image: url("tech/grid-shell-2.svg"); }
.tech--gs3 { aspect-ratio: 32 / 50;   background-image: url("tech/grid-shell-3.svg"); }
.tech--wt  { aspect-ratio: 100 / 32;  background-image: url("tech/wetsand-tex.svg"); }
.tech--os  { aspect-ratio: 133 / 15;  background-image: url("tech/one-stroke.svg"); }
/* 售完のカードでは写真と同じだけ色を落とす（紋章だけ浮かないように）。 */
.product-card.is-soldout .product-marks { opacity: .55; }

/* 新商品の「NEW」札（本城さん決定 2026-08-20 案⑤：赤ベタの丸札＋白い点）。
   置き場所は写真の左上。紋章を右下へ移したので空いた角に入る。
   これで四隅が「左上＝NEW／右上＝收藏ハート／左下＝子どもの札／右下＝紋章」で1つずつ。
   赤は割引と同じ --danger の単一ソース。三角のリボンは使わない（角は全部まるい）。
   付く条件＝登録日から30日以内（app-grid.js が判定。日数もそこが単一ソース）。 */
.product-new {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1;
  pointer-events: none;
}
/* 白い点。「入荷したて」の気配を出すための粒で、意味は文字が持つ。 */
.product-new::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, white 88%, transparent);
}
.product-card.is-soldout .product-new { opacity: .55; }

/* 子ども用の靴の札（本城さん決定 2026-08-13 案⑧）。写真の左下＝紋章（左上 10px）・
   收藏ハート（右上 10px）とぶつからない空き角に、同じ 10px の余白で置く。
   靴の写真は白背景なので、白い札が消えないよう ごく薄い縁を1本だけ回す。 */
.product-kidmark {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, white 86%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
  backdrop-filter: blur(3px);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  pointer-events: none;
}
.product-card.is-soldout .product-kidmark { opacity: .55; }

/* 商品ページの適合場地（2026-10-01）：鞋款だけ、説明文の下・技術欄の上に置く。
   面の地と余白は技術欄と同じ。行は「場地名｜記号｜一言」の3列で、記号の濃さで強弱をつける。 */
.ground-panel {
  margin: 26px 0 0;
  padding: 20px;
  border-radius: 6px;
  background: var(--fill);
}
.ground-panel h4 {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
}
.ground-panel h4 em {
  margin-left: 4px;
  font-style: normal;
  font-weight: 400;
  color: var(--detail-faint, var(--muted));
}
.ground-panel ul { margin: 0; padding: 0; list-style: none; }
.ground-row {
  display: grid;
  grid-template-columns: 1fr 22px 84px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 400;
  color: var(--detail-body, var(--muted));
}
.ground-row:first-child { border-top: 0; padding-top: 0; }
.ground-mark { text-align: center; font-size: 14px; }
.ground-word { text-align: right; font-size: 12px; }
.ground-row.is-best { color: var(--ink); }
.ground-row.is-best .ground-mark,
.ground-row.is-best .ground-word { color: var(--green); font-weight: 700; }
.ground-row.is-no { color: var(--detail-faint, var(--muted)); }
.ground-panel p {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--detail-body, var(--muted));
}

/* 商品ページの技術欄：説明文のすぐ下に、淡い地の面で置く（本城さん決定 2026-08-12 案B）。
   ロゴ＋見出し＋短い説明を1行ずつ。付いていない商品では丸ごと出さない。 */
/* 見出しを外したので（2026-08-13）、面の内側は上下左右そろえて 20px。
   1行目は上の余白を面の padding に任せる（重ねると上だけ厚くなる）。 */
.tech-panel {
  margin: 26px 0 0;
  padding: 20px;
  border-radius: 6px;
  background: var(--fill);
}
/* 系列（O-Rei 等のレーベル）と搭載科技は見出しを出さないので、地の色だけで見分ける
   （本城さん決定 2026-08-13 案⑤）。系列＝ごく薄い緑がかった地／技術＝いままでの淡灰。 */
.tech-panel--series { background: #e6ece9; }
.tech-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.tech-item:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
/* 図を持たない系列の行は、名前と説明を左端からそのまま流す。 */
.tech-item.is-textonly > div { flex: 1 1 auto; }
/* ロゴの枠は全部おなじ幅（76px）。中で contain するので、横長の ONE STROKE と
   WETSAND TEX は同じ幅にそろい、縦長の GRID SHELL は高さで収まって中央に立つ。 */
.tech-item > i {
  flex: 0 0 76px;
  width: 76px;
  align-self: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.tech-item > i.tech--orei { height: 34px; }
.tech-item > i.tech--upcycle { height: 52px; }
.tech-item > i.tech--cdb { height: 72px; }
.tech-item > i.tech--gs,
.tech-item > i.tech--gs2,
.tech-item > i.tech--gs3 { height: 52px; }
.tech-item > i.tech--wt { height: 26px; }
.tech-item > i.tech--os { height: 10px; }
.tech-item h4 {
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
}
.tech-item p {
  margin: 0;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.95;
  color: var(--detail-body, var(--muted));
}
/* 系列の行から「その系列だけの売場」へ（/?series=orei など）。説明文のすぐ下に小さく置く。
   面の末尾にある .tech-more（解説ページへの入口）とは役割が別なので、区切り線は引かない。 */
.tech-shop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  transition: gap .15s ease;
}
.tech-shop:hover { gap: 10px; }

/* 技術欄の末尾から写真つきの解説ページ（/tech）へ。区切り線は tech-item と同じ扱い。 */
.tech-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  transition: gap .15s ease;
}
.tech-more:hover { gap: 10px; }

/* 3行（品番→名前→値段）はひとかたまりの札として扱う。行あいだは gap ではなく
   各行の margin-top で 4px / 5px と段差をつける（2026-08-10 本城さん決定）。 */
.product-card .product-meta { min-width: 0; display: grid; gap: 0; justify-items: start; padding: 0; }
/* 季節キャプション：大文字＋字間広めの小オーバーライン（Boutique） */
.product-card .product-season {
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
}
/* 商品コード（品番 例 01080K）：カード3行（品番→名前→価格）の最上段オーバーライン。
   本城さん指定 2026-07-10。名前と喧嘩しない静かなミュート＋広め字間で上品に。 */
.product-card .product-code {
  margin: 0;
  /* 3行の中でいちばん薄い段。ただし品番は問い合わせで実際に読む文字なので、
     薄すぎ・小さすぎは不可（2026-08-13 本城さん指摘）。11px＋一段濃いグレーで読める薄さに。 */
  color: #8f959d;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .18em;
  /* 書体指定は撤去（2026-08-13 Noto Sans TC 一本化）。中文書体の旧式数字を避けるために
     ここだけ Arial を当てていたが、Noto Sans TC は数字も同一設計で揃うため body から継承する。 */
  font-variant-numeric: lining-nums tabular-nums;
}
.product-card .product-title {
  /* 1行で切る（…）。並べた時に横のラインが波打たない。 */
  display: block;
  margin: 6px 0 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #2a2e34;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .015em;
  line-height: 1.4;
}
.product-card .product-price {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
  margin: 7px 0 0;
  color: var(--ink);
  /* 値段は「太らせず背を伸ばす」＝太字をやめ、名前より 2px 大きくして主役にする
     （2026-08-13 本城さん選択・案②「大」。太字は下品に感じるとの指摘で、
     font-weight-two-steps-only の「値段は700」割当をここだけ上書き）。 */
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .01em;
  /* 書体指定は撤去（2026-08-13 Noto Sans TC 一本化）。旧式数字よけの Arial は不要になった。 */
  font-variant-numeric: lining-nums tabular-nums;
}
/* 割引時：特價 → 定価(取消線・単位つき) → 「20%OFF」の順。写真には何も重ねない。
   2026-08-13 本城さん選択（案②「大」）で、赤い下地の札はやめて濃い赤の文字だけにした。
   下地の色面が一覧でいちばん騒がしかったため。
   2026-08-20 本城さん決定（案Ⓒ）：赤に黒を混ぜていたため小さい文字が灰色に沈んでいた。
   下地も大きさも太さも変えず、色だけ明るい赤（--sale）に替えて読めるようにした。 */
.product-card .product-price.is-sale .price-now {
  color: var(--ink);
}
/* 元の値段と「◯%OFF」は同じ大きさにそろえる（2026-08-20 本城さん指摘）。
   別々の 11.5px / 10px にしていたため、並ぶと段差に見えていた。 */
.product-card .product-price .price-was {
  color: #c2c6cc;
  font-size: 11.5px;
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: currentColor;
}
.product-card .product-price .price-off {
  /* 2026-08-20 本城さん指摘：ここだけ「上下まん中ぞろえ」だったため、
     特價・元の値段と足元の線（ベースライン）がずれて見えていた。
     入れ物の baseline ぞろえに従わせて、3つとも同じ足元に立たせる。 */
  align-self: baseline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .06em;
  /* 予備値を書いておく：共有トークンの読み込みが古いままでも赤が消えない。 */
  color: var(--sale, #e60023);
}

/* ---- 收藏（ハート）トグル：一覧カード右上＋詳細タイトル横で共通 ---- */
.fav-toggle {
  display: grid;
  place-items: center;
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(1.1) blur(5px);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.fav-toggle::before {
  content: "";
  width: 17px;
  height: 17px;
  background: var(--muted);
  transition: background .15s ease, transform .2s cubic-bezier(.22, .61, .36, 1);
  /* 輪郭ハート（未収藏） */
  -webkit-mask: var(--ph-heart) center/contain no-repeat;
  mask: var(--ph-heart) center/contain no-repeat;
}
.fav-toggle:hover { border-color: var(--fav); transform: translateY(-1px); }
.fav-toggle:hover::before { background: var(--fav); }
.fav-toggle.on {
  border-color: transparent;
  background: color-mix(in srgb, var(--fav) 14%, var(--surface));
}
.fav-toggle.on::before {
  background: var(--fav);
  transform: scale(1.06);
  /* 塗りつぶしハート（収藏済み） */
  -webkit-mask: var(--ph-heart-fill) center/contain no-repeat;
  mask: var(--ph-heart-fill) center/contain no-repeat;
}
/* 一覧カードでは画像フレーム右上に浮かせる */
.product-card .fav-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, background .15s ease, border-color .15s ease;
}
.product-card:hover .fav-toggle,
.product-card:focus-within .fav-toggle,
.product-card.is-touch-revealed .fav-toggle,
.product-card .fav-toggle.on { opacity: 1; transform: translateY(0); }
/* 詳細：タイトル横に置く */
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-title-row .fav-toggle { flex: none; margin-top: 2px; }

/* ---- 收藏した瞬間の「ハートが弾ける」演出（X風） ---- */
/* ハート本体がポンッと跳ねる */
.fav-toggle.bursting::before {
  animation: favHeartPop .5s cubic-bezier(.18, .89, .32, 1.28);
}
@keyframes favHeartPop {
  0%   { transform: scale(0); }
  45%  { transform: scale(1.4); }
  70%  { transform: scale(.9); }
  100% { transform: scale(1.06); } /* .on の最終形に着地 */
}
/* 外側に広がるリング */
.fav-toggle.bursting::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--fav) 75%, transparent);
  animation: favRing .55s ease-out forwards;
  pointer-events: none;
}
@keyframes favRing {
  0%   { transform: scale(.55); opacity: .8; }
  100% { transform: scale(2); opacity: 0; }
}
/* 飛び散る小さなハート（JSで生成） */
.fav-burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 4;
}
.fav-burst i {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--c, var(--fav));
  opacity: 0;
  animation: favSpark .62s cubic-bezier(.22, .61, .36, 1) forwards;
  animation-delay: var(--d, 0ms);
  -webkit-mask: var(--ph-heart-fill) center/contain no-repeat;
  mask: var(--ph-heart-fill) center/contain no-repeat;
}
@keyframes favSpark {
  0%   { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0deg); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) scale(1) rotate(var(--rot, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .product-image,
  .product-image-track,
  .product-carousel-dots,
  .product-carousel-dots i,
  .product-carousel-nav { transition: none; }
  .fav-toggle, .fav-toggle::before { transition: none; }
  .fav-toggle.bursting::before { animation: none; }
  .fav-toggle.bursting::after { display: none; }
  .fav-burst { display: none; }
}

/* ---- 詳細パネル（右カラム sticky） ---- */
.detail-panel {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: auto;
  scrollbar-width: thin;
  border-left: 1px solid var(--line);
  background: var(--surface);
}
/* 詳細の待ち画面。中身は骨架（.detail-skeleton）だけなので、本文と同じ余白で
   同じ位置に置く＝出来上がりと入れ替わっても要素が飛ばない。 */
.detail-empty {
  padding: 26px 24px 40px;
  height: auto;
}
.detail-view { padding: 26px 24px 40px; }

/* === 読込中の骨架（旧「選擇商品」の文字の置き換え・2026-08-13）===
   一覧カードと同じ淡いグレー1系統（--fill / --fill-strong）に、
   商品写真の待ち（.product-thumb）と同じ光の帯を重ねる。 */
.detail-skeleton { display: grid; gap: 14px; max-width: 500px; margin-inline: auto; }
.detail-skeleton .ds-stage,
.detail-skeleton .ds-thumbs i,
.detail-skeleton .ds-title,
.detail-skeleton .ds-price,
.detail-skeleton .ds-swatches i,
.detail-skeleton .ds-sizes i,
.detail-skeleton .ds-lines i,
.detail-skeleton .ds-button {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--fill);
}
.detail-skeleton .ds-stage::after,
.detail-skeleton .ds-thumbs i::after,
.detail-skeleton .ds-title::after,
.detail-skeleton .ds-price::after,
.detail-skeleton .ds-swatches i::after,
.detail-skeleton .ds-sizes i::after,
.detail-skeleton .ds-lines i::after,
.detail-skeleton .ds-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 65%) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: thumbShimmer 1.4s ease-in-out infinite;
}
.detail-skeleton .ds-stage { aspect-ratio: 1 / 1; border-radius: 5px; }
.detail-skeleton .ds-stage.has-preview { background: transparent; }
.detail-skeleton .ds-stage.has-preview::after { display: none; }
.detail-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.detail-skeleton .ds-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.detail-skeleton .ds-thumbs i { aspect-ratio: 1 / 1; border-radius: 4px; }
.detail-skeleton .ds-title { width: 68%; height: 20px; margin-top: 8px; background: var(--fill-strong); }
.detail-skeleton .ds-price { width: 34%; height: 14px; background: var(--fill-strong); }
.detail-skeleton .ds-swatches { display: flex; gap: 8px; }
.detail-skeleton .ds-swatches i { width: 30px; height: 30px; border-radius: 999px; }
.detail-skeleton .ds-sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-skeleton .ds-sizes i { width: 58px; height: 38px; border-radius: 3px; }
.detail-skeleton .ds-lines { display: grid; gap: 9px; }
.detail-skeleton .ds-lines i { height: 10px; background: var(--fill-strong); }
.detail-skeleton .ds-lines i:nth-child(1) { width: 88%; }
.detail-skeleton .ds-lines i:nth-child(2) { width: 76%; }
.detail-skeleton .ds-lines i:nth-child(3) { width: 52%; }
.detail-skeleton .ds-button { height: 48px; border-radius: 4px; margin-top: 6px; }
/* 引き出しが閉じている間は見えないので光らせない（無駄な描画を止める）。 */
.detail-drawer:not(.open) .detail-skeleton ::after,
.detail-drawer:not(.open) .detail-skeleton > ::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .detail-skeleton ::after,
  .detail-skeleton > ::after { animation: none; }
}
.hidden { display: none !important; }

.detail-gallery { display: grid; gap: 10px; margin-bottom: 20px; }
.detail-main-image {
  width: 100%;
  /* 上限500px＝1000pxの写真がちょうど2倍で載る（高精細画面での最良点）。
     引き出しの残り幅はスクロール棒の太さで環境ごとに501前後へぶれるため、
     ここで止めてどの機械でも同じ大きさに揃える。 */
  max-width: 500px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  border: 0;
  object-fit: contain;
  background: transparent;
}
/* 大きい写真と左右をそろえるため小さい写真の列も同じ上限にする */
.thumb-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 502px; margin-inline: auto; }
.thumb-row img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid color-mix(in srgb, var(--line) 55%, var(--surface));
  border-radius: 4px;
  object-fit: contain;
  background: transparent;
  opacity: .72;
  transition: opacity .18s ease, transform .18s ease;
}
.thumb-row img:hover { opacity: 1; cursor: pointer; }
.thumb-row img.active { opacity: 1; }

/* 画像の左右おくりボタン（chevron）＝線だけ（フロスト丸なし）を画像の左右へ重ねる */
.detail-stage {
  position: relative;
  overflow: hidden;
  /* 白っぽい商品が背景に溶けないよう、写真の器に細い線を置く（本城さん指示 2026-08-20）。
     線は写真1枚ずつではなく器に置く。スワイプで写真が動いても枠は止まったまま＝窓になる。
     外形502px＝内側がちょうど500pxで、写真の「1000pxを2倍で載せる」上限が変わらない。 */
  max-width: 502px;
  margin-inline: auto;
  /* 線は「あるかないか」くらいまで薄める（本城さん指示 2026-08-20）。
     仕切り線 --line を白で薄めた 55%＝写真の輪郭は分かるが線自体は主張しない。 */
  border: 1px solid color-mix(in srgb, var(--line) 55%, var(--surface));
  border-radius: 5px;
  /* 横スワイプはギャラリーが処理し、縦方向はドロワーのスクロールへ渡す。
     pinch-zoomを添えないと2本指の拡大まで封じてしまう。 */
  touch-action: pan-y pinch-zoom;
}
.detail-main-image {
  position: relative;
  z-index: 1;
  will-change: transform;
  /* 行の中の文字と同じ扱いのままだと、写真の下に文字のぶら下がり分（数px）の
     すき間ができ、その分だけ枠が縦に高くなる。スワイプで入ってくる隣の写真は
     枠いっぱいに置くので、高い枠の中央＝1〜2px下にずれて見えていた。
     ここで「文字ではなく面」として扱わせて、枠と写真の高さを一致させる。
     max-width と margin-inline: auto による中央寄せも、これで初めて効く。 */
  display: block;
}
.detail-image-text {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  display: grid;
  gap: 3px;
  max-width: calc(100% - 24px);
  pointer-events: none;
}
.detail-image-text[hidden] { display: none; }
/* 写真に重ねる印（O-Rei・upcycle・CAFÉ DO BRASIL）は説明札より奥へ置く
   （本城さん指示 2026-08-21）。下げるのは詳細の写真の中だけで、一覧カードの
   印は z-index:3 のまま。写真(z-index:1)より後ろのDOMに置いているので、
   同じ 1 でも写真の上には出る＝印は今までどおり見えたまま、
   説明札(z-index:2)と重なった所だけ札が勝って文字が読める。 */
.detail-stage .product-marks { z-index: 1; }
/* 写真の枚数と現在位置（例 7/9）。左上は商品の印、左下は説明札、
   下の右端は写真に焼き込まれたロゴが来るので、空いている右上に置く
   （本城さん指示 2026-08-21）。写真の邪魔をしないよう小さく薄い札にする。 */
.gallery-counter {
  position: absolute;
  z-index: 2;
  right: 10px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(15 23 42 / 40%);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.detail-image-text span {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgb(15 23 42 / 78%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.detail-swipe-neighbor {
  position: absolute;
  /* 現在の写真とぴたりと重なる箱にする（上限500px・左右中央）。
     ずれた箱に置くと、入ってくる写真と定位置の写真で位置が食い違う。 */
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  width: 100%;
  max-width: 500px;
  margin-inline: auto;
  height: 100%;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
  will-change: transform;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--line);
  cursor: pointer;
  z-index: 3;
  transition: color .14s ease, transform .14s ease;
  -webkit-tap-highlight-color: transparent;
}
.gallery-nav svg { width: 28px; height: 28px; display: block; }
.gallery-nav.prev { left: 6px; }
.gallery-nav.next { right: 6px; }
.gallery-nav:hover { color: var(--muted); }
.gallery-nav.prev:hover { transform: translateY(-50%) translateX(-2px); }
.gallery-nav.next:hover { transform: translateY(-50%) translateX(2px); }
.gallery-nav:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

/* ---- 詳細ドロワーの文字づかい（案①「静」・本城さん採用 2026-08-13） ----------
   見本＝drawer-catalog.html（現況＋5案を並べて比較したもの）。決めごとは3つ。
   ① 値段は太字にしない（圧迫感が出る）。名前より小さく、細いまま置く。
   ② 太さは「ふつう(400)」と「太字(700)」の2段だけ。この店は見る人の端末の書体を
      そのまま使うので、中間の太さ(500〜850)は Windows では出ず Mac とずれる。
      強弱は【大きさ・字間・行間・グレーの濃さ】で作る。
   ③ 買うボタンは丸いまま（四角にしない）。変えるのは字の大きさと字間だけ。
   説明文と小見出しの2つのグレーはここで一元管理する。 */
.detail-view {
  --detail-body: #5b616b;   /* 説明・仕様の値など「読む文字」 */
  --detail-faint: #8a9099;  /* 小見出し・在庫の一言など「添える文字」 */
}
.detail-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; line-height: 1.32; letter-spacing: -0.005em; }
.detail-summary { margin-top: 10px; color: var(--detail-body, var(--muted)); white-space: pre-line; font-size: 13.5px; font-weight: 400; line-height: 1.95; }
.price-line { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 26px; }
.price-line strong { color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: .01em; }
/* 割引中の値札（商品ページ）。一覧カードと同じ「特價 → 元の値段(取消線) → ◯%OFF」。
   一覧より値段そのものが大きいので、添える2つも 11.5px → 13px に上げて釣り合わせる。 */
.price-line .price-was {
  color: #c2c6cc;
  font-size: 13px;
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: currentColor;
  font-variant-numeric: lining-nums tabular-nums;
}
.price-line .price-off {
  align-self: baseline;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .06em;
  /* 予備値を書いておく：共有トークンの読み込みが古いままでも赤が消えない。 */
  color: var(--sale, #e60023);
}

.selector-group { margin: 26px 0; }
.selector-label { margin-bottom: 10px; font-size: 11.5px; font-weight: 400; letter-spacing: .06em; color: var(--detail-faint); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* 同じ品番の色ちがい（14001-70/-20/-10 等）を写真タイルで並べる。
   adminでは別商品なので選択肢ボタンではなく「別商品へ乗り換える <a>」。 */
.colorway-row { display: flex; flex-wrap: wrap; gap: 8px; }
.colorway {
  position: relative;
  display: block;
  width: 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.colorway img,
.colorway-blank {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: transparent;
}
.colorway:hover { border-color: var(--blue); }
.colorway.selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.colorway.soldout img { opacity: .45; }
.colorway-soldout {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgb(15 23 42 / 62%);
}

.choice {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  transition: border-color .14s ease, color .14s ease, background .2s ease;
}
.choice:hover { border-color: var(--blue); }
.choice.selected { border-color: var(--ink); background: var(--ink); color: #fff; }
.choice.swatch {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  color: transparent;
}
.choice.swatch::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, var(--line));
  background: var(--swatch, #d9dde3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 58%, transparent);
}
/* サイズ等の選択肢に在庫状況を焼き込む（B案・本城さん決定 2026-07-10）。
   売切＝斜線＋薄グレーで押せない／残り5点以下＝ボタン内に小さく「剩N」。赤は --danger 単一ソース。 */
.choice.soldout {
  color: color-mix(in srgb, var(--muted) 52%, transparent);
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background:
    linear-gradient(to top right,
      transparent calc(50% - 0.5px),
      color-mix(in srgb, var(--muted) 36%, transparent) calc(50% - 0.5px),
      color-mix(in srgb, var(--muted) 36%, transparent) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)),
    color-mix(in srgb, var(--ink) 2.5%, var(--surface));
  cursor: not-allowed;
}
.choice.soldout:hover { border-color: color-mix(in srgb, var(--line) 72%, transparent); }
.choice.low {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.12;
  padding-top: 3px;
  padding-bottom: 3px;
}
.choice-left {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  color: color-mix(in srgb, var(--danger) 88%, black);
}
.choice.low.selected .choice-left { color: color-mix(in srgb, var(--danger) 36%, white); }
.choice.swatch:hover { border-color: var(--blue); }
.choice.swatch.selected {
  border-color: var(--surface);
  background: var(--surface);
  color: transparent;
  box-shadow: 0 0 0 2px var(--ink);
}
.choice.swatch.selected::before {
  width: 30px;
  height: 30px;
}
/* 色玉（swatch）の売切は玉を薄く＋斜線1本。「剩N」は載せない（丸が小さく読めないため） */
.choice.swatch.soldout::before { opacity: .35; }
.choice.swatch.soldout::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 1px;
  background: color-mix(in srgb, var(--muted) 62%, transparent);
  transform: rotate(-45deg);
}
.choice-swatch-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 色玉の下に色コード（BEG・NVY…）を並べる（2026-08-20 本城さん決定＝案③）。
   丸だけでは客が色を呼べないため。文字はタグ・注文書と同じ記号に揃える。 */
.choice-row.is-swatch { gap: 8px 6px; align-items: flex-start; }
.choice-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  padding: 0 2px;
}
.choice-code {
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .07em;
  text-align: center;
  color: var(--detail-faint, var(--muted));
  white-space: nowrap;
}
.choice-cell.is-selected .choice-code { color: var(--ink); font-weight: 700; }
.choice-cell.is-soldout .choice-code { color: color-mix(in srgb, var(--muted) 55%, var(--surface)); }

.stock-note { margin: 14px 0 0; color: var(--detail-faint, var(--muted)); font-size: 12.5px; font-weight: 400; letter-spacing: .01em; }

.spec-list { display: grid; gap: 0; margin-top: 26px; padding-top: 4px; border-top: 1px solid var(--line); }
.spec-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.spec-row dt { color: var(--detail-faint, var(--muted)); font-weight: 400; }
.spec-row dd { margin: 0; color: var(--ink); font-weight: 700; white-space: pre-line; }

/* 加入購物車（詳細ドロワーの app.js 生成ボタン） → solid ピル化。
   結帳ボタン .checkout-button とカート抽斗の一式は、全ページ共通の共有ドロワー化に伴い
   /assets/cart.css へ移設した（cart-drawer.js が全ページへ <link> 注入）。 */
.add-button {
  width: 100%;
  min-height: 50px;
  margin-top: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  transition: background .2s ease, transform .12s ease;
}
.add-button:not(:disabled):hover { background: var(--blue); transform: translateY(-1px); }
.add-button:disabled {
  cursor: not-allowed;
  background: var(--fill);
  color: var(--muted);
  transform: none;
  opacity: .7;
}
.detail-actions { margin-top: 28px; }
/* 売切時の一言（約束はしない・♡収藏への案内だけ）。stock-note と同じ控えめさ。 */
.soldout-hint { margin: 10px 0 0; color: var(--detail-faint, var(--muted)); font-size: 12.5px; font-weight: 400; letter-spacing: .01em; }

/* カート抽斗の見た目は全ページ共通の /assets/cart.css へ移設（cart-drawer.js が注入）。
   共用の .icon-button（詳細ドロワーの閉じる × にも使う）は design-components.css へ移した。
   ここから下（.detail-drawer〜）は storefront 専用なので shop.css に残す。 */

/* ---- 詳細ドロワー（index を sidebar+field シェルへ統一したため、
   右カラム常設のかわりに商品詳細を右からスライドで開く。app.js は中身描画のみ） ---- */
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(560px, 100vw);
  height: 100vh;
  transform: translateX(104%);
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  box-shadow: var(--shadow);
  transition: transform 320ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.detail-drawer.open { transform: translateX(0); }
/* 詳細ドロワー背後の暗幕（見た目は購物車の .cart-backdrop と同じ）。
   .detail-drawer.open の直後要素として + で連動＝JSはクリックの配線だけでよい。
   z-index はドロワー(90)の一段下。購物車の暗幕(94)はさらに上なので重ね順は保たれる。 */
.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms ease;
}
.detail-drawer.open + .detail-backdrop { opacity: 1; visibility: visible; }
.detail-drawer .detail-scroll { overflow: auto; min-height: 0; scrollbar-width: thin; }
/* 骨架は上から積むため高さは決め打ちしない（旧: 100vh 固定＝文字を中央へ置くためのもの）。 */
.detail-drawer .detail-empty { height: auto; }
.detail-header-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
/* ドロワー左肩のロゴ＝行動版だけ。PC はページ上部のヘッダーが見えているので出さない。 */
.detail-brand { display: none; }
@media (max-width: 940px) {
  /* ロゴの絵は「上に星・下に文字」なので、絵の高さの真ん中と文字の中心はそろわない
     （縦中央ぞろえだと ATHLETA の文字が見出しより 4.4px 下がる＝2026-08-12 実測）。
     絵の下端＝ATHLETA の文字が乗る線なので、見出しの文字が乗る線（baseline）へ合わせる。
     ロゴ枠(.detail-brand)の下端がそのまま baseline として扱われるため、字体が変わっても
     （Windows の別書体でも）ずれない。× ボタンだけは従来どおり縦中央。 */
  .detail-drawer .cart-header { align-items: baseline; }
  .detail-drawer .cart-header > .icon-button { align-self: center; }
  .detail-brand {
    display: flex;
    align-items: center;
    flex: none;
    margin-right: 12px;
    color: var(--ink);
  }
  .detail-brand .logo {
    width: 84px;
    flex-shrink: 0;
    transform: none;
  }
}
.detail-header-main h2 { flex: none; }
.detail-sku {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- レスポンシブ ---- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .detail-panel { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}

/* 縦積み（page-grid が1カラム化）になる幅では、左サイドバーを
   横スクロールできる薄いフィルタートレイに圧縮する。 */
@media (max-width: 940px) {
  .page-grid > .sidebar {
    display: grid;
    gap: 10px;
    padding: 12px var(--padx);
  }

  .sidebar .side-section {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    border-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar .side-section::-webkit-scrollbar { display: none; }
  .sidebar .side-section h2 {
    flex: none;
    min-width: 36px;
    margin: 0;
    letter-spacing: .08em;
  }

  /* 價格はトラックを潰さず横スクロール帯の中で固定幅に */
  #priceSection .price-filter { flex: none; width: 240px; }
  #priceSection .price-hist { height: 30px; margin-bottom: 7px; }

  .cat-section {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    border-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cat-section::-webkit-scrollbar { display: none; }
  .cat-section h2 { flex: none; margin: 0; }
  .cat-section .side-link {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 36px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
  }
  .cat-section .side-link.active {
    border-color: var(--blue);
    color: var(--ink);
    background: color-mix(in srgb, var(--blue) 8%, transparent);
  }
  .cat-section .side-link b { display: none; }
  /* 横スクロールのカテゴリピルでは radio ドットは省く（ピル自体が選択を示す） */
  .cat-section .side-link .ind { display: none; }

  .scene-grid,
  .size-grid,
  .swatches {
    flex: none;
    flex-wrap: nowrap;
  }

  .scene-grid button,
  .size-grid button {
    flex: none;
    min-height: 34px;
  }

  .swatches button {
    flex: none;
    width: 28px;
    height: 28px;
  }

  .field-hero .search-box { width: 100%; }
}

/* ============================================================
   モバイル(≤940)の篩選シートの中身（2026-08-21 本城さん指示）。
   このすぐ上のブロックは、シートが無かった頃の「横に流れる細い帯」の名残で、
   今の下から出るシートの中では狭すぎ・詰まりすぎになる。ここで売場のシート
   （.sidebar--shop）だけ上書きして、幅をいっぱい使う縦積みへ戻す。
   ・記事ページ等の .sidebar は上のままなので影響しない。
   直したこと：
   ①つまみ棒の上の隙間から中身が透けていた → 上の余白を見出し側へ移す。
   ②年份・季節などが1列で縦に長い → 2〜3列に。押せる範囲は行いっぱい。
   ③顏色・價格が細い帯のままだった → 画面幅をいっぱい使う。
   ============================================================ */
@media (max-width: 940px) {
  /* ① 上の余白は見出し(.mf-head)が持つ。シート側の上余白を 0 にして、
        スクロールした中身がつまみ棒の上から覗く隙間をなくす。 */
  /* 最終行（價格の金額表示）が下のフロストバーの裏へ入らないよう、
     島の上端 62px + 従来の下余白 22px をスクロール余白にする。 */
  .page-grid > .sidebar--shop {
    padding: 0 var(--padx) calc(84px + env(safe-area-inset-bottom, 0px));
  }

  /* 各枠＝見出しを1行使って、その下に中身を全幅で置く（横スクロールはしない）。 */
  .sidebar--shop .side-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 11px 0;
    overflow: visible;
  }
  .sidebar--shop .side-section h2 {
    flex: 0 0 100%;
    min-width: 0;
    margin: 0;
  }

  /* 分類＝折り返すピル。横に流すと右側が隠れて気づけないため。 */
  .sidebar--shop .cat-section {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
  }

  /* ② チェック列（款式・季節・年份・對象・標籤）は2〜3列。
        ボタンが枠いっぱいなので、文字の右の余白を押しても反応する。 */
  .sidebar--shop .subcat-list {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2px 8px;
  }
  /* 年は「2026」と短いので3列で足りる。 */
  .sidebar--shop #yearGrid { grid-template-columns: repeat(3, 1fr); }
  /* 数字は名前のすぐ右へ（列いっぱいに離すと別の行の数字に見える）。
     3列目を余白にして、その空白を押しても選べるようにする。 */
  .sidebar--shop .subcat-list button {
    grid-template-columns: 18px minmax(0, auto) minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }
  .sidebar--shop .subcat-list b { text-align: left; }

  /* 尺寸のチップも折り返す（横スクロールで隠さない）。 */
  .sidebar--shop .size-grid {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .sidebar--shop .size-range { flex: 1 1 100%; }

  /* ③ 顏色＝7色を全幅に等分。丸も指で押しやすい大きさへ。 */
  .sidebar--shop .swatches {
    flex: 1 1 100%;
    gap: 10px 0;
  }
  .sidebar--shop .swatches button {
    width: 34px;
    height: 34px;
  }

  /* ③ 價格＝全幅。分布の山も少し高くして読めるように。 */
  .sidebar--shop #priceSection .price-filter {
    flex: 1 1 100%;
    width: auto;
  }
  .sidebar--shop #priceSection .price-hist {
    height: 40px;
    margin-bottom: 9px;
  }
}

@media (max-width: 680px) {
  .catalog-panel { padding: 22px var(--padx); }
  .catalog-toolbar,
  .filters { grid-template-columns: 1fr; }
  /* スマホは2列。縦は32px（PCの48pxより詰めるが、上下の商品はしっかり分ける）。 */
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 12px; }
  /* 幅が狭いと「特價・定価・20%OFF」の3つが1行に入らないので、ここだけ折り返しを許す。 */
  .product-card .product-price { flex-wrap: wrap; gap: 4px 6px; }
  .detail-view { padding: 18px 16px 32px; }

  /* 行動版は購物車ボタンをドロワー下端に常設する。
     固定バーの高さ分をスクロール末尾に足し、最後の商品情報が隠れないようにする。 */
  .detail-drawer .detail-scroll {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .detail-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 -8px 20px color-mix(in srgb, var(--ink) 8%, transparent);
    backdrop-filter: saturate(1.1) blur(8px);
  }
}


/* ============================================================
   トップのヒーロー（.shop-hero）— index の一番上。
   ・2026-08-19、横に流れるスライダーへ全面変更（本城さん採用）。中身の見え方と
     動きの正本は assets/hero-slider.css と assets/hero-slider.js。ここでは器だけ。
     ＝直したい時は hero-slider.css の先頭にある数値（幅・高さ・暗さ等）を直す。
   ・履歴：2026-08-13 に黒帯 →白地＋店舗写真（.doc-hero--photo 共用）。
     2026-08-19 にその共用部品の使用をやめ、トップ独自のスライダーへ。
     /stores・/story は引き続き .doc-hero--photo のままで、こことは連動しない。
   ・.shop-hero は「トップ専用の印」兼、部品を body 直下へ置くための器。
     wishlist / category / product は class="shop-hero" のブロックごと剥がして使うので
     クラス名は変えないこと。
   ============================================================ */
.shop-hero {
  display: block;
  width: 100%;
  background: #0b0d11; /* スライダーの地と同じ黒。読み込み中に白が一瞬出るのを防ぐ。 */
}

/* ヒーローと本文の間（2026-08-20 本城さん指示：もう少し広く／左右で高さを揃える）。
   旧 22px は黒いヒーローの直下に件数・分類がすぐ始まって窮屈だったため 52px へ。
   左右の柱を同じ 52px にして、「全部清除」と「件数＋排序」の帯を水平に揃える。
   ・.result-row は自前で padding-top:16px を持つ（見出しのあるページ用）。
     ヒーローの下では上に見出しが無く、この 16px が右だけ余分に効いて
     左右が 16px ずれていた（2026-08-20 本城さん指摘）ので 0 に戻す。
   ・「全部清除」の高さは排序セグメント（32＋枠1×2＝34px）に合わせる。
     これで左右のボタンの上端・下端がピタリ揃う。
   ≤940 は 1 カラム＝サイドバーが下から出るシートになるので一覧側だけ 32px。
   ※この余白はトップ専用。wishlist 等は .shop-hero ごと剥がすので影響しない。 */
.shop-hero + .page-grid .product-field {
  padding-top: 52px;
}
.shop-hero + .page-grid .result-row {
  padding-top: 0;
}
@media (min-width: 941px) {
  .shop-hero + .page-grid .sidebar {
    padding-top: 52px;
  }
  .shop-hero + .page-grid .sidebar-clear .filter-clear {
    min-height: 34px;
  }
}
@media (max-width: 940px) {
  .shop-hero + .page-grid .product-field {
    padding-top: 32px;
  }
}

/* =========================================================================
   鞋碼對照表（公分 / 美國 / 英國）のポップアップ
   マークアップは assets/shoe-size-chart.js が注入する（換算の基準もそこ）。
   開く口は商品ドロワーの「鞋碼」見出しの右の .size-guide-btn。
   z-index は他のスライド部品（ドロワー90・選單1510・お知らせ1600）より前面。
   ========================================================================= */

/* 見出し行に対照表ボタンを同居させる時だけ横並びにする（他の見出しは元のまま）。 */
.selector-label--with-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.size-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .02em;
  line-height: 1.6;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}

.size-guide-btn::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  background: currentColor;
  /* 物差しの絵記号（Phosphor ruler）。色は currentColor に従う。 */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'><path d='M235.32 73.37L182.63 20.69a16 16 0 0 0-22.63 0L20.68 160a16 16 0 0 0 0 22.63l52.69 52.68a16 16 0 0 0 22.63 0L235.32 96a16 16 0 0 0 0-22.63M84.68 224L32 171.31l32-32l26.34 26.35a8 8 0 0 0 11.32-11.32L75.31 128L96 107.31l26.34 26.35a8 8 0 0 0 11.32-11.32L107.31 96L128 75.31l26.34 26.35a8 8 0 0 0 11.32-11.32L139.31 64l32-32L224 84.69Z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'><path d='M235.32 73.37L182.63 20.69a16 16 0 0 0-22.63 0L20.68 160a16 16 0 0 0 0 22.63l52.69 52.68a16 16 0 0 0 22.63 0L235.32 96a16 16 0 0 0 0-22.63M84.68 224L32 171.31l32-32l26.34 26.35a8 8 0 0 0 11.32-11.32L75.31 128L96 107.31l26.34 26.35a8 8 0 0 0 11.32-11.32L107.31 96L128 75.31l26.34 26.35a8 8 0 0 0 11.32-11.32L139.31 64l32-32L224 84.69Z'/></svg>") center / contain no-repeat;
}

.size-guide-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.size-guide-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---- ポップアップ本体 ---- */
.ssc {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: rgb(20 22 26 / 52%);
  opacity: 0;
  transition: opacity .2s ease;
}

.ssc.show { opacity: 1; }
.ssc[hidden] { display: none; }

body.ssc-lock { overflow: hidden; }

.ssc-card {
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  max-height: min(700px, calc(100dvh - 32px));
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgb(20 24 34 / 34%);
  transform: translateY(10px) scale(.985);
  transition: transform .2s ease;
}

.ssc.show .ssc-card { transform: none; }
.ssc-card:focus { outline: none; }

.ssc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.ssc-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
}

.ssc-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

.ssc-close {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.ssc-close:hover { background: var(--fill); color: var(--ink); }
.ssc-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* 中身は1画面に収める設計（本城さん指示 2026-08-21＝窓の中でスクロールさせない）。
   overflow は「画面がよほど低い端末」の最後の保険で、通常は働かない。 */
.ssc-body {
  padding: 2px 18px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 今えらんでいるサイズの読み替えを、表の前に1行で言い切る。 */
.ssc-current {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
}

.ssc-current b { font-weight: 700; }
.ssc-current[hidden] { display: none; }

.ssc-block { margin-top: 18px; }

.ssc-h {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
}

/* 15段を縦一列にすると窓に入らないので、前半（22.0〜25.5）と後半（26.0〜29.0）を
   左右に並べた6列の表にする。真ん中に太めの区切りを1本入れて2枚に見せる。 */
.ssc-table {
  width: 100%;
  /* separate＋border-spacing:0 にすると角丸で中身をきれいに切り落とせる
     （collapse のままだと角のマスの地色が枠からはみ出す）。 */
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 12.5px;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  table-layout: fixed;
}

.ssc-table thead th {
  padding: 7px 4px;
  background: var(--fill);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

/* 左右の組の境目。ここだけ地の色まで届く縦線を引く。 */
.ssc-table .ssc-gap { border-left: 2px solid var(--line); }

.ssc-col {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ssc-col small {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--muted);
}

/* 国旗は小さく角丸＋細い縁。白地の旗でも面が消えないように縁を必ず入れる。 */
.ssc-flag {
  width: 18px;
  height: 12px;
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(20 24 34 / 14%);
  object-fit: cover;
}

.ssc-table tbody th,
.ssc-table tbody td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}

.ssc-table tbody th { font-weight: 700; }
.ssc-table tbody tr:last-child th,
.ssc-table tbody tr:last-child td { border-bottom: 0; }

/* 後半が1つ足りない分の空きマス。線だけ残して中身は空。 */
.ssc-table .ssc-empty { background: var(--paper); }

/* 選択中の3マス。地の色＋公分マスの左の縦棒で、走査中でも目が止まる。 */
.ssc-table .is-on {
  background: color-mix(in srgb, var(--blue) 13%, var(--surface));
  font-weight: 700;
}

.ssc-table th.is-on { box-shadow: inset 3px 0 0 var(--blue); }

.ssc-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--muted);
}

.ssc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ssc-chip {
  flex: 1 1 auto;
  min-width: 44px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  color: var(--ink);
}

.ssc-chip.is-on {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, var(--surface));
  font-weight: 700;
}

/* 足の測り方は1行だけ。面を作ると窓が伸びるので、地の色を敷いた帯にする。 */
.ssc-tip {
  margin: 18px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--paper);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 520px) {
  .ssc-card { max-height: calc(100dvh - 20px); }
  .ssc-body { padding-left: 12px; padding-right: 12px; }
  .ssc-head { padding: 14px 12px 11px; }
  /* 幅が足りない所では、旗と中文だけ残して英字の添え書きを畳む。 */
  .ssc-table { font-size: 12px; }
  .ssc-table thead th { font-size: 10.5px; padding: 6px 2px; }
  .ssc-col small { display: none; }
  .ssc-table tbody th,
  .ssc-table tbody td { padding: 6px 2px; }
  .ssc-chip { min-width: 42px; padding: 5px 7px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ssc,
  .ssc-card { transition: none; }
}
