.hwt-gallery {
  --hwt-thumb-size: 84px;
  box-sizing: border-box;
  width: 100%;
}

.hwt-gallery *,
.hwt-gallery *::before,
.hwt-gallery *::after {
  box-sizing: inherit;
}

.hwt-gallery__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
}

.hwt-gallery__caption {
  border-bottom: 1px solid var(--e-global-color-secondary);
  text-align: center;
  padding-bottom: 40px;
  margin-bottom: 40px;
}

.hwt-gallery--no-arrows .hwt-gallery__top {
  grid-template-columns: 1fr;
}

.hwt-gallery__nav {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #111;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.hwt-gallery__nav:focus {
  outline: 2px solid rgba(0, 0, 0, 0.3);
  outline-offset: 2px;
}

.hwt-gallery--no-arrows .hwt-gallery__nav {
  display: none;
}

.hwt-gallery__stage {
  display: block;
  overflow: hidden;
  width: 100%;
}

.hwt-gallery__viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.hwt-gallery__track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hwt-gallery__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hwt-gallery__lightbox {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.hwt-gallery__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 5px !important;
  user-select: none;
  -webkit-user-drag: none;
}

.hwt-gallery__image.is-loading {
  opacity: 0.35;
}

.hwt-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
  gap: 10px;
}

.hwt-gallery--no-thumbs .hwt-gallery__thumbs {
  display: none;
}

.hwt-gallery__thumb {
  appearance: none;
  border: 2px solid transparent;
  background: transparent;
  padding: 0;
  width: var(--hwt-thumb-size);
  height: var(--hwt-thumb-size);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.hwt-gallery__thumb.is-active {
  border-color: #000;
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hwt-gallery__lightbox-items {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 767px) {
  .hwt-gallery__top {
    grid-template-columns: 1fr;
  }

  .hwt-gallery__nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .hwt-gallery__thumb {
    width: 25px !important;
    height: 25px !important;
  }

  .hwt-gallery__thumbs {
    gap: 5px !important;
  }

  .hwt-gallery__top {
    padding-bottom: 5px !important;
  }
}
