/**
 * Helova Core Store 4.14.9 — deterministic product gallery and quantity controls.
 * Loaded only on single-product pages and after every legacy presentation layer.
 */

/* Main gallery must always occupy the media column and remain visible. */
body.single-product.helova-core-active .helova-static-product-v420__media {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

body.single-product.helova-core-active.helova-pdp-gallery-thumbs-left
  .helova-static-product-v420 .helova-pdp-gallery-v400,
body.single-product.helova-core-active:not(.helova-pdp-gallery-thumbs-bottom):not(.helova-pdp-gallery-stacked)
  .helova-static-product-v420 .helova-pdp-gallery-v400 {
  display: grid !important;
  grid-template-columns: var(--helova-pdp-thumb-size, 82px) minmax(0, 1fr) !important;
  grid-template-areas: "thumbs main" !important;
  align-items: start !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-gallery-v400.has-one-image {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas: "main" !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-gallery-v400.has-one-image .helova-pdp-thumbs-v400 {
  display: none !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-main-frame-v400 {
  grid-area: main !important;
  display: block !important;
  position: relative !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 320px !important;
  max-height: none !important;
  aspect-ratio: var(--helova-pdp-image-ratio, 4 / 5) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(75, 46, 43, .10) !important;
  border-radius: 8px !important;
  background: linear-gradient(145deg, #fffdfb, #f7eee3) !important;
  box-shadow: 0 18px 48px rgba(75, 46, 43, .06) !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-main-link-v400,
body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-main-image-v400 {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-main-link-v400 {
  position: absolute !important;
  inset: 0 !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-main-image-v400 {
  object-fit: var(--helova-pdp-image-fit, contain) !important;
  object-position: center !important;
  background: transparent !important;
  transform: none !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-thumbs-v400 {
  grid-area: thumbs !important;
  display: grid !important;
  grid-auto-flow: row !important;
  grid-auto-rows: min-content !important;
  align-content: start !important;
  gap: 9px !important;
  width: var(--helova-pdp-thumb-size, 82px) !important;
  max-height: min(78vh, 760px) !important;
  margin: 0 !important;
  padding: 0 2px 0 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.single-product.helova-core-active .helova-static-product-v420
  .helova-pdp-thumb-v400 {
  width: 100% !important;
  height: auto !important;
  min-height: 72px !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 !important;
  padding: 3px !important;
}

/* Bottom-thumbnail setting remains supported without allowing the main image to collapse. */
body.single-product.helova-core-active.helova-pdp-gallery-thumbs-bottom
  .helova-static-product-v420 .helova-pdp-gallery-v400 {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
}

body.single-product.helova-core-active.helova-pdp-gallery-thumbs-bottom
  .helova-static-product-v420 .helova-pdp-main-frame-v400 {
  order: 1 !important;
  width: 100% !important;
}

body.single-product.helova-core-active.helova-pdp-gallery-thumbs-bottom
  .helova-static-product-v420 .helova-pdp-thumbs-v400 {
  order: 2 !important;
  display: flex !important;
  flex-flow: row nowrap !important;
  width: 100% !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body.single-product.helova-core-active.helova-pdp-gallery-thumbs-bottom
  .helova-static-product-v420 .helova-pdp-thumb-v400 {
  flex: 0 0 var(--helova-pdp-thumb-size, 82px) !important;
  width: var(--helova-pdp-thumb-size, 82px) !important;
}

/* Keep the stacked option intentional. */
body.single-product.helova-core-active.helova-pdp-gallery-stacked
  .helova-static-product-v420 .helova-pdp-gallery-v400 {
  display: block !important;
}
body.single-product.helova-core-active.helova-pdp-gallery-stacked
  .helova-static-product-v420 :where(.helova-pdp-main-frame-v400, .helova-pdp-thumbs-v400) {
  display: none !important;
}
body.single-product.helova-core-active.helova-pdp-gallery-stacked
  .helova-pdp-stack-v4140 {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;
}

/* Symmetrical minus / quantity / plus control: one row in every browser. */
body.single-product.helova-core-active .helova-product-quantity-v474 {
  display: grid !important;
  grid-template-columns: 46px 64px 46px !important;
  grid-template-rows: 54px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  flex: 0 0 auto !important;
  width: 156px !important;
  min-width: 156px !important;
  max-width: 100% !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(107, 30, 53, .22) !important;
  border-radius: var(--helova-button-radius, 6px) !important;
  background: #fffdfb !important;
  box-sizing: border-box !important;
}

body.single-product.helova-core-active .helova-product-quantity-v474 > .is-minus {
  grid-column: 1 !important;
  grid-row: 1 !important;
}
body.single-product.helova-core-active .helova-product-quantity-v474 > .quantity {
  grid-column: 2 !important;
  grid-row: 1 !important;
}
body.single-product.helova-core-active .helova-product-quantity-v474 > .is-plus {
  grid-column: 3 !important;
  grid-row: 1 !important;
}

body.single-product.helova-core-active .helova-product-quantity-v474 > .helova-quantity-button-v474,
body.single-product.helova-core-active .helova-product-quantity-v474 > .quantity {
  position: static !important;
  inset: auto !important;
  float: none !important;
  clear: none !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 54px !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
}

body.single-product.helova-core-active .helova-product-quantity-v474 > .quantity {
  border-top: 0 !important;
  border-bottom: 0 !important;
  border-right: 1px solid rgba(107, 30, 53, .13) !important;
  border-left: 1px solid rgba(107, 30, 53, .13) !important;
  border-radius: 0 !important;
}

body.single-product.helova-core-active .helova-product-quantity-v474 input.qty {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 52px !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 0 6px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  text-align: center !important;
  line-height: 52px !important;
  box-shadow: none !important;
}

body.single-product.helova-core-active .helova-product-quantity-v474
  > .helova-quantity-button-v474 {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  line-height: 54px !important;
  text-align: center !important;
}

@media (max-width: 899px) {
  body.single-product.helova-core-active:not(.helova-pdp-gallery-stacked)
    .helova-static-product-v420 .helova-pdp-gallery-v400 {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  body.single-product.helova-core-active:not(.helova-pdp-gallery-stacked)
    .helova-static-product-v420 .helova-pdp-main-frame-v400 {
    order: 1 !important;
    width: 100% !important;
    min-height: 280px !important;
    aspect-ratio: var(--helova-pdp-image-ratio, 4 / 5) !important;
  }
  body.single-product.helova-core-active:not(.helova-pdp-gallery-stacked)
    .helova-static-product-v420 .helova-pdp-thumbs-v400 {
    order: 2 !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    width: 100% !important;
    max-height: none !important;
    padding: 2px 0 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
  body.single-product.helova-core-active:not(.helova-pdp-gallery-stacked)
    .helova-static-product-v420 .helova-pdp-thumb-v400 {
    flex: 0 0 68px !important;
    width: 68px !important;
    min-height: 68px !important;
  }
}

@media (max-width: 600px) {
  body.single-product.helova-core-active form.cart,
  body.single-product.helova-core-active .woocommerce-variation-add-to-cart {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  body.single-product.helova-core-active .helova-product-quantity-v474 {
    grid-template-columns: 48px minmax(58px, 1fr) 48px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.single-product.helova-core-active form.cart .single_add_to_cart_button {
    width: 100% !important;
    min-width: 0 !important;
  }
}
