/* ================= STICKY ADD TO CART BAR (FINAL RECTANGLE GLASS) ================= */

body.single-product #lacework-sticky-cart{
  position:fixed;
  bottom:0 !important;
  left:0;
  right:0;
  width:100%;
  padding:8px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  z-index:9999;
  font-family:'Helvetica Neue',sans-serif;
  flex-wrap:nowrap;
  overflow-x:auto;

  /* GLASS EFFECT */
  background:rgba(255,255,255,0.18);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-top:1px solid rgba(255,255,255,0.35);
  box-shadow:0 -6px 18px rgba(0,0,0,0.18);

  /* FORCE RECTANGLE */
  border-radius:0 !important;
}

/* Product title + price */
body.single-product #lacework-sticky-cart .product-title{
  font-size:14px;
  font-weight:600;
  color:#333;
  flex:1 1 auto;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-right:10px;
  display:flex;
  align-items:center;
  gap:6px;
}

body.single-product #lacework-sticky-cart .product-title .price{
  font-size:14px;
  font-weight:700;
  color:#111;
  flex-shrink:0;
}

/* Right side actions */
body.single-product #lacework-sticky-cart .psc-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

/* Quantity box */
body.single-product #lacework-sticky-cart .qty-wrapper{
  display:flex;
  align-items:center;
  background:#fff;
  border:1px solid #ccc;
  border-radius:14px;
  overflow:hidden;
  height:28px;
}

body.single-product #lacework-sticky-cart .qty-wrapper button{
  background:transparent;
  border:none;
  font-size:14px;
  width:26px;
  height:28px;
  cursor:pointer;
  color:#555;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

body.single-product #lacework-sticky-cart input.qty{
  width:30px;
  height:28px;
  text-align:center;
  border:none;
  font-size:13px;
  outline:none;
  background:#fff;
  color:#333;
  -moz-appearance:textfield;
}

body.single-product #lacework-sticky-cart input.qty::-webkit-inner-spin-button,
body.single-product #lacework-sticky-cart input.qty::-webkit-outer-spin-button{
  -webkit-appearance:none;
  margin:0;
}

/* Add to cart button */
body.single-product #lacework-sticky-cart button.add-to-cart-btn{
  background-color:#d4b68a;
  color:#fff;
  border:none;
  border-radius:14px;
  padding:5px 12px;
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  transition:background .3s ease;
  white-space:nowrap;
}

body.single-product #lacework-sticky-cart button.add-to-cart-btn:hover{
  background:#bfa173;
}

/* Cart icon */
body.single-product #lacework-sticky-cart .cart-icon{
  position:relative;
  width:30px;
  height:30px;
  background:#d4b68a;
  border-radius:50%;
  color:#fff;
  font-size:16px;
  display:flex;
  justify-content:center;
  align-items:center;
  text-decoration:none;
  flex-shrink:0;
}

/* Cart count bubble */
body.single-product #lacework-sticky-cart .cart-count{
  background:#b8860b;
  color:#fff;
  font-size:11px;
  font-weight:700;
  border-radius:50%;
  padding:2px 6px;
  position:absolute;
  top:-6px;
  right:-8px;
}

/* Page bottom spacing so content not hidden */
body.single-product{
  padding-bottom:70px;
}

/* Hide sticky cart when Astra cart / menu open */
.ast-cart-drawer,
.ast-mobile-cart-drawer,
.ast-site-header-cart-data{
  z-index:999999!important;
}

.ast-flyout-menu-overlay,
.ast-off-canvas-overlay{
  z-index:999998!important;
}

body.ast-main-header-nav-open #lacework-sticky-cart,
body.ast-side-cart-open #lacework-sticky-cart,
body.off-canvas-opened #lacework-sticky-cart{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
}

/* Mobile font size tweak */
@media(max-width:480px){
  body.single-product #lacework-sticky-cart .product-title{
    font-size:12px;
  }
}

/* ================= HIDE STICKY BAR WHEN SIDE CART IS OPEN ================= */

/* 1. Target the specific body classes Astra adds when drawers are active */
body.ast-side-cart-open #lacework-sticky-cart,
body.ast-mobile-cart-drawer-active #lacework-sticky-cart,
body.ast-cart-drawer-active #lacework-sticky-cart,
body.ast-main-header-nav-open #lacework-sticky-cart {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 2. Lower the sticky bar's base z-index so it doesn't fight the drawer */
body.single-product #lacework-sticky-cart {
    z-index: 99 !important; /* Standard fixed elements usually stay below 1000 */
}

/* 3. Ensure the Astra Cart Drawer and its Overlay are always on top */
.astra-cart-drawer, 
.ast-mobile-cart-drawer, 
.astra-mobile-cart-overlay {
    z-index: 999999 !important;
}

