/* Sprint 624 — Premium dense product cards / image fit */

/* Card shell */
.product-grid .product-card-detailed{
  display:flex!important;
  flex-direction:column!important;
  height:auto!important;
  min-height:0!important;
  border:1px solid #dce4ee!important;
  border-radius:14px!important;
  background:#fff!important;
  overflow:hidden!important;
  box-shadow:0 5px 16px rgba(17,42,72,.055)!important;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease!important;
}
.product-grid .product-card-detailed:hover{
  transform:translateY(-2px)!important;
  border-color:#cbd8e7!important;
  box-shadow:0 14px 30px rgba(17,42,72,.105)!important;
}

/* Image: use more of the card width, remove excessive side gutters */
.product-grid .product-card-detailed .product-image{
  position:relative!important;
  width:100%!important;
  aspect-ratio:1.34/1!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-bottom:1px solid #e8edf3!important;
  border-radius:0!important;
  background:#f8fafc!important;
  overflow:hidden!important;
}
.product-grid .product-card-detailed .product-image-link{
  display:block!important;
  width:100%!important;
  height:100%!important;
}
.product-grid .product-card-detailed .product-image img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  object-fit:contain!important;
  object-position:center!important;
  border-radius:0!important;
  background:#fff!important;
}

/* Body: natural flow — no pushed-down seller row / dead vertical space */
.product-grid .product-card-detailed .product-body{
  display:block!important;
  flex:0 0 auto!important;
  min-height:0!important;
  padding:11px 12px 12px!important;
}
.product-grid .product-card-detailed h3{
  min-height:0!important;
  margin:0 0 7px!important;
  color:#132844!important;
  font-size:12px!important;
  line-height:1.35!important;
  font-weight:850!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}
.product-grid .product-card-detailed h3 a{
  color:inherit!important;
  text-decoration:none!important;
}
.product-grid .product-card-detailed h3 a:hover{
  color:#1263c5!important;
}

/* Price / primary metadata */
.product-grid .product-card-detailed .price{
  display:flex!important;
  align-items:baseline!important;
  gap:4px!important;
  min-height:0!important;
  margin:0 0 4px!important;
  color:#102b4e!important;
  font-size:17px!important;
  line-height:1.15!important;
  font-weight:900!important;
}
.product-grid .product-card-detailed .price small,
.product-grid .product-card-detailed .price span{
  color:#7a899d!important;
  font-size:7.5px!important;
  font-weight:700!important;
}
.product-grid .product-card-detailed .product-primary-meta{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:7px!important;
  min-height:20px!important;
  margin:0 0 4px!important;
  color:#66788e!important;
  font-size:7.5px!important;
}

/* One concise description row instead of large text block */
.product-grid .product-card-detailed .product-description{
  min-height:0!important;
  max-height:30px!important;
  margin:4px 0 7px!important;
  color:#718196!important;
  font-size:7.6px!important;
  line-height:1.42!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}

/* Chips */
.product-grid .product-card-detailed .product-compact-chips{
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  flex-wrap:wrap!important;
  min-height:0!important;
  margin:0 0 7px!important;
}
.product-grid .product-card-detailed .product-compact-chips>span{
  min-height:20px!important;
  padding:0 6px!important;
  border-radius:999px!important;
  font-size:6.5px!important;
  line-height:18px!important;
}

/* Seller row: no margin-top:auto — this was creating the large empty space */
.product-grid .product-card-detailed .tf-storefront-row,
.product-grid .product-card-detailed .supplier-line{
  display:grid!important;
  grid-template-columns:25px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:7px!important;
  width:100%!important;
  min-height:39px!important;
  margin:0!important;
  padding:7px 0 6px!important;
  border-top:1px solid #e8edf3!important;
}
.product-grid .product-card-detailed .tf-store-icon{
  width:25px!important;
  height:25px!important;
  border-radius:7px!important;
}
.product-grid .product-card-detailed .tf-storefront-copy{
  min-width:0!important;
}
.product-grid .product-card-detailed .tf-seller-link{
  display:block!important;
  overflow:hidden!important;
  color:#155fb8!important;
  font-size:7.7px!important;
  font-weight:900!important;
  line-height:1.2!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.product-grid .product-card-detailed .tf-storefront-link{
  display:inline-block!important;
  margin-top:2px!important;
  color:#60738b!important;
  font-size:6.4px!important;
  font-weight:800!important;
}

/* CTA: premium but compact */
.product-grid .product-card-detailed .card-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:7px!important;
  margin:7px 0 0!important;
}
.product-grid .product-card-detailed .card-actions>*{
  width:100%!important;
  margin:0!important;
}
.product-grid .product-card-detailed .card-actions form{
  display:block!important;
}
.product-grid .product-card-detailed .card-actions button,
.product-grid .product-card-detailed .card-actions a{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-height:36px!important;
  padding:0 8px!important;
  border-radius:8px!important;
  font-size:7.7px!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
.product-grid .product-card-detailed .tf-add-cart{
  border:1px solid #1768cf!important;
  background:#fff!important;
  color:#145db8!important;
}
.product-grid .product-card-detailed .tf-buy-now,
.product-grid .product-card-detailed .tf-rfq-actions button{
  border:1px solid #eeb42a!important;
  background:#ffc33f!important;
  color:#102341!important;
}
.product-grid .product-card-detailed .tf-rfq-actions a{
  border:1px solid #d6e0ec!important;
  background:#fff!important;
  color:#183451!important;
}

/* Keep card-level helper actions unobtrusive */
.product-grid .product-card-detailed .product-commerce-actions{
  display:none!important;
}

/* Floating controls */
.product-grid .product-card-detailed [data-wishlist-product],
.product-grid .product-card-detailed .wishlist-button{
  top:9px!important;
  right:9px!important;
}
.product-grid .product-card-detailed .tf-compare-icon{
  top:49px!important;
  right:9px!important;
  width:30px!important;
  height:30px!important;
  min-height:30px!important;
}
.product-grid .product-card-detailed .tf-tradesecure-card-badge{
  top:86px!important;
  right:8px!important;
  width:38px!important;
  min-height:44px!important;
}

/* Desktop density */
@media(min-width:1280px){
  .product-grid .product-card-detailed .product-image{
    aspect-ratio:1.4/1!important;
  }
}

/* Mobile: maintain visual product prominence while staying compact */
@media(max-width:620px){
  .product-grid .product-card-detailed .product-image{
    aspect-ratio:1.08/1!important;
  }
  .product-grid .product-card-detailed .product-body{
    padding:8px!important;
  }
  .product-grid .product-card-detailed h3{
    font-size:9.8px!important;
    margin-bottom:5px!important;
  }
  .product-grid .product-card-detailed .price{
    font-size:14px!important;
  }
  .product-grid .product-card-detailed .product-description{
    display:none!important;
  }
  .product-grid .product-card-detailed .product-compact-chips{
    overflow-x:auto!important;
    flex-wrap:nowrap!important;
    scrollbar-width:none!important;
  }
  .product-grid .product-card-detailed .product-compact-chips::-webkit-scrollbar{
    display:none!important;
  }
  .product-grid .product-card-detailed .product-compact-chips>span{
    flex:0 0 auto!important;
  }
  .product-grid .product-card-detailed .tf-storefront-row{
    grid-template-columns:22px minmax(0,1fr) auto!important;
    min-height:34px!important;
    padding:5px 0!important;
  }
  .product-grid .product-card-detailed .tf-store-icon{
    width:22px!important;
    height:22px!important;
  }
  .product-grid .product-card-detailed .tf-storefront-link{
    display:none!important;
  }
  .product-grid .product-card-detailed .card-actions{
    gap:5px!important;
    margin-top:5px!important;
  }
  .product-grid .product-card-detailed .card-actions button,
  .product-grid .product-card-detailed .card-actions a{
    min-height:33px!important;
    padding:0 5px!important;
    font-size:7px!important;
  }
  .product-grid .product-card-detailed .tf-compare-icon{
    top:43px!important;
    right:6px!important;
    width:27px!important;
    height:27px!important;
    min-height:27px!important;
  }
  .product-grid .product-card-detailed .tf-tradesecure-card-badge{
    top:75px!important;
    right:5px!important;
    width:32px!important;
    min-height:38px!important;
  }
}
