/* =====================================================
   WL Multimarcas — Carrinho Lateral (versão unificada)
   Substitua seu carrinho.css por este conteúdo
   ===================================================== */

/* Painel lateral do carrinho (base + transição) */
.carrinho-lateral {
  position: fixed;
  top: 0;
  right: -420px;   /* escondido fora da tela */
  width: 360px;
  height: 100vh;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 9000;
  color: #fff;
  background: linear-gradient(180deg, #0e0e13 0%, #0b0b0f 100%);
  border-left: 1px solid rgba(212, 175, 55, .25);
  box-shadow: -18px 0 40px rgba(241, 196, 15, .08), -4px 0 14px rgba(0,0,0,.6);
  transition: right .3s ease;
}
.carrinho-lateral.aberto { right: 0; }

/* Cabeçalho do carrinho */
.carrinho-lateral .cart-header {
  position: sticky; top: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(241,196,15,.12), rgba(241,196,15,0));
  padding: 12px 16px;
  border-bottom: 1px solid rgba(212,175,55,.18);
  display: flex; align-items: center; gap: 10px;
}
.carrinho-lateral .cart-header .title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .3px;
  color: #f5f5f5;
}
.carrinho-lateral .cart-header .title::before {
  content: "🛒";
  filter: drop-shadow(0 0 6px rgba(241,196,15,.4));
  margin-right: 4px;
}

/* Lista de itens */
.carrinho-lateral ul { list-style: none; padding-left: 0; margin: 0; flex: 1; overflow-y: auto; }
.carrinho-lateral li { margin: 0 0 6px; }

/* Item visual (use .cart-item no HTML, se puder) */
.carrinho-lateral .cart-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px dashed rgba(255,255,255,.08);
  transition: background .2s ease, transform .15s ease;
}
.carrinho-lateral .cart-item:hover { background: rgba(241,196,15,.06); transform: translateX(-1px); }
.carrinho-lateral .cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.carrinho-lateral .cart-item .name { color: #f4f4f7; font-weight: 700; line-height: 1.2; }
.carrinho-lateral .cart-item .variant { color: #bfbfbf; font-size: .88rem; }
.carrinho-lateral .cart-item .price {
  align-self: start;
  background: rgba(241,196,15,.16);
  color: #f8f8f8;
  padding: 4px 8px; border-radius: 999px; font-weight: 700;
}
.carrinho-lateral .cart-item .remove-btn {
  margin-left: 6px; border: 0; background: transparent; color: #aaa; cursor: pointer;
  transition: color .2s ease, transform .1s ease;
}
.carrinho-lateral .cart-item .remove-btn:hover { color: #ff6b6b; transform: scale(1.1); }

/* Total e rodapé fixo */
.total-carrinho { font-weight: 800; margin: 4px 0 12px; }
.carrinho-lateral .cart-footer {
  position: sticky; bottom: 0; z-index: 3;
  padding: 14px; background: linear-gradient(180deg, rgba(0,0,0,.0) 0%, rgba(0,0,0,.75) 45%, #0b0b0f 100%);
  border-top: 1px solid rgba(212,175,55,.2);
  box-shadow: 0 -8px 24px rgba(0,0,0,.35);
}
.carrinho-lateral .cart-total {
  display: flex; justify-content: space-between; align-items: center;
  color: #f1f1f1; font-weight: 800; margin-bottom: 10px; letter-spacing: .3px;
}
.carrinho-lateral .cart-total .value {
  font-size: 1.25rem;
  text-shadow: 0 0 10px rgba(241,196,15,.35);
}

/* Botões principais (Finalizar / Ir para carrinho / Fechar) */
#fechar-carrinho,
#btn-ir-carrinho,
#btn-finalizar-whats,
.btn-cart-primary {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: #f1c40f;     /* dourado WL */
  color: #000;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, background .25s ease;
}
#fechar-carrinho:hover,
#btn-ir-carrinho:hover,
#btn-finalizar-whats:hover,
.btn-cart-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(241,196,15,.25);
  filter: brightness(.98);
}

/* WhatsApp (mantém verde padrão WPP) */
.finalizar-wpp {
  margin: 10px 0;
  padding: 10px;
  background-color: #25d366;
  color: #fff;
  border: none;
  width: 100%;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: background .3s, transform .15s ease;
}
.finalizar-wpp:hover { background-color: #128c7e; transform: translateY(-1px); }

/* Limpar carrinho (ghost dourado) */
#btn-limpar-carrinho,
.btn-cart-ghost {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  color: #f1f1f1;
  border: 2px solid rgba(212,175,55,.55);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
#btn-limpar-carrinho:hover,
.btn-cart-ghost:hover { background: #d4af37; color: #000; transform: translateY(-1px); }

/* ===== Carrinho do topo (texto maior + badge) ===== */
.cart {  /* <a class="cart" id="btn-carrinho">Carrinho <span class="cart-count">0</span></a> */
  font-size: 1.2rem;
  font-weight: 800;
  color: #f1c40f;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .3s ease, transform .2s ease;
}
.cart:hover { color: #fff; transform: scale(1.05); }

.cart-count {
  background: #f1c40f; color: #000; font-weight: 900;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px;
  box-shadow: 0 0 0 3px rgba(241,196,15,.15);
  transition: transform .2s ease;
}

/* Pulso curto no badge (chame via JS adicionando/removendo .pulse) */
@keyframes pulse-badge { 0%{ transform: scale(1);} 50%{ transform: scale(1.22);} 100%{ transform: scale(1);} }
.cart-count.pulse { animation: pulse-badge .38s ease; }

/* Piscar quando houver itens (adicione a classe .piscando na âncora do carrinho via JS) */
.cart.piscando .cart-count {
  animation: blink-cart 1s infinite alternate;
  box-shadow: 0 0 10px rgba(241,196,15,0.8);
}
@keyframes blink-cart {
  0% { background: #f1c40f; color: #000; transform: scale(1); }
  50% { background: #000; color: #f1c40f; transform: scale(1.15); }
  100% { background: #f1c40f; color: #000; transform: scale(1); }
}

/* Scrollbar estilizada no painel */
.carrinho-lateral::-webkit-scrollbar { width: 8px; }
.carrinho-lateral::-webkit-scrollbar-thumb {
  background: linear-gradient(#f1c40f, #d4af37); border-radius: 8px;
}
.carrinho-lateral::-webkit-scrollbar-track { background: rgba(255,255,255,.06); }

/* Animação de entrada do painel (se você alterna .aberto/.open) */
@keyframes slideInCart { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.carrinho-lateral.aberto { animation: slideInCart .35s ease both; }
