/* ==========================================================================
   Vital Brasil — Carrinho (FAB flutuante + drawer lateral)
   Usa as variáveis de marca já definidas em style.css / header inline.
   ========================================================================== */

/* ---------- Botão flutuante ---------- */
.vb-cart-fab {
  position: fixed;
  right: 20px;
  bottom: 92px; /* acima do botão flutuante de WhatsApp (vb-wpp-float) */
  z-index: 900;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--cor-primaria);
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 42, 71, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.vb-cart-fab:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(11, 42, 71, .34); }
.vb-cart-fab svg { width: 26px; height: 26px; fill: currentColor; }
.vb-cart-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cor-secundaria);
  color: #fff;
  font: 700 .78rem/22px 'Poppins', sans-serif;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.vb-cart-fab.has-itens { animation: vb-cart-pop .3s ease; }
@keyframes vb-cart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- Overlay ---------- */
.vb-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(11, 42, 71, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.vb-cart-overlay.is-open { opacity: 1; visibility: visible; }

/* ---------- Drawer ---------- */
.vb-cart {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 960;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 30px rgba(11, 42, 71, .18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s ease;
}
.vb-cart.is-open { transform: translateX(0); }

.vb-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--cinza-borda);
}
.vb-cart__head h3 { font-size: 1.2rem; color: var(--cor-escura); margin: 0; }
.vb-cart__close {
  background: none; border: none; cursor: pointer;
  font-size: 1.8rem; line-height: 1; color: var(--texto-suave);
}
.vb-cart__close:hover { color: var(--cor-escura); }

.vb-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 22px;
}
.vb-cart__empty {
  text-align: center;
  color: var(--texto-suave);
  padding: 48px 10px;
  font-size: .95rem;
}

/* ---------- Item ---------- */
.vb-cart-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--cinza-borda);
}
.vb-cart-item__info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.vb-cart-item__nome { font-weight: 600; color: var(--cor-escura); font-size: .98rem; }
.vb-cart-item__preco { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--cor-secundaria); white-space: nowrap; }
.vb-cart-item__acoes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.vb-qtd { display: inline-flex; align-items: center; border: 1px solid var(--cinza-borda); border-radius: 999px; overflow: hidden; }
.vb-qtd__btn {
  width: 32px; height: 32px; border: none; background: var(--cinza-bg);
  cursor: pointer; font-size: 1.1rem; color: var(--cor-primaria); font-weight: 700;
}
.vb-qtd__btn:hover { background: var(--cor-primaria); color: #fff; }
.vb-qtd__n { min-width: 34px; text-align: center; font-weight: 600; }
.vb-cart-item__rm {
  background: none; border: none; cursor: pointer;
  color: var(--texto-suave); font-size: .85rem; text-decoration: underline;
}
.vb-cart-item__rm:hover { color: #9b1c1c; }

/* ---------- Rodapé ---------- */
.vb-cart__foot {
  border-top: 1px solid var(--cinza-borda);
  padding: 18px 22px 22px;
}
.vb-cart__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 1.05rem;
  color: var(--cor-escura);
}
.vb-cart__total strong { font-family: 'Poppins', sans-serif; font-size: 1.5rem; color: var(--cor-secundaria); }
.vb-cart__wpp svg { width: 22px; height: 22px; fill: currentColor; }
.vb-cart__hint { margin-top: 10px; font-size: .82rem; color: var(--texto-suave); text-align: center; }

/* trava o scroll do fundo quando o drawer está aberto */
body.vb-cart-lock { overflow: hidden; }

/* estado momentâneo do botão "Adicionar" */
.js-add-carrinho.is-added { background: var(--cor-secundaria); border-color: var(--cor-secundaria); color: #fff; }

@media (max-width: 480px) {
  .vb-cart-fab { width: 54px; height: 54px; right: 16px; bottom: 82px; }
}
