.ufg-gallery {
  max-width: 640px;
  margin: auto;
  font-family: system-ui;
}

.ufg-main {
  position: relative;
  padding-bottom: var(--ratio);
  background: #eee;
  border-radius: var(--radius);
  overflow: hidden;
}

.ufg-main img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ufg-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.ufg-thumb {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.ufg-thumb.active {
  border-color: #10b981;
}

.ufg-thumb img {
  width: 96px;
  height: 72px;
  object-fit: cover;
}
/* === Lightbox Zoom === */
.ufg-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.ufg-lightbox[hidden] {
  display: none;
}

.ufg-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 10px;
}

.ufg-lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  font-size: 34px;
  color: #fff;
  cursor: pointer;
}