/* bestkanc.ru: compact MOBILE product title and gallery.
   Preserve aspect ratio, full image, thumbnails and desktop layout.
   2026-10-27; independent of existing checkout, tabs and gallery scripts. */
@media (max-width: 767px) {
  .content article:has(.product-info) > h1 {
    font-size: 23px !important;
    line-height: 1.28 !important;
    font-weight: 700;
    letter-spacing: -.012em;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    overflow-wrap: break-word;
  }

  .product-info .product-card__left {
    padding: 14px 12px 16px !important;
    box-sizing: border-box !important;
  }

  .product-info .product-card__gallery {
    width: 100% !important;
    max-width: 310px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Reuse the gallery's existing CSS size variable. It controls the
     carousel, all slides and their min/max height together. */
  .product-info .product-gallery-main {
    --bestkanc-mobile-gallery-size: min(310px, calc(100vw - 46px)) !important;
  }

  .product-info .product-gallery-main__el-inner,
  .product-info .product-gallery-main__el-link {
    padding: 5px !important;
    aspect-ratio: 1 / 1 !important;
  }

  .product-info .product-gallery-main__el-photo,
  .product-info .product-gallery-main__el-inner img,
  .product-info .product-gallery-main__el-link img {
    object-fit: contain !important;
    object-position: center center !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }
}
