/* ============================================================
 * Colourest — design.css  (カラーデザインページ)
 * 白基調・薄グレー枠・パステル不使用
 * ============================================================ */

:root {
  --clr-bg: #ffffff;
  --clr-bd: #e5e3de;
  --clr-bd2: #d4d1ca;
  --clr-tx: #1a1916;
  --clr-tx2: #5a5750;
  --clr-tx3: #9a9590;
  --clr-ac: #1a1916;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--clr-bg);
  color: var(--clr-tx);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 14px;
}

/* ---------- header ---------- */


.clr-header-note {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--clr-tx3);
}

/* ---------- layout ---------- */

.clr-main {
  display: flex;
  height: calc(100vh - 57px);
}

.clr-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

#clr-stage {
  position: absolute;
  inset: 0;
}

#clr-stage canvas { display: block; }

#clr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-bg);
  color: var(--clr-tx3);
  font-size: 12px;
  letter-spacing: .25em;
  transition: opacity .5s;
  pointer-events: none;
}

#clr-loading.is-done { opacity: 0; }

.clr-stage-hint {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-size: 11px;
  color: var(--clr-tx3);
  letter-spacing: .08em;
  pointer-events: none;
}

/* ---------- panel ---------- */

#clr-panel {
  flex: 0 0 340px;
  overflow-y: auto;
  border-left: 1px solid var(--clr-bd);
  padding: 20px 20px 40px;
}

.clr-sec { margin-bottom: 28px; }

.clr-sec-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--clr-tx2);
  border-bottom: 1px solid var(--clr-bd);
  padding-bottom: 8px;
}

/* 地金 */

.clr-metal-row { display: flex; gap: 8px; }

.clr-metal-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  background: #fff;
  border: 1px solid var(--clr-bd);
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
  color: var(--clr-tx2);
  transition: border-color .15s;
}

.clr-metal-btn:hover { border-color: var(--clr-bd2); }
.clr-metal-btn.is-active { border-color: var(--clr-tx); color: var(--clr-tx); }

.clr-metal-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--clr-bd);
}

/* 宝石 */

.clr-gem-bulk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 12px;
  border-bottom: 1px dashed var(--clr-bd);
  margin-bottom: 8px;
}

.clr-row-label { font-size: 11px; color: var(--clr-tx3); letter-spacing: .15em; }

.clr-gem-swatches { display: flex; gap: 6px; }

.clr-gem-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--clr-bd2);
  cursor: pointer;
  padding: 0;
  transition: transform .1s;
}

.clr-gem-swatch:hover { transform: scale(1.12); }
.clr-gem-swatch.is-active { outline: 2px solid var(--clr-tx); outline-offset: 1px; }

/* zone rows (gem + resin 共通) */

.clr-zone-list { display: flex; flex-direction: column; }

.clr-zone-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--clr-bd);
  border-left: 2px solid transparent;
}

.clr-zone-row.is-selected {
  border-left-color: var(--clr-tx);
  background: #faf9f7;
}

.clr-zone-label {
  flex: 0 0 58px;
  padding: 4px 0;
  background: none;
  border: none;
  text-align: left;
  font-size: 12px;
  color: var(--clr-tx2);
  cursor: pointer;
  letter-spacing: .05em;
}

.clr-zone-label:hover { color: var(--clr-tx); }

/* 樹脂 tools */

.clr-resin-tools { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.clr-resin-picker {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--clr-bd2);
  border-radius: 2px;
  background: none;
  cursor: pointer;
}

.clr-resin-swatches { display: flex; gap: 4px; flex-wrap: wrap; max-width: 200px; }

.clr-resin-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--clr-bd2);
  cursor: pointer;
  padding: 0;
  transition: transform .1s;
}

.clr-resin-swatch:hover { transform: scale(1.2); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .clr-main { flex-direction: column; height: auto; }
  .clr-stage-wrap { height: 58vh; }
  #clr-panel { flex: none; width: 100%; border-left: none; border-top: 1px solid var(--clr-bd); }
}

/* ---------- price section (STEP3-B) ---------- */

.clr-price-sec {
  border-bottom: 2px solid var(--clr-bd, #e0ddd6);
  padding-bottom: 14px;
}

.clr-alloy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.clr-alloy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--clr-bd, #e0ddd6);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}

.clr-alloy-btn:hover { border-color: var(--clr-ac, #2b5fd4); }

.clr-alloy-btn.is-active {
  border-color: var(--clr-ac, #2b5fd4);
  box-shadow: 0 0 0 1px var(--clr-ac, #2b5fd4) inset;
}

.clr-alloy-name { font-size: .82rem; font-weight: 600; }

.clr-alloy-price { font-size: .74rem; color: #6a675f; }

.clr-price-display { margin-top: 12px; }

.clr-price-big {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.clr-price-note {
  margin-top: 3px;
  font-size: .72rem;
  color: #9a9590;
}

/* ---------- selection-driven UI (STEP3-C) ---------- */

.clr-sel-row { margin-top: 8px; }

.clr-sel-label { min-width: 86px; }

.clr-sel-hint {
  margin-top: 8px;
  font-size: .72rem;
  color: #9a9590;
}

.clr-resin-sel {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.clr-resin-picker:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* ---------- gem name labels ---------- */

.clr-gem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.clr-gem-name {
  font-size: .62rem;
  color: #9a9590;
  line-height: 1;
}

/* ---------- resin commit button ---------- */

.clr-resin-commit {
  margin-top: 8px;
  padding: 6px 16px;
  background: #E9D9A8;           /* 薄い金色 */
  color: #5a4a1e;
  border: 1px solid #D9C382;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  animation: clr-commit-pulse 2s ease-in-out infinite;
}

@keyframes clr-commit-pulse {
  0%   { background: #FDFCF8; border-color: #EFE9D8; }
  50%  { background: #EBDCA9; border-color: #DCC98A; }
  100% { background: #FDFCF8; border-color: #EFE9D8; }
}

.clr-resin-commit:disabled {
  background: #e4e2dd;           /* 薄いグレー固定 */
  color: #a5a29b;
  border-color: #d5d2cb;
  cursor: not-allowed;
  animation: none;
}

/* ---------- gem item fixed grid (v10) ---------- */

.clr-gem-swatches {
  display: flex;
  gap: 2px;
  align-items: flex-start;
}

.clr-gem-swatches .clr-gem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 58px;
  width: 58px;
  min-width: 58px;
}

.clr-gem-swatches .clr-gem-name {
  font-size: .58rem;
  white-space: nowrap;
  line-height: 1;
  color: #9a9590;
}

/* ---------- vertical selection label (v11) ---------- */

.clr-sel-label-v {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 52px;
  max-width: 64px;
}

.clr-sel-label-v .clr-sel-cap {
  font-size: .72rem;
}

.clr-sel-label-v .clr-sel-val {
  font-size: .68rem;
  color: #5a5750;
  line-height: 1.3;
  word-break: break-all;
}

/* ---------- gem label align (v12) ---------- */

.clr-gem-bulk > .clr-row-label {
  flex: 0 0 64px;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  box-sizing: border-box;
}

/* ---------- resin label align (v13) ---------- */

.clr-resin-sel > .clr-row-label {
  flex: 0 0 64px;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  box-sizing: border-box;
}

/* ---------- inlay info tooltip + selection number (v14) ---------- */

.clr-info-btn {
  margin-left: 6px;
  padding: 0;
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  color: #2b5fd4;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.clr-info-tip {
  margin: 6px 0 4px;
  padding: 10px 12px;
  background: #f9f8f5;
  border: 1px solid #e0ddd6;
  border-radius: 8px;
  font-size: .74rem;
  line-height: 1.7;
  color: #5a5750;
}

.clr-sel-val.is-num {
  color: #b06068;          /* 薄いエンジ */
  font-size: .95rem;
  font-weight: 700;
}

/* ---------- gem bulk disabled (v15) ---------- */

.clr-gem-swatches.is-disabled {
  opacity: .3;
  filter: grayscale(.4);
}

.clr-gem-swatch:disabled {
  cursor: not-allowed;
}

/* ---------- mobile sticky viewer (v17) ---------- */

@media (max-width: 900px) {
  .clr-stage-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
  }
}

/* ---------- alloy tint + price caption + metal disabled (v20) ---------- */

.clr-alloy-btn.tint-yg { background: #FBF3DC; }
.clr-alloy-btn.tint-pg { background: #FBE9E2; }
.clr-alloy-btn.tint-wg { background: #F2F3F4; }
.clr-alloy-btn.tint-pt { background: #EDF0F2; }

.clr-price-cap {
  font-size: .72rem;
  color: #9a9590;
  margin-bottom: 2px;
}

.clr-metal-btn.is-disabled,
.clr-metal-btn:disabled {
  opacity: .3;
  filter: grayscale(.4);
  cursor: not-allowed;
}

/* ---------- alloy colour chip (v21) ---------- */

.clr-alloy-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.clr-alloy-chip {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.08);
  flex: 0 0 auto;
}

/* v20の淡色背景は廃止(白ベースに戻す) */
.clr-alloy-btn.tint-yg,
.clr-alloy-btn.tint-pg,
.clr-alloy-btn.tint-wg,
.clr-alloy-btn.tint-pt { background: #fff; }

/* ---------- compact labels and metal buttons (v22) ---------- */

/* ラベル幅 64px → 44px (宝石・インレイ共通、左頭揃えは維持) */
.clr-gem-bulk > .clr-row-label,
.clr-resin-sel > .clr-row-label {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}

/* 地金カラーボタンの小型化 */
.clr-metal-row {
  gap: 8px;
  justify-content: flex-start;
}

.clr-metal-btn {
  flex: 0 0 auto;
  min-width: 0;
  padding: 7px 14px;
}

.clr-metal-chip {
  width: 22px;
  height: 22px;
}

/* ---------- uniform alloy grid + tighter gem labels (v23) ---------- */

/* 素材ボタンを3列グリッドで同一サイズに */
.clr-alloy-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.clr-alloy-btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}

/* 宝石・インレイのラベルとスウォッチの距離を短縮 */
.clr-gem-bulk,
.clr-resin-sel {
  gap: 6px;
}

.clr-gem-bulk > .clr-row-label,
.clr-resin-sel > .clr-row-label {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
}

/* ── favorites ─────────────────────────── */
.clr-fav { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e6e6e6; }
.clr-fav-btn {
  width: 100%; padding: 13px 16px; background: #fff; color: #1a1916;
  border: 1px solid #1a1916; border-radius: 2px; font-size: 13px;
  letter-spacing: .06em; cursor: pointer; transition: background .18s, color .18s;
}
.clr-fav-btn:hover:not(:disabled) { background: #1a1916; color: #fff; }
.clr-fav-btn:disabled { opacity: .5; cursor: default; }
.clr-fav-note { margin-top: 8px; font-size: 11px; color: #9a9590; letter-spacing: .04em; }

.clr-modal {
  position: fixed; inset: 0; background: rgba(26,25,22,.45);
  display: none; align-items: center; justify-content: center; z-index: 900;
}
.clr-modal.is-open { display: flex; }
.clr-modal-box {
  background: #fff; border: 1px solid #e0ddd6; border-radius: 2px;
  padding: 32px 34px; max-width: 420px; width: calc(100% - 48px);
}
.clr-modal-box h3 { margin: 0 0 12px; font-size: 15px; font-weight: 500; letter-spacing: .06em; }
.clr-modal-box p { margin: 0; font-size: 13px; line-height: 1.85; color: #5a5750; }
.clr-modal-act { margin-top: 24px; display: flex; gap: 10px; }
.clr-btn-line {
  flex: 1; padding: 11px; text-align: center; text-decoration: none;
  background: #1a1916; color: #fff; font-size: 12px; letter-spacing: .06em;
}
.clr-btn-ghost {
  flex: 1; padding: 11px; background: #fff; color: #5a5750;
  border: 1px solid #e0ddd6; font-size: 12px; letter-spacing: .06em; cursor: pointer;
}
.clr-header-link { margin-left: auto; font-size: 12px; color: #5a5750; text-decoration: none; letter-spacing: .06em; }
.clr-header-link:hover { color: #1a1916; }

/* ── restore notice ────────────────────── */
.clr-restore-note { margin-bottom: 20px; padding: 13px 15px; background: #f4f7fd; border: 1px solid #d4e0f5; }
.clr-restore-note.is-warn { background: #fdf6ec; border-color: #f0dcc0; }
.clr-restore-note p { margin: 0; font-size: 11px; line-height: 1.8; color: #5a5750; letter-spacing: .02em; }
.clr-restore-note p + p { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(0,0,0,.06); color: #c07a1a; }

/* ── cart (design page) ────────────────── */
.clr-cart { margin-top: 12px; }
.clr-cart-btn { width: 100%; padding: 14px 16px; background: #1a1916; color: #fff; border: 1px solid #1a1916; border-radius: 2px; font-size: 13px; letter-spacing: .08em; cursor: pointer; transition: opacity .18s; }
.clr-cart-btn:hover:not(:disabled) { opacity: .82; }
.clr-cart-btn:disabled { opacity: .5; cursor: default; }
.clr-cart-note { margin-top: 8px; font-size: 11px; color: #9a9590; line-height: 1.7; }
.clr-cart-link { display: inline-flex; align-items: center; gap: 5px; margin-left: 18px; }
.clr-cart-badge { min-width: 17px; height: 17px; padding: 0 5px; background: #2b5fd4; color: #fff; border-radius: 9px; font-size: 10px; line-height: 17px; text-align: center; }

/* ─── 会員価格の二重表記 (S4) ─── */
.clr-price-was{
  display:block;font-size:14px;color:#a9a9a9;
  text-decoration:line-through;text-decoration-thickness:1px;
  letter-spacing:.04em;margin-bottom:2px;font-weight:400;
}
.clr-price-now{display:block}
.clr-price-member{margin-top:5px;line-height:1.6}
.clr-price-member[hidden]{display:none}
.clr-price-tag{
  display:inline-block;font-size:11px;letter-spacing:.08em;
  color:#8a7a4a;background:#faf7ef;border:1px solid #ece3cd;
  border-radius:2px;padding:2px 8px;
}
.clr-price-mlabel{font-size:11.5px;color:#8a8a8a;letter-spacing:.06em}
.clr-price-myen{font-size:14px;color:#5a5a5a;letter-spacing:.02em}
.clr-price-mnote{display:block;font-size:10.5px;color:#a9a9a9;margin-top:2px}


/* 商品名はビューア左上へ退避（ヘッダーから撤去） */
.clr-prod-name{
  position:absolute; top:10px; left:14px; z-index:5;
  font-size:11px; letter-spacing:.12em; color:#9a9590;
  pointer-events:none;
}

/* 既存レイアウトの高さ整合 */
.clr-main{ height:calc(100vh - var(--clr-hh)); }
@media (max-width:900px){
  .clr-stage-wrap{ top:var(--clr-hh); }
}
@media (max-width:860px){
  .clr-main{ height:auto; }
}


/* ══════════ マイページ サマリー（S4.5） ══════════ */
.mp-sum{ display:flex; gap:10px; margin:18px 0; }
.mp-sum-item{
  flex:1; display:flex; align-items:center; gap:8px;
  padding:14px 16px; text-decoration:none;
  background:#faf9f6; border:1px solid #ece7dc; border-radius:2px;
  color:#5a5750; transition:border-color .15s;
}
.mp-sum-item:hover{ border-color:#cfc7b6; }
.mp-sum-ico{ font-size:16px; line-height:1; }
.mp-sum-lbl{ font-size:12px; letter-spacing:.06em; }
.mp-sum-num{
  margin-left:auto; font-size:15px; color:#1a1916; font-weight:500;
  letter-spacing:.02em;
}
.mp-sum-num.is-zero{ font-size:12px; color:#9a9590; font-weight:400; }
@media (max-width:600px){
  .mp-sum{ flex-direction:column; gap:8px; }
}
