/* v5.1.86 — desktop product layout balance + gallery/code sync polish */
body.vlg-theme.single-product .vlg-single-product-page {
  width: min(1460px, calc(100vw - 48px)) !important;
  max-width: min(1460px, calc(100vw - 48px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.vlg-theme.single-product .vlg-product-detail,
body.vlg-theme.single-product .vlg-product-main-grid {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

body.vlg-theme.single-product .vlg-product-left,
body.vlg-theme.single-product .vlg-product-right {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (min-width: 1100px) {
  body.vlg-theme.single-product .vlg-product-main-grid,
  body.vlg-theme.single-product .vlg-product-detail .vlg-product-main-grid,
  body.single-product .vlg-product-main-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) clamp(390px, 31vw, 470px) !important;
    gap: clamp(24px, 2.6vw, 42px) !important;
    align-items: start !important;
  }

  body.vlg-theme.single-product .vlg-product-right {
    justify-self: stretch !important;
    width: 100% !important;
    max-width: 470px !important;
  }

  body.vlg-theme.single-product .vlg-product-summary-card {
    width: 100% !important;
    max-width: 470px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.vlg-theme.single-product .vlg-at-gallery-main {
    min-height: clamp(330px, 34vw, 540px) !important;
    aspect-ratio: 4 / 3 !important;
  }

  body.vlg-theme.single-product .vlg-at-gallery-main-img,
  body.vlg-theme.single-product .vlg-at-product-gallery img.vlg-at-gallery-main-img,
  body.vlg-theme.single-product .vlg-at-gallery-image-frame img {
    max-height: clamp(300px, 31vw, 500px) !important;
  }
}

@media (min-width: 1500px) {
  body.vlg-theme.single-product .vlg-single-product-page {
    width: min(1420px, calc(100vw - 72px)) !important;
    max-width: min(1420px, calc(100vw - 72px)) !important;
  }
}

@media (max-width: 1099px) {
  body.vlg-theme.single-product .vlg-single-product-page {
    width: min(100%, calc(100vw - 24px)) !important;
    max-width: min(100%, calc(100vw - 24px)) !important;
  }

  body.vlg-theme.single-product .vlg-product-main-grid,
  body.vlg-theme.single-product .vlg-product-detail .vlg-product-main-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  body.vlg-theme.single-product .vlg-product-right,
  body.vlg-theme.single-product .vlg-product-summary-card {
    max-width: none !important;
    width: 100% !important;
  }
}

/* Keep gallery arrows usable for code/variation switching even after older gallery JS has run. */
body.vlg-theme.single-product .vlg-at-gallery-nav:disabled,
body.vlg-theme.single-product .vlg-at-gallery-nav[disabled] {
  opacity: .42 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

body.vlg-theme.single-product .vlg-at-gallery-thumb.is-active,
body.vlg-theme.single-product .vlg-at-gallery-thumb[aria-current="true"] {
  border-color: var(--vlg-dark, #172033) !important;
  box-shadow: 0 0 0 2px rgba(23, 32, 51, .12) !important;
}
