.viewer-container {
  position: relative;
  width: 100%;
  height: auto;
  font-family: inherit;
  overflow: visible;
}

/* Ensure panorama iframe doesn't block page scroll */
.panorama-iframe-container {
  position: relative;
  width: 100%;
  height: auto; /* Fixed height to match typical product viewer */
  pointer-events: auto;
}

.panorama-iframe {
  width: 100%;
  height: 100%;
  min-height: 80vh;
  border: none;
  pointer-events: auto;
  /* Allow scroll events to pass through when not actively interacting with panorama */
  touch-action: pan-y;
}

/* When panorama is not visible, disable pointer events completely */
.panorama-view[style*='display: none'] {
  pointer-events: none;
}

/* Ensure page can scroll even when panorama is active */
/* body {
  overflow-y: auto !important;
} */

.product-viewer__container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.product-viewer {
  align-items: center;
  cursor: grab;
  display: flex;
  height: 100%;
  justify-content: center;
  overflow: hidden;
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.product-viewer--js-press-active {
  cursor: grabbing;
}

.product-viewer__image {
  height: auto;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.product-viewer__variants-selector {
  bottom: 2rem;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.product-viewer__current-variant {
  font-size: large;
  font-weight: 400;
  margin-bottom: 1rem;
  text-align: center;
  color: #000;
  font-family: inherit;
}

.product-viewer__variants-container {
  display: flex;
  justify-content: center;
}

.product-viewer__variant {
  background-color: #fff;
  border-radius: 50%;
  caret-color: transparent;
  cursor: pointer;
  display: inline-block;
  height: 1.2rem;
  margin: 0 0.3rem;
  width: 1.2rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
}

@media (min-width: 992px) {
  .product-viewer__variant {
    height: 1.8rem;
    width: 1.8rem;
  }

  .panorama-iframe-container {
    height: 600px; /* Larger height for desktop */
  }
}

/* Removed hover effects to match original */

.product-viewer__variant.selected-variant {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='14' fill='none'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' d='M17 1 7 13 1 7'/%3E%3C/svg%3E");
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: 50%;
}

.product-viewer__variant.selected-variant.inverted {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='14' fill='none'%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' d='M17 1 7 13 1 7'/%3E%3C/svg%3E");
}

.product-viewer_tips {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 10px;
  font-style: italic;
  color: #666;
}

/* Viewer switcher buttons */
.viewer-switcher {
  left: 50%;
  position: absolute;
  top: 50%;
  top: 4rem;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  z-index: 999;
  font-family: inherit;
}

@media screen and (max-width: 575px) {
  .viewer-switcher {
    top: -2.5rem;
  }
}

@media screen and (min-width: 576px) {
  .viewer-switcher {
    top: 40px;
    transform: translateX(-50%);
  }
}

.viewer-switcher__btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition:
    color 0.15s ease-in-out,
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}
/* .btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition:
    color 0.15s ease-in-out,
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
} */

.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  line-height: 1.5;
  border-radius: 0.3rem;
}

.btn-secondary {
  color: #000;
  background-color: #fff;
  border-color: #fff;
}

.btn-secondary.active {
  color: #000 !important;
  background-color: #fff !important;
  border-color: #fff !important;
}

.btn-secondary:hover {
  color: #fff;
  background-color: rgba(90, 98, 104, 0.8);
  border-color: #545b62;
}

.btn-secondary:disabled {
  background-color: #343a40;
  border-color: #343a40;
}

.me-2 {
  margin-right: 0.5rem;
}

.ms-2 {
  margin-left: 0.5rem;
}

.no-wrap {
  white-space: nowrap;
}

/* Ikona pano-globe - widoczna tylko w widoku esterni */
.pano-globe {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' fill='none'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' d='M1 13c0 6.627 5.373 12 12 12s12-5.373 12-12S19.627 1 13 1 1 6.373 1 13' clip-rule='evenodd'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' d='M1 13.45q.002-.231.186-.45'/%3E%3Cpath stroke='%23fff' stroke-dasharray='1.01 2.03' stroke-linecap='round' stroke-linejoin='round' d='M3 11.505C5.165 10.597 8.84 10 13.01 10c4.888 0 9.096.82 10.99 2'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' d='M25 13c0 1.657-5.373 3-12 3S1 14.657 1 13M13 1q.23.002.451.186'/%3E%3Cpath stroke='%23fff' stroke-dasharray='1.01 2.03' stroke-linecap='round' stroke-linejoin='round' d='M14.495 3C15.403 5.165 16 8.84 16 13.01c0 4.888-.82 9.096-2 10.99'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' d='M13 25c-1.657 0-3-5.373-3-12s1.343-12 3-12'/%3E%3C/svg%3E")
    no-repeat 50%;
  background-size: contain;
  display: block;
  height: 5vw;
  position: absolute;
  right: 3vw;
  top: 3vw;
  width: 5vw;
  z-index: 10;
  cursor: pointer;
}

/* Ukryj pano-globe gdy panorama jest aktywna (widok interni) */
.viewer-container:has(.panorama-view[style*='display: block']) .pano-globe,
.viewer-container:has(.panorama-view:not([style*='display: none']))
  .pano-globe {
  display: none !important;
}

/* Fallback for browsers without :has() - use JavaScript class */
.viewer-container.panorama-active .pano-globe {
  display: none !important;
}

/* Loading indicator styles for optimized viewer */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: none;
}

.loading-indicator .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .pano-globe {
    height: 8vw;
    width: 8vw;
    right: 4vw;
    top: 4vw;
  }
}

@media (max-width: 480px) {
  .pano-globe {
    height: 10vw;
    width: 10vw;
    right: 5vw;
    top: 5vw;
  }
}

/* Responsive styles */
@media (max-width: 575.98px) {
  .product-viewer__variants-selector {
    background: #fff;
    bottom: 0;
    left: 0;
    padding-bottom: 1rem;
    padding-top: 1rem;
    position: inherit;
    transform: none;
  }

  .product-viewer__current-variant {
    color: #000;
    text-shadow: none;
  }

  .panorama-iframe-container {
    height: 400px; /* Smaller height for mobile */
  }
}

@media (max-width: 768px) {
  .product-viewer__variants-selector {
    bottom: 10px;
  }

  .product-viewer__current-variant {
    font-size: 0.9rem;
  }

  /* Variants container styles removed to match original */

  .btn-lg {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
  }

  .pano-globe {
    width: 30px;
    height: 30px;
    top: 15px;
    right: 15px;
  }

  .panorama-iframe-container {
    height: 450px; /* Medium height for tablet */
  }
}

@media (max-width: 480px) {
  /* Mobile variant styles removed to use default responsive sizes */

  /* Old selected variant styles removed */

  .btn-lg {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
  }

  .pano-globe {
    width: 24px;
    height: 24px;
    top: 10px;
    right: 10px;
  }
}
