/*
 * Single product live updates: total weight line, soft-navigation busy state,
 * add-to-cart loading state and the "Added to cart" toast (assets/js/product-*.js).
 */

/* ---------- Total weight (next to the quantity on product pages, see "Buy row" below) ---------- */
.quantity-total {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.quantity-total__icon {
  flex: none;
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quantity-total__value {
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
}

/* ---------- Busy states ---------- */
.woocommerce-content[aria-busy='true'] {
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.single-product form.cart[aria-busy='true'] .single_add_to_cart_button {
  opacity: 0.6;
  cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
  .woocommerce-content[aria-busy='true'] {
    transition: none;
  }
}

/* ---------- Toast ---------- */
.cart-toast {
  position: fixed;
  inset-block-end: var(--space-4);
  inset-inline: var(--space-4);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 28rem;
  margin-inline: auto;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-forest);
  color: var(--color-on-dark);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  animation: cart-toast-in var(--transition-base);
}

.cart-toast--error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error-text);
}

.cart-toast__message {
  flex: 1;
}

.cart-toast__link {
  color: inherit;
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  white-space: nowrap;
}

/* Base a:hover turns links dark, like the toast background; keep the light text, drop the underline. */
.cart-toast__link:hover {
  color: inherit;
  text-decoration: none;
}

.cart-toast__close {
  flex: none;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.cart-toast__close:hover {
  background: rgb(255 255 255 / 0.14);
}

@keyframes cart-toast-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cart-toast {
    animation: none;
  }
}
