/* ============================================================
   THE WHITE DIGITAL — Product Detail
   Matches homepage marketplace tokens (olive / black / gold)
   ============================================================ */

:root {
  --pd-bg: #faf9f6;
  --pd-ink: #222;
  --pd-muted: #6a6a6a;
  --pd-line: #e1e3df;
  --pd-panel: #2f3a2e;
  --pd-gold: #c4a35a;
  --pd-radius: 12px;
  --pd-radius-lg: 18px;
}

body:has(.pd-page) {
  background: var(--pd-bg);
}

/* Old navbar hidden when marketplace header is used */
body:has(.pd-page) .navbar {
  display: none !important;
}

.pd-page {
  color: var(--pd-ink);
  padding-bottom: 88px;
  overflow-x: clip;
  width: 100%;
}

.pd-page .container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Breadcrumb */
.pd-crumb {
  border-bottom: 1px solid var(--pd-line);
  background: #fff;
  padding: 12px 0;
  font-size: 0.8rem;
}

.pd-crumb .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.pd-crumb a {
  color: var(--pd-muted);
  text-decoration: none;
}

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

.pd-crumb i {
  font-size: 0.55rem;
  color: #bbb;
}

.pd-crumb span {
  color: var(--pd-ink);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main layout */
.pd-main {
  padding: 20px 0 40px;
}

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas:
    "media buy"
    "trust buy"
    "sales buy";
  column-gap: 40px;
  row-gap: 14px;
  align-items: start;
}

.pd-gallery__stage { grid-area: media; }
.pd-buy { grid-area: buy; min-width: 0; }
.pd-trust { grid-area: trust; }
.pd-sales { grid-area: sales; }

/* Gallery */
.pd-gallery__stage {
  border-radius: var(--pd-radius-lg);
  overflow: hidden;
  background: transparent;
  border: none;
  line-height: 0;
  width: 100%;
}

.pd-gallery__stage img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: unset;
}

.pd-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 0;
}

.pd-trust__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 10px;
}

.pd-trust__item i {
  color: var(--pd-gold);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.pd-trust__item strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.pd-trust__item span {
  display: block;
  font-size: 0.68rem;
  color: var(--pd-muted);
  line-height: 1.2;
}

.pd-sales {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--pd-muted);
}

.pd-sales i {
  color: var(--pd-gold);
}

/* Buy panel */
.pd-cat {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecece8;
  color: var(--pd-panel);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.pd-title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--pd-ink);
}

.pd-lead {
  margin: 0 0 16px;
  color: var(--pd-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.pd-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 18px;
}

.pd-price strong {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pd-price s {
  font-size: 1rem;
  color: #aaa;
}

.pd-price em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pd-panel);
  background: #d4b56a;
  padding: 3px 8px;
  border-radius: 999px;
}

.pd-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-body);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.pd-btn:hover {
  transform: scale(1.015);
}

.pd-btn--dark {
  background: var(--pd-ink);
  color: #fff;
}

.pd-btn--outline {
  background: #fff;
  border-color: var(--pd-ink);
  color: var(--pd-ink);
}

.pd-btn--sm {
  padding: 8px 12px;
  font-size: 0.78rem;
}

.pd-actions .pd-btn {
  flex: 1;
}

.pd-includes {
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.pd-includes h2 {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pd-muted);
  font-family: var(--font-body);
}

.pd-includes ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pd-includes li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--pd-ink);
}

.pd-includes li:last-child {
  margin-bottom: 0;
}

.pd-includes i {
  color: var(--pd-panel);
  margin-top: 2px;
  flex-shrink: 0;
}

.pd-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius);
  overflow: hidden;
  background: #fff;
}

.pd-steps__item {
  text-align: center;
  padding: 12px 6px;
  border-right: 1px solid var(--pd-line);
}

.pd-steps__item:last-child {
  border-right: none;
}

.pd-steps__item i {
  display: block;
  color: var(--pd-gold);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.pd-steps__item--done i {
  color: #2f7d4a;
}

.pd-steps__item strong {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}

.pd-steps__item span {
  display: block;
  font-size: 0.65rem;
  color: var(--pd-muted);
  margin-top: 2px;
}

/* Tabs */
.pd-tabs {
  margin-top: 48px;
  padding-top: 8px;
}

.pd-tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--pd-line);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-tabs__nav::-webkit-scrollbar {
  display: none;
}

.pd-tab {
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  color: var(--pd-muted);
  margin-bottom: -2px;
  white-space: nowrap;
  font-family: var(--font-body);
}

.pd-tab.is-active {
  color: var(--pd-ink);
  border-bottom-color: var(--pd-panel);
}

.pd-tabs__heading {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-family: var(--font-head);
  font-weight: 500;
}

.pd-tabs__heading i {
  color: var(--pd-gold);
  margin-right: 6px;
}

.pd-prose {
  max-width: 740px;
  line-height: 1.8;
  color: #555;
  font-size: 0.95rem;
}

.pd-prose--muted {
  color: var(--pd-muted);
}

/* Related */
.pd-section-title {
  margin: 0 0 20px;
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pd-related {
  margin-top: 52px;
}

.pd-related__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pd-card__media {
  display: block;
  position: relative;
  border-radius: var(--pd-radius);
  overflow: hidden;
  background: transparent;
  border: 1px solid var(--pd-line);
  text-decoration: none;
  line-height: 0;
}

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

.pd-card__media em {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
  z-index: 1;
}

.pd-card__body {
  padding: 10px 2px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pd-card__body > span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pd-muted);
  font-weight: 700;
}

.pd-card__body a {
  text-decoration: none;
  color: inherit;
}

.pd-card__body h3 {
  margin: 4px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pd-card__price {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
}

.pd-card__price strong {
  font-size: 1.05rem;
}

.pd-card__price s {
  font-size: 0.82rem;
  color: var(--pd-muted);
}

.pd-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.pd-card__actions .pd-btn {
  flex: 1 1 auto;
  min-width: 0;
}

/* Reviews */
.pd-reviews {
  padding: 40px 0 56px;
  background: #f0efe9;
  border-top: 1px solid var(--pd-line);
}

.pd-reviews__inner {
  max-width: 720px;
  margin: 0 auto;
}

.pd-review-form {
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius-lg);
  padding: 22px 20px;
  margin-bottom: 28px;
}

.pd-review-form h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-family: var(--font-head);
  font-weight: 500;
}

.pd-field {
  display: block;
  margin-bottom: 14px;
}

.pd-field > span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.pd-field input,
.pd-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--pd-line);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  outline: none;
  box-sizing: border-box;
  background: #faf9f6;
  color: var(--pd-ink);
}

.pd-field input:focus,
.pd-field textarea:focus {
  border-color: var(--pd-panel);
  box-shadow: 0 0 0 3px rgba(47, 58, 46, 0.12);
  background: #fff;
}

.pd-stars {
  display: flex;
  gap: 6px;
  font-size: 1.45rem;
  cursor: pointer;
  color: #ddd;
}

.pd-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.pd-alert--ok {
  background: #e8f5e9;
  border-left: 4px solid #28a745;
  color: #1b5e20;
}

.pd-alert--err {
  background: #fff3f3;
  border-left: 4px solid #e53935;
  color: #b71c1c;
}

.pd-reviews__count {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--pd-muted);
  font-weight: 600;
}

.pd-review {
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.pd-review__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pd-review__who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pd-review__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pd-panel);
  color: #f3efe4;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.pd-review__who strong {
  display: block;
  font-size: 0.9rem;
}

.pd-review__who time {
  display: block;
  font-size: 0.72rem;
  color: #999;
}

.pd-review__stars {
  color: #b8953a;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.pd-review p {
  margin: 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.65;
}

.pd-reviews__empty {
  color: #999;
  font-size: 0.92rem;
}

/* Sticky mobile CTA */
.pd-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--pd-line);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}

.pd-sticky[hidden] {
  display: none !important;
}

.pd-sticky__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pd-sticky__price {
  min-width: 0;
}

.pd-sticky__price strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.pd-sticky__price span {
  display: block;
  font-size: 0.72rem;
  color: var(--pd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
}

.pd-sticky .pd-btn {
  flex-shrink: 0;
  min-width: 110px;
}

/* Responsive */
@media (max-width: 980px) {
  .pd-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "buy"
      "trust"
      "sales";
    column-gap: 0;
    row-gap: 16px;
  }

  .pd-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .pd-page {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .pd-page .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pd-main {
    padding: 0 0 24px;
  }

  .pd-main > .container {
    padding-left: 0;
    padding-right: 0;
  }

  .pd-crumb {
    padding: 10px 0;
    font-size: 0.74rem;
  }

  .pd-crumb .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pd-layout {
    row-gap: 0;
  }

  .pd-gallery__stage {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .pd-buy {
    padding: 16px 16px 0;
  }

  .pd-title {
    font-size: 1.35rem;
    word-wrap: break-word;
  }

  .pd-lead {
    font-size: 0.88rem;
    margin-bottom: 12px;
  }

  .pd-price {
    margin-bottom: 14px;
  }

  .pd-price strong {
    font-size: 1.5rem;
  }

  .pd-actions {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
  }

  .pd-actions .pd-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .pd-includes {
    margin-bottom: 12px;
    padding: 14px;
  }

  .pd-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .pd-steps__item {
    padding: 12px 8px;
  }

  .pd-steps__item:nth-child(1),
  .pd-steps__item:nth-child(2) {
    border-bottom: 1px solid var(--pd-line);
  }

  .pd-steps__item:nth-child(2),
  .pd-steps__item:nth-child(4) {
    border-right: none;
  }

  .pd-steps__item:nth-child(3) {
    border-right: 1px solid var(--pd-line);
  }

  /* Compact trust — one slim row, less vertical clutter */
  .pd-trust {
    margin: 14px 16px 0;
    gap: 6px;
  }

  .pd-trust__item {
    flex-direction: column;
    text-align: center;
    gap: 3px;
    padding: 8px 4px;
  }

  .pd-trust__item i {
    font-size: 0.85rem;
  }

  .pd-trust__item strong {
    font-size: 0.66rem;
  }

  .pd-trust__item span {
    font-size: 0.62rem;
  }

  .pd-sales {
    margin: 10px 16px 0;
    font-size: 0.8rem;
  }

  .pd-tabs {
    margin-top: 28px;
    padding: 0 16px;
  }

  .pd-tab {
    padding: 10px 12px;
    font-size: 0.84rem;
  }

  .pd-related {
    margin-top: 32px;
    padding: 0 16px;
  }

  .pd-related__grid {
    gap: 12px;
  }

  .pd-card__actions {
    flex-direction: column;
  }

  .pd-card__actions .pd-btn {
    width: 100%;
    box-sizing: border-box;
  }

  .pd-reviews {
    padding: 28px 0 40px;
  }

  .pd-reviews .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pd-review-form {
    padding: 16px 14px;
  }

  .pd-review__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pd-sticky__inner {
    padding: 0 2px;
  }
}

@media (max-width: 480px) {
  .pd-related__grid {
    grid-template-columns: 1fr 1fr;
  }

  .pd-card__body h3 {
    font-size: 0.86rem;
  }

  .pd-steps__item strong {
    font-size: 0.66rem;
  }

  .pd-steps__item span {
    font-size: 0.6rem;
  }
}

@media (min-width: 721px) {
  .pd-page {
    padding-bottom: 0;
  }

  .pd-sticky {
    display: none !important;
  }
}
