.product-images-field {
  margin-bottom: 17px;
}

.product-images-field > label {
  margin-bottom: 0;
}

.product-image-previews {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 12px;
}

.product-image-previews figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  aspect-ratio: 1;
  background: var(--paper);
}

.product-image-previews img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-previews button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #292726dc;
  color: #fff;
  font-size: 17px;
  line-height: 1;
}

.product-image-previews figcaption {
  position: absolute;
  bottom: 5px;
  left: 5px;
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--berry);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

.gallery-control {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: #fffdf9dd;
  color: var(--ink);
  box-shadow: 0 2px 8px #0002;
}

.gallery-control.previous { left: 9px; }
.gallery-control.next { right: 9px; }

.gallery-count {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 99px;
  background: #292726cc;
  color: #fff;
  font-size: 9px;
}

.photo img.gallery-swap {
  animation: gallery-swap .45s ease;
}

@keyframes gallery-swap {
  from {
    opacity: .35;
    transform: scale(1.02);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo img.gallery-swap {
    animation: none;
  }
}

@media (max-width: 500px) {
  .product-image-previews { grid-template-columns: repeat(3, 1fr); }
}
