/* Product detail V2: loaded only by product.php and scoped to the product page shell. */
.product-v2 {
  --product-surface: #111118;
  --product-raised: #171720;
  --product-line: rgba(255,255,255,.1);
  --product-muted: #a9a9b4;
  display: block;
  padding: 18px 0 0;
  overflow: clip;
}

.product-v2 .product-v4 {
  display: grid;
  grid-template-columns: minmax(0,1.12fr) minmax(360px,.88fr);
  grid-template-areas: "meta visual" "purchase visual";
  align-items: start;
  gap: 14px clamp(28px,4vw,70px);
  width: min(calc(100% - 44px), 1640px);
  padding: 20px 0 0;
}

.product-v2 .product-v4-visual { grid-area: visual; position: sticky; top: 112px; min-width: 0; }
.product-v2 .product-v4-topmeta { grid-area: meta; display: grid; gap: 11px; min-width: 0; align-self: end; }
.product-v2 .product-v4-purchase { grid-area: purchase; min-width: 0; max-width: none; }
.product-v2 .product-v4-topmeta .breadcrumb { margin: 0; font-size: .78rem; }
.product-v2 .product-v4-topmeta .product-v2-badges { gap: 7px; }
.product-v2 .product-v2-badges span { padding: 5px 10px; border-color: var(--product-line); background: rgba(255,255,255,.035); color: #d7d7de; font-size: .74rem; }

.product-v2 .product-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: none;
  border: 1px solid var(--product-line);
  border-radius: 22px;
  background: radial-gradient(circle at 50% 30%, rgba(var(--page-accent-rgb),.14), transparent 56%), #0b0b10;
  box-shadow: 0 24px 60px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
  overflow: hidden;
}

.product-v2 [hidden] { display: none !important; }

.product-v2 .product-gallery img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; object-position: center; }
.product-v2 .product-v4-game .product-gallery { display: flex; align-items: center; justify-content: center; justify-self: center; width: min(100%,400px); height: clamp(300px,62vh,482px); aspect-ratio: auto; min-height: 300px; padding: 16px; }
.product-v2 .product-v4-game .product-gallery img { width: auto; height: min(62vh, 450px); max-width: 100%; max-height: 100%; object-fit: contain; }
.product-v2 .product-v4-service .product-gallery { aspect-ratio: 16 / 9; max-height: 390px; }
.product-v2 .product-v4-service .product-gallery img { width: 84%; height: 80%; margin: auto; object-fit: contain; }
.product-v2 .product-visual-discount { position: absolute; z-index: 2; top: 16px; inset-inline-end: 16px; padding: 7px 11px; border-radius: 9px; background: #f97316; color: #160c05; font-size: .78rem; font-weight: 800; direction: rtl; }

.product-v2 .product-v4-purchase h1 {
  max-width: 100%;
  margin: 0 0 13px;
  color: #fff;
  font-size: clamp(2rem,3.2vw,3.35rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-v2 .product-v2-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: none;
}

.product-v2 .product-v2-price strong { color: #fff; font-size: clamp(2rem,3vw,2.7rem); font-weight: 850; line-height: 1.25; }
.product-v2 .product-v2-price del { order: 0; color: #85858f; font-size: .98rem; }
.product-v2 .product-v2-price b { padding: 3px 8px; border-radius: 7px; background: rgba(249,115,22,.14); color: #ff9854; font-size: .76rem; direction: ltr; unicode-bidi: isolate; }
.product-v2 .product-availability { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; margin: 5px 0 17px; color: #81dfa0; font-size: .86rem; font-weight: 700; }
.product-v2 .product-availability > span { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #36c66c; box-shadow: 0 0 0 4px rgba(54,198,108,.1); }

.product-v2 .product-discount-expiry { margin: -4px 0 16px; }
.product-v2 .variants {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  padding: 13px;
  border: 1px solid var(--product-line);
  border-radius: 16px;
  background: rgba(8,8,12,.3);
}

.product-v2 .variants legend { grid-column: 1 / -1; max-width: 100%; margin: 0 0 1px; color: #fff; font-weight: 800; }
.product-v2 .variants legend span { margin-inline-start: 6px; color: #ffad75; font-size: .7rem; font-weight: 600; }
.product-v2 .variants label { min-width: 0; margin: 0; cursor: pointer; }
.product-v2 .variants label > span { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 60px; height: 100%; padding: 11px 12px; border: 1px solid var(--product-line); border-radius: 12px; background: linear-gradient(145deg,var(--product-raised),#0d0d13); transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.product-v2 .variants label:hover > span { border-color: rgba(249,115,22,.45); }
.product-v2 .variants input:checked + span { border-color: #f97316; background: linear-gradient(145deg,rgba(249,115,22,.14),var(--product-raised)); box-shadow: 0 0 0 1px rgba(249,115,22,.35), 0 8px 24px rgba(0,0,0,.14); transform: translateY(-1px); }
.product-v2 .variants input:focus-visible + span { outline: 3px solid rgba(249,115,22,.55); outline-offset: 2px; }
.product-v2 .variants b { min-width: 0; color: #f2f2f4; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.product-v2 .variants small { color: #ffbd8f; font-size: .82rem; font-weight: 800; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.product-v2 .variant-check { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #f97316; color: #160c05; font-size: .75rem; line-height: 1; }

.product-v2 .product-quick-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; width: 100%; min-width: 0; margin: 0 0 15px; }
.product-v2 .quick-fact { display: grid; align-content: center; gap: 2px; min-width: 0; min-height: 66px; padding: 10px 12px; border-inline-start: 2px solid rgba(var(--page-accent-rgb),.55); border-radius: 10px; background: rgba(255,255,255,.035); }
.product-v2 .quick-fact span { color: var(--product-muted); font-size: .7rem; }
.product-v2 .quick-fact strong { min-width: 0; color: #f2f2f4; font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }

.product-v2 .product-v2-order { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "primary share" "note note" "trust trust" "status status"; align-items: center; gap: 7px 10px; margin: 0; padding: 12px 14px; border: 1px solid rgba(249,115,22,.25); border-radius: 16px; background: linear-gradient(145deg,rgba(249,115,22,.09),rgba(17,17,24,.88)); }
.product-v2 .product-v2-order > .button:first-child { grid-area: primary; width: 100%; min-height: 48px; font-size: 1rem; }
.product-v2 .product-v2-order .product-share { grid-area: share; width: auto; min-width: 104px; min-height: 42px; color: #d8d8df; }
.product-v2 .product-v2-order p { grid-area: note; margin: 0; color: var(--product-muted); font-size: .78rem; line-height: 1.5; text-align: center; }
.product-v2 .product-v2-order p[role="status"] { grid-area: status; }
.product-v2 .product-v2-order .trust-purchase-link { justify-self: center; min-height: 34px; color: #ff9d61; font-size: .78rem; }
.product-v2 .product-v2-order small[data-share-status] { grid-area: status; text-align: center; }
.product-v2 .order-trigger:disabled { opacity: .5; }

.product-v2 .product-v4-content { display: grid; gap: 14px; width: min(calc(100% - 44px),1640px); margin-inline: auto; padding-top: 22px; }
.product-v2 .product-v4-content > .container,
.product-v2 .product-v4-content .product-v3-lower,
.product-v2 .product-policy-links { width: 100%; }
.product-v2 .product-v3-lower { gap: 14px; padding-top: 0; }
.product-v2 .product-v3-module,.product-v2 .product-core-facts { border-color: var(--product-line); background: linear-gradient(145deg,rgba(23,23,32,.9),rgba(13,13,19,.92)); }
.product-v2 .product-v3-module p { overflow-wrap: anywhere; }
.product-v2 .product-policy-links { margin-inline: auto; }
.product-v2 .related-products { width: min(calc(100% - 44px),1640px); margin-inline: auto; padding-top: 28px; }

.product-v2 .mobile-order-bar { padding: 9px 14px max(9px,env(safe-area-inset-bottom)); border-top-color: rgba(255,255,255,.14); background: rgba(12,12,16,.97); }
.product-v2 .mobile-order-bar strong { direction: ltr; unicode-bidi: isolate; }
.product-v2 .order-dialog { width: min(calc(100% - 28px),560px); max-height: min(88vh,680px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 26px; border: 1px solid var(--product-line); border-radius: 20px; background: #14141c; color: #fff; box-shadow: 0 34px 100px rgba(0,0,0,.55); }
.product-v2 .order-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(5px); }
.product-v2 .channel-list button,.product-v2 .copy-details { min-height: 50px; border-radius: 12px; }
.product-v2 .order-summary-preview { display: grid; gap: 0; margin: 14px 0 16px; padding: 4px 13px; border: 1px solid rgba(249,115,22,.25); border-radius: 13px; background: rgba(249,115,22,.07); }
.product-v2 .order-summary-preview > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; min-width: 0; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.product-v2 .order-summary-preview > div:last-child { border-bottom: 0; }
.product-v2 .order-summary-preview span { flex: 0 0 auto; color: #b9b9c4; font-size: .78rem; }
.product-v2 .order-summary-preview strong { min-width: 0; color: #fff; font-size: .88rem; line-height: 1.45; text-align: left; overflow-wrap: anywhere; }
.product-v2 .order-summary-preview [data-order-summary-price] { color: #ffb17e; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.product-v2 .copy-fallback textarea { min-height: 150px; max-height: 220px; overflow: auto; direction: rtl; unicode-bidi: plaintext; text-align: right; color: #fff; background: #0d0d13; border-color: rgba(249,115,22,.35); line-height: 1.75; scrollbar-color: #6e4b35 #111118; }
.product-v2 .copy-fallback textarea::selection { background: #f97316; color: #160c05; }

@media (max-width: 900px) {
  .product-v2 .product-v4 { grid-template-columns: minmax(0,1fr); grid-template-areas: "meta" "visual" "purchase"; gap: 13px; width: min(calc(100% - 28px),1640px); padding-top: 12px; }
  .product-v2 .product-v4-visual { position: relative; top: auto; }
  .product-v2 .product-v4-content { width: min(calc(100% - 28px),1640px); }
  .product-v2 .related-products { width: min(calc(100% - 28px),1640px); }
}

@media (min-width: 901px) {
  /* Keep the sticky artwork's full box in the product grid before lower modules begin. */
  .product-v2 .product-v4 { padding-bottom: 52px; }
}

@media (max-width: 600px) {
  .product-v2 { padding-top: 8px; }
  .product-v2 .product-v4 { gap: 11px; }
  .product-v2 .product-v4-topmeta { gap: 8px; }
  .product-v2 .product-v4-topmeta .breadcrumb { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
  .product-v2 .product-v2-badges span { padding: 4px 8px; font-size: .7rem; }
  .product-v2 .product-gallery { aspect-ratio: 4 / 3; border-radius: 17px; }
  .product-v2 .product-v4-game .product-gallery { justify-self: stretch; width: 100%; height: min(44vh,340px); aspect-ratio: auto; min-height: 240px; padding: 12px; }
  .product-v2 .product-v4-game .product-gallery img { height: min(44vh, 340px); }
  .product-v2 .product-v4-service .product-gallery { aspect-ratio: 16 / 9; max-height: 245px; }
  .product-v2 .product-v4-purchase h1 { margin-bottom: 10px; font-size: clamp(1.65rem,7.8vw,2.1rem); line-height: 1.3; }
  .product-v2 .product-v2-price strong { font-size: 1.85rem; }
  .product-v2 .product-availability { margin-bottom: 14px; font-size: .82rem; }
  .product-v2 .variants { grid-template-columns: 1fr; gap: 8px; padding: 11px; border-radius: 14px; }
  .product-v2 .variants label > span { min-height: 56px; }
  .product-v2 .product-quick-facts { gap: 7px; }
  .product-v2 .quick-fact { min-height: 61px; padding: 9px 10px; }
  .product-v2 .quick-fact strong { font-size: .78rem; }
  .product-v2 .product-v2-order { grid-template-columns: minmax(0,1fr) auto; gap: 7px 8px; padding: 12px; }
  .product-v2 .product-v2-order > .button:first-child { grid-column: 1 / -1; }
  .product-v2 .product-v2-order .product-share { justify-self: center; min-width: 116px; }
  .product-v2 .product-v4-content { gap: 11px; padding-top: 16px; }
  .product-v2 .product-v3-module { padding: 16px; }
  .product-v2 .related-products { padding-top: 22px; }
  .product-v2 .mobile-order-bar { gap: 9px; }
  .product-v2 .mobile-order-bar .button { min-width: 130px; }
  .product-v2 .order-dialog { width: min(calc(100% - 20px),560px); max-height: min(90vh,700px); padding: 20px 16px; }
  .product-v2 .order-summary-preview { margin-top: 12px; padding-inline: 11px; }
  .product-v2 .order-summary-preview > div { gap: 10px; padding-block: 8px; }
  .product-v2 .order-summary-preview strong { font-size: .82rem; }
  .product-v2 .copy-fallback textarea { min-height: 132px; max-height: 190px; }
  .product-v2.mobile-order-visible { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .product-v2 .variants label > span { transition: none; }
}
