.top-rightblock .collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 10px;
}

.collection-grid .collection-card {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
}

.collection-grid .collection-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.collection-grid .collection-card:focus-visible {
  outline: 3px solid #765389;
  outline-offset: 3px;
}

.collection-item { min-width: 0; }
.collection-thumbnail { position: relative; }
.collection-grid .collection-name {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  color: #333;
  text-decoration: none;
  font-weight: normal;
}
.collection-grid .collection-name:hover { color: #666; text-decoration: none; }
.collection-zoom {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #536975;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.collection-zoom::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; }
#collection-hover-preview {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  background: #fff;
  box-shadow: 0 4px 24px #0004;
  border-radius: 8px;
  overflow: hidden;
}
#collection-hover-preview[hidden] { display: none; }
#collection-hover-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
#collection-preview-dialog {
  padding: 0;
  border: 0;
  border-radius: 0;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  background: transparent;
}
#collection-preview-dialog::backdrop { background: #0009; }
.collection-preview-close {
  display: grid;
  place-items: center;
  margin: 0 0 8px auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
#collection-preview-dialog .collection-preview-image {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 116px);
  object-fit: contain;
}

.collection-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 12px;
}

.collection-pagination a,
.collection-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.collection-pagination .current {
  background: #765389;
  color: #fff;
  border-color: #765389;
}

@media screen and (max-width: 767px) {
  .top-rightblock .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
  }
}
