.custom-gallery-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.main-and-thumbs {
  display: flex;
  gap: 16px;
  height: 464px;
}

.main-image-wrapper {
  flex: 2;
  height: 100%;
  overflow: hidden;
}

.main-image {
  height: 100%;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-thumbs {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  justify-content: space-between;
}

.thumb-box {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
}

.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.thumb-box img:hover {
  transform: scale(1.05);
}

/* Mobile styles */
@media (max-width: 768px) {
  .main-and-thumbs {
    flex-direction: column;
    height: auto;
  }

  .side-thumbs {
    flex-direction: row; /* тепер горизонтальний ряд */
    flex-wrap: wrap;
    justify-content: center; /* по центру по горизонталі */
    gap: 8px;
    height: auto;
    align-items: center; /* по центру по вертикалі, якщо висота різна */
    margin-bottom: 55px;
  }

  .side-thumbs a {
    width: 30%;
    height: auto;
  }
}

.elementor-slideshow__counter {
  display: none !important;
}