/* ══════════════════════════════════════
   NS PRODUCT GALLERY
══════════════════════════════════════ */

.ns-gallery-wrap {
  font-family: 'Outfit', sans-serif;
}

/* ── MAIN IMAGE ── */
.ns-gallery-main {
  position: relative;
  overflow: hidden;
  background: #081230;
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 12px;

  /* Center images of different sizes */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

/* Premium blurred image background */
.ns-gallery-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;

  /* More subtle blur */
  transform: scale(1.08);
  filter: blur(10px);

  /* Lower opacity so image details remain visible */
  opacity: 0.35;

  z-index: 0;
  transition: background-image 0.3s ease;
}

/* Premium dark overlay */
.ns-gallery-main::before {
  content: '';
  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      180deg,
      rgba(8,18,48,0.55) 0%,
      rgba(8,18,48,0.15) 30%,
      rgba(8,18,48,0.15) 70%,
      rgba(8,18,48,0.55) 100%
    );

  z-index: 1;
  pointer-events: none;
}

/* Subtle NanoShield blue glow */
.ns-gallery-main::after {
  content: '';
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at center,
      rgba(8,115,234,0.12) 0%,
      rgba(8,115,234,0) 65%
    );

  z-index: 1;
  pointer-events: none;
}

/* Main image stays above effects */
#nsGalleryMainImg {
  position: relative;
  z-index: 2;
}

/* UI elements stay on top */
.ns-gallery-badges,
.ns-gallery-counter,
.ns-gallery-zoom {
  z-index: 3;
}

#nsGalleryMainImg {
  width: 100%;
  height: 400px;

  /* Show full image without cropping */
  object-fit: cover;

  display: block;
  filter: brightness(0.88);
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.4s;
  cursor: zoom-in;
}

/* Hover effect */
.ns-gallery-main:hover #nsGalleryMainImg {
  filter: brightness(1);
  transform: scale(1.02);
}

/* Badges */
.ns-gallery-badges {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 2;
}

.ns-gallery-badge {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 5px 13px;
  display: inline-block;
}

.ns-gb-blue { background: #0873EA; color: white; }
.ns-gb-gold { background: #c9a84c; color: #04091a; }

/* Zoom button */
.ns-gallery-zoom {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(4,9,26,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 8px 14px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
  font-family: 'Outfit', sans-serif;
}

.ns-gallery-zoom,
.ns-gallery-zoom:hover,
.ns-gallery-zoom:focus,
.ns-gallery-zoom:active,
.ns-gallery-zoom:visited {
  border-color: rgba(8,115,234,0.4);
  color: white;
  background: rgba(4,9,26,0.7);
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  text-decoration: none;
}

.ns-gallery-zoom svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Counter */
.ns-gallery-counter {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  background: rgba(4,9,26,0.6);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* ── THUMBS ── */
.ns-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.ns-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.ns-gallery-thumb {
  width: 90px;
  height: 66px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.25s;
}

.ns-gallery-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #0873EA;
  opacity: 0;
  transition: opacity 0.25s;
}

.ns-gallery-thumb:hover,
.ns-gallery-thumb.active {
  border-color: #0873EA;
}

.ns-gallery-thumb.active::after {
  opacity: 0.12;
}

.ns-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75) saturate(0.8);
  transition: filter 0.3s;
  display: block;
}

.ns-gallery-thumb:hover img,
.ns-gallery-thumb.active img {
  filter: brightness(1) saturate(1);
}

/* ── LIGHTBOX ── */
.ns-gallery-lb {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ns-gallery-lb.open {
  opacity: 1;
  pointer-events: all;
}

.ns-gallery-lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4,9,26,0.96);
  backdrop-filter: blur(8px);
}

.ns-gallery-lb-inner {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ns-gallery-lb-inner img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Close button */
.ns-gallery-lb-close {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  transition: background 0.2s, border-color 0.2s;
  z-index: 3;
}

.ns-gallery-lb-close:hover {
  background: rgba(8,115,234,0.15);
  border-color: #0873EA;
}

.ns-gallery-lb-close span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: white;
  position: absolute;
}

.ns-gallery-lb-close span:first-child {
  transform: rotate(45deg);
}

.ns-gallery-lb-close span:last-child {
  transform: rotate(-45deg);
}

/* Prev / Next */
.ns-gallery-lb-prev,
.ns-gallery-lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  z-index: 3;
  color: white;

  /* Add these */
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.ns-gallery-lb-prev:hover,
.ns-gallery-lb-next:hover,
.ns-gallery-lb-prev:focus,
.ns-gallery-lb-next:focus,
.ns-gallery-lb-prev:active,
.ns-gallery-lb-next:active {
  background: rgba(8,115,234,0.2);
  border-color: #0873EA;
  outline: none;
  box-shadow: none;
  color: white;
}

.ns-gallery-lb-close:focus,
.ns-gallery-lb-close:active {
  outline: none;
  box-shadow: none;
}

.ns-gallery-lb-prev { left: 24px; }
.ns-gallery-lb-next { right: 24px; }

.ns-gallery-lb-prev:hover,
.ns-gallery-lb-next:hover {
  background: rgba(8,115,234,0.2);
  border-color: #0873EA;
}

.ns-gallery-lb-prev svg,
.ns-gallery-lb-next svg {
  width: 20px;
  height: 20px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .ns-gallery-main {
    min-height: 280px;
  }

  #nsGalleryMainImg {
    height: 280px;
  }

  .ns-gallery-thumb {
    width: 72px;
    height: 54px;
  }

  .ns-gallery-lb-prev { left: 10px; }
  .ns-gallery-lb-next { right: 10px; }

  .ns-gallery-lb-prev,
  .ns-gallery-lb-next {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .ns-gallery-main {
    min-height: 240px;
  }

  #nsGalleryMainImg {
    height: 240px;
  }

  .ns-gallery-thumb {
    width: 60px;
    height: 46px;
  }
}