/* Shopify-style PDP */

.pdp {
  padding-bottom: 0;
  overflow-x: clip;
  max-width: 100%;
}

.pdp .breadcrumb {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.pdp-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: start;
  padding: 20px 0 56px;
  min-width: 0;
  max-width: 100%;
}

.pdp-layout > * {
  min-width: 0;
  max-width: 100%;
}

/* Gallery */
.pdp-gallery {
  min-width: 0;
  max-width: 100%;
}

.pdp-gallery__stage {
  background: var(--surface-2);
  aspect-ratio: 1;
  overflow: hidden;
  max-width: 100%;
}

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

.pdp-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.pdp-gallery__thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.2s, border-color 0.2s;
}

.pdp-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-gallery__thumb:hover,
.pdp-gallery__thumb.is-active {
  opacity: 1;
  border-color: var(--ink);
}

/* Buy box */
.pdp-buy {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  min-width: 0;
  max-width: 100%;
}

.pdp-buy h1 {
  font-size: clamp(26px, 3.5vw, 40px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdp-buy__cat {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.pdp-buy__model,
.pdp-buy__subtitle {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}

.pdp-buy__model:empty,
.pdp-buy__subtitle:empty,
.pdp-buy__desc:empty {
  display: none;
}

.pdp-buy__model strong:empty,
.pdp-buy__model:has(strong:empty) {
  display: none;
}

.pdp-buy__model strong {
  color: var(--ink);
  font-weight: 600;
}

.pdp-buy__desc {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}

.pdp-buy__price {
  padding: 20px 0;
  margin-bottom: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pdp-buy__note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pdp-buy__qty {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.pdp-buy__label {
  font-size: 14px;
  font-weight: 500;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
}

.qty-control button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}

.qty-control input {
  width: 56px;
  height: 44px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: center;
  font-size: 15px;
  -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pdp-buy__actions {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.pdp-buy__perks {
  margin: 0 0 22px;
  display: grid;
  gap: 10px;
}

.pdp-buy__perks li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-2);
}

.pdp-buy__perks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.pdp-buy__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.pdp-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}

.pdp-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pdp-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Detail sections (stacked) */
.pdp-sections {
  border-top: 1px solid var(--line);
  padding: 8px 0 56px;
  min-width: 0;
  max-width: 100%;
}

.pdp-section {
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--line);
}

.pdp-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pdp-section__title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.pdp-prose,
.pdp-specs {
  max-width: 920px;
  width: 100%;
  min-width: 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.pdp-prose img,
.pdp-specs img,
.pdp-prose iframe,
.pdp-specs iframe,
.pdp-prose video,
.pdp-specs video {
  max-width: 100% !important;
  height: auto;
  margin: 18px 0;
}

.pdp-specs table,
.pdp-prose table,
.pdp-specs .tg,
.pdp-prose .tg {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: 14px;
  table-layout: fixed;
}

.pdp-specs th,
.pdp-specs td,
.pdp-prose th,
.pdp-prose td,
.pdp-specs .tg th,
.pdp-specs .tg td,
.pdp-prose .tg th,
.pdp-prose .tg td {
  border: 1px solid var(--line) !important;
  padding: 12px 14px !important;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  white-space: normal !important;
  overflow: visible !important;
}

.pdp-specs th,
.pdp-prose th,
.pdp-specs .tg th,
.pdp-prose .tg th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
}

.pdp-video {
  max-width: 960px;
}

.pdp-video img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
}

.pdp-video p {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Related */
.pdp-related {
  padding: 24px 0 72px;
  border-top: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
}

.pdp-related .product-grid--4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 16px;
  min-width: 0;
}

.pdp-related .shop-card {
  min-width: 0;
  max-width: 100%;
}

.pdp-related .shop-card__media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-2);
}

.pdp-related .shop-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-related .shop-card__body {
  padding-top: 14px;
}

.pdp-related .shop-card__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pdp-related .shop-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.pdp-related .shop-card__cart {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pdp-related .shop-card__cart svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.pdp-related .text-link {
  font-size: 14px;
  font-weight: 600;
}

.section-title--sm {
  font-size: clamp(22px, 3vw, 28px);
}

/* Band */
.pdp-band {
  background: var(--ink);
  color: #fff;
  padding: 56px 0;
}

.pdp-band__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.pdp-band h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 8px;
}

.pdp-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

/* Modal */
.pdp-modal[hidden] {
  display: none;
}

.pdp-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.pdp-modal.is-open {
  display: block;
}

.pdp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 24, 0.55);
}

.pdp-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 460px);
  margin: 12vh auto 0;
  padding: 32px 28px 28px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(14, 18, 24, 0.2);
}

.pdp-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.pdp-modal h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.pdp-modal__product {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

.pdp-form {
  display: grid;
  gap: 12px;
}

.pdp-form input,
.pdp-form textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 14px;
}

.pdp-form input[readonly] {
  color: var(--muted);
}

.pdp-form textarea {
  resize: vertical;
  min-height: 110px;
}

@media (max-width: 960px) {
  .pdp-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .pdp-buy {
    position: static;
  }

  .pdp-related .product-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pdp {
    overflow-x: hidden;
  }

  .pdp .container {
    max-width: 100%;
    overflow-x: clip;
  }

  .pdp-layout {
    padding: 12px 0 40px;
    gap: 22px;
  }

  .pdp-gallery__thumb {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
  }

  .pdp-section__title {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .pdp-specs th,
  .pdp-specs td,
  .pdp-prose th,
  .pdp-prose td,
  .pdp-specs .tg th,
  .pdp-specs .tg td,
  .pdp-prose .tg th,
  .pdp-prose .tg td {
    padding: 10px 8px !important;
    font-size: 13px;
  }

  .pdp-band__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .pdp-related .product-grid--4 {
    grid-template-columns: 1fr;
  }

  .pdp-modal__dialog {
    width: min(calc(100vw - 32px), 460px);
    margin: 10vh auto 0;
    padding: 28px 20px 22px;
  }
}
