/* FIX184 — Home cleanup: products + footer + final-section placement */

/* 1) Remove the services strip generated by FIX174. */
body.sp-ios-home .sp174-services{
  display:none!important;
}

/* 2) Defensive hide if an old cached DOM still contains the offers block. */
body.sp-ios-home .sp-ios-block--offers{
  display:none!important;
}

/* =========================================================
   PRODUCT CARDS — image must never cover title/price/button
   ========================================================= */
body.sp-ios-home .products{
  align-items:stretch!important;
}

body.sp-ios-home .product-card{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  height:100%!important;
  overflow:hidden!important;
  isolation:isolate!important;
  border:1px solid #e8ebf0!important;
  background:#fff!important;
}

body.sp-ios-home .product-card .card-media{
  position:relative!important;
  z-index:1!important;
  display:grid!important;
  place-items:center!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:4 / 5!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,#fff 0%,#fbfbfc 100%)!important;
}

body.sp-ios-home .product-card .card-media > img{
  position:static!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  transform:none!important;

  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:10px!important;
  box-sizing:border-box!important;
  object-fit:contain!important;
  object-position:center!important;
  background:#fff!important;
}

body.sp-ios-home .product-card .card-body{
  position:relative!important;
  z-index:3!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  width:100%!important;
  min-width:0!important;
  min-height:142px!important;
  margin:0!important;
  padding:10px 11px 12px!important;
  background:#fff!important;
  overflow:hidden!important;
}

body.sp-ios-home .product-card .title{
  position:relative!important;
  z-index:2!important;
  display:-webkit-box!important;
  width:100%!important;
  min-height:40px!important;
  max-height:40px!important;
  margin:0!important;
  overflow:hidden!important;
  color:#171a20!important;
  font-size:13px!important;
  font-weight:850!important;
  line-height:1.5!important;
  text-align:right!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
}

body.sp-ios-home .product-card .price-row{
  position:relative!important;
  z-index:2!important;
  width:100%!important;
  margin-top:auto!important;
  padding-top:8px!important;
}

body.sp-ios-home .product-card .price{
  color:#111827!important;
  font-size:14px!important;
  font-weight:950!important;
  white-space:nowrap!important;
}

body.sp-ios-home .product-card .price-old{
  font-size:10px!important;
  color:#9ca3af!important;
}

body.sp-ios-home .product-card .add-cart-btn{
  position:relative!important;
  z-index:4!important;
  width:100%!important;
  min-height:40px!important;
  margin:9px 0 0!important;
  padding:0 10px!important;
  border-radius:12px!important;
  background:#111827!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1!important;
}

/* Keep badges inside image, never over text. */
body.sp-ios-home .product-card .badges-top,
body.sp-ios-home .product-card .badges-bottom{
  position:absolute!important;
  z-index:4!important;
  pointer-events:none!important;
}

/* Mobile card sizing */
@media (max-width:599px){
  body.sp-ios-home .products{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }

  body.sp-ios-home .product-card{
    border-radius:15px!important;
  }

  body.sp-ios-home .product-card .card-media{
    aspect-ratio:4 / 4.8!important;
  }

  body.sp-ios-home .product-card .card-media > img{
    padding:8px!important;
  }

  body.sp-ios-home .product-card .card-body{
    min-height:126px!important;
    padding:8px 9px 10px!important;
  }

  body.sp-ios-home .product-card .title{
    min-height:35px!important;
    max-height:35px!important;
    font-size:11px!important;
    line-height:1.55!important;
  }

  body.sp-ios-home .product-card .price{
    font-size:12px!important;
  }

  body.sp-ios-home .product-card .add-cart-btn{
    min-height:36px!important;
    margin-top:7px!important;
    border-radius:10px!important;
    font-size:10.5px!important;
  }
}

/* =========================================================
   FOOTER — compact, clickable, correct final placement
   ========================================================= */
body.sp-ios-home .sp-store-footer{
  position:relative!important;
  z-index:20!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-height:0!important;
  margin:30px 0 0!important;
  padding:0 12px 20px!important;
  pointer-events:auto!important;
  background:transparent!important;
}

body.sp-ios-home .sp-store-footer-shell{
  position:relative!important;
  z-index:21!important;
  width:min(1320px,100%)!important;
  min-height:0!important;
  margin:0 auto!important;
  padding:14px!important;
  overflow:visible!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:22px!important;
  background:linear-gradient(145deg,#111d33 0%,#081225 100%)!important;
  box-shadow:0 14px 36px rgba(2,8,23,.16)!important;
  pointer-events:auto!important;
}

body.sp-ios-home .sp-store-footer-shell::before{
  pointer-events:none!important;
}

body.sp-ios-home .sp-store-footer-links{
  position:relative!important;
  z-index:25!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  pointer-events:auto!important;
}

body.sp-ios-home .sp-store-footer-link{
  position:relative!important;
  z-index:26!important;
  box-sizing:border-box!important;
  display:flex!important;
  width:100%!important;
  min-width:0!important;
  min-height:46px!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  padding:8px 12px!important;
  border:1px solid rgba(255,255,255,.09)!important;
  border-radius:14px!important;
  background:rgba(255,255,255,.055)!important;
  color:#f8fbff!important;
  font-size:13px!important;
  font-weight:900!important;
  line-height:1.35!important;
  text-align:center!important;
  text-decoration:none!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:rgba(255,255,255,.08)!important;
}

body.sp-ios-home .sp-store-footer-link:hover,
body.sp-ios-home .sp-store-footer-link:focus-visible{
  background:rgba(255,255,255,.11)!important;
  border-color:rgba(255,255,255,.16)!important;
  outline:none!important;
}

/* Footer / WhatsApp / bottom-nav spacing on phone. */
@media (max-width:599px){
  body.sp-ios-home .sp-store-footer{
    margin-top:22px!important;
    padding:0 9px calc(86px + env(safe-area-inset-bottom,0px))!important;
  }

  body.sp-ios-home .sp-store-footer-shell{
    padding:10px!important;
    border-radius:18px!important;
  }

  body.sp-ios-home .sp-store-footer-links{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }

  body.sp-ios-home .sp-store-footer-link{
    min-height:43px!important;
    padding:7px 8px!important;
    border-radius:12px!important;
    font-size:11px!important;
  }

  body.sp-ios-home .sp-floating-whatsapp{
    right:12px!important;
    left:auto!important;
    bottom:calc(78px + env(safe-area-inset-bottom,0px))!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    padding:0!important;
    border-radius:50%!important;
    z-index:170!important;
  }

  body.sp-ios-home .sp-floating-whatsapp-icon,
  body.sp-ios-home .sp-floating-whatsapp-icon svg{
    width:22px!important;
    height:22px!important;
  }

  body.sp-ios-home .bottom-nav{
    z-index:180!important;
  }
}

@media (min-width:600px) and (max-width:899px){
  body.sp-ios-home .sp-store-footer{
    padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important;
  }
  body.sp-ios-home .sp-store-footer-links{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

@media (min-width:900px){
  body.sp-ios-home .sp-store-footer-links{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
