:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --accent: #0ea5e9;
  --success: #059669;
  --danger: #dc2626;
  --muted: #6b7280;
  --text: #0f172a;
  --radius: 24px;
  --shadow: 0 25px 45px rgba(15, 23, 42, 0.08);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

main {
  padding: 32px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cart-hero {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 36px 32px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
  text-align: left;
}

.cart-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 10px;
}

.cart-hero__subhead {
  max-width: 720px;
  color: var(--muted);
  margin-bottom: 20px;
}

.cart-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 0;
}

.cart-steps li {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 600;
}

.cart-steps span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
}

.cart-checkout {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.payments-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 32px;
}

@media (min-width: 960px) {
  .payments-shell {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.order-panel,
.payment-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.order-panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.order-panel__header h1 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  margin-top: 4px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.order-panel__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  font-size: 0.9rem;
}

.order-panel__meta dt {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.order-panel__meta dd {
  font-weight: 600;
}

.order-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.order-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fdfdfd;
}

.order-item__thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
}

.order-item__content h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.order-item__content p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.order-item__price {
  text-align: right;
  font-weight: 600;
  margin-left: auto;
}

.order-item__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.qty-control input[type="number"] {
  width: 56px;
  border: none;
  text-align: center;
  padding: 6px;
  font-weight: 600;
}

.remove-item {
  border: 1px solid #ef4444;
  background: #fff1f2;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.order-totals {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-totals dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.order-totals dd {
  margin-left: auto;
  font-weight: 600;
}

.order-totals__grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.2rem;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.order-totals__discount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #047857;
}

.earn-breakdown {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
}

.earn-breakdown__header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.earn-breakdown__header .muted {
  margin: 0;
}

.earn-breakdown__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.earn-breakdown__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.earn-title {
  margin: 0;
  font-weight: 600;
}

.earn-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.earn-credits {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.pill-vc {
  background: #ecfeff;
  color: #0f172a;
  border: 1px solid #bae6fd;
}

.pill-evc {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.info-card {
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: 18px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.info-card h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.info-card__hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.payment-panel h2 {
  margin-bottom: 24px;
  font-size: 1.5rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; color: var(--muted); }

.loyalty-card {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 18px 18px 14px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(14,165,233,0.05), rgba(99,102,241,0.05));
}

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

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.loyalty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 10px 0 6px;
}

.loyalty-grid strong {
  font-size: 1.05rem;
}

.loyalty-apply {
  margin: 12px 0;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
}

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

.apply-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.apply-row input[type="range"] {
  flex: 1;
  border: none;
  padding: 0;
  accent-color: #0ea5e9;
}

.apply-row input[type="number"] {
  width: 120px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
}

.btn-ghost {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.4);
}

.applied-note {
  font-size: 0.9rem;
  color: #047857;
  font-weight: 700;
}

.loyalty-earn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 24px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

input {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.payment-element-shell {
  margin-bottom: 16px;
}

#payment-element {
  border: none;
  padding: 0;
  background: transparent;
}

button[data-submit-button] {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button[data-submit-button]:hover {
  box-shadow: 0 15px 40px rgba(14, 165, 233, 0.35);
  transform: translateY(-1px);
}

button[data-submit-button]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
}

button[data-loading="true"] .loading-spinner {
  opacity: 1;
}

button[data-loading="true"] [data-submit-label] {
  opacity: 0.7;
}

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

.payment-panel__disclaimer {
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.payment-message {
  min-height: 1.5rem;
  font-weight: 600;
}

.payment-message[data-state="error"] {
  color: var(--danger);
}

.payment-message[data-state="success"] {
  color: var(--success);
}

@media (max-width: 768px) {
  .order-item {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  .order-item__price {
    text-align: left;
  }
}
