/**
 * Product Lightbox Styles
 */

/* Lightbox container */
#shop-lightbox-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#shop-lightbox-container.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hidden state */
#shop-lightbox-container.shop-lightbox-hidden {
  display: none;
}

/* Overlay */
.shop-lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1;
}

/* Lightbox content - fixed size container */
.shop-lightbox-content {
  position: relative;
  z-index: 2;
  width: min(85vw, 1200px);
  height: min(85vh, 800px);
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#shop-lightbox-container.visible .shop-lightbox-content {
  transform: scale(1);
  opacity: 1;
}

/* Image container - maintains fixed dimensions */
.shop-lightbox-image-container {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #ffffff;
}

/* Image - centered and contained within fixed container */
.shop-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

/* Title */
.shop-lightbox-title {
  color: #333;
  margin: 0;
  padding: 15px 20px;
  text-align: center;
  width: 100%;
  font-size: 18px;
  font-weight: bold;
  background-color: #ffffff;
  border-bottom: 1px solid #eaeaea;
  z-index: 3;
}

/* Buttons container */
.shop-lightbox-buttons {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background-color: #ffffff;
  border-top: 1px solid #eaeaea;
  z-index: 3;
}

/* Button styles */
.shop-lightbox-buy-btn,
.shop-lightbox-more-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  margin: 0 5px;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.shop-lightbox-buy-btn {
  background-color: #f5987d;
  color: white;
}

.shop-lightbox-more-btn {
  background-color: #52c5ff;
  color: white;
}

.shop-lightbox-buy-btn:hover {
  background-color: #e57e64;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.shop-lightbox-more-btn:hover {
  background-color: #3ab0e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Close button */
.shop-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 90, 135, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 20px;
}

.shop-lightbox-close:hover {
  background-color: rgba(255, 58, 111, 1);
  transform: scale(1.1);
}

/* Navigation buttons */
.shop-lightbox-prev,
.shop-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
  opacity: 0.8;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.shop-lightbox-prev {
  left: 15px;
}

.shop-lightbox-next {
  right: 15px;
}

.shop-lightbox-prev:hover,
.shop-lightbox-next:hover {
  background-color: rgba(0, 0, 0, 0.2);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* Hidden state */
.shop-lightbox-hidden {
  display: none !important;
  opacity: 0;
}

/* Body class when lightbox is open */
body.shop-lightbox-open {
  overflow: hidden;
}

/* Image loading state - prevents layout shifts */
.shop-lightbox-image-container.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #555;
  animation: spin 1s ease-in-out infinite;
  z-index: 5;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive styles */
@media (max-width: 768px) {
  .shop-lightbox-content {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .shop-lightbox-title {
    font-size: 16px;
    padding: calc(env(safe-area-inset-top, 0px) + 90px) 15px 10px;
  }

  .shop-lightbox-close {
    top: calc(env(safe-area-inset-top, 0px) + 80px);
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    padding: 20px;
  }

  .shop-lightbox-prev,
  .shop-lightbox-next {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .shop-lightbox-prev {
    left: 8px;
  }

  .shop-lightbox-next {
    right: 8px;
  }

  .shop-lightbox-buttons {
    padding: 10px 10px calc(env(safe-area-inset-bottom, 0px) + 112px);
  }

  .shop-lightbox-buy-btn,
  .shop-lightbox-more-btn {
    padding: 16px;
    font-size: 14px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .shop-lightbox-title {
    font-size: 14px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 95px);
  }
  
  .shop-lightbox-close {
    top: calc(env(safe-area-inset-top, 0px) + 80px);
  }
  
  .shop-lightbox-buttons {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
  }
  

  
  .shop-lightbox-buy-btn,
  .shop-lightbox-more-btn {
    padding: 14px;
    font-size: 14px;
  }
}
