/* BCX Theme — add-to-cart toast + badge bump, v1.2.0 */

/* ─── Toast ──────────────────────────────────────────────────────── */
.bcx-cart-toast {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  max-width: 480px;
  margin: 0 auto;
  background: #0F172A;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.30);
  z-index: 99999;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: bcx-toast-in 0.3s ease-out;
}
.bcx-cart-toast-out {
  animation: bcx-toast-out 0.25s ease-in forwards;
}
@keyframes bcx-toast-in {
  from { transform: translateY(120%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes bcx-toast-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(120%); opacity: 0; }
}

.bcx-cart-toast-check {
  width: 32px; height: 32px;
  background: var(--bcx-accent, #10B981);
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}

.bcx-cart-toast-text { flex: 1; min-width: 0; }
.bcx-cart-toast-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 1px;
}
.bcx-cart-toast-text small {
  font-size: 11px;
  opacity: 0.85;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bcx-cart-toast-cta {
  background: var(--bcx-primary, #37B7FF);
  color: #fff !important;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.bcx-cart-toast-cta:hover {
  background: var(--bcx-primary-dark, #1E90DB);
}

.bcx-cart-toast-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.bcx-cart-toast-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ─── Badge bump animation no header ─────────────────────────────── */
.bcx-bump,
.bcx-cart-count.bcx-bump,
.cart-contents-count.bcx-bump,
.header-icon .badge.bcx-bump,
.bcx-cart-badge.bcx-bump {
  animation: bcx-badge-bump 0.4s ease-out;
}
@keyframes bcx-badge-bump {
  0% { transform: scale(1); }
  40% {
    transform: scale(1.6);
    background: var(--bcx-accent, #10B981) !important;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
  }
  100% { transform: scale(1); }
}

/* ─── Esconde botão "Ver carrinho" nativo do WC ──────────────────── */
/* Toast BCX já tem o CTA "Ver carrinho", o link nativo do WC fica redundante */
.single-product a.added_to_cart,
.single-product .added_to_cart.wc-forward,
.woocommerce-product-summary a.added_to_cart,
form.cart + .added_to_cart,
form.cart ~ a.added_to_cart {
  display: none !important;
}

/* ─── Spinner no botão durante AJAX add-to-cart ──────────────────── */
.bcx-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  animation: bcx-spin 0.7s linear infinite;
}
@keyframes bcx-spin {
  to { transform: rotate(360deg); }
}
.bcx-loading {
  opacity: 0.85;
  cursor: progress !important;
}

/* ─── Reduce motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bcx-cart-toast { animation: none; }
  .bcx-bump { animation: none; }
}
