.swatch-clickable {
  cursor: pointer;
}

.swatch-clickable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.swatch-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.swatch-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.swatch-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 14, 0.82);
  backdrop-filter: blur(4px);
}

.swatch-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  width: 100%;
  max-width: 720px;
  max-height: min(88vh, 640px);
  background: var(--cream);
  border: 1px solid rgba(200, 160, 96, 0.35);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.swatch-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(26, 48, 33, 0.08);
  color: var(--g2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.swatch-modal-close:hover {
  background: rgba(26, 48, 33, 0.14);
}

.swatch-modal-visual {
  min-height: 280px;
  background: var(--g1);
  background-size: cover;
  background-position: center;
}

.swatch-modal-body {
  padding: 32px 28px 28px;
  overflow-y: auto;
}

.swatch-modal-meta {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.swatch-modal-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--g2);
  margin: 0 0 16px;
  line-height: 1.45;
  padding-right: 28px;
}

.swatch-modal-desc {
  font-size: 14px;
  line-height: 1.95;
  color: var(--muted);
  font-weight: 300;
  white-space: pre-wrap;
}

.swatch-modal-desc.is-empty {
  color: rgba(106, 106, 106, 0.75);
  font-style: italic;
}

.swatch-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(26, 48, 33, 0.08);
}

.swatch-modal-btn {
  display: inline-block;
  padding: 11px 20px;
  font-size: 12px;
  letter-spacing: 2px;
  text-decoration: none;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.swatch-modal-btn-outline {
  border: 1px solid var(--g3);
  color: var(--g2);
}

.swatch-modal-btn-outline:hover {
  background: rgba(26, 48, 33, 0.06);
}

.swatch-modal-btn-primary {
  background: var(--g2);
  color: var(--cream);
}

.swatch-modal-btn-primary:hover {
  background: var(--g3);
}

@media (max-width: 640px) {
  .swatch-modal-panel {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }

  .swatch-modal-visual {
    min-height: 200px;
    max-height: 220px;
  }

  .swatch-modal-body {
    padding: 24px 20px 20px;
  }

  .swatch-modal-title {
    font-size: 18px;
  }
}

/* ===== 色卡放大檢視（2026-10 新增，附加於 swatch-modal.css 檔尾） ===== */

/* 彈窗左側：完整顯示，不裁切 */
.swatch-modal-visual.swatch-zoomable {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #ece8df;
  cursor: zoom-in;
}
.swatch-modal-visual.is-magnifying {
  background-color: #ece8df;
  cursor: crosshair;
}

/* 全螢幕大圖 */
.swatch-lightbox {
  position: fixed; inset: 0; z-index: 10000;
  display: none; flex-direction: column;
  background: rgba(20, 24, 20, .94);
}
.swatch-lightbox.is-open { display: flex; }
.swatch-lightbox-stage {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 3vh 3vw 0;
  touch-action: pinch-zoom;
}
.swatch-lightbox-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; cursor: zoom-in;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  user-select: none; -webkit-user-drag: none;
}
/* 原始尺寸：可捲動、拖曳 */
.swatch-lightbox.is-actual .swatch-lightbox-stage {
  display: block; overflow: auto; padding: 0; cursor: grab;
}
.swatch-lightbox.is-actual .swatch-lightbox-stage img {
  max-width: none; max-height: none; cursor: zoom-out; box-shadow: none;
}
.swatch-lightbox-caption {
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; justify-content: center;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  color: #f3efe6; font-size: 15px; letter-spacing: .05em;
}
.swatch-lightbox-hint { font-size: 12px; color: #c9b98f; }
.swatch-lightbox-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 28px; line-height: 44px; cursor: pointer;
}
.swatch-lightbox-close:hover { background: rgba(255,255,255,.25); }