/* KHF Bottom Gap Compact Final
   Fokus: hapus celah kosong besar di bawah halaman, tapi menu bawah tetap fixed dan tidak menutup konten penting. */

html{
  scroll-padding-bottom:calc(98px + env(safe-area-inset-bottom,0px)) !important;
  overflow-x:hidden !important;
}

body.storefront-body,
body.orange-home-page,
body.product-page-body,
body.invoice-page{
  padding-bottom:calc(94px + env(safe-area-inset-bottom,0px)) !important;
  margin-bottom:0 !important;
  overflow-x:hidden !important;
}

main,
.store-shell,
.product-dash-shell,
.orange-home-shell,
.invoice-wrap-v2,
.page-content,
.products-page,
.home-page{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
  min-height:auto !important;
}

/* Matikan spacer kosong bawaan kalau ada */
.bottom-spacer,
.page-spacer,
.nav-spacer,
.safe-bottom-space,
.khf-bottom-spacer,
.mobile-nav-spacer,
.footer-spacer{
  display:none !important;
  height:0 !important;
  min-height:0 !important;
  max-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}

/* Section terakhir di product/home jangan punya jarak bawah besar */
.product-page-body .pd-live-visual-panel{
  margin-top:14px !important;
  margin-bottom:8px !important;
}
.product-page-body .pd-flow-panel.flow-live-panel{
  margin-bottom:14px !important;
}
.orange-home-page .orange-section-grid{
  margin-bottom:8px !important;
}
.orange-home-page .orange-product-card:last-child,
.product-page-body .pd-live-visual-panel:last-of-type,
.product-page-body .pd-flow-panel:last-of-type{
  margin-bottom:8px !important;
}

/* Menu bawah tetap pekat dan fixed; area aman dihitung dari body padding, bukan spacer tinggi. */
.khf-bottom-v11{
  position:fixed !important;
  bottom:calc(8px + env(safe-area-inset-bottom,0px)) !important;
  left:50% !important;
  transform:translate3d(-50%,0,0) !important;
}

/* CS jangan bikin ruang layout tambahan */
#cs-fab,
.cs-fab,
[data-cs-fab],
.floating-cs,
.cs-floating{
  position:fixed !important;
  bottom:calc(104px + env(safe-area-inset-bottom,0px)) !important;
}
#cs-popup,
.cs-popup,
[data-cs-popup]{
  position:fixed !important;
  bottom:calc(172px + env(safe-area-inset-bottom,0px)) !important;
}

@media (max-width:640px){
  body.storefront-body,
  body.orange-home-page,
  body.product-page-body,
  body.invoice-page{
    padding-bottom:calc(92px + env(safe-area-inset-bottom,0px)) !important;
  }
  .product-page-body .pd-live-visual-panel{
    margin-bottom:6px !important;
  }
  .orange-home-page .orange-section-grid{
    margin-bottom:6px !important;
  }
}

@media (max-width:380px){
  body.storefront-body,
  body.orange-home-page,
  body.product-page-body,
  body.invoice-page{
    padding-bottom:calc(88px + env(safe-area-inset-bottom,0px)) !important;
  }
}
