/* =========================================================
   デザインを比べる（collection.html）
   style.css を読み込んだうえで、このページだけの部品を追加します
   （ページ見出し・最後のご案内は style.css の Sub pages）
   ========================================================= */

/* ---------- Filter ---------- */
.cpage-body { padding: 0 0 160px; background: var(--paper); }
.cfilter {
  position: sticky; top: 84px; z-index: 20;
  margin: 0 calc(var(--gutter) * -1) 64px;
  padding: 28px var(--gutter) 22px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 40px;
}
.cfilter-row { grid-column: 1; display: flex; align-items: center; gap: 24px; }
.cfilter-label { flex: none; width: 84px; font-size: 12px; letter-spacing: .14em; color: var(--stone); line-height: 1.4; }
.cfilter-label small { display: block; font-size: 10px; letter-spacing: .06em; margin-top: 2px; }
.cfilter-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cfilter .chip { padding: 7px 16px; font-size: 12.5px; }
.chip:disabled { opacity: .35; cursor: default; }
.chip:disabled:hover { border-color: var(--rule); color: var(--stone); }
.cfilter-result {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: end;
  text-align: right;
  font-size: 12px; letter-spacing: .1em; color: var(--stone);
}
.cfilter-num { font-family: var(--f-num); font-weight: 500; font-size: 30px; color: var(--ink); margin-right: 6px; letter-spacing: .02em; }
.cfilter-reset {
  margin-top: 6px;
  padding: 0; border: 0; background: none;
  font-size: 12px; letter-spacing: .1em; color: var(--gold-deep);
  text-decoration: underline; text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- Grid ---------- */
.cgrid { row-gap: 80px; }
.ccard { display: flex; flex-direction: column; }
.ccard .card { flex: 1; }
.cgrid-empty { padding: 80px 0; text-align: center; color: var(--stone); font-size: 14px; }

.ctoggle {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 20px;
  padding: 9px 18px 9px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  font-size: 12px; letter-spacing: .12em; color: var(--ink);
  cursor: pointer;
  transition: border-color .3s ease, background .3s ease;
}
.ctoggle:hover { border-color: var(--ink); }
.ctoggle-box {
  position: relative;
  width: 14px; height: 14px;
  border: 1px solid currentColor;
}
.ctoggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ctoggle[aria-pressed="true"] .ctoggle-box::after {
  content: "";
  position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid currentColor; border-width: 0 1.4px 1.4px 0;
  transform: rotate(45deg);
}
.ctoggle:disabled { opacity: .35; cursor: default; }
.ctoggle:disabled:hover { border-color: var(--rule); }

/* ---------- Compare tray ---------- */
.ctray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -16px 36px -24px rgba(31, 29, 26, .4);
}
.ctray-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 32px;
}
.ctray-label { flex: none; font-size: 12px; letter-spacing: .12em; line-height: 1.6; }
.ctray-label span { display: block; color: var(--stone); font-size: 11px; }
.ctray-label b { font-family: var(--f-num); font-weight: 500; font-size: 18px; color: var(--gold-deep); margin-right: 2px; }
.ctray-list { flex: 1; display: flex; gap: 12px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ctray-item {
  position: relative;
  flex: 0 1 220px; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 34px 0 4px;
  background: var(--pearl);
  border: 1px solid var(--rule);
}
.ctray-item.is-empty { border-style: dashed; background: none; }
.ctray-item img {
  flex: none; width: 46px; height: 46px; object-fit: contain;
  background: var(--pearl);
}
.ctray-item img.is-product { mix-blend-mode: multiply; }
.ctray-name { font-family: var(--f-latin); font-size: 18px; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctray-remove {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  display: grid; place-items: center;
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer; opacity: .7;
}
.ctray-remove:hover { opacity: 1; }
.ctray-actions { flex: none; display: flex; align-items: center; gap: 20px; }
.ctray-clear {
  padding: 0; border: 0; background: none; color: var(--stone);
  font-size: 12px; letter-spacing: .1em; text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.ctray-go {
  padding: 14px 28px;
  border: 1px solid rgba(31, 29, 26, .7);
  background: transparent;
  color: var(--ink);
  font-size: 13px; font-weight: 500; letter-spacing: .14em;
  cursor: pointer;
  transition: background-color .5s var(--ease);
}
.ctray-go:hover { background-color: rgba(230, 214, 184, .4); }
.ctray-go:disabled { background: transparent; color: var(--stone); border-color: var(--rule); cursor: default; font-weight: 400; letter-spacing: .08em; }
body.has-tray .footer { padding-bottom: 120px; }

/* ---------- Compare view ---------- */
.cview {
  position: fixed; inset: 0; z-index: 95;
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity .5s ease;
}
.cview.is-open { opacity: 1; }
.cview-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 48px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.cview-title {
  margin: 56px 0 48px;
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: clamp(24px, 2.2vw, 30px);
  letter-spacing: .1em;
  line-height: 1.7;
}
.cview-table { --n: 3; }
.crow {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 32px;
  border-top: 1px solid var(--rule);
}
.crow--head { border-top: 0; }
.crow-label { padding: 20px 0; font-size: 12px; letter-spacing: .14em; color: var(--stone); line-height: 1.8; }
.crow-cells { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 32px; }
.crow-cell { padding: 20px 0; font-size: 14px; line-height: 1.9; }
.crow-cell.is-catch { font-family: var(--f-serif); font-size: 15px; letter-spacing: .08em; }
.crow--head .crow-cell { padding: 0 0 28px; }
.crow--foot .crow-cell { padding: 24px 0 0; }
.cview-media { aspect-ratio: 1; background: var(--pearl); }
.cview-media img { width: 100%; height: 100%; object-fit: contain; }
.cview-code { margin-top: 20px; font-family: var(--f-caps); font-size: 11px; letter-spacing: .26em; color: var(--gold-deep); }
.cview-name { font-family: var(--f-latin); font-weight: 400; font-size: 38px; line-height: 1.2; letter-spacing: .03em; margin-top: 6px; }
.cview-kana { font-size: 12px; letter-spacing: .14em; color: var(--stone); }
.crow-cell .nw { display: inline-block; white-space: nowrap; }
.cview-price { font-family: var(--f-num); font-weight: 500; font-size: 18px; letter-spacing: .04em; }
.cview-more {
  padding: 0 0 6px; border: 0; border-bottom: 1px solid currentColor; background: none;
  font-size: 13px; letter-spacing: .14em; color: var(--ink); cursor: pointer;
}
.cview-more::after { content: "→"; margin-left: 12px; }
.cview-more:hover { opacity: .6; }
.cview-cta { margin: 72px 0 0; padding: 0 0 96px; text-align: center; }
.cview-cta .detail-note { margin-top: 16px; }

/* =========================================================
   Tablet
   ========================================================= */
@media (max-width: 960px) {
  .cfilter { top: 72px; }
  .cview-bar { padding: 10px 12px 10px 24px; }
  .crow { grid-template-columns: 104px minmax(0, 1fr); gap: 20px; }
  .crow-cells { gap: 20px; }
}

/* =========================================================
   Smartphone
   ========================================================= */
@media (max-width: 767px) {

  /* 画面を広く使えるよう、スマホでは絞り込みを固定しない。項目は横スクロール */
  .cfilter {
    position: relative; top: auto;
    margin-bottom: 32px;
    padding: 14px 0 12px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .cfilter-row { gap: 0; }
  .cfilter-label { width: auto; padding: 0 12px 0 var(--gutter); font-size: 11px; }
  .cfilter-label small { display: none; }
  .cfilter-chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding-right: var(--gutter);
  }
  .cfilter-chips::-webkit-scrollbar { display: none; }
  .cfilter .chip { flex: none; padding: 6px 12px; font-size: 11.5px; gap: 6px; }
  .cfilter-result {
    grid-column: 1; grid-row: auto;
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0 var(--gutter);
    text-align: left;
  }
  .cfilter-num { font-size: 20px; }
  .cfilter-reset { margin: 0; }

  .cgrid { row-gap: 40px; }
  .ctoggle { align-self: stretch; justify-content: center; margin-top: 12px; padding: 8px 10px; font-size: 11px; letter-spacing: .08em; }

  .cpage-body { padding-bottom: 96px; }

  /* 選んだデザインは、サムネイルとボタンだけを1行に */
  .ctray-inner { gap: 10px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); }
  .ctray-label, .ctray-name, .ctray-clear { display: none; }
  .ctray-list { flex: none; gap: 8px; }
  .ctray-item { flex: none; width: 48px; height: 48px; padding: 0; justify-content: center; }
  .ctray-item img { width: 46px; height: 46px; }
  .ctray-remove {
    right: -8px; top: -8px; transform: none;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--paper); border: 1px solid var(--rule); opacity: 1;
  }
  .ctray-actions { margin-left: auto; }
  .ctray-go { padding: 13px 18px; font-size: 12px; letter-spacing: .08em; }
  .ctray-go:disabled { padding: 13px 0; border-color: transparent; font-size: 11px; }
  body.has-tray .footer { padding-bottom: 110px; }

  .cview-title { margin: 32px 0 28px; font-size: 20px; letter-spacing: .06em; }
  /* 項目名は行の上に置き、デザインを横に並べる */
  .crow { grid-template-columns: 1fr; gap: 0; }
  .crow-label { padding: 14px 0 0; font-size: 10.5px; }
  .crow--head .crow-label, .crow--foot .crow-label { display: none; }
  .crow-cells { gap: 12px; }
  .crow-cell { padding: 6px 0 14px; font-size: 12px; line-height: 1.8; }
  .crow-cell.is-catch { font-size: 12.5px; letter-spacing: .02em; }
  .crow--head .crow-cell { padding-bottom: 16px; }
  .cview-code { margin-top: 12px; font-size: 9px; letter-spacing: .16em; }
  .cview-name { font-size: 22px; }
  .cview-kana { font-size: 10px; letter-spacing: .06em; }
  .cview-price { font-size: 14px; }
  .cview-more { font-size: 11px; letter-spacing: .06em; }
  .cview-more::after { margin-left: 6px; }
  .cview-cta { margin-top: 40px; padding-bottom: 64px; }
  .cview-cta .btn-line { width: 100%; justify-content: center; padding: 20px 16px; font-size: 14px; }
}
