.af-cart-page {
  /* Align cart canvas with Bootstrap .container width on desktop. */
  max-width: 1170px;
  margin: 28px auto;
  padding: 0 15px 36px;
  overflow-x: clip;
}

.af-cart-header {
  margin-bottom: 18px;
}

.af-cart-header h1 {
  margin: 0;
  color: #1f2937;
  font-size: 2.1rem;
}

.af-cart-header p {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.af-cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.af-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  min-width: 0;
}

.af-card h2 {
  margin: 0 0 16px;
  font-size: 1.45rem;
  color: #111827;
}

.af-card--summary {
  position: sticky;
  top: 14px;
}

.af-cart-empty {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

.af-cart-row {
  display: grid;
  grid-template-columns: 78px minmax(180px, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
}

.af-cart-thumb {
  width: 78px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.af-cart-title {
  font-weight: 600;
  color: #111827;
}

.af-cart-title a {
  color: inherit;
  text-decoration: none;
}

.af-cart-title a:hover {
  text-decoration: underline;
}

.af-cart-meta {
  margin-top: 6px;
  color: #64748b;
  font-size: 1.2rem;
  font-weight: 500;
}

.af-cart-price,
.af-cart-line-total {
  font-weight: 600;
  color: #0f172a;
}

.af-cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.af-cart-qty span {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}

.af-qty-btn,
.af-remove-btn,
.af-cart-link,
.af-checkout-btn,
.af-test-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

.af-qty-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 30px;
  text-align: center;
}

.af-remove-btn {
  color: #475569;
}

.af-checkout-btn,
.af-test-btn--primary {
  background: #d65982;
  color: #fff;
  border-color: #d65982;
}

.af-checkout-btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.af-checkout-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(214, 89, 130, 0.3);
}

.af-checkout-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.af-summary-box {
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  overflow: hidden;
}

.af-summary-box p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

/* Preserves hidden rows when checkout logic toggles summary lines. */
.af-summary-box p[hidden] {
  display: none;
}

.af-summary-box p:last-child {
  border-bottom: 0;
}

.af-summary-box span {
  color: #475569;
}

.af-summary-box strong {
  color: #0f172a;
  font-size: 1.22rem;
}

.af-status {
  margin: 10px 0 0;
  font-size: 1.22rem;
  color: #64748b;
}

.af-status--error {
  color: #b91c1c;
}

.af-status--success {
  color: #15803d;
}

@media (max-width: 991px) {
  .af-cart-grid {
    grid-template-columns: 1fr;
  }

  .af-card--summary {
    position: static;
  }

  .af-cart-row {
    grid-template-columns: 64px minmax(0, 1fr) auto auto auto;
    gap: 8px 10px;
    grid-template-areas:
      'thumb info info info info'
      'price price qty total total'
      'actions actions actions actions actions';
    align-items: start;
  }

  .af-cart-thumb {
    grid-area: thumb;
  }

  .af-cart-info {
    grid-area: info;
  }

  .af-cart-price {
    grid-area: price;
    margin-top: 2px;
    align-self: center;
    white-space: nowrap;
    justify-self: start;
  }

  .af-cart-qty {
    grid-area: qty;
    justify-self: center;
    gap: 6px;
    align-self: center;
  }

  .af-cart-line-total {
    grid-area: total;
    justify-self: end;
    align-self: center;
    white-space: nowrap;
  }

  .af-cart-actions {
    grid-area: actions;
    justify-self: start;
    margin-top: 2px;
  }

  .af-cart-price,
  .af-cart-qty,
  .af-cart-line-total,
  .af-cart-actions {
    grid-column: auto;
  }

  .af-remove-btn {
    padding: 5px 10px;
    font-size: 0.9rem;
  }

  .af-cart-thumb {
    width: 66px;
    height: 66px;
  }

  .af-cart-info,
  .af-cart-price,
  .af-cart-qty,
  .af-cart-line-total,
  .af-cart-actions {
    min-width: 0;
  }

  .af-card {
    padding: 16px;
  }

  .af-qty-btn {
    width: 30px;
    height: 30px;
    line-height: 28px;
  }

}
