.pdp-page {
  padding: clamp(20px, 2.4vw, 34px) clamp(16px, 2.08vw, 30px) 0;
}

.pdp-info h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.pdp-sku {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--pd-r-xs);
  background: var(--pd-line);
  color: var(--pd-muted);
  font-size: 13px;
  line-height: 1;
}

.pdp-vars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--pd-line);
}

.pdp-vars__label {
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
}

.pdp-vars__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pdp-var {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 4px 14px 4px 4px;
  border: 1px solid var(--pd-line-strong);
  border-radius: var(--pd-r-sm);
  background: var(--pd-surface);
  color: var(--pd-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pdp-var__photo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: var(--pd-r-xs);
  background: var(--pd-line);
}

.pdp-var__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}

.pdp-var__name,
.pdp-var__price {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.pdp-var__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.pdp-var__price {
  color: var(--pd-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.pdp-var.is-active {
  border-color: var(--pd-primary);
  color: var(--pd-primary);
}

.pdp-var.is-active .pdp-var__price {
  color: inherit;
}

@media (max-width: 1024px) {
  .pdp-vars__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdp-var {
    width: 100%;
  }
}

@media (max-width: 479px) {
  .pdp-vars__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pdp-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding-top: 20px;
  border-top: 1px solid var(--pd-line);
}

.pdp-price__now {
  font-size: clamp(30px, 2.8vw, 40px);
  line-height: 1.1;
  font-weight: 700;
}

.pdp-price__old {
  font-size: 20px;
  color: var(--pd-muted);
  text-decoration: line-through;
}

.pdp-price__unit {
  font-size: 15px;
  color: var(--pd-muted);
}

.pdp-buy {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.pdp-qty {
  flex: none;
  display: flex;
  align-items: center;
  width: 126px;
  height: 50px;
  border: 1px solid var(--pd-line-strong);
  border-radius: var(--pd-r-sm);
  background: var(--pd-surface);
}

.pdp-qty button {
  width: 44px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--pd-primary);
}

.pdp-qty input {
  flex: 1 1 auto;
  width: 36px;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  color: var(--pd-text);
  appearance: none;
  -webkit-appearance: none;
}

.pdp-cart {
  flex: 1 1 200px;
  height: 50px;
  min-width: 0;
  min-height: 0;
  padding: 0 24px;
  border: 0;
  border-radius: var(--pd-r-sm);
  background: var(--pd-primary);
  color: var(--pd-surface);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pdp-cart:hover {
  background: var(--pd-primary-hover);
}

.pdp-cart img {
  width: 22px;
  height: auto;
  flex: none;
  display: block;
}

.pdp-return {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--pd-r-md);
  background: var(--pd-bg);
}

.pdp-return img {
  width: 24px;
  height: auto;
  flex: none;
  margin-top: 2px;
}

.pdp-return__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--pd-text-2);
}

.pdp-return__body strong {
  color: var(--pd-text);
  font-size: 16px;
  font-weight: 700;
}

.pdp-return__body a {
  color: var(--pd-primary);
  text-decoration: underline;
}

.pdp-tabs {
  grid-column: 1 / -1;
  padding: clamp(20px, 2.8vw, 40px);
  background: var(--pd-surface);
  border-radius: var(--pd-r-lg);
  min-width: 0;
}

.pdp-tabs__bar {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--pd-line);
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pdp-tabs__bar::-webkit-scrollbar {
  display: none;
}

/* На вузькому екрані останній таб не впирається в край скролу. iOS не додає
   padding-inline-end у ширину скролу, тому кінцевий відступ тримає ::after. */
@media (max-width: 767px) {
  .pdp-page {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-left: max(var(--frame-pad), env(safe-area-inset-left, 0px));
    padding-right: max(var(--frame-pad), env(safe-area-inset-right, 0px));
  }

  .pdp-tabs {
    padding-right: max(20px, var(--frame-pad), env(safe-area-inset-right, 0px));
  }

  .pdp-tabs__bar {
    scroll-padding-inline-end: max(var(--frame-pad), env(safe-area-inset-right, 0px));
  }

  .pdp-tabs__bar::after {
    content: "";
    flex: 0 0 max(var(--frame-pad), env(safe-area-inset-right, 0px));
    width: max(var(--frame-pad), env(safe-area-inset-right, 0px));
  }
}

.pdp-tabs__bar button {
  padding: 0 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-family: inherit;
  font-size: clamp(18px, 1.55vw, 22px);
  font-weight: 700;
  line-height: normal;
  color: var(--pd-muted);
  white-space: nowrap;
  min-height: 0;
  min-width: 0;
}

.pdp-tabs__bar button.is-active {
  color: var(--pd-text);
  border-bottom-color: var(--pd-primary);
}

.pdp-specs {
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin-top: 8px;
}

.pdp-spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--pd-line);
  font-size: 15px;
  line-height: 1.35;
}

.pdp-spec span:first-child {
  color: var(--pd-muted);
}

.pdp-desc {
  margin: 22px 0 0;
  max-width: 900px;
  font-size: clamp(15px, 1.18vw, 17px);
  line-height: 1.5;
  color: var(--pd-text-2);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.pdp-desc p,
.pdp-desc ul,
.pdp-desc ol,
.pdp-desc blockquote {
  margin: 0 0 0.8em;
}

.pdp-desc ul,
.pdp-desc ol {
  padding-left: 1.2em;
}

.pdp-desc a {
  color: inherit;
}

.pdp-desc table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .pdp-desc {
    margin-top: 16px;
  }
}

.pdp-fallback {
  margin-top: var(--pd-gap);
  padding: clamp(20px, 2.8vw, 40px);
  background: var(--pd-surface);
  border-radius: var(--pd-r-lg);
}

.pdp a:focus-visible,
.pdp button:focus-visible,
.pdp input:focus-visible {
  outline: 2px solid var(--pd-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pdp-tabs__bar {
    scroll-behavior: auto;
  }
}

/* display:flex інакше лишає порожню смугу в Safari, коли на елементі стоїть hidden. */
.pdp [hidden] {
  display: none;
}
