/* ==========================================================================
   Cart / checkout page
   ========================================================================== */

.cart-page .cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 24px;
  margin: 28px auto;
}

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

.cart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-item {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.cart-item.out-of-stock {
  border-color: rgba(255, 96, 96, 0.35);
  background: rgba(255, 96, 96, 0.08);
}

.cart-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.cart-item-main header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cart-item-main h3 {
  margin: 0;
  font-size: 1.05rem;
}

.cart-item-main .badge {
  background: rgba(11, 91, 215, 0.18);
  color: #d7ecff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cart-item.out-of-stock .badge {
  background: rgba(255, 96, 96, 0.18);
  color: #ffd7d7;
}

.cart-stock-note {
  margin: 0 0 10px;
  color: #ffd7d7;
  font-size: 0.88rem;
}

.cart-item-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 16px;
  color: rgba(226, 239, 255, 0.7);
  font-size: 0.88rem;
}

.cart-item-meta li strong {
  color: rgba(226, 239, 255, 0.92);
  margin-right: 4px;
}

.cart-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-width: 120px;
}

.cart-item-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.cart-item-subprice {
  font-size: 0.78rem;
  color: rgba(226, 239, 255, 0.55);
  margin-top: -2px;
}

.summary-row.summary-rate-note {
  font-size: 0.78rem;
  color: rgba(226, 239, 255, 0.6);
  font-style: italic;
}

.summary-row.summary-warning {
  color: #ffd7d7;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  color: rgba(226, 239, 255, 0.85);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-total strong {
  font-size: 1.4rem;
  color: #ffffff;
}

.cart-section-title {
  margin: 16px 0 10px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 239, 255, 0.7);
}

.payment-method-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.payment-method-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.payment-method-card:hover:not(:disabled) {
  border-color: rgba(31, 139, 255, 0.6);
  background: rgba(31, 139, 255, 0.08);
}

.payment-method-card.active {
  border-color: rgba(31, 139, 255, 0.85);
  background: rgba(31, 139, 255, 0.18);
  box-shadow: 0 0 0 2px rgba(31, 139, 255, 0.4) inset;
}

.payment-method-card:disabled,
.payment-method-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.payment-method-card .method-icon {
  grid-row: span 2;
  font-size: 1.6rem;
  align-self: center;
}

.payment-method-card .method-title {
  font-weight: 700;
  font-size: 1rem;
}

.payment-method-card .method-title small {
  font-weight: 500;
  color: rgba(226, 239, 255, 0.65);
  margin-left: 6px;
}

.payment-method-card .method-desc {
  grid-column: 2;
  font-size: 0.85rem;
  color: rgba(226, 239, 255, 0.68);
}

.btn.btn-large {
  padding: 14px 22px;
  font-size: 1rem;
}

.btn.btn-block {
  width: 100%;
}

.btn.btn-small {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.payment-details-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.payment-detail-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payment-detail-rows li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.payment-detail-rows li span:first-child {
  color: rgba(226, 239, 255, 0.7);
}

.payment-detail-rows li span:last-child {
  font-weight: 600;
}

.slip-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slip-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: rgba(226, 239, 255, 0.85);
}

.slip-form input[type="text"],
.slip-form textarea,
.slip-form input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
}

.slip-preview img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.payment-success-banner {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(60, 200, 130, 0.18), rgba(60, 200, 130, 0.05));
  border: 1px solid rgba(60, 200, 130, 0.5);
}

.payment-success-banner h3 {
  margin: 0 0 6px;
}

.separator {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.orders-table th,
.orders-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.orders-table th {
  color: rgba(226, 239, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

.orders-table code {
  font-size: 0.78rem;
}

.recent-order-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recent-order-actions .btn-small {
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(226, 239, 255, 0.92);
}

.status-pill.status-paid { background: rgba(60, 200, 130, 0.2); color: #6effa9; }
.status-pill.status-pending_payment { background: rgba(255, 200, 80, 0.18); color: #ffd372; }
.status-pill.status-cancelled,
.status-pill.status-declined { background: rgba(255, 90, 90, 0.18); color: #ff8c8c; }

.status-pill.success { background: rgba(60, 200, 130, 0.2); color: #6effa9; }
.status-pill.error { background: rgba(255, 90, 90, 0.18); color: #ff8c8c; }
.status-pill.info { background: rgba(110, 160, 255, 0.18); color: #a5c2ff; }

.auto-poll-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(110, 160, 255, 0.35);
  background: linear-gradient(135deg, rgba(110, 160, 255, 0.12), rgba(11, 91, 215, 0.12));
  color: rgba(226, 239, 255, 0.95);
  margin-bottom: 18px;
}

.auto-poll-banner.error {
  border-color: rgba(255, 90, 90, 0.5);
  background: rgba(255, 90, 90, 0.12);
  color: #ffb4b4;
}

.auto-poll-banner p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: rgba(226, 239, 255, 0.75);
}

.auto-poll-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #0b5bd7;
  animation: auto-poll-spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes auto-poll-spin {
  to { transform: rotate(360deg); }
}

.manual-fallback-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px 0 8px;
}

.manual-fallback-details summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(226, 239, 255, 0.85);
  padding: 4px 0;
}

.manual-fallback-details[open] summary {
  margin-bottom: 6px;
}

/* Cart entry button in client/admin headers */
.cart-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.cart-link-badge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff5252;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

/* Inline cart panel inside the client dashboard */
.client-cart-kpis {
  margin-bottom: 16px;
}

.client-cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.client-cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Modal "Continue to Checkout" CTA emphasis (used by main.js modal) */
.checkout-cta {
  background: linear-gradient(135deg, #0b5bd7, #22a6f2);
  color: #ffffff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
  width: 100%;
}

.checkout-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(11, 91, 215, 0.45);
}

.checkout-cta:disabled,
.checkout-cta.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
