/* =========================
   GALLERY FIX: no crop, fit by height, width auto
   подключить после основного CSS
   ========================= */

/* 1) отключаем "шахматную" ширину слайдов из nth-child */
.gallery .swiper-slide:nth-child(2n),
.gallery .swiper-slide:nth-child(2n+1) {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* 2) задаём базовую высоту ряда (меняй под дизайн) */
.gallery .swiper-slide {
  height: 260px;                 /* desktop height */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;             /* чтобы ничего не резало */
}

/* 3) картинка целиком, вписываем по высоте, ширина — по пропорциям */
.gallery .swiper-slide img,
.gallery .swiper-slide picture,
.gallery .swiper-slide picture img {
  height: 100% !important;
  width: auto !important;
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important; /* перебиваем cover */
  border-radius: 8px;
  display: block;
}

/* 4) если где-то контейнеры задают width:100% — убираем */
.gallery .swiper-slide picture {
  width: auto !important;
}

/* ---------- Адаптив ---------- */

/* <= 1580 (как у тебя основной брейк) */
@media (max-width:1579.98px) {
  .gallery .swiper-slide { height: 220px; }
}

/* <= 1271 */
@media (max-width:1270.98px) {
  .gallery .swiper-slide { height: 200px; }
}

/* <= 768 */
@media (max-width:767.98px) {
  .gallery .swiper-slide { height: 180px; }
}

/* <= 480 */
@media (max-width:479.98px) {
  .gallery .swiper-slide { height: 160px; }
}