/* Account and transaction panels retain their existing appearance. */
.detail-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    padding: var(--ds-space-6);
}
.seller-avatar {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ds-surface-2);
}
.seller-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    background: var(--sport-secondary);
    color: var(--ds-on-brand);
    font-weight: 700;
}
.seller-avatar[hidden] { display: none; }
.sold-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--ds-overlay);
    border-radius: var(--ds-radius-md);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.sold-overlay span {
    background: var(--ds-error); color: var(--ds-on-error);
    font-size: var(--ds-type-heading-3); font-weight: 800;
    padding: var(--ds-space-2) var(--ds-space-6); border-radius: 6px;
    transform: rotate(-15deg);
}

.product-page {
  --product-paper: var(--ds-surface-primary);
  --product-mat: color-mix(in srgb, var(--ds-surface-secondary) 88%, var(--ds-border-default));
  --product-rule: var(--ds-border-default);
  color: var(--ds-text-primary);
}

.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: 44px;
  margin-bottom: var(--ds-space-3);
  font-size: var(--ds-type-label);
}
.product-breadcrumb a { display: inline-flex; align-items: center; gap: var(--ds-space-2); min-height: 44px; color: var(--ds-text-primary); text-decoration: none; }
.product-breadcrumb a:hover { text-decoration: underline; }
.product-breadcrumb i { font-size: .76em; }
.product-category { display: inline-flex; gap: var(--ds-space-2); color: var(--ds-text-secondary); }
.product-category > span { color: var(--ds-border-strong); }
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "gallery" "title" "facts" "description";
  gap: var(--ds-space-5);
}
.product-page.listing-without-photos .product-layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "title" "facts" "description"; }

.product-heading { grid-area: title; min-width: 0; }
html body main .product-page .listing-title,
html body main .product-description h2 {
  font-family: var(--ds-font);
  text-transform: none;
  color: var(--ds-text-primary);
}
html body main .product-page .listing-title {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2.9rem);
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: -.042em;
  text-wrap: pretty;
}
.product-price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2) var(--ds-space-4);
  margin-top: var(--ds-space-3);
}
.product-page .price-tag {
  font-weight: 650;
  font-size: clamp(1.5rem, 2.25vw, 2.05rem);
  letter-spacing: -.04em;
  line-height: 1.1;
  color: var(--ds-text-primary);
  font-variant-numeric: tabular-nums;
}
.product-condition {
  display: inline-flex;
  gap: var(--ds-space-1);
  align-items: baseline;
  padding-inline-start: var(--ds-space-4);
  border-inline-start: 1px solid var(--ds-border-strong);
  color: var(--ds-text-secondary);
  font-size: var(--ds-type-label);
}
.product-condition strong { color: var(--ds-text-primary); font-weight: 650; }
.product-heading .listing-photo-note { display: inline-block; margin-top: var(--ds-space-2); }

.product-gallery {
  grid-area: gallery;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-areas: "stage stage stage" "previous thumbs next";
  align-items: center;
  align-self: start;
  min-width: 0;
  gap: var(--ds-space-2);
}
.product-stage {
  grid-area: stage;
  position: relative;
  align-self: stretch;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--product-rule);
  border-radius: var(--ds-radius-lg);
  background: var(--product-mat);
}
.product-stage .main-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(46svh, 23rem);
  aspect-ratio: 1.27;
  object-fit: contain;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
}
.product-stage:focus-within { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }
.product-zoom, .product-photo-count {
  border: 1px solid var(--product-rule);
  border-radius: 100vmax;
  background: var(--product-paper);
  color: var(--ds-text-primary);
  pointer-events: none;
}
.product-zoom {
  position: absolute;
  inset: var(--ds-space-2) var(--ds-space-2) auto auto;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  font-size: .8125rem;
}
.product-photo-count {
  grid-area: stage;
  position: relative;
  align-self: start;
  justify-self: start;
  z-index: 1;
  margin: var(--ds-space-2);
  padding: var(--ds-space-1) var(--ds-space-2);
  font-size: var(--ds-type-caption);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.product-page .product-step {
  display: inline-grid;
  place-items: center;
  height: 44px;
  width: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--ds-border-strong);
  background: var(--product-paper);
  color: var(--ds-text-primary);
  font-size: .875rem;
}
.product-page .product-step:hover { background: var(--ds-surface-secondary); border-color: var(--ds-text-primary); }
.product-step--previous { grid-area: previous; }
.product-step--next { grid-area: next; }
.product-gallery .thumb-strip {
  grid-area: thumbs;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--ds-space-1);
  padding: var(--ds-space-1);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ds-border-strong) transparent;
}
.product-gallery .product-thumb {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: .25rem;
  border-radius: var(--ds-radius-sm);
  border: 2px solid transparent;
  background: var(--product-mat);
  cursor: pointer;
}
.product-gallery .product-thumb img { display: block; min-width: 0; width: 100%; height: 100%; object-fit: contain; }
.product-gallery .product-thumb[aria-current="true"] { border-color: var(--ds-text-primary); background: var(--product-paper); box-shadow: inset 0 0 0 1px var(--ds-text-primary); }
.product-gallery .product-thumb:not([aria-current="true"]):hover { border-color: var(--ds-border-strong); }
.product-gallery :is(.product-thumb,.product-step):focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 1px; }
.product-gallery--single { grid-template-columns: minmax(0,1fr); grid-template-areas: "stage"; }

.product-rail { grid-area: facts; min-width: 0; }
.product-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ds-space-4) var(--ds-space-5);
  margin: 0;
  padding: var(--ds-space-4) 0;
  border-block: 1px solid var(--product-rule);
}
.product-facts dt { margin-bottom: var(--ds-space-1); color: var(--ds-text-secondary); font-size: var(--ds-type-label); font-weight: 450; }
.product-facts dd { margin: 0; color: var(--ds-text-primary); font-size: var(--ds-type-body); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.product-snapshot { margin: var(--ds-space-2) 0 0; color: var(--ds-text-secondary); font-size: var(--ds-type-caption); }
.product-note { margin: var(--ds-space-2) 0 0; color: var(--ds-text-secondary); font-size: var(--ds-type-caption); line-height: 1.45; }

/* Buying and selling controls: one column, the next step first. */
.product-actions { display: grid; gap: var(--ds-space-2); margin-top: var(--ds-space-5); }
.product-actions > form { display: grid; margin: 0; }
.product-actions .btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; }
.product-offer {
  display: grid;
  gap: var(--ds-space-2);
  padding: var(--ds-space-4);
  border: 1px solid var(--product-rule);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-secondary);
}
.product-offer.d-none { display: none; }
.product-offer-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-2); }
.product-offer strong { font-weight: 650; }
.product-offer p { margin: 0; color: var(--ds-text-secondary); font-size: var(--ds-type-label); }
.product-offer .form-label { margin: 0; font-size: var(--ds-type-label); font-weight: 600; }
.product-offer .form-label span { color: var(--ds-text-secondary); font-weight: 450; }
.product-offer .form-label:not(:first-of-type) { margin-top: var(--ds-space-2); }
.product-offer > .btn { margin-top: var(--ds-space-2); }

.product-utilities, .product-safety {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 var(--ds-space-5);
}
.product-utilities { margin-top: var(--ds-space-2); }
.product-safety { margin: var(--ds-space-1) 0 0; }
.product-safety > details { min-width: 0; }
.product-safety > details[open] { flex: 1 1 100%; }
.product-safety > details > .product-offer { margin-bottom: var(--ds-space-2); }
.product-page .product-utility {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ds-text-primary);
  font: inherit;
  font-size: var(--ds-type-label);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.product-page summary.product-utility { list-style: none; }
.product-page summary.product-utility::-webkit-details-marker { display: none; }
.product-page .product-utility:hover { text-decoration: underline; text-underline-offset: .18em; }
.product-page .product-utility:disabled { color: var(--ds-text-secondary); cursor: default; text-decoration: none; }
.product-page .product-utility i { font-size: .9em; color: var(--ds-text-secondary); }
.product-page .product-utility[aria-pressed="true"] i { color: var(--ds-error); }
.product-page .product-utility--danger, .product-page .product-utility--danger i { color: var(--ds-error); }

.product-seller {
  margin-top: var(--ds-space-4);
  padding-top: var(--ds-space-4);
  border-top: 1px solid var(--product-rule);
}
html body main .product-seller h2 {
  margin: 0 0 var(--ds-space-3);
  font-family: var(--ds-font);
  font-size: var(--ds-type-label);
  font-weight: 450;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ds-text-secondary);
}
.product-seller-identity { display: flex; align-items: center; gap: var(--ds-space-3); min-width: 0; }
.product-seller-copy { display: grid; min-width: 0; }
.product-seller-copy strong { color: var(--ds-text-primary); font-size: var(--ds-type-body); font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.product-seller-copy small { color: var(--ds-text-secondary); font-size: var(--ds-type-caption); }
.seller-signals { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); margin-top: var(--ds-space-3); }
.product-seller [aria-label="Marketplace reputation"] { margin-top: var(--ds-space-3) !important; font-size: var(--ds-type-label); color: var(--ds-text-primary); }
.product-seller [aria-label="Marketplace reputation"] a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ds-text-primary); font-weight: 600; text-decoration: underline; text-underline-offset: .18em;
}
.product-seller > .product-note { margin-top: 0; }
.product-page .marketplace-price-guide { margin: var(--ds-space-4) 0 0; }

.product-description { grid-area: description; min-width: 0; }
html body main .product-description h2 { margin: 0; font-size: var(--ds-type-heading-3); line-height: 1.18; font-weight: 650; letter-spacing: -.025em; }
.product-description p { margin: var(--ds-space-2) 0 0; max-width: 66ch; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--ds-text-secondary); }

/* Keep the controls outside the photograph. The native scrollport supplies bounded
   touch, wheel and keyboard panning at the original image size. */
.product-page .lightbox {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #101213; /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
  color: var(--ds-on-dark);
  color-scheme: dark;
}
.product-page .lightbox.active { display: grid; }
.viewer-header, .viewer-toolbar {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-2) var(--ds-space-4);
}
.viewer-header { min-height: 52px; }
.product-viewer-count { font-size: var(--ds-type-label); font-weight: 600; font-variant-numeric: tabular-nums; }
.viewer-pan-hint { display: none; color: #c7cdcf; font-size: var(--ds-type-label); } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
.view-actual .viewer-pan-hint { display: inline; }
.viewer-header .lightbox-close { margin-inline-start: auto; }
.viewer-toolbar { justify-content: center; gap: var(--ds-space-3); padding-block: var(--ds-space-2); }
.product-page .lightbox button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0;
  border: 1px solid #747c80; border-radius: 50%;
  background: #222628; color: var(--ds-on-dark); line-height: 1; font-size: var(--ds-type-body); /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
}
.product-page .lightbox button:hover { background: #393e40; } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
.product-page .lightbox button:focus-visible { outline: 2px solid var(--ds-on-dark); outline-offset: 2px; }
.viewer-scale { display: inline-flex; gap: .25rem; padding: .25rem; border: 1px solid #747c80; border-radius: 100vmax; background: #222628; } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
.product-page .viewer-scale button {
  padding-inline: var(--ds-space-3); border: 0; border-radius: 100vmax;
  background: transparent; font-size: var(--ds-type-label); font-weight: 600;
}
.product-page .viewer-scale button:disabled { opacity: .65; cursor: default; }
.product-page .viewer-scale button[aria-pressed="true"] { background: #f3f5f5; color: #141718; } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
.viewer-viewport {
  position: relative; min-width: 0; min-height: 0;
  overflow: auto; overscroll-behavior: contain;
  scrollbar-color: #758084 #191c1d; scrollbar-width: thin; /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
}
.viewer-viewport:focus-visible { outline: 2px solid #d8e1e3; outline-offset: -2px; } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
.viewer-canvas {
  display: grid; place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  width: 100%; height: 100%;
  min-width: 100%; min-height: 100%;
}
.product-page .viewer-canvas img {
  display: block;
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain; cursor: zoom-in;
  user-select: none; -webkit-user-drag: none;
}
.view-actual .viewer-canvas { width: max-content; height: max-content; }
.product-page .view-actual .viewer-canvas img { max-width: none; max-height: none; cursor: grab; }
.product-page .view-actual .viewer-canvas img:active { cursor: grabbing; }

@media (min-width: 52rem) {
  .product-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "gallery title" "gallery facts" "gallery description";
    grid-template-rows: auto auto 1fr;
    gap: var(--ds-space-5) clamp(var(--ds-space-6), 4.2vw, (4rem + .5rem));
  }
  .product-heading { padding-top: var(--ds-space-2); }
  .product-gallery:not(.product-gallery--single) {
    grid-template-columns: 54px minmax(0, 1fr) 44px 44px;
    grid-template-areas: "thumbs stage stage stage" "thumbs count previous next";
    align-items: start;
    gap: var(--ds-space-2);
  }
  .product-stage .main-photo { height: clamp(25rem, 41vw, 34rem); max-height: 66svh; aspect-ratio: auto; }
  .product-gallery .thumb-strip {
    flex-direction: column;
    max-height: min(66svh, 34rem);
    justify-self: stretch;
    align-self: start;
  }
  .product-gallery .product-thumb { width: 46px; height: 50px; }
  .product-photo-count {
    grid-area: count;
    align-self: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ds-text-secondary);
    font-size: var(--ds-type-label);
  }
}
@media (max-width: 35.99rem) {
  .marketplace-workspace.product-page { padding-block-start: 0; }
  .product-breadcrumb { margin: 0; }
  .product-layout { gap: var(--ds-space-4); }
}
@media (prefers-contrast: more) {
  .product-gallery .product-thumb { border-color: var(--ds-border-strong); }
  .product-gallery .product-thumb[aria-current="true"] { border-color: var(--ds-text-primary); }
}

@media (max-width: 35.99rem) and (max-height: 40rem) {
  .product-stage .main-photo { max-height: 33svh; }
}
