/*
 * Shopping cart: header counter, "add to cart" buttons and the cart page.
 * Kept in public/ so it is served without re-running assets:precompile.
 */

.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 100rem;
  background: var(--accent-500);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}

.cart-count-badge.is-empty {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* Catalog tables: the copy and cart buttons sit side by side. */
.catalog-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
}

.catalog-cart-form {
  display: inline-flex;
  margin: 0;
}

.add-to-cart-btn {
  align-items: center;
  display: inline-flex;
  gap: .35rem;
  white-space: nowrap;
}

.add-to-cart-btn.is-added {
  --bs-btn-bg: #1f7a4d;
  --bs-btn-border-color: #1f7a4d;
  --bs-btn-hover-bg: #1a6740;
  --bs-btn-hover-border-color: #1a6740;
}

@media (max-width: 575.98px) {
  .add-to-cart-btn .add-to-cart-label {
    display: none;
  }
}

/* Toast shown after a product is added. */
.cart-toast-container {
  position: fixed;
  z-index: 1080;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.cart-toast {
  padding: .7rem .9rem;
  border-radius: var(--radius-md);
  background: var(--brand-800);
  color: #fff;
  box-shadow: 0 12px 30px rgba(14, 33, 68, .28);
  font-size: .92rem;
  line-height: 1.4;
  animation: cart-toast-in .18s ease-out;
}

.cart-toast.is-danger {
  background: #8c1d1d;
}

@keyframes cart-toast-in {
  from {
    opacity: 0;
    transform: translateY(.4rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cart page */
.cart-card,
.cart-summary-card,
.cart-order-card,
.cart-empty-card {
  background: #fff;
  border: 1px solid #d5ddeb;
  box-shadow: 0 1px 2px rgba(14, 33, 68, .06), 0 8px 24px rgba(14, 33, 68, .09);
}

.cart-table {
  font-size: .94rem;
}

.cart-table thead th {
  white-space: nowrap;
}

.cart-item-name {
  color: var(--brand-800);
  font-weight: 600;
  line-height: 1.35;
  min-width: 14rem;
}

.cart-item-meta {
  margin-left: .15rem;
}

.cart-quantity-group {
  flex-wrap: nowrap;
  margin: 0 auto;
  width: 7.5rem;
}

.cart-quantity-group .form-control {
  min-width: 3rem;
}

.cart-quantity-group .input-group-text {
  background: var(--brand-050);
  color: var(--muted);
  font-size: .82rem;
  padding-left: .45rem;
  padding-right: .45rem;
}

.cart-remove-btn {
  font-size: .85rem;
  text-decoration: none;
}

.cart-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  color: var(--muted);
}

.cart-summary-row b {
  color: var(--brand-800);
  white-space: nowrap;
}

.cart-summary-total {
  border-top: 1px solid var(--line);
  margin-top: .35rem;
  padding-top: .65rem;
  color: var(--brand-800);
  font-weight: 600;
}

.cart-summary-total b {
  font-size: 1.25rem;
}

.cart-order-card .form-label {
  color: var(--brand-800);
  font-size: .9rem;
  font-weight: 600;
}

.cart-captcha altcha-widget {
  display: block;
  max-width: 100%;
}

@media (max-width: 767.98px) {
  .cart-item-name {
    min-width: 10rem;
  }

  .cart-table {
    font-size: .88rem;
  }
}
