/* Roongsiri Product to Post Migrator v0.1.2 — stable 4:3 gallery frame.
   Display each source image in full (contain); never crop original photographs. */
.rs-p2p-gallery {
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 1.5rem;
}
.rs-p2p-gallery *,
.rs-p2p-gallery *::before,
.rs-p2p-gallery *::after { box-sizing: border-box; }

/* Aspect ratio belongs to the BUTTON, not the image. Swapping a portrait or
   landscape image therefore does not change this element's dimensions. */
.rs-p2p-gallery .rs-p2p-hero {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f7f8fa;
  cursor: zoom-in;
  line-height: 0;
}
.rs-p2p-gallery .rs-p2p-hero .rs-p2p-hero-image {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  margin: 0;
  object-fit: contain;
  object-position: center center;
  border-radius: 0;
}
.rs-p2p-gallery .rs-p2p-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  background: rgba(0, 0, 0, .68);
  border-radius: 5px;
  color: #fff;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}
.rs-p2p-gallery .rs-p2p-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.rs-p2p-gallery .rs-p2p-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  margin: 0;
  padding: 3px;
  background: #f7f8fa;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.rs-p2p-gallery .rs-p2p-thumb.is-active { border-color: #266caa; }
.rs-p2p-gallery .rs-p2p-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 3px;
}
.rs-p2p-gallery .rs-p2p-thumb:focus-visible,
.rs-p2p-gallery .rs-p2p-hero:focus-visible {
  outline: 3px solid #246cad;
  outline-offset: 3px;
}
.rs-p2p-gallery .rs-p2p-dialog {
  position: fixed;
  max-width: 95vw;
  max-height: 95vh;
  border: 0;
  padding: 45px 12px 12px;
  border-radius: 9px;
  background: #fff;
}
.rs-p2p-gallery .rs-p2p-dialog::backdrop { background: rgba(0, 0, 0, .82); }
.rs-p2p-gallery .rs-p2p-dialog img {
  display: block;
  max-width: 90vw;
  max-height: calc(90vh - 60px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.rs-p2p-gallery .rs-p2p-close {
  position: absolute;
  right: 9px;
  top: 5px;
  padding: 3px 10px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.rs-p2p-variations { margin: 1.5rem 0; }
@media (max-width: 767px) {
  .rs-p2p-gallery .rs-p2p-thumbnails { gap: 6px; margin-top: 8px; }
  .rs-p2p-gallery .rs-p2p-thumb {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    padding: 2px;
  }
  .rs-p2p-gallery .rs-p2p-zoom-hint { right: 6px; bottom: 6px; font-size: 11px; }
}
