/* Product Detail Page Fixes */
/* Ensure styles target only product detail page */
.shop-detail-page .carousel-main {
  width: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  height: auto;
  max-height: 650px;
  overflow: hidden;
  position: relative;
}

.shop-detail-page .carousel-main.carousel-loaded {
  opacity: 1;
  visibility: visible;
}

.shop-detail-page .carousel-cell {
  width: 100%;
  height: auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.shop-detail-page .centered-image {
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Make sure images stay visible */
.shop-detail-page .flickity-viewport {
  min-height: 450px;
  overflow: hidden;
  transition: height 0.3s ease;
}

/* Improve slider navigation visibility */
.shop-detail-page .flickity-button {
  background: rgba(255, 255, 255, 0.75);
  transition: all 0.3s ease;
}

.shop-detail-page .flickity-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.shop-detail-page .flickity-button-icon {
  fill: #000;
}

/* Loading spinner while images load */
.shop-detail-page .carousel-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #000;
  animation: spin 1s ease-in-out infinite;
  z-index: 5;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Ensure image container maintains its spacing during load */
.shop-detail-page .container.relative {
  position: relative;
  min-height: 450px;
}

/* Prevent page jumping during image load */
.shop-detail-page #hero {
  min-height: 600px;
}

/* Fix flickity issues on Safari and other browsers */
.shop-detail-page .flickity-enabled {
  position: relative;
  visibility: hidden;
}

.shop-detail-page .carousel-loaded.flickity-enabled {
  visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .shop-detail-page .flickity-viewport {
    min-height: 300px;
  }
  
  .shop-detail-page .centered-image {
    max-height: 400px;
  }
  
  .shop-detail-page .container.relative {
    min-height: 300px;
  }
  
  .shop-detail-page #hero {
    min-height: 400px;
  }
}