/* modal.css */

/* Hide modal and backdrop by default */
#productModal,
.modal-backdrop {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

/* Show modal/backdrop when .show class is present */
#productModal.show {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  position: fixed;
  z-index: 1050;
}

.modal-backdrop.show {
  display: block;
  opacity: 0.5;
  visibility: visible;
  pointer-events: auto;
  position: fixed;
  z-index: 1040;
}

/* Responsive: Hide modal/backdrop on mobile */
@media (max-width: 767px) {
  #productModal,
  .modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: static !important;
    z-index: -1 !important;
  }
}

/* Skeleton Loader */
.modal-skeleton {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
}

.modal-skeleton .skeleton-box {
  height: 20px !important;
  width: 100% !important;
  background-color: #e0e0e0 !important;
  border-radius: 0.25rem !important;
  animation: shimmer 1.5s infinite linear !important;
  background-image: linear-gradient(
    90deg,
    #e0e0e0 0px,
    #f5f5f5 40px,
    #e0e0e0 80px
  ) !important;
  background-size: 500px 100% !important;
}

.modal-skeleton .skeleton-img {
  height: 300px !important;
  background-color: #e0e0e0 !important;
  border-radius: 0.5rem !important;
  animation: shimmer 1.5s infinite linear !important;
  background-image: linear-gradient(
    90deg,
    #e0e0e0 0px,
    #f5f5f5 60px,
    #e0e0e0 120px
  ) !important;
  background-size: 500px 100% !important;
}

@keyframes shimmer {
  0% {
    background-position: -500px 0 !important;
  }
  100% {
    background-position: 500px 0 !important;
  }
}

/* Thumbnail navigation */
.modal-thumbnails {
  display: flex !important;
  gap: 0.5rem !important;
  margin-top: 1rem !important;
  overflow-x: auto !important;
}

.modal-thumbnails img {
  width: 60px !important;
  height: 60px !important;
  object-fit: cover !important;
  border-radius: 0.375rem !important;
  cursor: pointer !important;
  border: 2px solid transparent !important;
  transition: border 0.3s ease !important;
}

.modal-thumbnails img.active {
  border-color: #d97706 !important;
}

/* Social Share Actions */
.modal-social-share {
  display: flex !important;
  gap: 0.5rem !important;
  margin-top: 1rem !important;
}

.modal-social-share button {
  border: none !important;
  background: #f3f4f6 !important;
  color: #1f2937 !important;
  padding: 0.5rem !important;
  border-radius: 0.375rem !important;
  transition: background 0.2s !important;
}

.modal-social-share button:hover {
  background: #e5e7eb !important;
}

/* Quick View Icon - visible on hover */
.product-image {
  position: relative !important;
}

.quick-view-icon {
  display: none !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 2 !important;
  background: rgba(255,255,255,0.85) !important;
  border-radius: 50% !important;
  padding: 0.65em !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  font-size: 1.5em !important;
  color: #d97706 !important;
  pointer-events: none !important;
  transition: opacity 0.2s !important;
  opacity: 0 !important;
}

.product-image:hover .quick-view-icon,
.product-image:focus-within .quick-view-icon {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Ensure new quick view button variant is visible */
.product-item .quick-view-btn {
  opacity: 1 !important;
  transform: none !important;
  transition: background-color 0.25s ease !important;
  z-index: 1 !important;
}

/* Force overlay container to show on hover even if Tailwind group-hover classes are missing */
.product-item:hover .product-image > .absolute {
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 2 !important; /* Overlay above image */
}