.st360 {
  position: relative;
  width: 100%;
  max-width: var(--st360-width, 600px);
  aspect-ratio: var(--st360-ratio, 1 / 1);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--st360-bg, linear-gradient(#e9e9e9, #cfcfcf));
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.st360.is-dragging { cursor: grabbing; }
.st360.is-zoomed { touch-action: none; cursor: move; }
.st360:focus-visible { box-shadow: 0 0 0 2px #1a73e8; }

.st360-stage {
  position: absolute;
  inset: 0;
  transform-origin: center;
  transition: transform .2s ease;
}
.st360.is-dragging .st360-stage { transition: none; }
.st360-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}
.st360-stage img.is-active { opacity: 1; }

.st360-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 20px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  cursor: default;
  box-sizing: border-box;
}
.st360 .st360-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #111;
  cursor: pointer;
  line-height: 0;
}
.st360 .st360-btn:hover { background: rgba(0, 0, 0, .08); color: #111; }
.st360 .st360-btn:disabled { opacity: .35; cursor: default; background: transparent; }

.st360 .st360-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 120px;
  width: 120px;
  min-width: 50px;
  height: 18px;
  margin: 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.st360-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #111 var(--st360-fill, 0%), #bbb var(--st360-fill, 0%));
}
.st360-slider::-moz-range-track { height: 4px; border-radius: 2px; background: #bbb; }
.st360-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: #111; }
.st360-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #111;
}
.st360-slider::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #111; }

.st360:fullscreen,
.st360.is-fake-fullscreen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}
.st360.is-fake-fullscreen { position: fixed; inset: 0; z-index: 999999; }

@media (max-width: 420px) {
  .st360-bar { gap: 0; padding: 4px 6px; bottom: 8px; }
  .st360 .st360-btn { width: 30px; height: 30px; }
}

/* ---------- galerij ---------- */
.st360-gallery {
  width: 100%;
  max-width: var(--st360-width, 600px);
  margin: 0 auto;
}
.st360-gallery [hidden] { display: none !important; }
.st360-gallery-main {
  position: relative;
  aspect-ratio: var(--st360-ratio, 1 / 1);
  overflow: hidden;
  border-radius: 14px;
  background: var(--st360-bg, linear-gradient(#ececec, #d6d6d6));
}
.st360-gallery-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 4%;
  box-sizing: border-box;
  object-fit: contain;
}
.st360-gallery .st360:not(:fullscreen):not(.is-fake-fullscreen) {
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  background: transparent;
}
.st360-gallery .st360 .st360-stage { inset: 4%; }

.st360-gallery-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.st360-gallery-thumbs {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.st360-gallery-thumbs::-webkit-scrollbar { display: none; }

.st360-gallery .st360-gallery-thumb {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  min-width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #ececec;
  box-shadow: none;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s, box-shadow .15s;
}
.st360-gallery .st360-gallery-thumb:hover { opacity: 1; background: #ececec; }
.st360-gallery .st360-gallery-thumb.is-active { opacity: 1; box-shadow: 0 0 0 2px #111; }
.st360-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 6px;
  box-sizing: border-box;
  object-fit: contain;
}

.st360-gallery .st360-gallery-tile { opacity: 1; margin: 2px; }
.st360-gallery-tile span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, .55);
  color: #fff;
  line-height: 0;
  transition: background .15s;
}
.st360-gallery-tile:hover span { background: rgba(20, 20, 20, .7); }

.st360-gallery .st360-gallery-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #111;
  cursor: pointer;
  line-height: 0;
}
.st360-gallery .st360-gallery-arrow:hover { background: rgba(0, 0, 0, .08); color: #111; }
.st360-gallery-arrow.is-prev svg { transform: rotate(180deg); }

@media (max-width: 420px) {
  .st360-gallery .st360-gallery-thumb { width: 58px; height: 58px; }
  .st360-gallery-nav { gap: 4px; }
}

/* ---------- compact bij weinig ruimte (bijv. smalle kolom) ---------- */
.st360,
.st360-gallery { container-type: inline-size; }

@container (max-width: 400px) {
  .st360-bar { gap: 0; padding: 4px 6px; bottom: 8px; }
  .st360 .st360-btn { width: 28px; height: 28px; }
  .st360 .st360-btn svg { width: 18px; height: 18px; }
  .st360 .st360-slider { min-width: 28px; margin: 0 2px; }
}
@container (max-width: 300px) {
  .st360 .st360-btn[aria-label="Uitzoomen"] { display: none; }
}
@container (max-width: 440px) {
  .st360-gallery .st360-gallery-arrow { display: none; }
  .st360-gallery .st360-gallery-thumb { width: 56px; height: 56px; }
  .st360-gallery-nav, .st360-gallery-thumbs { gap: 6px; }
}

/* ---------- accentkleur ---------- */
.st360-gallery .st360-gallery-thumb.is-active { box-shadow: 0 0 0 2px var(--st360-accent, #111); }

/* ---------- WooCommerce productpagina ---------- */
.st360-woo { margin-bottom: 2em; }
.st360-woo .st360-gallery { max-width: none; }
.woocommerce div.product div.images.st360-woo img { width: 100%; height: 100%; max-width: none; box-shadow: none; }
