/* overlay */
#hec-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.35);
  backdrop-filter:saturate(120%) blur(2px);
  opacity:0;visibility:hidden;transition:opacity .22s ease,visibility .22s;
  z-index:9998;
}
#hec-overlay.active{opacity:1;visibility:visible}

/* drawer como coluna (header / scroll / footer) */
#hec-drawer{
  position:fixed;top:0;right:-420px;width:400px;max-width:100%;height:100%;
  background:#fff;border-left:1px solid #eee;box-shadow:-12px 0 32px rgba(0,0,0,.14);
  z-index:9999;display:flex;flex-direction:column;transition:right .28s cubic-bezier(.25,.8,.25,1)
}
#hec-drawer.open{right:0}

/* header */
.hec-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #eee;position:relative}
.hec-head:before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:#111}
.hec-title{font-size:16px;font-weight:700;letter-spacing:.2px}
.hec-close{background:none;border:0;font-size:22px;cursor:pointer;line-height:1;opacity:.7}
.hec-close:hover{opacity:1}

/* a área scrollável de fato */
.cc-body-container{flex:1 1 auto;min-height:0;overflow:scroll}
.cc-body{
  height:100%;
  overflow:auto;               /* rolagem aqui */
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain; /* não “bate” no fundo */
  padding:0 16px;
}
.cc-row.cc-cart-items{display:block}
.cc-cart-product-list{display:grid;gap:12px;padding:16px 0 24px}

/* footer fixo */
.cc-cart-actions{border-top:1px solid #eee;padding:14px 16px;display:grid;gap:12px;background:#fff}
.cc-totals .cc-total-box{display:flex;align-items:center;justify-content:space-between}
.cc-total-text{font-size:14px;color:#444}
.cc-total-amount{font-weight:800;font-size:18px}
.cc-button{display:inline-flex;align-items:center;justify-content:center;padding:12px 14px;border-radius:12px;text-decoration:none;gap:8px}
.cc-button-primary{background:#111;color:#fff}
.cc-button.cc-button-primary svg{width:18px;height:18px}

/* botão flutuante */
#hec-toggle{position:fixed;right:16px;bottom:16px;z-index:9997;display:inline-flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:50%;background:#111;color:#fff;text-decoration:none;box-shadow:0 8px 20px rgba(0,0,0,.18)}
#hec-toggle svg{width:24px;height:24px}
#hec-count{position:absolute;right:-2px;top:-2px;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#ff3b30;color:#fff;font-size:12px;line-height:20px;text-align:center;font-weight:700;display:none}
#hec-toggle.has-items #hec-count{display:inline-block}

/* esconder botões padrão do mini-cart */
#hec-drawer .woocommerce-mini-cart__buttons,
#hec-drawer .woocommerce-mini-cart__buttons.buttons{display:none !important}

/* bolinha preta para recolher */
.hec-fab-close{
  position:absolute; left:-28px; bottom:110px;
  width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:#000;color:#fff;border:0;box-shadow:0 10px 22px rgba(0,0,0,.25);
  cursor:pointer;z-index:10000
}
.hec-fab-close i{display:block;width:22px;height:22px;position:relative}
.hec-fab-close i:before,.hec-fab-close i:after{
  content:"";position:absolute;left:50%;top:50%;width:2px;height:22px;background:#fff;transform-origin:center
}
.hec-fab-close i:before{transform:translate(-50%,-50%) rotate(45deg)}
.hec-fab-close i:after{transform:translate(-50%,-50%) rotate(-45deg)}

/* mobile: dar “respiro” de gaveta */
@media (max-width:480px){
  #hec-drawer{width:88vw}
  .hec-fab-close{left:-24px;bottom:110px}
}

/* body travado (sem bloquear o scroll da gaveta) */
html.hec-lock, body.hec-lock{
  overflow:hidden !important;
  height:100%;
}

/* garantir pan vertical dentro da gaveta no mobile */
#hec-drawer, #hec-drawer * { touch-action: pan-y; }
