#stefan-ds-gallery .main_gallery_wrapper {
  width: 100%;
  max-width: 100%;
}

#stefan-ds-gallery .mg_nav_arrow:focus {
  outline: none;
  box-shadow: none;
}
#stefan-ds-gallery .mg_nav_arrow:focus-visible {
  outline: none;
  box-shadow: none;
}

#stefan-ds-gallery .mg_main_image_container {
  position: relative;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  overflow: hidden;
  transition: height 0.3s ease-in-out;
  border: 1px solid #00000020;
}

#stefan-ds-gallery .mg_media_display_area {
  width: calc(100% - 80px);
  height: 100%;
  overflow: hidden;
}

#stefan-ds-gallery .mg_media_track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease-in-out;
}

#stefan-ds-gallery .mg_media_slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stefan-ds-gallery .mg_media_display_area img,
#stefan-ds-gallery .mg_media_display_area video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  object-fit: contain;
}

#stefan-ds-gallery .mg_nav_arrow {
  position: absolute;
  background-color: var(--divi-color-4);
  color: white;
  border: none;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.2s,
    transform 0.2s,
    filter 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#stefan-ds-gallery .mg_nav_arrow:hover {
  filter: brightness(85%);
}

#stefan-ds-gallery .mg_prev_arrow {
  left: 0;
}
#stefan-ds-gallery .mg_next_arrow {
  right: 0;
}

#stefan-ds-gallery .mg_thumbnail_track_viewport {
  width: 100%;
  overflow-x: auto;
  position: relative;
  margin: 0 auto;
  padding-bottom: 16px;
  box-sizing: border-box;
}

#stefan-ds-gallery .mg_thumbnail_list {
  display: flex;
  gap: 16px;
  width: fit-content;
}

#stefan-ds-gallery .mg_thumbnail_item {
  width: 10vw;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  transition:
    border-color 0.3s,
    opacity 0.3s;
  flex-shrink: 0;
  opacity: 0.4;
  box-sizing: border-box;
  position: relative;
  background-color: #000;
}

#stefan-ds-gallery .mg_thumbnail_item[data-type="video"]::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 24px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 5px black;
  transition:
    transform 0.2s,
    background-color 0.2s;
  pointer-events: none;
}
#stefan-ds-gallery .mg_thumbnail_item[data-type="video"]:hover::after {
  background-color: rgba(80, 116, 215, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

#stefan-ds-gallery .mg_thumbnail_item img,
#stefan-ds-gallery .mg_thumbnail_item video,
#stefan-ds-gallery .mg_thumbnail_item canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#stefan-ds-gallery .mg_thumbnail_item.active {
  border-color: #5074d7;
  opacity: 1;
}

#stefan-ds-gallery .mg_thumbnail_track_viewport::-webkit-scrollbar {
  height: 11px;
}
#stefan-ds-gallery .mg_thumbnail_track_viewport::-webkit-scrollbar-track {
  background: var(--divi-color-6);
  border-radius: 4px;
}
#stefan-ds-gallery .mg_thumbnail_track_viewport::-webkit-scrollbar-thumb {
  background: var(--divi-color-4);
  border-radius: 4px;
}
#stefan-ds-gallery .mg_thumbnail_track_viewport::-webkit-scrollbar-thumb:hover {
  background: var(--divi-color-5);
}

#stefan-ds-gallery .mg_dots_container {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
#stefan-ds-gallery .mg_dot {
  width: 8px;
  height: 8px;
  background-color: var(--divi-color-5);
  opacity: 0.4;
  border-radius: 50%;
  cursor: pointer;
  transition:
    background-color 0.3s,
    transform 0.3s,
    opacity 0.3s;
  border: none;
  padding: 0;
}
#stefan-ds-gallery .mg_dot:hover {
  transform: scale(1.1);
}
#stefan-ds-gallery .mg_dot.active {
  opacity: 1;
}

@media (max-width: 767px) {
  #stefan-ds-gallery .mg_thumbnail_track_viewport {
    display: none;
  }
  #stefan-ds-gallery .mg_dots_container {
    display: flex;
  }
  #stefan-ds-gallery .mg_media_display_area {
    width: 100%;
  }
  #stefan-ds-gallery .mg_nav_arrow {
    top: auto;
    bottom: 0px;
    transform: translateY(0);
    height: 44px;
    width: 44px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 0;
  }
  #stefan-ds-gallery .mg_nav_arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
    filter: none;
  }
  #stefan-ds-gallery .mg_prev_arrow {
    left: 0px;
  }
  #stefan-ds-gallery .mg_next_arrow {
    right: 0px;
  }
  #stefan-ds-gallery .mg_main_image_container {
    border-radius: 0;
    box-shadow: 0px 3px 6px #0000004a;
  }
}

@media (min-width: 768px) {
  #stefan-ds-gallery .mg_nav_arrow {
    top: 0;
    height: 100%;
    width: 40px;
  }
  #stefan-ds-gallery .mg_prev_arrow {
    border-radius: 2px 0 0 2px;
  }
  #stefan-ds-gallery .mg_next_arrow {
    border-radius: 0 2px 2px 0;
  }
}
