/* ============================================================
   LUNIBER — Product Detail Page Styles
   ============================================================ */

/* ---------- Page Base ---------- */
.product-page {
  background: var(--bg);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-bar {
  margin-top: var(--header-h);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--white); }
.breadcrumb span { color: var(--text-dim); }

/* ---------- Main Layout ---------- */
.product-main {
  padding: 48px 0 80px;
}
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: flex-start;
}

/* ============================================================
   3D VIEWER (pseudo-3D rotateY)
   ============================================================ */
.viewer-section {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.viewer-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---- 3D stage ---- */
.viewer-stage {
  position: relative;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  /* ダークスタジオ背景 */
  background:
    radial-gradient(ellipse 80% 70% at center 55%, #1a2050 0%, #0d1340 50%, #06081a 100%);
  touch-action: none;
}
.viewer-stage:active { cursor: grabbing; }

/* WHITE カラー時：白Tが映えるよう少し明るめのスタジオ背景 */
.viewer-stage.white-bg {
  background:
    radial-gradient(ellipse 80% 70% at center 55%, #2a3270 0%, #161d4c 50%, #0a0d24 100%);
}

/* 3D perspective scene */
.viewer-3d-scene {
  position: relative;
  width: 82%;
  height: 82%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  z-index: 2;
}

.viewer-3d-object {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  will-change: transform;
}

/* Each garment face */
.viewer-3d-object .face {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 22px 38px rgba(0,0,0,0.55));
  transform-origin: center center;
  /* JSが角度に応じて opacity を制御（重なり防止） */
  opacity: 0;
  transition: opacity 0.08s linear;
}
/* 初期状態：FRONT のみ表示 */
.face-front { opacity: 1; }

/* Front at 0°, pushed slightly forward to give body depth */
.face-front {
  transform: translate(-50%, -50%) translateZ(60px) scale(1);
}
/* Back at 180° — slightly scaled up so its shirt matches the front's size */
.face-back {
  transform: translate(-50%, -50%) rotateY(180deg) translateZ(60px) scale(1.12);
}
/* Sides at ±90° — these create the "thickness" illusion.
   Slightly narrower scale so the side reads as the garment's depth. */
.face-side-right {
  transform: translate(-50%, -50%) rotateY(90deg) scale(0.96);
}
.face-side-left {
  transform: translate(-50%, -50%) rotateY(-90deg) scale(0.96);
}

/* Soft floor shadow that flattens during rotation */
.viewer-floor-shadow {
  position: absolute;
  bottom: 6%;
  left: 50%;
  width: 56%;
  height: 5%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 72%);
  filter: blur(4px);
  z-index: 1;
  pointer-events: none;
  transition: width 0.1s linear, opacity 0.1s linear;
}
.viewer-overlay-text {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(9,12,26,0.75);
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 8px 16px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.viewer-overlay-text.hidden { opacity: 0; }

/* Controls */
.viewer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}
.viewer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all var(--transition);
  background: transparent;
}
.viewer-btn:hover {
  border-color: var(--text);
  color: var(--white);
  background: var(--bg2);
}
.viewer-btn.active {
  background: var(--accent);
  color: var(--black);
  border-color: var(--accent);
}
.viewer-btn { min-width: 100px; justify-content: center; }

/* Progress bar */
.viewer-progress {
  height: 2px;
  background: var(--border);
}
.viewer-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

.viewer-hint {
  padding: 12px 16px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  text-align: center;
}
.viewer-hint i { margin-right: 4px; }

/* ---------- Detail close-ups (胸元ロゴ / 首タグ) ---------- */
.detail-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.detail-shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.detail-shot-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 80% at center, #1a2050 0%, #0a0d24 100%);
}
.detail-shot-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.detail-shot:hover .detail-shot-img img {
  transform: scale(1.12);
}
.detail-shot figcaption {
  padding: 9px 12px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg3);
  border-top: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-shot figcaption i { margin-right: 5px; color: var(--accent, #ffe84d); }

@media (max-width: 480px) {
  .detail-shot figcaption { font-size: 9px; letter-spacing: 0; }
}

/* Thumbnail strip */
.thumb-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.thumb-item {
  aspect-ratio: 1/1;
  cursor: pointer;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  border-radius: 2px;
  background: var(--surface);
}
.thumb-item:hover { transform: translateY(-2px); }
.thumb-item:hover { border-color: var(--border-light); }
.thumb-item.active { border-color: var(--accent); }
.thumb-item canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Angle badge ---------- */
.viewer-angle-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 6;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  color: #0a0d24;
  background: var(--accent, #ffe84d);
  padding: 5px 12px;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* ---------- TAG button ---------- */
.viewer-btn-tag {
  min-width: 78px !important;
}
.viewer-btn-tag:hover {
  border-color: var(--accent, #ffe84d);
  color: var(--accent, #ffe84d);
}

/* ---------- Neck Tag Modal ---------- */
.tag-modal-overlay {
  align-items: center;
  justify-content: center;
}
.tag-modal-box {
  max-width: 560px;
  text-align: center;
}
.tag-zoom-wrap {
  margin: 18px 0 14px;
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1a2050, #06081a);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  cursor: zoom-in;
}
.tag-zoom-img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
  transform-origin: center 38%;
}
.tag-zoom-wrap:hover .tag-zoom-img {
  transform: scale(1.9);
}
@media (max-width: 600px) {
  .tag-zoom-wrap:hover .tag-zoom-img { transform: none; }
  .tag-zoom-wrap { cursor: default; }
}

/* ============================================================
   PRODUCT INFO SECTION
   ============================================================ */
.product-info-section {
  padding-top: 16px;
}
.product-info-inner { max-width: 500px; }

.product-collection-label {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.product-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.product-price-main {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 32px;
}
.price-tax-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Options */
.option-group {
  margin-bottom: 28px;
}
.option-label {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.option-value {
  color: var(--text);
  font-weight: 600;
}
.option-sub {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 10px;
}

/* Color Swatches */
.color-swatches { display: flex; gap: 12px; }
.color-swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  position: relative;
  outline-offset: 3px;
}
.swatch-black { background: #0e1020; }
.swatch-white { background: #f5f5f5; border-color: #ccc; }
.color-swatch.active.swatch-black { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.color-swatch.active.swatch-white { border-color: var(--text-muted); box-shadow: 0 0 0 1px var(--text-muted); }
.swatch-check {
  font-size: 12px;
  opacity: 0;
  transition: opacity var(--transition);
}
.swatch-black .swatch-check { color: var(--accent); }
.swatch-white .swatch-check { color: var(--black); }
.color-swatch.active .swatch-check { opacity: 1; }
.color-swatch:hover { transform: scale(1.1); }

/* Size Grid */
.size-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.size-btn {
  width: 52px; height: 52px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all var(--transition);
  border-radius: var(--radius);
}
.size-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.size-btn.active {
  background: var(--accent);
  color: var(--black);
  border-color: var(--accent);
}

.size-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.size-guide-link:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Size Display Chips（表示専用 / 選択はShopify側で） ─── */
.size-grid-display {
  gap: 8px;
}
.size-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.02);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: var(--radius);
  user-select: none;
  cursor: default;
}

/* Add to Cart Block（Shopify購入導線） */
.add-to-cart-block { margin-bottom: 24px; }

/* Shopifyへの購入ボタン */
.shopify-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
}
.shopify-buy-btn .shopify-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}
.shopify-buy-btn:hover .shopify-arrow {
  transform: translateX(4px);
}

/* Shopifyノート */
.shopify-note {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.shopify-note i { font-size: 10px; opacity: 0.7; }

/* （旧）cart-warning は使わないが念のため残す */
.cart-warning {
  color: #e87878;
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: 10px;
}

/* Product Meta */
.product-meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.product-meta-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.product-meta-list li i { color: var(--text-dim); }

/* Accordion */
.accordion-group { border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
}
.accordion-header:hover { color: var(--accent); }
.accordion-header[aria-expanded="true"] { color: var(--accent); }
.accordion-icon { font-size: 12px; transition: transform var(--transition); }
.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}
.accordion-body {
  display: none;
  padding: 0 0 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.9;
}
.accordion-body.open { display: block; }
.accordion-body ul { margin-top: 12px; padding-left: 16px; }
.accordion-body ul li {
  list-style: disc;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* 商品説明 見出し */
.product-desc-headline {
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Size Table キャプション */
.size-table-caption {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  text-align: right;
}

/* Size Table（行＝計測項目 / 列＝サイズ） */
.size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
/* thead: SIZE/XS/S/M/L/XL */
.size-table thead th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}
.size-table thead th:first-child {
  text-align: left;
}
/* tbody 行ヘッダー: 着丈/身巾/肩巾/袖丈 */
.size-table tbody th {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.size-table .size-row-en {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.size-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.size-table tbody tr:last-child th,
.size-table tbody tr:last-child td { border-bottom: none; }

.size-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0.5px;
}

/* ============================================================
   SIZE GUIDE MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9,12,26,0.92);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border-light);
  padding: 40px;
  max-width: 520px;
  width: 100%;
  position: relative;
  border-radius: var(--radius);
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 18px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.modal-close:hover { color: var(--accent); }
.modal-title { font-size: 1.2rem; font-weight: 700; letter-spacing: 2px; margin-bottom: 8px; }
.modal-sub {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.modal-table { width: 100%; }
.size-tip {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.size-tip i { margin-right: 6px; color: var(--text-dim); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .viewer-section { position: static; }
  .product-info-inner { max-width: 100%; }
  .thumb-strip { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 480px) {
  .thumb-strip { grid-template-columns: repeat(4, 1fr); }
  .size-grid { gap: 6px; }
  .size-btn { width: 46px; height: 46px; font-size: 12px; }

  /* サイズテーブルを狭い画面で詰める */
  .size-table { font-size: 11px; }
  .size-table thead th,
  .size-table tbody th,
  .size-table tbody td { padding: 10px 4px; }
  .size-table tbody th { font-size: 11px; }
  .size-table .size-row-en { font-size: 9px; }
  .modal-box { padding: 28px 20px; }
}
