/* v5.1.36 — mobile product image cover fallback: show the actual product, not the white canvas */

@media (max-width: 782px) {
  html body.vlg-theme.single-product .vlg-product-gallery-card {
    min-height: 0 !important;
    height: auto !important;
    padding: 6px !important;
    margin: 0 0 8px !important;
    background: #fff !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  html body.vlg-theme.single-product .vlg-mobile-featured-image,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image {
    position: relative !important;
    width: 100% !important;
    height: clamp(190px, 52vw, 238px) !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: 84% 50% !important;
    background-size: auto 112% !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  html body.vlg-theme.single-product .vlg-mobile-featured-image__link,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image__link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Default: use a cover crop so products embedded on a wide white canvas become visible. */
  html body.vlg-theme.single-product .vlg-mobile-featured-image__img,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image__img,
  html body.vlg-theme.single-product .vlg-mobile-featured-image img,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: 84% 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    background: transparent !important;
  }

  /* When JS canvas crop succeeded, show the generated cropped image normally. */
  html body.vlg-theme.single-product .vlg-mobile-featured-image__img.vlg-autocropped-image,
  html body.vlg-theme.single-product .vlg-mobile-featured-image__img.vlg-core-cropped-image,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image__img.vlg-autocropped-image,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image__img.vlg-core-cropped-image {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 98% !important;
    max-height: 98% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: auto !important;
  }

  /* If Core/JS switches to background crop mode, hide image and let background show product. */
  html body.vlg-theme.single-product .vlg-mobile-featured-image.vlg-bg-product-crop,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image.vlg-bg-product-crop {
    background-size: auto 118% !important;
    background-position: 86% 50% !important;
  }

  html body.vlg-theme.single-product .vlg-mobile-featured-image.vlg-bg-product-crop img,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image.vlg-bg-product-crop img {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  html body.vlg-theme.single-product .vlg-single-image-energy {
    right: 6px !important;
    bottom: 6px !important;
    transform: scale(.58) !important;
    transform-origin: right bottom !important;
    z-index: 4 !important;
  }

  html body.vlg-theme.single-product .vlg-product-summary-card,
  html body.vlg-theme.single-product div.product .summary {
    padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important;
  }

  html body.vlg-theme.single-product .vlg-product-buybox,
  html body.vlg-theme.single-product #vlg-product-buybox {
    margin-bottom: calc(150px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 390px) {
  html body.vlg-theme.single-product .vlg-mobile-featured-image,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image {
    height: clamp(176px, 50vw, 214px) !important;
    background-size: auto 120% !important;
    background-position: 86% 50% !important;
  }

  html body.vlg-theme.single-product .vlg-mobile-featured-image__img,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image__img,
  html body.vlg-theme.single-product .vlg-mobile-featured-image img,
  html body.vlg-theme.single-product .vlg-core-mobile-featured-image img {
    object-position: 86% 50% !important;
  }
}
