/* Shared gallery lightbox (tingle) + video badge (product & series) */

.swiper-slide.is-video,
.swiper-slide:has(.gallery-video-badge) {
  position: relative;
}

.gallery-video-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.gallery-video-badge__icon {
  display: block;
  width: 42px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.preview__slider .gallery-video-badge__icon {
  width: 28px;
  height: 20px;
}

.main-slider .gallery-video-badge__icon,
.product .swiper-slide .gallery-video-badge__icon {
  width: 64px;
  height: 46px;
}

/* Legacy class still present in chunks during transition */
.demo-gallery-poster {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  margin: 0;
}

.demo-gallery-poster img {
  display: block;
  width: 42px;
  height: 30px;
  max-width: none;
  margin: 0 !important;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.preview__slider .demo-gallery-poster img {
  width: 28px;
  height: 20px;
}

.main-slider .demo-gallery-poster img,
.product .swiper-slide .demo-gallery-poster img {
  width: 64px;
  height: 46px;
}

/* tingle gallery modal — same stack as certificates, darker media shell */
.tingle-modal.gallery-modal {
  background: rgba(20, 24, 28, 0.88);
  z-index: 10050;
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  .tingle-modal.gallery-modal {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.tingle-modal.gallery-modal .tingle-modal-box {
  width: min(96vw, 1100px);
  max-width: min(96vw, 1100px);
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.tingle-modal.gallery-modal .tingle-modal-box__content {
  position: relative;
  padding: 0;
  min-height: min(90vh, 780px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nl-gallery__stage {
  width: 100%;
  height: min(90vh, 780px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nl-gallery__image,
.nl-gallery__video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.nl-gallery__frame {
  width: min(100%, 1000px);
  aspect-ratio: 16 / 9;
  max-height: 100%;
  border: 0;
  background: #000;
}

.nl-gallery__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  border: none;
  outline: none;
  background: none;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  transition: 0.6s;
  padding: 8px;
  line-height: 1;
}

/* icon font glyph (series page may not load product.css) */
.nl-gallery__close .icon-close:before {
  content: "\e90d";
  font-family: 'nvgtr', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nl-gallery__close:hover {
  transform: rotate(90deg);
}

.nl-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  cursor: pointer;
}

.nl-gallery__nav[hidden] {
  display: none !important;
}

.nl-gallery__nav--prev {
  left: 0;
}

.nl-gallery__nav--next {
  right: 0;
}

.nl-gallery__nav--prev::before,
.nl-gallery__nav--next::before {
  font-family: 'nvgtr', sans-serif;
  font-size: 18px;
  line-height: 44px;
}

.nl-gallery__nav--prev::before {
  content: '\e900';
}

.nl-gallery__nav--next::before {
  content: '\e901';
}

.nl-gallery__counter {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  color: #fff;
  font: 13px/1.2 Helvetica Neue, Helvetica, Arial, sans-serif;
  opacity: 0.9;
  pointer-events: none;
}

@media screen and (max-width: 767.98px) {
  .tingle-modal.gallery-modal .tingle-modal-box {
    width: 100%;
    max-width: 100%;
  }

  .tingle-modal.gallery-modal .tingle-modal-box__content,
  .nl-gallery__stage {
    min-height: 100vh;
    height: 100vh;
  }

  .nl-gallery__close {
    top: 8px;
    right: 8px;
  }

  .nl-gallery__nav--prev {
    left: 8px;
  }

  .nl-gallery__nav--next {
    right: 8px;
  }

  .nl-gallery__counter {
    bottom: 16px;
  }

  .main-slider .gallery-video-badge__icon,
  .product .swiper-slide .gallery-video-badge__icon,
  .main-slider .demo-gallery-poster img,
  .product .swiper-slide .demo-gallery-poster img {
    width: 48px;
    height: 34px;
  }
}
