/* ================================================
   06-carrinho.css
   Carrinho flutuante + Drawer lateral de pedido
   ================================================ */

/* ================================================
   BOTÃO FLUTUANTE (canto inferior direito)
   ================================================ */
.cart-float-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--vermelho);
  color: var(--creme);
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-family: var(--font-corpo);
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: var(--sombra-float);
  transition:
    background var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.cart-float-btn:hover {
  background: var(--vermelho-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(178,34,34,0.55);
}

.cart-float-btn:active {
  transform: translateY(0);
}

.cart-float-btn .cart-badge {
  background: var(--dourado);
  color: var(--espresso);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 0.3s;
}

/* Ocultar quando carrinho vazio */
.cart-float-btn.hidden { display: none; }

/* ================================================
   OVERLAY DE FUNDO
   ================================================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ================================================
   DRAWER DO CARRINHO
   ================================================ */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--espresso);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(197,164,109,0.18);
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open {
  transform: translateX(0);
}

/* --- Cabeçalho do drawer --- */
.cart-drawer-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.8rem;
  border-bottom: 1px solid rgba(197,164,109,0.12);
}

.cart-drawer-header h2 {
  font-family: var(--font-titulo);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--creme);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer-header h2 i {
  color: var(--dourado);
}

.btn-close-cart {
  background: none;
  border: none;
  color: rgba(197,164,109,0.5);
  font-size: 1.4rem;
  padding: 4px;
  transition: color var(--transition-base);
}

.btn-close-cart:hover {
  color: var(--dourado);
}

/* --- Área de itens (rolável) --- */
.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.8rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(197,164,109,0.2) transparent;
}

.cart-drawer-items::-webkit-scrollbar {
  width: 4px;
}

.cart-drawer-items::-webkit-scrollbar-thumb {
  background: rgba(197,164,109,0.2);
  border-radius: 2px;
}

/* Estado vazio */
.cart-empty {
  text-align: center;
  padding: 3.5rem 1rem;
}

.cart-empty i {
  display: block;
  font-size: 3.2rem;
  color: rgba(197,164,109,0.18);
  margin-bottom: 1rem;
}

.cart-empty p {
  font-size: 0.95rem;
  color: rgba(245,230,204,0.35);
  line-height: 1.7;
}

/* --- Item individual --- */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(197,164,109,0.08);
  animation: itemSlideIn 0.3s ease;
}

@keyframes itemSlideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cart-item-emoji {
  font-size: 1.9rem;
  flex-shrink: 0;
  line-height: 1;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-nome {
  font-family: var(--font-titulo);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--creme);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-subtexto {
  font-size: 0.78rem;
  color: rgba(197,164,109,0.75);
  margin-bottom: 6px;
}

.cart-item-preco-unit {
  font-size: 0.82rem;
  color: rgba(197,164,109,0.55);
}

/* Controles de quantidade */
.cart-item-qtd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-qtd {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(197,164,109,0.28);
  background: none;
  color: var(--dourado);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base), border-color var(--transition-base);
  line-height: 1;
}

.btn-qtd:hover {
  background: var(--dourado);
  color: var(--espresso);
  border-color: var(--dourado);
}

.qtd-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--creme);
  min-width: 22px;
  text-align: center;
}

.cart-item-subtotal {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dourado);
  margin-left: auto;
}

/* Botão remover */
.btn-remove-item {
  background: none;
  border: none;
  color: rgba(178,34,34,0.45);
  font-size: 1.05rem;
  padding: 2px;
  flex-shrink: 0;
  transition: color var(--transition-base);
}

.btn-remove-item:hover { color: var(--vermelho); }

/* --- Rodapé do drawer --- */
.cart-drawer-footer {
  flex-shrink: 0;
  padding: 1.5rem 1.8rem;
  border-top: 1px solid rgba(197,164,109,0.12);
}

.cart-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.cart-subtotal span {
  font-size: 0.82rem;
  color: rgba(245,230,204,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cart-subtotal strong {
  font-family: var(--font-titulo);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--dourado);
}

/* Botão enviar pelo WhatsApp */
.btn-whatsapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px;
  font-size: 0.98rem;
  font-family: var(--font-corpo);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  transition: background var(--transition-base), transform 0.15s;
}

.btn-whatsapp:hover:not(:disabled) {
  background: #1ebe5d;
}

.btn-whatsapp:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-whatsapp:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Botão limpar carrinho */
.btn-limpar-carrinho {
  width: 100%;
  background: none;
  border: 1px solid rgba(178,34,34,0.25);
  color: rgba(178,34,34,0.55);
  border-radius: 6px;
  padding: 10px;
  font-size: 0.83rem;
  font-family: var(--font-corpo);
  letter-spacing: 0.04em;
  transition: border-color var(--transition-base), color var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-limpar-carrinho:hover {
  border-color: var(--vermelho);
  color: var(--vermelho);
}

/* ================================================
   BUMP ANIMATION (contador)
   ================================================ */
.bump { animation: bumpAnim 0.4s ease; }

@keyframes bumpAnim {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ================================================
   RESPONSIVIDADE — Carrinho
   ================================================ */
@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
  .cart-float-btn { bottom: 1.2rem; right: 1.2rem; }
}