/* ============================================================
   SugarNote 公式サイト — グッズページ（goods.html）
   絞り込み / 一覧 / 商品ダイアログ / カート / 特典
   メンバーカラーはバリアント選択チップの小さな色点だけに使う
   ============================================================ */

/* ---------- ページ頭 ---------- */
.goods-head { padding-top: clamp(40px, 5.6vw, 72px); }
.goods-head .sec-lead { margin-top: -4px; max-width: none; }
.goods-ja-only { font-size: 12px; color: var(--ink-soft); margin-top: -10px; margin-bottom: 20px; }
.goods-ja-only:empty { display: none; }

/* ---------- 推しの棚 ---------- */
.sec-shelves { padding-top: clamp(28px, 4vw, 48px); }
/* 推しを選ぶタイル: 顔写真の輪だけがメンバーカラー。選択中は ♡ の印と墨の枠 */
.oshi-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; max-width: 980px; margin-bottom: clamp(28px, 3.6vw, 40px); }
.oshi-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 10px 16px; border: 1px solid var(--hairline); background: var(--card); color: var(--ink); cursor: pointer;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.oshi-tile:hover { border-color: var(--ink); transform: translateY(-3px); }
.oshi-tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.oshi-tile-face { position: relative; width: clamp(64px, 6.4vw, 92px); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--vc, var(--hairline)); }
.oshi-tile-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.oshi-tile-mark {
  position: absolute; right: -6px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--ui, var(--ink)); color: var(--ui, var(--ink));
  display: grid; place-items: center; font-size: 13px; line-height: 1;
  opacity: 0; transform: scale(0.6);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.oshi-tile[aria-pressed="true"] .oshi-tile-mark { opacity: 1; transform: scale(1); }
.oshi-tile-name { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; line-height: 1.3; text-align: center; }
.shelves { display: grid; gap: clamp(30px, 4vw, 48px); }
.shelf-empty {
  border: 1px dashed var(--hairline); padding: 34px 20px; text-align: center;
  font-size: 13px; color: var(--ink-soft);
}
.shelf-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
/* 顔写真の縁だけがその子のメンバーカラー（--vc は goods.js が当てる） */
.shelf-face { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--vc, var(--hairline)); }
.shelf-head h3 { font-weight: 700; font-size: 17px; letter-spacing: 0.06em; }
.shelf-count { font-family: var(--en); font-weight: 600; font-size: 11px; letter-spacing: 0.12em; color: var(--ink-soft); }
.shelf-remove {
  margin-left: auto; border: 0; background: none; color: var(--ink-soft); cursor: pointer;
  font-size: 11.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0;
}
.shelf-remove:hover { color: var(--ink); }

/* ---------- 絞り込み ---------- */
.filters { display: grid; gap: 18px; padding: 22px 0 26px; border-top: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft); margin-bottom: 26px; }
.filter-group { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.filter-label { font-family: var(--en); font-weight: 600; font-size: 10.5px; letter-spacing: 0.26em; color: var(--ink-soft); padding-top: 9px; }
html:lang(th) .filter-label { font-family: var(--th); letter-spacing: 0.08em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--hairline); background: var(--card); color: var(--ink);
  padding: 7px 14px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip small { font-family: var(--en); font-weight: 600; font-size: 10.5px; color: var(--ink-soft); letter-spacing: 0.04em; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] small { color: var(--paper); opacity: 0.75; }
.chip-face { padding: 4px 14px 4px 4px; }
.chip-face img { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; }
.chip-face .chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #ddd); border: 1px solid rgba(86, 82, 82, 0.25); flex-shrink: 0; }
.chip-oshi { font-size: 11px; color: var(--oshi, var(--ink-soft)); margin-left: -3px; }
.chip[aria-pressed="true"] .chip-oshi { color: var(--paper); }

.items-status { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; margin-bottom: 18px; display: flex; align-items: baseline; gap: 12px; }
.items-status small { font-family: var(--en); font-weight: 600; font-size: 11px; color: var(--ink-soft); letter-spacing: 0.1em; }
.items-empty { padding: 40px 0; color: var(--ink-soft); font-size: 13px; }

/* ---------- まとめ買い特典 ---------- */
.bonus-rows { list-style: none; border-top: 1px solid var(--hairline-soft); max-width: 900px; }
.bonus-rows li { display: grid; grid-template-columns: 170px 1fr; gap: 10px 24px; padding: 20px 2px; border-bottom: 1px solid var(--hairline-soft); }
.bonus-threshold { font-family: var(--en); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bonus-threshold small { display: block; font-family: var(--ja); font-size: 11px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0.1em; margin-top: 4px; }
html:lang(th) .bonus-threshold small { font-family: var(--th); }
.bonus-name { font-weight: 700; font-size: 15px; }
.bonus-detail { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.bonus-prizes { font-size: 12.5px; margin-top: 8px; }
.bonus-prizes b { font-weight: 600; }
.bonus-note { font-size: 11.5px; color: var(--ink-soft); margin-top: 14px; max-width: 60ch; }

/* ---------- ご案内 ---------- */
.guide-list { max-width: 760px; display: grid; }
.guide-list > div { display: grid; grid-template-columns: 170px 1fr; gap: 6px 24px; padding: 14px 2px; border-top: 1px solid var(--hairline-soft); }
.guide-list > div:last-child { border-bottom: 1px solid var(--hairline-soft); }
.guide-list dt { font-weight: 700; font-size: 13px; }
.guide-list dd { font-size: 13px; color: var(--ink-soft); }
.guide-list dd a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.sec-guide { padding-bottom: clamp(48px, 7vw, 96px); }

/* ---------- ダイアログ共通（閉じるボタン .icon-close は site.css） ---------- */
.product-dialog, .cart-drawer { border: 1px solid var(--hairline); padding: 0; background: var(--card); color: var(--ink); }
.product-dialog::backdrop, .cart-drawer::backdrop { background: rgba(86, 82, 82, 0.45); backdrop-filter: blur(2px); }

/* ---------- 商品ダイアログ ---------- */
.product-dialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; overflow-y: auto; }
.pd-body { display: grid; grid-template-columns: 1fr 1fr; }
.pd-media { padding: 24px 0 24px 24px; }
.pd-media img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--hairline-soft); }
.pd-info { padding: 30px 28px 26px 26px; display: flex; flex-direction: column; gap: 12px; }
.pd-cat { font-family: var(--en); font-weight: 600; font-size: 10px; letter-spacing: 0.24em; color: var(--ink-soft); }
.pd-info h2 { font-size: 17px; font-weight: 700; line-height: 1.6; letter-spacing: 0.02em; }
.pd-price { font-family: var(--en); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; }
.pd-price .price-range { font-family: var(--base); font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-left: 8px; }
.pd-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.9; }
.pd-variants-label { font-family: var(--en); font-weight: 600; font-size: 10.5px; letter-spacing: 0.24em; color: var(--ink-soft); margin-top: 4px; }
html:lang(ja) .pd-variants-label, html:lang(th) .pd-variants-label { font-family: inherit; letter-spacing: 0.1em; font-size: 12px; }
.pd-variants { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-variant {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline); background: var(--card); padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pd-variant:hover { border-color: var(--ink); }
.pd-variant[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pd-variant small { font-weight: 500; color: var(--ink-soft); }
.pd-variant[aria-pressed="true"] small { color: var(--paper); opacity: 0.75; }
/* 写真つきバリアントチップ（メンバー系商品） */
.pd-variants.is-photo { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pd-photo {
  border: 1px solid var(--hairline); background: var(--card); padding: 5px 5px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; line-height: 1.35; text-align: center; color: var(--ink); cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pd-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pd-photo span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pd-photo small { font-weight: 500; font-size: 9.5px; color: var(--ink-soft); }
.pd-photo .vc { margin-top: 1px; }
.pd-photo:hover { border-color: var(--ink); }
.pd-photo[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pd-contents { font-size: 12.5px; padding-left: 18px; }
.pd-notes { list-style: none; display: grid; gap: 4px; }
.pd-notes li { font-size: 11.5px; color: var(--ink-soft); background: var(--paper); border-left: 2px solid var(--hairline); padding: 6px 10px; }
.pd-buy { display: flex; gap: 10px; align-items: stretch; margin-top: 6px; }

.qty { display: flex; align-items: center; border: 1px solid var(--ink); }
.qty button { border: 0; background: none; width: 36px; height: 100%; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.qty button:hover { background: var(--paper); }
.qty output { min-width: 32px; text-align: center; font-family: var(--en); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.pd-buy .btn { flex: 1; padding: 12px 18px; }

/* ---------- カートドロワー ---------- */
.cart-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(420px, 100vw); height: 100dvh; max-height: 100dvh;
  border-width: 0 0 0 1px; box-shadow: -12px 0 40px rgba(86, 82, 82, 0.2);
  display: flex; flex-direction: column;
}
.cart-drawer:not([open]) { display: none; }
.cd-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.cd-head h2 { font-family: var(--en); font-weight: 600; font-size: 16px; letter-spacing: 0.2em; }
.cd-head h2 small { display: block; font-family: var(--ja); font-weight: 600; font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-soft); }
html:lang(th) .cd-head h2 small { font-family: var(--th); }
.cd-meter { padding: 0 20px 14px; border-bottom: 1px solid var(--hairline-soft); }
.meter-label { font-size: 11.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.meter-label span:first-child { font-family: var(--en); font-size: 10px; letter-spacing: 0.22em; color: var(--ink-soft); }
html:lang(ja) .meter-label span:first-child, html:lang(th) .meter-label span:first-child { font-family: inherit; letter-spacing: 0.08em; font-size: 11px; }
.meter-track { height: 6px; background: var(--paper); margin-top: 8px; overflow: hidden; border: 1px solid var(--hairline-soft); }
.meter-fill { height: 100%; background: var(--ink); transition: width 400ms var(--ease); }
.meter-earned { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--ink-soft); align-items: center; }
.ticket { font-size: 10.5px; font-weight: 600; color: var(--ink); border: 1px dashed var(--ink); padding: 1px 8px; }
.cd-list { list-style: none; flex: 1; overflow-y: auto; padding: 12px 20px; display: grid; gap: 14px; align-content: start; }
.cd-empty { color: var(--ink-soft); text-align: center; padding: 36px 0; font-size: 13px; }
.cd-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.cd-item img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--hairline-soft); }
.cd-item-name { font-size: 12px; font-weight: 600; line-height: 1.5; }
.cd-item-variant { font-size: 11px; color: var(--ink-soft); }
.cd-item-variant b { color: var(--ink); font-family: var(--en); font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-item-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cd-item-row .qty { transform: scale(0.9); transform-origin: left; }
.cd-remove { border: 0; background: none; color: var(--ink-soft); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; padding: 2px; cursor: pointer; }
.cd-remove:hover { color: var(--ink); }
.cd-foot { border-top: 1px solid var(--hairline-soft); padding: 16px 20px 18px; }
.cd-total { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 13px; }
.cd-total strong { font-family: var(--en); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-total-note { font-size: 11px; color: var(--ink-soft); font-weight: 500; }
.cd-foot .btn { display: block; width: 100%; margin-top: 10px; padding: 13px; }
.cd-note { font-size: 10.5px; color: var(--ink-soft); text-align: center; margin-top: 8px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 960px) {
  .oshi-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-group { grid-template-columns: 1fr; gap: 6px; }
  .filter-label { padding-top: 0; }
  .bonus-rows li { grid-template-columns: 1fr; gap: 6px; }
  .guide-list > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 640px) {
  .pd-body { grid-template-columns: 1fr; }
  .pd-media { padding: 18px 18px 0; }
  .pd-info { padding: 16px 18px 22px; }
}
@media (max-width: 430px) {
  .oshi-picker { gap: 8px; }
  .oshi-tile { padding: 14px 6px 12px; gap: 8px; }
  .oshi-tile-face { width: 60px; }
  .oshi-tile-name { font-size: 13.5px; }
  .chips { gap: 6px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .chip-face { padding: 3px 10px 3px 3px; }
  .chip-face img { width: 26px; height: 26px; }
  .pd-buy { flex-wrap: wrap; }
  .pd-buy .btn { flex-basis: 100%; }
}

/* ---------- 売り切れ（shopify.js が Shopify の在庫から付ける） ---------- */
.pd-variant.is-soldout, .pd-photo.is-soldout { color: var(--ink-soft); }
.pd-variant.is-soldout { text-decoration: line-through; }
.pd-photo.is-soldout img { opacity: 0.45; filter: grayscale(1); }
.pd-soldout-tag { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-soft); }
.pd-buy .btn:disabled { opacity: 0.4; cursor: default; }
.pd-buy .btn:disabled:hover { background: var(--ink); color: var(--paper); }
.cd-item.is-soldout img { opacity: 0.45; filter: grayscale(1); }
.cd-item-soldout { font-size: 11px; font-weight: 600; color: var(--ink); margin-top: 2px; }

/* ---------- 宛名・ニックネーム欄（goods-data.js の nickname がある商品だけ） ---------- */
.pd-nickname { display: grid; gap: 6px; margin-top: 4px; }
.pd-nickname label { font-size: 12px; font-weight: 600; }
.pd-nickname label small { font-weight: 500; color: var(--ink-soft); }
.pd-nickname input {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--ink-soft); border-radius: 0;
}
.pd-nickname input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.pd-nickname input[aria-invalid="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pd-nickname-error { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.cd-item-nickname { font-size: 11px; color: var(--ink); margin-top: 2px; word-break: break-all; }
.cd-alert { font-size: 12px; font-weight: 600; line-height: 1.6; color: var(--ink); margin-top: 10px; padding: 8px 10px; border: 1px solid var(--ink); }
.cd-alert[hidden] { display: none; }
#btn-checkout:not([href]) { cursor: pointer; }

