/**
 * Product Image Styling
 * Ensures consistent image sizes across the entire website
 */

/* Main product card images - used in home, all products, search results */
.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px 8px 0 0;
  background-color: #f8f9fa;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

/* Product card container */
.product-card {
  overflow: hidden;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-4px);
}

/* Product detail page - main image */
.product-detail-main-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  object-position: center;
  background-color: #f8f9fa;
  border-radius: 8px;
}

/* Product detail page - thumbnail images */
.product-thumbnail {
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.product-thumbnail:hover {
  border-color: #1baaae;
  transform: scale(1.1);
}

.product-thumbnail.active {
  border-color: #1baaae;
  box-shadow: 0 0 8px rgba(27, 170, 174, 0.4);
}

/* Cart page - product images */
.cart-product-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

/* Order detail page - product images */
.order-product-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

/* Admin panel - product preview */
.admin-product-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

/* Placeholder for missing images */
.product-image-placeholder {
  width: 100%;
  height: 250px;
  background-color: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 8px 0 0;
}

.product-image-placeholder i {
  font-size: 3rem;
  color: #adb5bd;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .product-image {
    height: 220px;
  }
}

@media (max-width: 992px) {
  .product-image {
    height: 200px;
  }
  
  .product-detail-main-image {
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .product-image {
    height: 180px;
  }
  
  .product-detail-main-image {
    max-height: 350px;
  }
  
  .cart-product-image {
    width: 60px;
    height: 60px;
  }
  
  .product-thumbnail {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 576px) {
  .product-image {
    height: 150px;
  }
  
  .product-detail-main-image {
    max-height: 300px;
  }
  
  .cart-product-image {
    width: 50px;
    height: 50px;
  }
  
  .order-product-image {
    width: 50px;
    height: 50px;
  }
  
  .product-thumbnail {
    width: 50px;
    height: 50px;
  }
}

/* Loading state for images */
.product-image.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Image aspect ratio containers */
.product-image-container {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 aspect ratio */
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background-color: #f8f9fa;
}

.product-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Badge positioning on product images */
.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
