/* Venofins Fish 4.29.7 — ONE WooCommerce product layout for ALL product types.
   No product IDs, image filenames, SKU, category or variation attribute selectors.
   A square image stage contains the entire original photo (never crop it).
   Preserve WC forms, selectable variations, carousel controls and share buttons. */
body.single-product .nusa-site-shell {
  --vf-gallery-stage: 1 / 1;
}

/* WooCommerce FlexSlider: the viewport normally gets a pixel height from JS.
   Constrain the image stage itself instead of allowing that stale calculated
   height to become a tall white frame for single-photo products. */
body.single-product .nusa-site-shell .woocommerce-product-gallery,
body.single-product .nusa-site-shell .ct-product-gallery-container,
body.single-product .nusa-site-shell .ct-woo-gallery {
  min-height: 0 !important;
  height: auto !important;
}
body.single-product .nusa-site-shell .woocommerce-product-gallery .flex-viewport,
body.single-product .nusa-site-shell .woocommerce-product-gallery__wrapper,
body.single-product .nusa-site-shell .ct-product-gallery-container .flexy-view,
body.single-product .nusa-site-shell .ct-product-gallery-container .vf-gallery-main-view {
  min-height: 0 !important;
  max-height: none !important;
}
body.single-product .nusa-site-shell .woocommerce-product-gallery__image,
body.single-product .nusa-site-shell .woocommerce-product-gallery__image > a {
  box-sizing: border-box !important;
  min-height: 0 !important;
  max-height: none !important;
}

@media (max-width: 980px) {
  /* Treat each gallery's actual image as a single, predictable square stage.
     A 1:1 photo now reaches every side of the picture area; a non-square photo
     stays fully visible (contain), without distorting its aspect ratio. */
  body.single-product .nusa-site-shell .woocommerce-product-gallery,
  body.single-product .nusa-site-shell .ct-product-gallery-container,
  body.single-product .nusa-site-shell .ct-woo-gallery {
    display: block !important;
    padding: 10px !important;
    margin-block: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
  }

  body.single-product .nusa-site-shell .woocommerce-product-gallery .flex-viewport,
  body.single-product .nusa-site-shell .woocommerce-product-gallery__wrapper,
  body.single-product .nusa-site-shell .ct-product-gallery-container .flexy-view,
  body.single-product .nusa-site-shell .ct-product-gallery-container .vf-gallery-main-view {
    box-sizing: border-box !important;
    aspect-ratio: var(--vf-gallery-stage) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.single-product .nusa-site-shell .woocommerce-product-gallery__image,
  body.single-product .nusa-site-shell .woocommerce-product-gallery__image > a,
  body.single-product .nusa-site-shell .ct-product-gallery-container .flexy-view .ct-image-container,
  body.single-product .nusa-site-shell .ct-product-gallery-container .flexy-view .ct-media-container {
    aspect-ratio: var(--vf-gallery-stage) !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.single-product .nusa-site-shell .woocommerce-product-gallery__image img,
  body.single-product .nusa-site-shell .woocommerce-product-gallery__wrapper img,
  body.single-product .nusa-site-shell .ct-product-gallery-container img.wp-post-image,
  body.single-product .nusa-site-shell .ct-product-gallery-container .flexy-view img {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    aspect-ratio: var(--vf-gallery-stage) !important;
    object-fit: contain !important;
    object-position: center center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
  }

  body.single-product .nusa-site-shell .woocommerce-product-gallery .flex-control-thumbs,
  body.single-product .nusa-site-shell .vf-gallery-vertical-host .vf-gallery-vertical-thumbs {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* A simple Woo product has no variation table. Its cart form only contains
     the fixed mobile purchase bar, so it MUST NOT occupy vertical space. */
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) form.cart:not(.variations_form):has(.vf-mobile-purchase-host) {
    display: block !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) form.cart:not(.variations_form):has(.vf-mobile-purchase-host)::before,
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) form.cart:not(.variations_form):has(.vf-mobile-purchase-host)::after {
    display: none !important;
  }

  body.single-product .nusa-site-shell :is(.summary,.entry-summary) {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    row-gap: 0 !important;
  }
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) > p.stock,
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) > .stock {
    margin: 7px 0 9px !important;
    padding: 5px 10px !important;
  }
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) .product_meta {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 9px 0 0 !important;
    padding: 10px 0 0 !important;
    border-top: 1px solid #e0e7e0 !important;
    line-height: 1.5 !important;
  }
  body.single-product .nusa-site-shell :is(.summary,.entry-summary) .product_meta > span {
    display: block !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  body.single-product .nusa-site-shell .vf-product-share {
    margin: 10px 0 12px !important;
    padding: 10px 0 0 !important;
  }

  /* The long product description is allowed to grow naturally, but the tabs
     and the related row must follow its real last content — not a min-height. */
  body.single-product .nusa-site-shell :is(.woocommerce-tabs,.ct-woo-tabs),
  body.single-product .nusa-site-shell :is(.woocommerce-tabs,.ct-woo-tabs) > :is(.panel,.woocommerce-Tabs-panel),
  body.single-product .nusa-site-shell :is(.woocommerce-tabs,.ct-woo-tabs) .entry-content {
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  body.single-product .nusa-site-shell :is(.woocommerce-tabs,.ct-woo-tabs) > :is(.panel,.woocommerce-Tabs-panel) > :last-child {
    margin-bottom: 0 !important;
  }
  body.single-product .nusa-site-shell .vf-product-related {
    clear: both !important;
    margin-top: 16px !important;
    padding-top: 18px !important;
    margin-bottom: 25px !important;
  }
}
