/* =========================================================
   PGP v265 — Bigger square product images on homepage
   المطلوب:
   - إزالة إطار/حد الصورة الداخلية.
   - تكبير مساحة الصورة داخل كارت المنتج.
   - الصورة تصعد لفوك وتبقى كاملة من جوة بدون قص قدر الإمكان.
   - شكل الصورة أقرب للمربع.
   - اسم المنتج يبقى أسود مباشرة تحت الصورة.
   - لا يغير السعر ولا القلب.
   ========================================================= */

/* Home product cards only, not garage cards */
html body #home .pgp-most-product:not(.pgp-most-garage){
  position:relative!important;
  border-color:transparent!important;
  box-shadow:0 8px 18px rgba(0,0,0,.040)!important;
  overflow:hidden!important;
}

/* make the image area taller and remove inner frame */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:0!important;
  bottom:auto!important;

  width:100%!important;
  height:calc(100% - 54px)!important;

  margin:0!important;
  padding:0!important;

  background:#ffffff!important;
  background-color:#ffffff!important;
  background-image:none!important;

  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  overflow:hidden!important;
}

/* remove old gradients/overlays from product images */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media::before,
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media::after{
  content:none!important;
  display:none!important;
  opacity:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

/* show full product image instead of cropping */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media img{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;

  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;

  object-fit:contain!important;
  object-position:center center!important;

  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  transform:none!important;
  background:#ffffff!important;
}

/* keep product name directly under the taller image */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info{
  position:absolute!important;
  left:8px!important;
  right:8px!important;
  top:calc(100% - 50px)!important;
  bottom:auto!important;
  z-index:80!important;

  display:block!important;
  visibility:visible!important;
  opacity:1!important;

  width:auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:28px!important;

  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
  pointer-events:none!important;
  text-align:left!important;
}

/* plain black product name, two lines max */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info > strong,
html body #home .pgp-most-product:not(.pgp-most-garage) :is(
  .pgp-v260-name-badges,
  .pgp-v261-name-badges,
  .pgp-v262-name-badges,
  .pgp-v260-name-line,
  .pgp-v261-name-line,
  .pgp-v262-name-line
){
  display:-webkit-box!important;
  visibility:visible!important;
  opacity:1!important;

  width:100%!important;
  max-width:100%!important;
  min-width:0!important;

  margin:0!important;
  padding:0!important;

  color:#111111!important;
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;

  font-size:9px!important;
  line-height:1.2!important;
  font-weight:850!important;
  letter-spacing:0!important;
  text-shadow:none!important;

  white-space:normal!important;
  word-break:normal!important;
  overflow:hidden!important;
  text-overflow:clip!important;

  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;

  border:0!important;
  outline:0!important;
  border-radius:0!important;
  clip-path:none!important;
  box-shadow:none!important;
}

/* remove old badge pseudo caps if a previous cached markup exists */
html body #home .pgp-most-product:not(.pgp-most-garage) :is(
  .pgp-v260-name-line,
  .pgp-v261-name-line,
  .pgp-v262-name-line
)::before,
html body #home .pgp-most-product:not(.pgp-most-garage) :is(
  .pgp-v260-name-line,
  .pgp-v261-name-line,
  .pgp-v262-name-line
)::after{
  content:none!important;
  display:none!important;
}

/* hide source/details only */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info > span:not(.pgp-v260-name-line):not(.pgp-v261-name-line):not(.pgp-v262-name-line){
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  height:0!important;
  max-height:0!important;
  overflow:hidden!important;
}

/* price and heart remain as they are */
html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-price{
  z-index:90!important;
}

html body #home .pgp-most-product:not(.pgp-most-garage) :is(
  .heart-btn,
  .pgp-heart-btn,
  .pgp-card-heart,
  .pgp-home-card-heart,
  .wishlist-btn,
  .save-btn,
  .favorite-btn,
  button[data-pgp-heart],
  button[data-heart]
){
  z-index:95!important;
}

/* Laptop / medium desktop */
@media(min-width:769px) and (max-width:1366px){
  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media{
    height:calc(100% - 52px)!important;
  }

  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info{
    top:calc(100% - 48px)!important;
    max-height:28px!important;
  }

  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info > strong,
  html body #home .pgp-most-product:not(.pgp-most-garage) :is(
    .pgp-v260-name-badges,
    .pgp-v261-name-badges,
    .pgp-v262-name-badges,
    .pgp-v260-name-line,
    .pgp-v261-name-line,
    .pgp-v262-name-line
  ){
    font-size:8.2px!important;
    line-height:1.18!important;
  }
}

/* Mobile: make image taller, close to square, but keep price/heart safe */
@media(max-width:768px){
  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media{
    height:calc(100% - 40px)!important;
  }

  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info{
    left:6px!important;
    right:6px!important;
    top:calc(100% - 38px)!important;
    max-height:22px!important;
  }

  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info > strong,
  html body #home .pgp-most-product:not(.pgp-most-garage) :is(
    .pgp-v260-name-badges,
    .pgp-v261-name-badges,
    .pgp-v262-name-badges,
    .pgp-v260-name-line,
    .pgp-v261-name-line,
    .pgp-v262-name-line
  ){
    font-size:6.8px!important;
    line-height:1.15!important;
  }
}

/* Very small phones */
@media(max-width:390px){
  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-media{
    height:calc(100% - 39px)!important;
  }

  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info{
    left:5px!important;
    right:5px!important;
    top:calc(100% - 37px)!important;
    max-height:21px!important;
  }

  html body #home .pgp-most-product:not(.pgp-most-garage) > .pgp-most-info > strong,
  html body #home .pgp-most-product:not(.pgp-most-garage) :is(
    .pgp-v260-name-badges,
    .pgp-v261-name-badges,
    .pgp-v262-name-badges,
    .pgp-v260-name-line,
    .pgp-v261-name-line,
    .pgp-v262-name-line
  ){
    font-size:6.4px!important;
    line-height:1.13!important;
  }
}
