.uhlbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.uhlbox-overlay.uhlbox-open {
  opacity: 1;
  visibility: visible;
}
.uhlbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.uhlbox-close:hover { background: rgba(255,255,255,0.3); }
.uhlbox-viewport {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: calc(100vh - 160px);
  padding: 20px;
}
.uhlbox-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 95%;
  max-height: 100%;
}
.uhlbox-image-container img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.uhlbox-caption {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  padding: 8px 0;
}
.uhlbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}
.uhlbox-nav:hover { background: rgba(255,255,255,0.3); }
.uhlbox-nav:active { transform: translateY(-50%) scale(0.92); }
.uhlbox-prev { left: 20px; }
.uhlbox-next { right: 20px; }
.uhlbox-thumbnails {
  width: 100%;
  height: 100px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 16px;
  gap: 8px;
  scroll-behavior: smooth;
  flex-shrink: 0;
}
.uhlbox-thumbnails::-webkit-scrollbar { height: 4px; }
.uhlbox-thumbnails::-webkit-scrollbar-track { background: transparent; }
.uhlbox-thumbnails::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }
.uhlbox-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.5;
}
.uhlbox-thumb:hover { opacity: 0.8; }
.uhlbox-thumb.uhlbox-active {
  border-color: #fff;
  opacity: 1;
}
.uhlbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.uhlbox-counter {
  position: absolute;
  bottom: 12px;
  right: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  z-index: 10;
  font-family: sans-serif;
}
@media (max-width: 576px) {
  .uhlbox-nav { width: 36px; height: 36px; font-size: 16px; }
  .uhlbox-prev { left: 8px; }
  .uhlbox-next { right: 8px; }
  .uhlbox-thumbnails { height: 76px; padding: 6px 10px; }
  .uhlbox-thumb { width: 56px; height: 56px; }
}
