/* ==========================================================================
   product.css — hanya gaya khusus Product Detail.
   Token, tombol, .filter, .stock, .card, .reveal/.enter dipakai ulang dari
   theme.css + style.css. Daftar isi:
   1. Halaman & breadcrumb
   2. Media (stage, slider, thumbnail)
   3. Panel pembelian
   4. Seksi (deskripsi, spesifikasi, ulasan)
   5. Lightbox & state kosong
   6. Responsif
   ========================================================================== */

/* 1. Halaman & breadcrumb
   -------------------------------------------------------------------------- */
.pd {
  padding: calc(var(--header-h) + 22px) 0 clamp(56px, 8vw, 96px);
}

.pd-crumb ol {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.pd-crumb li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.pd-crumb li + li::before {
  content: "/";
  margin: 0 .7em;
  color: var(--dim);
}

.pd-crumb a {
  text-decoration: none;
  transition: color .2s;
}

.pd-crumb a:hover {
  color: var(--purple-text);
}

.pd-crumb [aria-current] {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Media kiri + panel kanan: SATU baris di desktop */
.pd-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 29vw, 400px);
  gap: clamp(20px, 2.4vw, 32px);
  align-items: start;
}

/* Fokus keyboard */
.pd-stage:focus-visible,
.pd-nav:focus-visible,
.pd-thumb:focus-visible,
.pd-play:focus-visible,
.pd-share:focus-visible,
.pd-trust:focus-visible,
.pd-shot:focus-visible,
.pd-close:focus-visible,
.pd-crumb a:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}


/* 2. Media
   -------------------------------------------------------------------------- */
.pd-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0818;
  box-shadow: 0 30px 60px -34px #000, 0 0 70px -40px rgba(139, 92, 246, .5);
}

.pd-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}

.pd-slide.is-out {
  opacity: 0;
  transform: scale(1.015);
}

/* Latar buram: salinan gambar/poster yang sama (var --bd diisi product.js). Hanya terlihat bila gambar tampil utuh (contain);
   gambar yang diisi penuh (cover) menutupinya. Ini yang menggantikan bar kosong di sisi gambar. */
.pd-slide::before,
.pd-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bd, none) center / cover no-repeat;
  filter: blur(26px) brightness(.55) saturate(1.25);
  transform: scale(1.2);
  pointer-events: none;
}

.pd-thumb::before {
  filter: blur(10px) brightness(.6) saturate(1.2);
}

.pd-slide > img,
.pd-slide > video,
.pd-art,
.pd-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Panggung 16:9 tetap; media menyesuaikan di dalamnya tanpa mengubah rasio aslinya.
   Default = contain (utuh, tidak ada yang terpotong, tidak gepeng). product.js menandai data-fit="cover" hanya untuk gambar
   yang rasionya mendekati 16:9 (selisih <= 8%), supaya screenshot Steam 1920x1080 memenuhi panggung tanpa bar. */
.pd-slide > img:not(.pd-vframe),
.pd-thumb img:not(.pd-vframe) {
  position: relative;   /* di atas latar buram (bukan untuk .pd-vframe: itu harus absolute menutupi artwork) */
  object-fit: contain;
  object-position: center;
}

.pd-slide > img[data-fit="cover"],
.pd-thumb img[data-fit="cover"],
.pd-shot img {
  object-fit: cover;
}

.pd-slide > video:not(.pd-vframe) {
  position: relative;
  object-fit: contain;   /* trailer 16:9 memenuhi panggung; rasio lain tetap utuh, kontrol tetap bisa dipakai */
  background: #000;
}

/* Frame pratinjau trailer (tampil di atas artwork, di bawah tombol putar). Tidak menangkap klik: tombol putar/thumbnail tetap yang bekerja. */
.pd-vframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

.pd-thumb .pd-vframe {
  object-fit: cover;
}

.pd-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(22, 14, 44, .5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s;
}

.pd-play:hover {
  background: rgba(139, 92, 246, .7);
  transform: scale(1.06);
}

.pd-play:active {
  transform: scale(.97);
}

.pd-note {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(8, 8, 8, .6);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.pd-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: var(--on-purple);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s var(--ease);
}

.pd-nav:hover {
  background: var(--purple);
}

.pd-nav:active {
  transform: scale(.94);
}

.pd-nav--prev { left: 12px; }
.pd-nav--next { right: 12px; }

.pd-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(8, 8, 8, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pd-thumbs {
  position: relative;
  display: flex;
  gap: 10px;
  margin: 12px -3px 0;
  padding: 3px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, .35) transparent;
}

.pd-thumb {
  position: relative;
  flex: 0 0 auto;
  width: clamp(104px, 10.4vw, 140px);
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0818;
  opacity: .62;
  cursor: pointer;
  scroll-snap-align: start;
  transition: opacity .25s, border-color .25s, box-shadow .25s;
}

.pd-thumb:hover {
  opacity: .9;
}

.pd-thumb.on {
  opacity: 1;
  border-color: var(--purple);
  box-shadow: 0 0 0 1px var(--purple), 0 0 18px -6px var(--purple-glow);
}

.pd-thumb img,
.pd-thumb video {
  display: block;
  width: 100%;
  height: 100%;
}

.pd-thumb__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 14, .3);
  color: #fff;
}

.pd-thumb__play svg {
  box-sizing: content-box;
  width: 14px;
  height: 14px;
  padding: 7px 7px 7px 9px;   /* segitiga play terlihat sedikit ke kanan agar optik di tengah */
  border-radius: 50%;
  background: rgba(8, 6, 14, .62);
  border: 1px solid rgba(255, 255, 255, .55);
}


/* 3. Panel pembelian
   -------------------------------------------------------------------------- */
.pd-buy {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
  box-shadow: 0 18px 40px -24px var(--shadow);
}

.pd-title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.pd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.pd-meta > span + span {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.pd-meta b {
  color: var(--ink);
  font-weight: 600;
}

.pd-star {
  color: var(--warn);
}

.pd-price {
  margin-top: 20px;
}

.pd-price__old {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dim);
}

.pd-off {
  padding: 2px 8px;
  border: 1px solid rgba(167, 139, 250, .4);
  border-radius: 6px;
  background: var(--purple-soft);
  color: var(--purple-text);
  font-size: 12px;
  font-weight: 600;
}

.pd-price__now {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -.03em;
}

.pd-buy .stock {
  margin-top: 10px;
}

.pd-payrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.pd-payrow b {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.pd-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.pd-actions .btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
}

.pd-actions .btn:active {
  transform: scale(.985);
}

.pd-actions .btn:disabled {
  opacity: .4;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* Tombol sekunder: permukaan lavender lembut (varian dari .buy-btn) */
.btn--soft {
  color: var(--purple-text);
  border: 1px solid rgba(167, 139, 250, .35);
  background: var(--purple-soft);
}

.btn--soft:hover {
  border-color: rgba(167, 139, 250, .7);
  background: rgba(167, 139, 250, .2);
}

.btn:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

.pd-share {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: 13px Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: color .2s;
}

.pd-share:hover {
  color: var(--purple-text);
}

.pd-trust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .25s, background .25s;
}

.pd-trust:hover {
  border-color: rgba(167, 139, 250, .45);
  background: var(--purple-soft);
}

.pd-trust b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.pd-trust small {
  color: var(--muted);
  font-size: 13px;
}

.pd-trust svg {
  flex: none;
  color: var(--dim);
}

.pd-methods {
  display: flex;
  flex-wrap: wrap;
  margin: 20px -22px -22px;
  padding: 13px 22px;
  list-style: none;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.pd-methods li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.pd-methods li + li {
  border-left: 1px solid var(--line);
}

.pd-methods svg {
  flex: none;
}

.pd-store-logo {
  flex: none;
  display: block;
  width: auto;
  height: 16px;
  max-width: 44px;
  object-fit: contain;
  border-radius: 4px;
}


/* 4. Seksi
   -------------------------------------------------------------------------- */
.pd-section {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  margin-top: clamp(36px, 5vw, 64px);
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}

.pd-section--wide {
  grid-template-columns: 1fr;
}

.pd-section h2 {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
  font-size: clamp(20px, 1.9vw, 26px);
  letter-spacing: -.02em;
}

.pd-section--wide h2 {
  position: static;
}

.pd-prose {
  display: grid;
  gap: 1em;
  max-width: 62ch;
  color: rgba(244, 242, 236, .78);
}

/* Spesifikasi */
.pd-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.spec {
  padding: 18px 20px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
}

.spec--rec {
  border-color: rgba(167, 139, 250, .3);
  background: linear-gradient(180deg, rgba(167, 139, 250, .08), rgba(167, 139, 250, .02));
}

.spec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.spec--rec h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
}

.spec dl {
  margin: 0;
}

.spec dl > div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.spec dt {
  font-size: 12.5px;
  color: var(--muted);
}

.spec dd {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.pd-source {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--dim);
}

/* Rating & ulasan */
.stars {
  color: var(--warn);
  font-size: 14px;
  letter-spacing: .1em;
  line-height: 1;
}

.stars span {
  color: rgba(255, 255, 255, .18);
}

.rsum {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  max-width: 640px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.rsum__score b {
  display: block;
  font-weight: 500;
  font-size: clamp(48px, 5vw, 64px);
  letter-spacing: -.04em;
  line-height: 1;
}

.rsum__score .stars {
  display: block;
  margin-top: 10px;
}

.rsum__score small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dist {
  display: grid;
  gap: 7px;
}

.dist > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.dist i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
}

.dist b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--purple));
}

.dist > div > span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.review {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  animation: pd-fade .45s var(--ease) both;
}

@keyframes pd-fade {
  from { opacity: 0; }
}

.review__av {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(167, 139, 250, .3);
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple-text);
  font-weight: 600;
}

.review header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.review header b {
  font-weight: 600;
}

.review time,
.review small {
  color: var(--dim);
  font-size: 12.5px;
}

.review .stars {
  display: block;
  margin: 6px 0 8px;
}

.review p {
  max-width: 62ch;
  color: rgba(244, 242, 236, .82);
}

.review small {
  display: block;
  margin-top: 10px;
}

.review__imgs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pd-shot {
  width: 96px;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0818;
  cursor: zoom-in;
  transition: border-color .25s, transform .3s var(--ease);
}

.pd-shot:hover {
  border-color: rgba(167, 139, 250, .6);
  transform: scale(1.03);
}

.pd-shot img {
  display: block;
  width: 100%;
  height: 100%;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pager .filter:disabled {
  opacity: .4;
  cursor: not-allowed;
}


/* 5. Lightbox & state kosong
   -------------------------------------------------------------------------- */
.pd-lightbox {
  width: min(92vw, 880px);
  max-width: none;
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0;
  transform: scale(.97);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.pd-lightbox.is-in {
  opacity: 1;
  transform: none;
}

.pd-lightbox::backdrop {
  background: rgba(7, 6, 12, .86);
}

.pd-lightbox__img {
  aspect-ratio: 3 / 2;
  max-height: 82vh;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0818;
}

.pd-lightbox__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pd-close {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: var(--on-purple);
  cursor: pointer;
  transition: background .2s;
}

.pd-close:hover {
  background: var(--purple);
}

.pd-empty {
  max-width: 520px;
  margin: clamp(40px, 12vh, 120px) auto;
  text-align: center;
}

.pd-empty p {
  margin: 12px 0 24px;
  color: var(--muted);
}


/* 6. Responsif
   -------------------------------------------------------------------------- */
/* Di bawah 860px media dan panel tidak lagi muat berdampingan: tumpuk */
@media (max-width: 860px) {
  .pd-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .pd-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .pd-section h2 {
    position: static;
  }
}

@media (max-width: 560px) {
  .pd-nav {
    width: 34px;
    height: 34px;
    margin-top: -17px;
  }

  .pd-thumb {
    width: 96px;
  }

  .pd-buy {
    padding: 18px;
  }

  .pd-methods {
    margin: 18px -18px -18px;
    padding: 12px 18px;
  }

  .rsum {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Teks 'Tentang Produk' dari Admin: hormati baris baru */
.pd-prose p { white-space: pre-line; }

/* Ajakan menulis ulasan di Product Detail (form ada di halaman Rating) */
.pd-reviewcta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 24px;
}

.pd-reviewcta a:not(.btn) {
  color: var(--muted);
  font-size: 14px;
}

.pd-reviewcta a:not(.btn):hover {
  color: var(--purple-text);
}


/* Skeleton ringan: hanya tampil sementara data belum ada (Detail Product terbuka dulu, data melengkapi setelahnya)
   -------------------------------------------------------------------------- */
.pd-skel {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(167, 139, 250, .12) 50%, rgba(255, 255, 255, .04) 75%);
  background-size: 200% 100%;
  animation: pd-skel 1.3s linear infinite;
}

.pd-skel--fill { position: absolute; inset: 0; border-radius: 0; }
.pd-skel--title { height: 30px; width: 78%; margin-bottom: 14px; }
.pd-skel--line { height: 14px; width: 100%; margin: 0 0 12px; }
.pd-skel--short { width: 55%; }
.pd-skel--price { height: 34px; width: 46%; margin: 18px 0; }
.pd-skel--btn { height: 46px; width: 100%; margin-bottom: 10px; border-radius: 999px; }
.pd-buy > .pd-skel--line { width: 40%; }

@keyframes pd-skel {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-skel { animation: none; }
}
