/* public/css/products.css */

.catalogue-grid {
    --gap: 1rem;
  }
  
  .catalogue-grid .card {
    border-radius: 14px;
    transition: transform .12s ease, box-shadow .12s ease;
    height: 100%;
  }
  
  .catalogue-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
  }
  
  /* Maintain consistent thumbnails */
/* Force thumbnails to be a fixed box and let object-fit/object-position work */
.catalogue-grid .product-thumb {
  aspect-ratio: 4 / 4;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* Override Bootstrap's img rules */
.catalogue-grid .product-thumb > img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;  /* kill Bootstrap's max-width */
  object-fit: contain;
  object-position: center 80%; /* shift view down so top is cropped */
}
  /* Title clamp */
  .product-title {
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
  }
  
  /* Price row */
  .price-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: baseline;
    margin-top: .25rem;
  }
  .price {
    font-weight: 600;
  }
  .compare {
    color: #999;
    text-decoration: line-through;
    font-size: .9rem;
  }
  
  /* Badges */
  .badges {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .25rem;
  }
  .badge-soft {
    border: 1px solid #eee;
    background: #fbfbfb;
    border-radius: 999px;
    padding: .25rem .5rem;
    font-size: .8rem;
    color: #555;
  }
  .badge-in { border-color: #e6f4ea; background: #f0fbf3; color: #0a6b2d; }
  .badge-out { border-color: #ffe0e0; background: #fff6f6; color: #a31212; }
  
  /* Action buttons */
  .card .btn {
    border-radius: 10px;
  }
  
  /* Limit detail page carousel images */
.product-page .carousel-item img {
  max-height: 300px;   /* adjust this to taste: 400–600px works well */
  width: auto;         /* preserve aspect ratio */
  margin: 0 auto;      /* center horizontally */
  object-fit: contain; /* ensures no stretch if width > height */
}

/* Card thumbnails on home/latest products */
.card-thumb {
  height: 200px;            /* tweak: 160–240px works well */
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top-left-radius: .5rem;   /* optional: match card radius */
  border-top-right-radius: .5rem;
}

.card-thumb img {
  max-height: 100%;
  max-width: 100%;
  width: auto;              /* preserve aspect */
  height: auto;             /* preserve aspect */
  object-fit: contain;      /* no cropping */
  display: block;
}
