/* Motolab product gallery v2 */

body.type-detail .p-image-wrapper.ml-gallery-v2 {
  --mlg-orange: #ff650f;
  --mlg-ink: #171a1d;
  --mlg-muted: #6d747a;
  --mlg-line: #e2e6e8;
  --mlg-surface: #fff;
  --mlg-soft: #f5f6f7;
  --mlg-shadow: 0 14px 36px rgba(18, 22, 25, 0.12);
  --mlg-stage-aspect: 1 / 1;
  position: relative;
  display: block !important;
  min-width: 0;
  padding: 0 !important;
}

body.type-detail .ml-gallery-v2 .p-image {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: var(--mlg-stage-aspect);
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  touch-action: pan-y;
}

body.type-detail .ml-gallery-v2 .p-image #wrap,
body.type-detail .ml-gallery-v2 .p-image .p-main-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

body.type-detail .ml-gallery-v2 .p-image .p-main-image {
  cursor: zoom-in;
}

body.type-detail .ml-gallery-v2 .p-image .mousetrap {
  display: none !important;
  pointer-events: none !important;
}

body.type-detail .ml-gallery-v2 .p-image .p-main-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

body.type-detail .ml-gallery-v2.mlg-image-fills-stage .p-image .p-main-image img {
  object-fit: cover;
}

body.type-detail .ml-gallery-v2 .p-thumbnails-wrapper {
  position: static;
  width: 100%;
  min-width: 0;
  margin: 10px 0 0 !important;
  overflow: visible;
}

body.type-detail .ml-gallery-v2 .p-thumbnails {
  position: relative !important;
  inset: auto;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 2px 2px 7px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.type-detail .ml-gallery-v2 .p-thumbnails::before,
body.type-detail .ml-gallery-v2 .p-thumbnails::after {
  display: none !important;
}

body.type-detail .ml-gallery-v2 .p-thumbnails::-webkit-scrollbar,
.mlg-viewer__thumbs::-webkit-scrollbar,
.mlg-viewer__scroller::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body.type-detail .ml-gallery-v2 .p-thumbnails-inner {
  position: static !important;
  left: auto !important;
  display: block !important;
  width: max-content !important;
  min-width: 100% !important;
  height: auto !important;
  transform: none !important;
}

body.type-detail .ml-gallery-v2 .p-thumbnails-inner > div {
  display: flex !important;
  width: max-content !important;
  flex-direction: row;
  gap: 8px;
}

body.type-detail .ml-gallery-v2 .p-thumbnail {
  position: relative;
  display: block !important;
  flex: 0 0 auto;
  width: 72px !important;
  height: 72px !important;
  margin: 0 !important;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent !important;
  border-radius: 5px;
  opacity: 0.72;
  scroll-snap-align: center;
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}

body.type-detail .ml-gallery-v2 .p-thumbnail:hover,
body.type-detail .ml-gallery-v2 .p-thumbnail:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

body.type-detail .ml-gallery-v2 .p-thumbnail.highlighted,
body.type-detail .ml-gallery-v2 .p-thumbnail[aria-current="true"] {
  border-color: var(--mlg-orange) !important;
  box-shadow: 0 0 0 2px rgba(255, 101, 15, 0.16);
  opacity: 1;
}

body.type-detail .ml-gallery-v2 .p-thumbnail.mlg-is-pending {
  border-color: rgba(255, 101, 15, 0.55) !important;
  opacity: 1;
}

body.type-detail .ml-gallery-v2[aria-busy="true"] .p-main-image {
  cursor: progress;
}

body.type-detail .ml-gallery-v2 .p-thumbnail img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

body.type-detail .ml-gallery-v2 .cbox-gal {
  display: none !important;
}

.mlg-stage-button,
.mlg-stage-open,
.mlg-viewer__button,
.mlg-viewer__thumb {
  -webkit-tap-highlight-color: transparent;
}

.mlg-stage-button,
.mlg-stage-open {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.mlg-stage-button {
  top: 50%;
  width: 46px;
  height: 64px;
  transform: translateY(-50%);
  color: rgba(255, 101, 15, 0.78);
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9));
  font-family: Arial, sans-serif;
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
}

.mlg-stage-button--prev {
  left: 2px;
}

.mlg-stage-button--next {
  right: 2px;
}

.mlg-stage-button:hover,
.mlg-stage-button:focus-visible {
  color: var(--mlg-orange);
  background: transparent;
}

.mlg-stage-open:hover,
.mlg-stage-open:focus-visible {
  color: #fff;
  background: var(--mlg-orange);
  border-color: var(--mlg-orange);
}

.mlg-stage-button:active {
  transform: translateY(-50%) scale(0.95);
}

.mlg-stage-open {
  right: 9px;
  bottom: 9px;
  width: 34px;
  height: 34px;
  color: #30363b;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 26, 29, 0.11);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(18, 22, 25, 0.12);
  font-family: Arial, sans-serif;
  font-size: 19px;
  line-height: 1;
}

.mlg-stage-open:active {
  transform: scale(0.95);
}

.mlg-stage-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  min-width: 56px;
  padding: 6px 9px;
  color: #30363b;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 26, 29, 0.1);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(18, 22, 25, 0.1);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.mlg-stage-progress {
  position: absolute;
  right: 64px;
  bottom: 13px;
  left: 64px;
  z-index: 4;
  height: 3px;
  overflow: hidden;
  background: rgba(23, 26, 29, 0.2);
  border-radius: 999px;
  pointer-events: none;
}

.mlg-stage-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--mlg-orange);
  border-radius: inherit;
  transition: width 220ms ease;
}

.mlg-stage-button:focus-visible,
.mlg-stage-open:focus-visible,
.mlg-viewer__button:focus-visible,
.mlg-viewer__thumb:focus-visible {
  outline: 3px solid rgba(255, 101, 15, 0.48);
  outline-offset: 2px;
}

body.mlg-viewer-lock {
  overflow: hidden !important;
}

.mlg-viewer[hidden] {
  display: none !important;
}

.mlg-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr) 104px;
  color: #fff;
  background: #0d0f11;
  opacity: 0;
  transform: scale(0.995);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mlg-viewer.mlg-is-open {
  opacity: 1;
  transform: none;
}

.mlg-viewer__toolbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-width: 0;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.mlg-viewer__count {
  grid-column: 2;
  grid-row: 1;
  min-width: 76px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.mlg-viewer__tools {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.mlg-viewer__close {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.mlg-viewer__button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.mlg-viewer__button:hover,
.mlg-viewer__button:focus-visible {
  color: #fff;
  background: var(--mlg-orange, #ff650f);
  border-color: var(--mlg-orange, #ff650f);
}

.mlg-viewer__button:active {
  transform: scale(0.94);
}

.mlg-viewer__zoom-in,
.mlg-viewer__zoom-out {
  font-size: 22px;
  font-weight: 400;
}

.mlg-viewer__zoom-value {
  display: inline-flex;
  width: 42px;
  height: 36px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.mlg-viewer__button:disabled {
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  cursor: default;
}

.mlg-viewer__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.mlg-viewer__scroller {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mlg-viewer__image {
  display: block;
  max-width: calc(100% - 72px);
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.mlg-viewer.mlg-is-zoomed .mlg-viewer__scroller {
  align-items: flex-start;
  justify-content: flex-start;
  cursor: grab;
}

.mlg-viewer.mlg-is-panning .mlg-viewer__scroller {
  cursor: grabbing;
}

.mlg-viewer.mlg-is-zoomed .mlg-viewer__stage {
  touch-action: none;
}

.mlg-viewer.mlg-is-zoomed .mlg-viewer__image {
  flex: 0 0 calc(var(--mlg-zoom-scale, 2) * 100%);
  width: calc(var(--mlg-zoom-scale, 2) * 100%);
  min-width: calc(var(--mlg-zoom-scale, 2) * 100%);
  max-width: none;
  max-height: none;
  margin: auto;
}

.mlg-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 68px;
  transform: translateY(-50%);
  color: rgba(255, 101, 15, 0.82);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 52px;
  font-weight: 300;
  line-height: 1;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.58);
  transition: color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.mlg-viewer.mlg-is-zoomed .mlg-viewer__nav {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.mlg-viewer__nav--prev {
  left: 14px;
}

.mlg-viewer__nav--next {
  right: 14px;
}

.mlg-viewer__nav:hover,
.mlg-viewer__nav:focus-visible {
  color: var(--mlg-orange, #ff650f);
  background: transparent;
}

.mlg-viewer__nav:active {
  transform: translateY(-50%) scale(0.94);
}

.mlg-viewer__progress {
  position: absolute;
  right: 18px;
  bottom: 8px;
  left: 18px;
  z-index: 4;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.17);
  border-radius: 999px;
}

.mlg-viewer__progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--mlg-orange, #ff650f);
  border-radius: inherit;
  transition: width 220ms ease;
}

.mlg-viewer__thumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  justify-content: safe center;
  gap: 8px;
  padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  overflow-x: auto;
  overflow-y: hidden;
  background: #111417;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  scroll-behavior: auto;
  scroll-snap-type: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mlg-viewer__thumb {
  display: block;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 2px solid transparent;
  border-radius: 5px;
  opacity: 0.62;
  scroll-snap-align: center;
  cursor: pointer;
  transition: opacity 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.mlg-viewer__thumb:hover,
.mlg-viewer__thumb:focus-visible,
.mlg-viewer__thumb[aria-current="true"] {
  border-color: var(--mlg-orange, #ff650f);
  opacity: 1;
}

.mlg-viewer__thumb[aria-current="true"] {
  transform: translateY(-2px);
}

.mlg-viewer__thumb img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 991px) {
  body.type-detail .ml-gallery-v2 .p-image {
    width: 100%;
    aspect-ratio: var(--mlg-stage-aspect);
  }

  body.type-detail .ml-gallery-v2 .p-thumbnail {
    width: 70px !important;
    height: 70px !important;
    scroll-snap-align: start;
  }
}

@media (max-width: 767px) {
  .mlg-stage-button {
    width: 42px;
    height: 58px;
    font-size: 44px;
  }

  .mlg-stage-button--prev {
    left: 0;
  }

  .mlg-stage-button--next {
    right: 0;
  }

  .mlg-stage-count {
    top: 7px;
    right: 7px;
  }

  .mlg-stage-open {
    right: 6px;
    bottom: 6px;
  }

  .mlg-stage-progress {
    right: 58px;
    bottom: 10px;
    left: 58px;
  }

  .mlg-viewer {
    grid-template-rows: calc(58px + env(safe-area-inset-top)) minmax(0, 1fr) calc(88px + env(safe-area-inset-bottom));
  }

  .mlg-viewer__toolbar {
    align-items: end;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .mlg-viewer__button {
    width: 34px;
    height: 34px;
  }

  .mlg-viewer__zoom-value {
    width: 40px;
    height: 34px;
    flex-basis: 40px;
  }

  .mlg-viewer__stage {
    touch-action: none;
  }

  .mlg-viewer__image {
    max-width: 100%;
    max-height: 100%;
  }

  .mlg-viewer__nav {
    width: 42px;
    height: 60px;
    color: rgba(255, 101, 15, 0.82);
    background: transparent;
    border: 0;
    font-size: 46px;
  }

  .mlg-viewer__nav--prev {
    left: 6px;
  }

  .mlg-viewer__nav--next {
    right: 6px;
  }

  .mlg-viewer__progress {
    right: 10px;
    bottom: 6px;
    left: 10px;
  }

  .mlg-viewer__thumbs {
    gap: 7px;
    padding-top: 8px;
    padding-right: max(
      env(safe-area-inset-right),
      calc(50% - 31px)
    );
    padding-left: max(
      env(safe-area-inset-left),
      calc(50% - 31px)
    );
  }

  .mlg-viewer__thumb {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.type-detail .ml-gallery-v2 *,
  .mlg-viewer,
  .mlg-viewer * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
