/* Showroom gallery preview: modal of the product gallery (pixel_productimages) ported 1:1,
   class prefix ppi- -> pxs-ppi-. Used by views/js/gallery-modal.js. */

#pxs-ppi-modal.pxs-ppi-modal {
  position: fixed;
  inset: 0;
  z-index: 2000000000;
  padding: 0 !important;
  background: #fff;
}

#pxs-ppi-modal.pxs-ppi-modal.fade .pxs-ppi-modal__dialog {
  transform: none;
}

@keyframes pxs-ppi-expand-in {
  from {
    transform: scale(0.72);
    opacity: 0.35;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pxs-ppi-swap-out-left {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(-32%, 0, 0) scale(0.96);
  }
}

@keyframes pxs-ppi-swap-out-right {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(32%, 0, 0) scale(0.96);
  }
}

@keyframes pxs-ppi-swap-in {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pxs-ppi-swap-out {
  pointer-events: none;
  object-fit: contain;
  transform-origin: center center;
}

.pxs-ppi-swap-out--left {
  animation: pxs-ppi-swap-out-left 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.pxs-ppi-swap-out--right {
  animation: pxs-ppi-swap-out-right 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.pxs-ppi-swap-in {
  transform-origin: center center;
  animation: pxs-ppi-swap-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

.pxs-ppi-cover.is-dragging,
.pxs-ppi-modal__figure.is-dragging {
  overflow: hidden;
}

.pxs-ppi-cover.is-dragging .pxs-ppi-cover__img,
.pxs-ppi-modal__figure.is-dragging .pxs-ppi-modal__img {
  position: relative;
  z-index: 2;
}

.pxs-ppi-drag-in {
  pointer-events: none;
  object-fit: contain;
  transform-origin: center center;
  z-index: 1;
}

@media (max-width: 991px) {
  .pxs-ppi-modal__figure {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pxs-ppi-swap-out--left,
  .pxs-ppi-swap-out--right,
  .pxs-ppi-swap-in {
    animation: none;
  }
}

.pxs-ppi-expand-flyer {
  display: none !important;
}

body:has(#pxs-ppi-modal.pxs-ppi-modal.show) .modal-backdrop,
body:has(#pxs-ppi-modal.pxs-ppi-modal[style*="display: block"]) .modal-backdrop {
  opacity: 0 !important;
}

#pxs-ppi-modal.pxs-ppi-modal .pxs-ppi-modal__dialog {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
}

#pxs-ppi-modal.pxs-ppi-modal .pxs-ppi-modal__content,
#pxs-ppi-modal.pxs-ppi-modal .pxs-ppi-modal__body {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  background: #fff;
}

#pxs-ppi-modal.pxs-ppi-modal .pxs-ppi-modal__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0 0;
}

.pxs-ppi-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 100%;
  background: transparent;
  cursor: pointer;
}

.pxs-ppi-modal__close svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(0.9);
}

.pxs-ppi-modal__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.pxs-ppi-modal__figure {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.pxs-ppi-modal__figure.is-zooming {
  cursor: grab;
}

.pxs-ppi-modal__figure.is-zooming.is-panning {
  cursor: grabbing;
}

.pxs-ppi-modal__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform-origin: center center;
}

.pxs-ppi-modal__nav {
  appearance: none;
  position: relative;
  flex: 0 0 48px;
  z-index: 5;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 100%;
  background: transparent;
  cursor: pointer;
}

.pxs-ppi-modal__nav svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(0.9);
}

.pxs-ppi-modal__nav--prev {
  transform: rotateZ(180deg);
}

.pxs-ppi-modal__nav--next {
  transform: none;
}

.pxs-ppi-modal__zoom {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background-color: #fff;
  transition: opacity 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity;
  transform: translateZ(0);
}

.pxs-ppi-zoom__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
}

.pxs-ppi-modal__figure.is-zooming .pxs-ppi-modal__zoom {
  opacity: 1;
}

.pxs-ppi-modal__thumbs-bar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 88px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 20px 16px;
}

.pxs-ppi-modal__thumbs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 8px 28px;
}

.pxs-ppi-modal__thumb {
  appearance: none;
  width: 72px;
  height: 60px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  line-height: 0;
}

.pxs-ppi-modal__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  padding-bottom: 4px;
  border: 0;
  border-bottom: 2px solid transparent;
}

.pxs-ppi-modal__thumb:not(.is-active):hover img {
  border-bottom-color: rgba(180, 180, 180, 0.3);
}

.pxs-ppi-modal__thumb.is-active img {
  border-bottom-color: rgb(180, 180, 180);
}

@media (min-width: 768px) {
  .pxs-ppi-modal__nav {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .pxs-ppi-modal__thumbs-bar {
    padding: 8px 24px 20px;
  }

  .pxs-ppi-modal__thumbs {
    padding: 8px 36px;
  }
}

@media (max-width: 767px) {
  #pxs-ppi-modal.pxs-ppi-modal .pxs-ppi-modal__body {
    padding: 50px 8px 8px;
  }

  .pxs-ppi-modal__close {
    width: 50px;
    height: 50px;
    top: 0;
    right: 0;
  }

  .pxs-ppi-modal__close svg {
    transform: scale(0.8);
  }

  .pxs-ppi-modal__nav {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    margin: 0;
  }

  .pxs-ppi-modal__thumbs-bar {
    flex: 0 0 70px;
    padding: 6px 8px 10px;
    gap: 4px;
  }

  .pxs-ppi-modal__thumbs {
    flex: 1 1 auto;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 8px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pxs-ppi-modal__thumbs::-webkit-scrollbar {
    display: none;
  }

  .pxs-ppi-modal__thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 50px;
  }
}

/* Showroom only: the Freshchat bubble sits on the thumbnail bar's next arrow */
body:has(#pxs-ppi-modal.show) freshchat-widget,
body:has(#pxs-ppi-modal.show) #fc_frame {
  display: none !important;
}

/* Showroom only: zoom buttons next to the close button (desktop, like click / wheel zoom) */
.pxs-ppi-modal__zoom-tools {
  position: absolute;
  top: 18px;
  right: 72px;
  z-index: 6;
  display: none;
  gap: 6px;
}

.pxs-ppi-modal__zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 100%;
  color: #333;
  /* Readable over the white backdrop and over a zoomed photo alike */
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.pxs-ppi-modal__zoom-btn svg path,
.pxs-ppi-modal__zoom-btn svg circle {
  stroke: currentColor;
}

/* Same treatment for the close button, which also ends up on the zoomed photo */
#pxs-ppi-modal .pxs-ppi-modal__close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

#pxs-ppi-modal .pxs-ppi-modal__close svg {
  transform: scale(0.85);
}

#pxs-ppi-modal .pxs-ppi-modal__close svg path {
  fill: #333;
}

.pxs-ppi-modal__zoom-btn svg {
  display: block;
  width: 26px;
  height: 26px;
}

.pxs-ppi-modal__zoom-btn:hover:not(:disabled),
.pxs-ppi-modal__zoom-btn:focus-visible,
#pxs-ppi-modal .pxs-ppi-modal__close:hover,
#pxs-ppi-modal .pxs-ppi-modal__close:focus-visible {
  background-color: #fff;
}

.pxs-ppi-modal__zoom-btn:disabled {
  color: #aaa;
  cursor: default;
}

@media (min-width: 992px) {
  .pxs-ppi-modal__zoom-tools {
    display: flex;
  }
}

/* Showroom only: the modal opens without Bootstrap's .fade (see buildShowroomModal), so the
   white backdrop fades in here, at the same time as the photo expands from its thumbnail. */
@keyframes pxs-ppi-backdrop-in {
  from {
    background-color: rgba(255, 255, 255, 0);
  }
  to {
    background-color: rgba(255, 255, 255, 1);
  }
}

#pxs-ppi-modal.pxs-ppi-modal.show {
  animation: pxs-ppi-backdrop-in 0.2s ease-out;
}

#pxs-ppi-modal.pxs-ppi-modal.show .pxs-ppi-modal__content,
#pxs-ppi-modal.pxs-ppi-modal.show .pxs-ppi-modal__body {
  animation: pxs-ppi-backdrop-in 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  #pxs-ppi-modal.pxs-ppi-modal.show,
  #pxs-ppi-modal.pxs-ppi-modal.show .pxs-ppi-modal__content,
  #pxs-ppi-modal.pxs-ppi-modal.show .pxs-ppi-modal__body {
    animation: none;
  }
}
