.product-gallery {
  --product-gallery-thumb-size: 80px;
}

.product-gallery-main {
  position: relative;
}

.main-product-image {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  cursor: zoom-in;
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.main-product-image:hover,
.main-product-image:focus {
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.14);
  transform: translateY(-1px);
}

.product-gallery-badge {
  top: 10px;
  right: 24px;
  z-index: 2;
  font-size: 1rem;
}

.product-gallery-thumbs-wrap {
  min-height: 80px;
}

.product-gallery-thumbs {
  gap: 0.5rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.product-gallery-thumb-wrap {
  flex: 0 0 auto;
  width: var(--product-gallery-thumb-size);
}

.thumb-product-image {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  cursor: pointer;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.thumb-product-image:hover,
.thumb-product-image:focus,
.thumb-product-image.is-active {
  border-color: #34495e;
  box-shadow: 0 8px 18px rgba(52, 73, 94, 0.18);
  transform: translateY(-1px);
}

.product-gallery-thumb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
}

.product-gallery-thumb-nav--prev {
  left: 0;
}

.product-gallery-thumb-nav--next {
  right: 0;
}

.product-image-viewer-modal .modal-dialog {
  max-width: min(1180px, calc(100vw - 24px));
}

.product-image-viewer-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.48);
}

.product-image-viewer-shell {
  display: flex;
  min-height: min(86vh, 820px);
  flex-direction: column;
}

.product-image-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgb(255, 255, 255);
}

.product-image-viewer-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.15rem;
}

.product-image-viewer-title strong {
  overflow: hidden;
  max-width: 56vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-viewer-counter {
  color: #a3a3a3;
  font-size: 0.85rem;
}

.product-image-viewer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
}

.product-image-viewer-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(203, 213, 225, 0.26);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.product-image-viewer-btn:hover,
.product-image-viewer-btn:focus {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: 0;
  transform: translateY(-1px);
}

.product-image-viewer-layout {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 124px;
}

.product-image-viewer-stage-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgb(255, 255, 255)
  /* background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.45), rgba(68, 69, 70, 0.96) 62%),
    #ffffff; */
}

.product-image-viewer-stage {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
}

.product-image-viewer-stage.is-zoomed {
  cursor: grab;
}

.product-image-viewer-stage.is-dragging {
  cursor: grabbing;
}

.product-image-viewer-image {
  display: block;
  max-width: calc(100% - 5rem);
  max-height: min(72vh, 690px);
  object-fit: contain;
  user-select: none;
  will-change: transform;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.product-image-viewer-image.is-loading {
  opacity: 0.28;
}

.product-image-viewer-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  margin-left: -23px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  border-radius: 50%;
  animation: product-image-viewer-spin 0.85s linear infinite;
}

.product-image-viewer-spinner.is-visible {
  display: block;
}

.product-image-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
}

.product-image-viewer-nav--prev {
  left: 16px;
}

.product-image-viewer-nav--next {
  right: 16px;
}

.product-image-viewer-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  padding: 0.85rem;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  background: rgb(255, 255, 255);
}

.product-image-viewer-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product-image-viewer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-viewer-thumb:hover,
.product-image-viewer-thumb:focus,
.product-image-viewer-thumb.is-active {
  border-color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  outline: 0;
  transform: translateY(-1px);
}

@keyframes product-image-viewer-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767.98px) {
  .product-gallery-badge {
    right: 12px;
    font-size: 0.85rem;
  }

  .product-image-viewer-modal .modal-dialog {
    max-width: calc(100vw - 10px);
    margin: 5px;
  }

  .product-image-viewer-shell {
    min-height: calc(100vh - 10px);
  }

  .product-image-viewer-toolbar {
    align-items: flex-start;
    padding: 0.7rem;
  }

  .product-image-viewer-title strong {
    max-width: 42vw;
  }

  .product-image-viewer-actions {
    gap: 0.2rem;
  }

  .product-image-viewer-btn {
    width: 34px;
    height: 34px;
  }

  .product-image-viewer-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 92px;
  }

  .product-image-viewer-stage-wrap,
  .product-image-viewer-stage {
    min-height: 0;
  }

  .product-image-viewer-image {
    max-width: calc(100% - 3.2rem);
    max-height: calc(100vh - 185px);
  }

  .product-image-viewer-nav {
    width: 38px;
    height: 38px;
  }

  .product-image-viewer-nav--prev {
    left: 8px;
  }

  .product-image-viewer-nav--next {
    right: 8px;
  }

  .product-image-viewer-thumbs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    border-left: 0;
  }

  .product-image-viewer-thumb {
    flex: 0 0 72px;
    width: 72px;
  }
}
