/* Two Moon 商品管理 デモ：公開ページ */
.tm2-gallery { width: 100%; max-width: 650px; margin: 0 auto 24px; }
/* メイン・サムネイルは白い正方形の枠。商品は切り取らず、はみ出さず、中央に収める（透過PNGは白の上に乗る） */
.tm2-gallery-main { position: relative; width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; touch-action: pan-y; }
/* 大きさ・縦横比がそろっていない画像も枠に収める。小さい画像は引き伸ばさない */
.tm2-gallery-photo { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.tm2-gallery-prev, .tm2-gallery-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #222; cursor: pointer; font-size: 28px; line-height: 1; }
.tm2-gallery-prev { left: 8px; }
.tm2-gallery-next { right: 8px; }
.tm2-gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 6px; }
.tm2-gallery-thumbs button { flex: 0 0 72px; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tm2-gallery-thumbs button.active { border-color: #222; }
.tm2-gallery-thumbs img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.tm2-gallery-colors, .tm2-summary-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tm2-gallery-colors button, .tm2-color-button { padding: 8px 12px; border: 1px solid #aaa; background: #fff; color: #222; cursor: pointer; font-size: 14px; }
.tm2-gallery-colors button.active, .tm2-color-button.active { border-color: #222; background: #222; color: #fff; }
.tm2-summary { margin: 16px 0 30px; }
.tm2-price-summary { font-size: 18px; margin: 0 0 8px; }
.tm2-summary-color-name { margin: 16px 0 6px; font-weight: 600; }
.tm2-size-table { width: 100%; max-width: 520px; border-collapse: collapse; }
.tm2-size-table th, .tm2-size-table td { border: 1px solid #ddd; padding: 10px; text-align: center; font-size: 14px; white-space: nowrap; }
.tm2-size-table thead th { background: #f5f5f5; }
.tm2-stock-symbol { font-size: 16px; }
/* 在庫の凡例：表の文字より少し小さい程度（書体・大きさ・色はフォント構成ツールで変えられる） */
.tm2-summary .tm2-stock-legend, .tm2-summary .tm2-stock-note { font-size: 13px; line-height: 1.8; color: #333; margin: 10px 0 0; }
.tm2-summary .tm2-stock-note { margin-top: 4px; }
/* 素材・加工・原産国（空の行は出さない） */
.tm2-specs { margin: 8px 0 16px; }
.tm2-spec { margin: 0 0 4px; }

/* スマホの境目は 781px（WordPressのカラムが縦に並ぶ幅。フォント構成ツールと同じ）
   商品タイトルの大きさ・色、一覧のカードの書体は、フォント構成ツールが出す */

/* 現行商品の一覧 [two_moon_current_list]：枠線・影なし、写真と文字だけ。PC5列・スマートフォン2列
   手で並べるカード（グループ・画像・段落のブロック）にも、同じクラス名を付ければ同じ形になる。
   テーマの余白より優先させるため「.tm2-list 〜」の形で書く */
.tm2-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 36px 20px; margin: 24px 0 36px; }
.tm2-list > * { margin: 0; }
.tm2-list .tm2-list-card { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; color: inherit; text-decoration: none; }
.tm2-list .tm2-list-card > * { margin: 0; }
.tm2-list .tm2-list-photo { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; margin: 0 0 8px; overflow: hidden; }
.tm2-list .tm2-list-photo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity .2s; }
.tm2-list a.tm2-list-card:hover .tm2-list-photo img, .tm2-list a.tm2-list-card:focus-visible .tm2-list-photo img { opacity: .8; }
.tm2-list .tm2-list-no { font-size: 12px; line-height: 1.4; letter-spacing: .06em; }
.tm2-list .tm2-list-name { font-size: 14px; line-height: 1.5; }
@media (max-width: 1000px) {
    .tm2-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
    .tm2-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
}

/* 商品ページと一覧ページだけ、背景の色を今のサイトに寄せる（Two Moon 設定で外せる・色を変えられる） */
body.tm2-look { background-color: var(--tm2-bg, #f2f2f2); }
body.tm2-look .tm2-size-table thead th { background: rgba(0, 0, 0, .04); }

/* PCでは、メイン画像の枠を画面の高さに合わせて小さくし、説明文が1画面に入るようにする（スマートフォンは今のまま） */
@media (min-width: 782px) {
    .tm2-gallery { max-width: min(650px, var(--tm2-gallery-max, 55vh)); }
}

/* 検索と並べ替えのモック（動かない） */
.tm2-mock { margin: 24px 0; }
.tm2-mock-banner { margin: 0 0 16px; padding: 10px 14px; border: 1px solid #d9a300; border-radius: 6px; background: #fff6d6; color: #222; font-weight: 600; text-align: center; }
.tm2-mock-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tm2-mock-filter { margin: 0; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; min-width: 0; }
.tm2-mock-filter legend { padding: 0 4px; font-weight: 600; }
.tm2-mock-filter label { display: block; margin: 4px 0; font-size: 14px; color: #222; }
.tm2-mock-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 8px; }
.tm2-mock-sort-label { font-weight: 600; margin-right: 6px; }
.tm2-mock-pill { padding: 6px 14px; border: 1px solid #aaa; border-radius: 999px; font-size: 14px; color: #222; cursor: default; }
.tm2-mock-pill.active { border-color: #222; background: #222; color: #fff; }
.tm2-mock-count { font-size: 13px; color: #555; margin: 12px 0 8px; }
.tm2-mock-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tm2-mock-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid #ccc; border-radius: 6px; color: #222; text-decoration: none; }
.tm2-mock-card.is-dummy { color: #555; }
.tm2-mock-card-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #f3f3f3; margin-bottom: 6px; overflow: hidden; }
.tm2-mock-card-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.tm2-mock-card-title { font-weight: 600; }
.tm2-mock-card-line { font-size: 13px; }
@media (max-width: 781px) {
    .tm2-size-table th, .tm2-size-table td { padding: 8px 6px; font-size: 13px; }
    .tm2-mock-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tm2-mock-cards { grid-template-columns: 1fr; }
}
