.product-page .nav {
  border-bottom: 1px solid var(--line);
}

.product-page .search {
  display: none;
}

.product-page .nav-cart {
  margin-left: auto;
}

.pd-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 4% 88px;
}

.pd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.pd-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}

.pd-breadcrumb a:hover {
  color: var(--accent);
}

.pd-breadcrumb span:last-child {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(100%, 360px);
}

.pd-layout {
  display: grid;
  gap: 24px;
}

/* Gallery: main image + thumbs below */
.pd-gallery {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pd-gallery-main {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--photo-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.pd-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.pd-image-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--photo-bg);
}

.pd-stock-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--stock-bg);
  color: var(--stock-ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.pd-stock-badge.is-low { color: var(--stock-low); }
.pd-stock-badge.is-out { color: var(--stock-out); }

.pd-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(21, 21, 21, .62);
  color: var(--surface);
  font-size: 11px;
  font-weight: 600;
}

.pd-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}

.pd-nav:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
}

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

.pd-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.pd-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

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

.pd-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Product info panel */
.pd-info {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.pd-badge {
  display: inline-block;
  width: max-content;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.pd-badge-preloved { background: var(--preloved); color: var(--surface); }
.pd-badge-new { background: var(--accent); color: var(--surface); }

.pd-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

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

.pd-price {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
}

.pd-variants {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.pd-variant-group { display: grid; gap: 8px; }

.pd-variant-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.pd-variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.pd-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.pd-chip.is-disabled,
.pd-chip:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.pd-variant-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* Buy actions — primary cart CTA, quiet WhatsApp secondary */
.pd-buy {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.pd-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 50px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.pd-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pd-cta-primary {
  border: 0;
  background: var(--ink);
  color: #fff;
}

.pd-cta-primary svg {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pd-cta-primary:hover {
  background: #333;
}

.pd-cta-primary:disabled,
.pd-cta-primary.is-sold,
.pd-cta-bar:disabled,
.pd-cta-bar.is-sold {
  background: #e3dfda;
  color: #8f8a84;
  cursor: not-allowed;
}

.pd-cta-primary:disabled svg,
.pd-cta-primary.is-sold svg,
.pd-cta-bar:disabled svg,
.pd-cta-bar.is-sold svg {
  stroke: #8f8a84;
}

.pd-cta-outline {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.pd-cta-outline svg {
  fill: var(--wa);
}

.pd-cta-outline:hover {
  border-color: var(--wa);
  color: var(--wa-dark);
  background: #f4fcf7;
}

.pd-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.pd-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.pd-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
}

.pd-specs {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.pd-specs div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  font-size: 13px;
}

.pd-specs dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.pd-specs dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.pd-related {
  margin-top: 28px;
  padding-top: 8px;
}

.pd-related-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

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

.pd-buy-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(21, 21, 21, .06);
}

.pd-buy-bar-price {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  min-width: 0;
}

.pd-bar-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-bar-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--wa);
}

.pd-cta-bar {
  flex: 0 0 auto;
  width: auto;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.pd-cta-bar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Preloved theme */
.preloved-page.product-page .pd-breadcrumb a:hover,
.preloved-page.product-page .pd-price,
.preloved-page.product-page .pd-buy-bar-price {
  color: var(--preloved);
}

.preloved-page.product-page .pd-thumb.is-active {
  border-color: var(--preloved);
  box-shadow: 0 0 0 2px rgba(95, 127, 106, .28);
}

.preloved-page.product-page .pd-chip.is-active {
  border-color: var(--preloved);
  color: var(--preloved-ink);
  box-shadow: 0 0 0 2px rgba(95, 127, 106, .28);
}

/* Tablet + desktop */
@media (min-width: 768px) {
  .pd-main { padding: 20px 4% 48px; }

  .pd-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 380px);
    gap: 40px;
    align-items: start;
  }

  .pd-gallery {
    position: sticky;
    top: 92px;
  }

  .pd-thumbs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .pd-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
  }

  .pd-gallery-main {
    aspect-ratio: 4/5;
    width: 100%;
    max-height: min(calc(100svh - 120px), 920px);
    min-height: 520px;
    border-radius: 18px;
  }

  .pd-title { font-size: 28px; }
  .pd-price { font-size: 30px; }
  .pd-buy-bar { display: none; }
  .pd-related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 901px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 400px);
    gap: 48px;
  }

  .pd-thumb {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
  }

  .pd-gallery-main {
    max-height: min(calc(100svh - 100px), 960px);
    min-height: 560px;
  }

  .product-page .pd-related-grid {
    max-width: none;
    margin-inline: 0;
  }
}

@media (min-width: 1200px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, 420px);
    gap: 56px;
  }

  .pd-gallery-main {
    max-height: min(calc(100svh - 96px), 1000px);
  }
}

@media (max-width: 767px) {
  .pd-buy-desktop { display: none; }
}

/* Mobile marketplace bottom nav: stack the buy bar above it */
@media (max-width: 900px) {
  .pd-buy-bar {
    bottom: calc(var(--bn-h) + env(safe-area-inset-bottom));
    padding-bottom: 10px;
  }

  .pd-main {
    padding-bottom: 150px;
  }

  body.product-page .cart-toast {
    bottom: calc(var(--bn-h) + 76px);
  }

  body.product-page .pwa-banner {
    bottom: calc(var(--bn-h) + 82px);
  }
}
