/* =============================================================
   MARS×3D — product.css
   Product detail overlay: media, info, variant selectors
   ============================================================= */

/* ---------- Overlay shell ---------- */
.product-view {
  position: fixed; inset: 0; z-index: 70;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}
.product-view.is-open {
  opacity: 1;
  pointer-events: auto;
}
.product-view__panel {
  min-height: 100%;
  position: relative;
  padding: 6rem var(--pad) 4rem;
}
.product-view__close {
  position: fixed; top: 1.5rem; right: var(--pad);
  z-index: 5;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.product-view__close:hover {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

/* ---------- Layout ---------- */
.product-view__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  max-width: var(--max);
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 880px) {
  .product-view__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .product-view__panel { padding-top: 5rem; }
}

/* ---------- Media (left) ---------- */
.pv-media {
  position: sticky;
  top: 6rem;
  display: grid;
  gap: 1rem;
}
@media (max-width: 880px) {
  .pv-media { position: static; top: auto; }
}
/* Thumbnail strip */
.pv-thumbs {
  display: flex;
  gap: 0.5rem;
}
.pv-thumb {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.25s var(--ease);
  padding: 0;
}
.pv-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.pv-thumb:hover { border-color: var(--line-strong); }
.pv-thumb.is-active { border-color: var(--ink); }

.pv-media__main {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
  border-radius: 6px;
  overflow: hidden;
  transition: opacity 0.4s var(--ease);
}
.pv-media__main svg,
.pv-media__main img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.pv-media__main img { object-fit: cover; }
.pv-media__main.is-changing { opacity: 0.5; }
.pv-media__meta {
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Info (right) ---------- */
.pv-info {
  display: grid;
  gap: 2rem;
  align-content: start;
  padding-top: 1rem;
}
.pv-info__head {
  display: grid;
  gap: 0.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.75rem;
}
.pv-info__category {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.pv-info__title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.pv-info__title em {
  font-style: italic;
  display: block;
  color: var(--ink-soft);
  font-size: 0.42em;
  line-height: 1;
  margin-top: 0.6rem;
}
.pv-info__price {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-style: italic;
  color: var(--accent);
}
.pv-info__desc {
  color: var(--ink-soft);
  max-width: 50ch;
  line-height: 1.7;
}

/* ---------- Variant blocks ---------- */
.pv-variant { display: grid; gap: 0.85rem; }
.pv-variant__head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.pv-variant__label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft);
}
.pv-variant__value {
  font-size: 14px;
  font-style: italic;
  font-family: var(--serif);
}
.pv-variant__list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Color swatch */
.pv-swatch {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: transform 0.3s var(--ease);
  padding: 0;
}
.pv-swatch::after {
  content: ''; position: absolute; inset: -5px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: border-color 0.3s var(--ease);
}
.pv-swatch:hover { transform: scale(1.06); }
.pv-swatch.is-active::after { border-color: var(--ink); }
.pv-swatch--split { border: none; box-shadow: 0 0 0 1.5px var(--ink) inset, 0 0 0 3px var(--bg), 0 0 0 4.5px var(--line-strong); }
.pv-swatch--split::after { display: none; }

/* Material chip */
.pv-material {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pv-material:hover { border-color: var(--ink); }
.pv-material.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pv-material small {
  margin-left: 0.5rem;
  color: var(--ink-faint);
  font-size: 0.85em;
}
.pv-material.is-active small { color: var(--accent-soft); }

/* Quantity */
.pv-qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: max-content;
  overflow: hidden;
}
.pv-qty button {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 18px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pv-qty button:hover { background: var(--ink); color: var(--bg); }
.pv-qty span {
  padding: 0 1rem;
  font-variant-numeric: tabular-nums;
  min-width: 3ch; text-align: center;
  font-size: 14px;
}

/* Specs */
.pv-specs {
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: grid;
  font-size: 13px;
}
.pv-specs__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line);
}
.pv-specs__row:last-child { border-bottom: none; }
.pv-specs__row dt { color: var(--ink-soft); }
.pv-specs__row dd {
  font-style: italic;
  font-family: var(--serif);
  font-size: 1rem;
}

/* Body lock when product open */
body.is-product-open { overflow: hidden; }
