/* Product-detail corrections for the active modular production release. */
@media (min-width: 768px) {
  body.template-14.type-product .p-detail-inner {
    box-sizing: border-box !important;
    width: calc(100% - 48px) !important;
    max-width: 1600px !important;
    margin-inline: auto !important;
  }
}

@media (min-width: 1280px) {
  body.template-14.type-product .p-detail-inner {
    width: calc(100% - 64px) !important;
  }
}

@media (min-width: 1664px) {
  body.template-14.type-product .p-detail-inner {
    width: 1600px !important;
    max-width: calc(100vw - 64px) !important;
    margin-inline: auto !important;
  }
}

/* Shoptet's full-width tabs lose their side gutter before the 1600 px layout. */
@media (max-width: 767px) {
  body.template-14.type-product:has(.sh-product-long) .p-detail-full-width > .container-full-width {
    box-sizing: border-box !important;
    width: calc(100% - 32px) !important;
    margin-inline: auto !important;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  body.template-14.type-product:has(.sh-product-long) .p-detail-full-width > .container-full-width {
    box-sizing: border-box !important;
    width: calc(100% - 48px) !important;
    margin-inline: auto !important;
  }
}

@media (min-width: 1280px) and (max-width: 1663px) {
  body.template-14.type-product:has(.sh-product-long) .p-detail-full-width > .container-full-width {
    box-sizing: border-box !important;
    width: calc(100% - 64px) !important;
    margin-inline: auto !important;
  }
}

/* The simple priceId select needs the same designed picker as parameter variants. */
body.template-14.type-product #product-detail-form .sh-simple-variant {
  width: 100%;
}

body.template-14.type-product #product-detail-form .sh-simple-variant .sh-variant-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.template-14.type-product #product-detail-form .sh-simple-variant .sh-variant-display {
  box-sizing: border-box;
}

body.template-14.type-product #product-detail-form .sh-simple-variant .sh-variant-option {
  box-sizing: border-box;
}

@media (min-width: 1440px) and (max-width: 1663px) {
  body.template-14.type-product .sh-product-help {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
  }

  body.template-14.type-product .sh-product-help-heading h2 {
    grid-row: auto;
  }
}

/* The design keeps sizing links in the help content, not below the gallery. */
body.template-14.type-product .p-detail-inner > .sh-product-guides {
  display: none !important;
}

/* Keep the custom help link; remove only Shoptet's extra standalone row. */
body.template-14.type-product #product-detail-form > .detail-parameters > a.shipping-options {
  display: none !important;
}

/* Figma's right-hand help column is 383 px inside the 735 px data column. */
@media (min-width: 1664px) {
  body.template-14.type-product .sh-product-help {
    grid-template-columns: minmax(0, 287fr) minmax(0, 383fr) !important;
    column-gap: 0 !important;
  }

  body.template-14.type-product .sh-product-help-contacts {
    box-sizing: border-box;
    min-width: 0 !important;
    padding-inline: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 16px !important;
  }

  body.template-14.type-product .sh-product-help-contacts > *,
  body.template-14.type-product .sh-product-help-contacts .sh-contact-link {
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
}

/* Restore the catalogue's related products that the legacy JK stylesheet hid. */
body.template-14.type-product .products-related-header {
  display: block !important;
  box-sizing: border-box;
  width: calc(100% - 64px);
  max-width: 1600px;
  margin: 64px auto 24px !important;
  color: var(--sh-ink, #20231c);
  font-size: 32px;
  line-height: 1.2;
}

body.template-14.type-product .products-related-wrapper.products-wrapper.product-slider-holder.has-navigation {
  position: relative;
  display: block !important;
  box-sizing: border-box;
  width: calc(100% - 64px);
  max-width: 1600px;
  margin: 0 auto 64px !important;
  padding: 0 !important;
  overflow: visible !important;
  scroll-margin-top: 100px;
}

body.template-14.type-product .products-related-wrapper .products {
  width: 100% !important;
  overflow: visible !important;
}

body.template-14.type-product .products-related-wrapper .products-block {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  gap: 30px;
  transform: none !important;
}

body.template-14.type-product .products-related-wrapper .products-block::-webkit-scrollbar {
  display: none;
}

body.template-14.type-product .products-related-wrapper .products-block > .product {
  display: block !important;
  box-sizing: border-box;
  flex: 0 0 calc((100% - 90px) / 4);
  flex-shrink: 0;
  min-width: 0;
  max-width: none !important;
  margin: 0 !important;
  float: none !important;
  scroll-snap-align: start;
}

body.template-14.type-product .products-related-wrapper .product[data-sh-related-duplicate="true"] {
  display: none !important;
}

@media (min-width: 768px) and (max-width: 1439px) {
  body.template-14.type-product .products-related-header,
  body.template-14.type-product .products-related-wrapper.products-wrapper.product-slider-holder.has-navigation {
    width: calc(100% - 48px);
  }

  body.template-14.type-product .products-related-wrapper .products-block {
    gap: 16px;
  }

}

@media (min-width: 768px) and (max-width: 1023px) {
  body.template-14.type-product .products-related-wrapper .products-block > .product {
    flex-basis: calc((100% - 16px) / 2);
  }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  body.template-14.type-product .products-related-wrapper .products-block > .product {
    flex-basis: calc((100% - 32px) / 3);
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  body.template-14.type-product .products-related-header,
  body.template-14.type-product .products-related-wrapper.products-wrapper.product-slider-holder.has-navigation {
    width: calc(100% - 64px);
  }
}

@media (min-width: 768px) and (max-width: 1663px) {
  body.template-14.type-product .products-related-wrapper .products-block .p {
    padding: 16px;
  }

  body.template-14.type-product .products-related-wrapper .products-block .p > a.image {
    aspect-ratio: 1.12 / 1;
  }

  body.template-14.type-product .products-related-wrapper .products-block .name {
    font-size: 18px;
  }

  body.template-14.type-product .products-related-wrapper .products-block .price-final {
    font-size: 20px;
  }

  body.template-14.type-product .products-related-wrapper .products-block .p-tools .btn {
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 14px;
  }
}

body.template-14.type-product .products-related-wrapper .product-slider-pagination {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 24px auto 0;
}

body.template-14.type-product .products-related-wrapper .product-slider-pagination .sh-related-page {
  display: block;
  width: 40px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e9e5e1;
  cursor: pointer;
}

body.template-14.type-product .products-related-wrapper .product-slider-pagination .sh-related-page[aria-current="true"] {
  background: var(--sh-brand, #dd6e42);
}

body.template-14.type-product .products-related-wrapper .product-slider-navigation {
  display: none !important;
}

@media (max-width: 767px) {
  body.template-14.type-product .products-related-header {
    width: calc(100% - 32px);
    margin: 32px auto 16px !important;
    font-size: 24px;
  }

  body.template-14.type-product .products-related-wrapper.products-wrapper.product-slider-holder.has-navigation {
    width: calc(100% - 32px);
    margin-bottom: 32px !important;
  }

  body.template-14.type-product .products-related-wrapper .products-block {
    gap: 12px;
  }

  body.template-14.type-product .products-related-wrapper .products-block > .product {
    flex-basis: calc((100% - 12px) / 2);
  }

}
