/* Carrinho da loja (carrinho.js) — botão no cabeçalho + painel lateral.
   Mesmo "vidro" azul do resto da loja (--glass-fill/--glass-blur de landing.css). */

.carrinho-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carrinho-btn:hover { background: rgba(255, 255, 255, 0.2); }
.carrinho-btn:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.carrinho-btn.pulsar { animation: carrinho-pulsar 0.45s ease; }

@keyframes carrinho-pulsar {
  40% { transform: scale(1.18); }
}

.carrinho-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #f59e0b;
  color: white;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.carrinho-badge[hidden] { display: none; }

/* ── Painel lateral ── */
.carrinho-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.carrinho-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

body.carrinho-sem-rolagem { overflow: hidden; }

.carrinho-painel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(0, 52, 101, 0.92);
  backdrop-filter: blur(var(--glass-blur, 8.9px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 8.9px));
  color: white;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.carrinho-overlay.open .carrinho-painel { transform: none; }

.carrinho-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.carrinho-topo h3 { font-size: 1.15rem; }

.carrinho-fechar {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.carrinho-fechar:hover { background: rgba(255, 255, 255, 0.2); }

.carrinho-lista {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
}

.carrinho-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.carrinho-item-foto {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue-900, #003465);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrinho-item-foto img { width: 100%; height: 100%; object-fit: contain; }

.carrinho-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carrinho-item-nome {
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.3;
}

.carrinho-item-nome:hover { text-decoration: underline; }

.carrinho-item-detalhe { font-size: 0.75rem; opacity: 0.75; }

.carrinho-item-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.carrinho-item-preco { font-size: 0.9rem; white-space: nowrap; }

.carrinho-item-aviso { font-size: 0.7rem; color: #fcd34d; }

.carrinho-qtd {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-btn, 7px);
  overflow: hidden;
}

.carrinho-qtd button {
  width: 30px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.carrinho-qtd button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.carrinho-qtd button:disabled { opacity: 0.35; cursor: not-allowed; }

.carrinho-qtd span {
  min-width: 30px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.carrinho-remover {
  align-self: flex-start;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrinho-remover:hover { background: rgba(220, 38, 38, 0.25); color: white; }

.carrinho-vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 0;
  opacity: 0.85;
  text-align: center;
}

.carrinho-vazio svg { width: 40px; height: 40px; }

.carrinho-rodape {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carrinho-rodape:empty { display: none; }

.carrinho-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
}

.carrinho-total strong { font-size: 1.15rem; }

.carrinho-finalizar {
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-btn, 7px);
  background: white;
  color: var(--blue-900, #003465);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.carrinho-finalizar:disabled { opacity: 0.5; cursor: not-allowed; }

.carrinho-nota { font-size: 0.74rem; opacity: 0.75; line-height: 1.4; }

.carrinho-link {
  align-self: center;
  border: none;
  background: none;
  color: white;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  opacity: 0.8;
  cursor: pointer;
}

.carrinho-link:hover { opacity: 1; }

/* "Avise-me quando chegar" — card sem estoque e página do produto */
.loja-btn-avise {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-btn, 7px);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.loja-btn-avise:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.loja-btn-avise.feito { opacity: 0.7; cursor: default; }

/* No card sem estoque (apagado, ver landing.css) o botão de aviso é a única
   ação — fica no pé do card. */
.loja-card--sem-estoque .loja-card-aviso {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

@media (max-width: 640px) {
  .carrinho-painel { width: 100%; }
  .carrinho-btn { width: 34px; height: 34px; }
}
