/* Keep the square clock face centered inside the full wall scene at every size. */
body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square {
  position: relative !important;
}

body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square #scene {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square #product {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) perspective(1100px)
    rotateX(var(--square-rx, 1deg)) rotateY(var(--square-ry, -2deg)) scale(.92) !important;
  transform-origin: center center !important;
}

/* Desktop square preview: keep both wall sconces farther from the clock edge. */
@media (min-width: 801px) {
  body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square {
    background-image: url('/assets/aligned-sconces-backdrop.png') !important;
    background-position: center center !important;
    background-size: cover !important;
  }
}

@media (max-width: 800px) {
  body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square {
    height: 440px !important;
    min-height: 440px !important;
    aspect-ratio: 1 / 1 !important;
  }

  body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square #product {
    --w: 420px !important;
    --h: 420px !important;
    width: 420px !important;
    height: 420px !important;
    transform: translate(-50%, -50%) perspective(1000px)
      rotateX(var(--square-rx, 1deg)) rotateY(var(--square-ry, -2deg)) scale(var(--square-mobile-scale, .7)) !important;
  }

  body.square-template.vertical-template .design-preview .real-3d.bho-preview-clock--square #productFront {
    width: 420px !important;
    height: 420px !important;
    max-width: none !important;
    max-height: none !important;
  }
}
