/* JBA v16.20.51 — intelligent fully responsive listing cards.
 * Listing-only ownership layer: fluid card height, proportional full-image display,
 * and price containment at every viewport width.
 */

#content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid{
  grid-auto-rows:auto!important;
  align-items:stretch!important;
  overflow:visible!important;
}

#content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid > article.jba-one-product-card.jba-v1670-product-card{
  container-type:inline-size!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto 40px 30px minmax(54px,auto)!important;
  grid-template-areas:
    "image"
    "title"
    "code"
    "price"!important;
  align-content:start!important;
  row-gap:7px!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  padding:10px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* The image area follows the actual card width. No fixed pixel height, no crop. */
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__thumb,
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-v1670-product-image-link,
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-dk-card__image{
  grid-area:image!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:1 / 1!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  background:#fff!important;
  border-radius:10px!important;
  box-sizing:border-box!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__thumb picture,
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__thumb .jba-optimized-picture,
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-v1670-product-image-link picture,
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-v1670-product-image-link .jba-optimized-picture{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__thumb img:not(.deluxe-javaherat):not(.haraj-javaherat),
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-v1670-product-image-link img:not(.deluxe-javaherat):not(.haraj-javaherat),
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-dk-card__image img:not(.deluxe-javaherat):not(.haraj-javaherat){
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
  box-sizing:border-box!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__name{
  grid-area:title!important;
  display:-webkit-box!important;
  width:100%!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  margin:0!important;
  padding:0 2px!important;
  overflow:hidden!important;
  font-size:clamp(9px,4.7cqi,12px)!important;
  line-height:19px!important;
  text-overflow:ellipsis!important;
  overflow-wrap:anywhere!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  box-sizing:border-box!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__code{
  grid-area:code!important;
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  margin:0!important;
  padding:5px clamp(44px,24cqi,68px) 5px 7px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__code span:first-child{
  right:7px!important;
  max-width:clamp(40px,22cqi,58px)!important;
  font-size:clamp(8px,3.8cqi,10px)!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__code b{
  min-width:0!important;
  font-size:clamp(11px,5.5cqi,15px)!important;
  line-height:18px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Price always owns a real row inside the card. */
#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__prices{
  grid-area:price!important;
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"old old" "current badge"!important;
  grid-template-rows:minmax(13px,auto) minmax(30px,auto)!important;
  align-items:end!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:54px!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__prices del{
  grid-area:old!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  overflow:hidden!important;
  font-size:clamp(8px,3.8cqi,11px)!important;
  line-height:13px!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__prices > b{
  grid-area:current!important;
  justify-self:start!important;
  align-self:end!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  overflow:hidden!important;
  font-size:clamp(11px,6.4cqi,20px)!important;
  line-height:1.35!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

#content-page.jba-v1670-shop-listing .jba-v16202-home-card-grid .jba-one-product-card .jba-tpd-luxe__price-badge{
  grid-area:badge!important;
  align-self:end!important;
  justify-self:end!important;
  flex:0 0 auto!important;
  min-width:clamp(28px,13cqi,36px)!important;
  height:clamp(19px,9cqi,22px)!important;
  padding:0 clamp(5px,3cqi,8px)!important;
  font-size:clamp(7px,3.5cqi,10px)!important;
  line-height:1!important;
}

/* Fluid columns: keep cards readable instead of forcing an over-tight desktop grid. */
@media (min-width:1200px){
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
@media (min-width:900px) and (max-width:1199px){
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media (min-width:640px) and (max-width:899px){
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media (max-width:639px){
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid > article.jba-one-product-card.jba-v1670-product-card{
    padding:7px!important;
    row-gap:6px!important;
  }
}

/* Extra-narrow phones remain two-column, but typography scales from the card itself. */
@media (max-width:340px){
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid{
    gap:6px!important;
  }
  #content-page.jba-v1670-shop-listing .whole-jewels.jba-v16202-home-card-grid > article.jba-one-product-card.jba-v1670-product-card{
    padding:6px!important;
  }
}
