/* WRAPING – product detail only, no global sizing changes.
   Original theme uses .nf-single-wrapper, sidebar layout uses
   .nf-catalogue-with-tree-main; do not touch the left category tree.
   The 1430px category layout from the previous plugin remains intact. */

/* Constrain the product itself – NOT the whole page and NOT the left menu. */
html body.single-product .nf-single-wrapper,
html body.single-product .nf-catalogue-with-tree-main > .woocommerce,
html body.single-product .nf-catalogue-with-tree-main > article.product,
html body.single-product main#main-content > .woocommerce:has(> div.product),
html body.single-product main#main-content > .nf-single-wrapper {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1050px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Remove the needless huge top/bottom emptiness of the single-product section. */
html body.single-product .nf-single-wrapper {
  min-height: 0 !important;
  padding-top: 20px !important;
  padding-bottom: 64px !important;
}
html body.single-product .nf-single-wrapper div.product {
  padding-top: 0 !important;
  max-width: 100% !important;
}

/* Balance existing image and text columns without changing product photography. */
@media (min-width: 841px) {
  html body.single-product .nf-single-wrapper div.product .woocommerce-product-gallery {
    box-sizing: border-box !important;
    width: 47% !important;
    max-width: 490px !important;
    float: left !important;
    margin-right: 0 !important;
  }
  html body.single-product .nf-single-wrapper div.product .summary {
    box-sizing: border-box !important;
    width: 49% !important;
    max-width: 510px !important;
    float: right !important;
    margin: 0 !important;
  }
}
html body.single-product .nf-single-wrapper div.product .product_title {
  font-size: clamp(29px, 3vw, 45px) !important;
  line-height: 1.13 !important;
  letter-spacing: -.025em !important;
}
html body.single-product .nf-single-wrapper div.product .woocommerce-product-gallery img {
  max-width: 100% !important;
  height: auto !important;
}

/* Description, tabs and related product sections remain inside the same width. */
html body.single-product .nf-single-wrapper :is(.woocommerce-tabs, .related, .upsells) {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

@media (max-width: 840px) {
  html body.single-product .nf-single-wrapper,
  html body.single-product .nf-catalogue-with-tree-main > .woocommerce,
  html body.single-product .nf-catalogue-with-tree-main > article.product,
  html body.single-product main#main-content > .woocommerce:has(> div.product) {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  html body.single-product .nf-single-wrapper {
    padding-top: 12px !important;
    padding-bottom: 45px !important;
  }
  html body.single-product .nf-single-wrapper div.product .woocommerce-product-gallery,
  html body.single-product .nf-single-wrapper div.product .summary {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html body.single-product .nf-single-wrapper div.product .product_title {
    font-size: clamp(28px, 6vw, 40px) !important;
  }
}
