.bbg-swap-gallery {
  --bbg-gap: 10px;
  width: 100%;
}

.bbg-swap-gallery__main {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}

.bbg-swap-gallery__main:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.bbg-swap-gallery__main-image {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.bbg-swap-gallery .bbg-swap-gallery__slider {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 12px;
}

.bbg-swap-gallery .bbg-swap-gallery__thumbs {
  display: flex !important;
  flex-flow: row nowrap !important;
  grid-template-columns: none !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: var(--bbg-gap);
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bbg-swap-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.bbg-swap-gallery .bbg-swap-gallery__thumb {
  flex: 0 0 calc((100% - (3 * var(--bbg-gap))) / 4) !important;
  width: calc((100% - (3 * var(--bbg-gap))) / 4) !important;
  max-width: none !important;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
  background: transparent;
  cursor: pointer;
  opacity: .55;
  scroll-snap-align: start;
  transition: opacity .2s ease, outline-color .2s ease;
}

.bbg-swap-gallery__thumb.is-active,
.bbg-swap-gallery__thumb[aria-pressed="true"] {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.bbg-swap-gallery__thumb:focus-visible {
  opacity: 1;
  outline: 3px solid currentColor;
  outline-offset: -3px;
}

.bbg-swap-gallery .bbg-swap-gallery__thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
}

/* Flatsome rundet Bilder teils über zusätzliche Bild-/Thumbnail-Wrapper ab. */
.bbg-swap-gallery .bbg-swap-gallery__thumb picture,
.bbg-swap-gallery .bbg-swap-gallery__thumb span,
.bbg-swap-gallery .bbg-swap-gallery__thumb .image-cover,
.bbg-swap-gallery .bbg-swap-gallery__thumb .image-tools,
.bbg-swap-gallery .bbg-swap-gallery__thumb .thumbnail {
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
}

.bbg-swap-gallery__nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 34px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .9);
  color: #222;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .2);
}

.bbg-swap-gallery__nav--prev { left: 0; }
.bbg-swap-gallery__nav--next { right: 0; }
.bbg-swap-gallery__nav:disabled { opacity: .35; cursor: default; }

@media (hover: none), (pointer: coarse) {
  .bbg-swap-gallery__main { cursor: default; }
  .bbg-swap-gallery__nav { width: 38px; height: 48px; }
}

@media (max-width: 849px) {
  .bbg-swap-gallery .bbg-swap-gallery__thumbs {
    display: flex !important;
    flex-flow: row nowrap !important;
    overflow-x: auto !important;
  }

  .bbg-swap-gallery .bbg-swap-gallery__thumb {
    flex: 0 0 calc((100% - (3 * var(--bbg-gap))) / 4) !important;
  }
}
