/* Keep the same centered image box whether the badge is on or off. */
.bcrs-thumbnail {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  line-height: 0;
}
.bcrs-thumbnail > img:not(.bcrs-badge) {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.bcrs-thumbnail > img.bcrs-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  left: auto;
  bottom: auto;
  /* Thumbnail containers size all descendant images, including overlays. */
  width: 28% !important;
  max-width: 90px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  pointer-events: none;
  z-index: 2;
}
/* Mobile checkout: move the theme's image gutter and stacking from the img to the wrapper,
   so the badge stays on the image (the theme rule has ID specificity). */
body.checkout-checkout #cart-section .product-item .bcrs-thumbnail,
body.checkout-checkout #collapse-checkout-confirm .product-item .bcrs-thumbnail,
body.checkout-checkout .product-section .product-item .bcrs-thumbnail {
  flex: 0 0 auto;
  margin: 0 10px 0 0;
}
body.checkout-checkout #cart-section .product-item .bcrs-thumbnail > img:not(.bcrs-badge),
body.checkout-checkout #collapse-checkout-confirm .product-item .bcrs-thumbnail > img:not(.bcrs-badge),
body.checkout-checkout .product-section .product-item .bcrs-thumbnail > img:not(.bcrs-badge) {
  margin-right: 0;
}
body.checkout-checkout #cart-section .product-item .product-item-info > .bcrs-thumbnail,
body.checkout-checkout #collapse-checkout-confirm .product-item .product-item-info > .bcrs-thumbnail,
body.checkout-checkout .product-section .product-item .product-item-info > .bcrs-thumbnail {
  z-index: 99;
}
