:root {
  --ds-pg-border: #e6e8ee;
  --ds-pg-radius: 12px;
  --ds-pg-gap: 10px;
}

/* Shell */
.ds-pg {
  width: 100%;
}

/* Main stage */
.ds-pg__main {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.ds-pg__stage {
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
}

.ds-pg__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Arrows */
.ds-pg__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.ds-pg__nav--prev {
  left: 10px;
}
.ds-pg__nav--next {
  right: 10px;
}

.ds-pg__nav:active {
  transform: translateY(-50%) scale(0.98);
}

/* Thumbs */
.ds-pg__thumbs {
  display: flex;
  gap: var(--ds-pg-gap);
  margin-top: 10px;
  overflow-x: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.ds-pg__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid #ced4da;
  background: #fff;
  padding: 0px;
  cursor: pointer;
}

.ds-pg__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ds-pg__thumb.is-active {
}
.ds-pg__thumb.is-active:focus {
}

/* Mobile sizing */
@media (max-width: 480px) {
  .ds-pg__stage {
    aspect-ratio: 5 / 5;
  }
  .ds-pg__thumb {
    width: 64px;
    height: 64px;
  }
  .ds-pg__nav {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

.ds-pg__thumb {
  position: relative;
  overflow: hidden; /* keeps overlay inside rounded corners */
}

/* overlay layer */
.ds-pg__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28); /* overlay strength */
  opacity: 1;
  transition: opacity 160ms ease;
  pointer-events: none;
}

/* remove overlay on hover/focus/active + active thumb */
.ds-pg__thumb:hover::after,
.ds-pg__thumb:focus::after,
.ds-pg__thumb:focus-visible::after,
.ds-pg__thumb:active::after,
.ds-pg__thumb.is-active::after {
  opacity: 0;
}

/* accessible focus ring */
.ds-pg__thumb:focus-visible {
  outline: 0;
  outline-offset: 0;
}

/* optional: make active thumb feel "raised" */
.ds-pg__thumb.is-active {
  border-color: #111827;
}
