.images-container .product-cover,
.product-cover,
[data-product-cover],
.product__cover {
  position: relative;
}

.images-container .product-cover img.js-qv-product-cover,
.images-container .product-cover picture img,
.images-container .product-cover img.img-fluid,
.product-cover img,
[data-product-cover] img,
.product__cover img,
.images-container .product-cover .layer,
.product-cover .layer {
  cursor: zoom-in;
}

body.bt-sz-open {
  overflow: hidden;
  touch-action: none;
}

.bt-sz-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.82);
  overscroll-behavior: contain;
}

.bt-sz-overlay.is-visible {
  display: flex;
}

.bt-sz-dialog {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 18px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.bt-sz-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.bt-sz-view {
  flex: 1 1 auto;
  min-width: 0;
}

.bt-sz-stage {
  position: relative;
  width: min(calc(var(--bt-sz-size, 800) * 1px), calc(100vw - 240px), calc(100vh - 140px));
  width: min(calc(var(--bt-sz-size, 800) * 1px), calc(100vw - 240px), calc(100dvh - 140px));
  height: min(calc(var(--bt-sz-size, 800) * 1px), calc(100vw - 240px), calc(100vh - 140px));
  height: min(calc(var(--bt-sz-size, 800) * 1px), calc(100vw - 240px), calc(100dvh - 140px));
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
}

.bt-sz-stage-img {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateZ(0);
}

.bt-sz-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.bt-sz-toolbar-sep {
  width: 1px;
  height: 30px;
  background: #e5e7eb;
}

.bt-sz-btn {
  min-width: 48px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  line-height: 1;
}

.bt-sz-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.bt-sz-nav-btn,
.bt-sz-play-btn {
  min-width: 78px;
}

.bt-sz-stage.is-loading::after {
  content: 'Loading...';
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.bt-sz-btn:hover:not([disabled]),
.bt-sz-thumb:hover,
.bt-sz-close:hover {
  border-color: #60a5fa;
}

.bt-sz-thumbs {
  flex: 0 0 92px;
  width: 92px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(calc(var(--bt-sz-size, 800) * 1px), calc(100vh - 140px));
  max-height: min(calc(var(--bt-sz-size, 800) * 1px), calc(100dvh - 140px));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.bt-sz-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  padding: 4px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
}

.bt-sz-thumb.is-active {
  border-color: #36a6dd;
  box-shadow: 0 0 0 1px #36a6dd inset;
}

.bt-sz-thumb img {
  display: block;
  width: 100%;
  max-height: 64px;
  height: auto;
  object-fit: contain;
}

.bt-sz-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 991px) {
  .bt-sz-overlay {
    padding: 10px;
  }

  .bt-sz-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .bt-sz-layout {
    flex-direction: column;
  }

  .bt-sz-stage {
    width: min(calc(100vw - 48px), calc(100vh - 180px));
    width: min(calc(100vw - 48px), calc(100dvh - 180px));
    height: min(calc(100vw - 48px), calc(100vh - 180px));
    height: min(calc(100vw - 48px), calc(100dvh - 180px));
  }

  .bt-sz-thumbs {
    width: 100%;
    max-height: 168px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    padding-right: 0;
  }

  .bt-sz-thumb {
    width: 68px;
    min-height: 68px;
  }

  .bt-sz-thumb img {
    max-height: 56px;
  }
}

@media (max-width: 480px) {
  .bt-sz-dialog {
    padding: 12px;
  }

  .bt-sz-stage {
    width: calc(100vw - 44px);
    height: calc(100vw - 44px);
  }

  .bt-sz-toolbar {
    justify-content: center;
  }

  .bt-sz-toolbar-sep {
    display: none;
  }

  .bt-sz-nav-btn,
  .bt-sz-play-btn {
    min-width: 72px;
    padding-left: 9px;
    padding-right: 9px;
  }

  .bt-sz-close {
    top: 8px;
    right: 8px;
  }
}
