/* === ZM33 m203: mobile card images — center gallery slides (Хиты/Выгодно + catalog) === */
@media (max-width: 767px) {
  /*
   * Theme gallery lays slides in a horizontal row (hover swap).
   * On mobile that shifts the active photo left. Stack slides and
   * show only .is-active, centered in the gray rounded plane.
   */
  #mainContainer .products .products__item-gallery,
  .products-featured .products__item-gallery {
    display: -ms-flexbox !important;
    display: flex !important;
    -ms-flex-direction: column !important;
    flex-direction: column !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
  }

  #mainContainer .products .products__item-gallery > .products__item-image,
  .products-featured .products__item-gallery > .products__item-image {
    display: none !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0.6rem !important;
    border-radius: 0 !important;
    background: transparent !important;
    aspect-ratio: auto !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
    transform: none !important;
  }

  #mainContainer .products .products__item-gallery > .products__item-image.is-active,
  .products-featured .products__item-gallery > .products__item-image.is-active {
    display: -ms-flexbox !important;
    display: flex !important;
  }

  #mainContainer .products .products__item-gallery .products__item-pagination,
  .products-featured .products__item-gallery .products__item-pagination {
    display: none !important;
  }

  /* Single-image cards + gallery active slide: fill plane, keep aspect */
  #mainContainer .products .products__item-image img,
  #mainContainer .products .products__item-gallery img,
  .products-featured .products__item-image img,
  .products-featured .products__item-gallery img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  /* Non-gallery image link: also flex-center the img */
  #mainContainer .products a.products__item-image,
  .products-featured a.products__item-image {
    display: -ms-flexbox !important;
    display: flex !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
  }
}
