.checkout-container {
  display: grid;
  width: min(100% - 2rem, 1200px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  align-items: start;
  gap: 1rem;
  margin-inline: auto;
  padding-block: 1.25rem 3rem;
}

.checkout-header {
  grid-column: 1 / -1;
  margin-bottom: 0.25rem;
}

.checkout-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.checkout-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.25;
}

.checkout-header > p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.checkout-main {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
}

.checkout-products,
.payment-section,
.order-summary {
  min-width: 0;
  border: 1px solid #e6e8eb;
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: 0 2px 8px rgb(20 30 45 / 4%);
}

.checkout-products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #e6e8eb;
}

.checkout-products-heading h2,
.payment-section h2,
.order-summary h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.checkout-products-heading a {
  font-size: 0.85rem;
}

#checkout-summary {
  display: grid;
}

.checkout-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem;
  border-bottom: 1px solid #e6e8eb;
}

.checkout-item:last-child {
  border-bottom: 0;
}

.checkout-item-game {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.checkout-item-game img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.35rem;
  object-fit: cover;
}

.checkout-game-initial {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.35rem;
  color: #315e99;
  background: #e8f0fa;
  font-size: 1.1rem;
  font-weight: 700;
}

.checkout-item-details {
  min-width: 0;
}

.checkout-item-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}

.checkout-item-name {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.checkout-item-price {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.checkout-item-target {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.checkout-quantity {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.checkout-quantity button {
  width: 2rem;
  height: 2rem;
  border: 1px solid #d8dce1;
  border-radius: 0.25rem;
  background: #fff;
}

.checkout-quantity button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.checkout-quantity output {
  min-width: 2.2rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.2rem;
  background: #f1f3f6;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.checkout-line-total {
  align-self: end;
  padding-bottom: 0.3rem;
  white-space: nowrap;
}

.checkout-empty {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
}

.payment-section {
  padding: 1rem;
}

.payment-section h2 {
  margin-bottom: 0.75rem;
}

.payment-availability {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #f2d574;
  border-radius: 0.3rem;
  color: #694f00;
  background: #fff9df;
  font-size: 0.85rem;
  line-height: 1.45;
}

.payment-options {
  display: grid;
  gap: 0.55rem;
}

.payment-choice-row {
  display: grid;
  min-width: 0;
  min-height: 4.4rem;
  grid-template-columns: 1rem minmax(0, 1fr) minmax(7rem, auto);
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #d4d8de;
  border-radius: 0.4rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(20 30 45 / 3%);
}

.payment-choice-indicator {
  width: 1rem;
  height: 1rem;
  border: 1px solid #aeb4bc;
  border-radius: 50%;
  background: #fff;
}

.payment-brands {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.payment-brand {
  display: inline-flex;
  min-height: 1.9rem;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.3rem;
}

.payment-currency-name {
  color: #344054;
  font-size: 0.88rem;
  font-weight: 600;
}

.payment-brand img {
  display: block;
  width: auto;
  max-width: 6.25rem;
  height: 2.15rem;
  object-fit: contain;
}

.payment-brand img.payment-brand-emphasis {
  max-width: 7rem;
  height: 2.55rem;
}

.payment-method-state {
  color: #7a8089;
  font-size: 0.75rem;
  white-space: nowrap;
}

.payment-row-end {
  display: grid;
  justify-items: end;
  gap: 0.2rem;
}

.payment-method-price {
  color: #1f2937;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.payment-choice-available {
  border-color: #cbd5e1;
}

.currency-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
}

.currency-row select {
  min-height: 2.2rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid #dfe2e6;
  border-radius: 0.3rem;
  background: #fff;
  color: inherit;
  font: inherit;
}

.save-payment-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.save-payment-option input {
  margin: 0.12rem 0 0;
}

.checkout-help-button {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d4d8de;
  border-radius: 999px;
  color: #1f2937;
  background: #fff;
  box-shadow: 0 4px 16px rgb(20 30 45 / 12%);
  font: inherit;
  font-size: 0.8rem;
}

#checkout-help {
  width: min(100% - 2rem, 26rem);
  border: 1px solid #dfe2e6;
  border-radius: 0.5rem;
  padding: 1.25rem;
  color: #273142;
}

#checkout-help::backdrop {
  background: rgb(15 23 42 / 45%);
}

#checkout-help h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

#checkout-help p {
  color: var(--text-muted);
  line-height: 1.5;
}

#checkout-help button {
  min-height: 2.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid #d4d8de;
  border-radius: 0.3rem;
  background: #fff;
  font: inherit;
}

.secure-badge {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.order-summary {
  position: sticky;
  top: 1rem;
  height: fit-content;
  padding: 1rem;
}

.order-summary h2 {
  margin-bottom: 1.1rem;
}

.coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.coupon-row input,
.coupon-row button {
  min-width: 0;
  min-height: 2.5rem;
  border: 1px solid #dfe2e6;
  border-radius: 0.3rem;
}

.coupon-row input {
  padding: 0.5rem 0.65rem;
  background: #f1f3f6;
}

.coupon-row button {
  padding-inline: 0.8rem;
  background: #fff;
}

.coupon-row input:disabled,
.coupon-row button:disabled {
  cursor: not-allowed;
  color: #9298a1;
}

.coupon-note {
  margin: 0.35rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.tax-location {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem;
  border: 1px solid #e6e8eb;
  border-radius: 0.35rem;
}

.tax-location legend {
  padding-inline: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.tax-location label {
  color: #344054;
  font-size: 0.8rem;
}

.tax-location select,
.tax-location input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d4d8de;
  border-radius: 0.3rem;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
}

.tax-location-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.summary-line,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.summary-line {
  padding-block: 0.7rem;
  border-bottom: 1px solid #e6e8eb;
  font-size: 0.9rem;
}

.summary-total {
  padding-block: 0.85rem;
  font-weight: 650;
}

.summary-total .summary-label {
  font-size: 0.95rem;
}

.summary-total .summary-value {
  color: #e65100;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  text-align: right;
  overflow-wrap: anywhere;
}

.btn-checkout {
  display: flex;
  width: 100%;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0.3rem;
  color: #3b3420;
  background: #f3c623;
  font: inherit;
  font-weight: 650;
}

.btn-checkout:disabled {
  cursor: not-allowed;
  color: #665c3d;
  background: #f4d975;
}

.payment-note {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  font-size: 0.77rem;
  line-height: 1.45;
  text-align: center;
}

#checkout-login {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.9rem;
}

#checkout-login[hidden] {
  display: none;
}

.return-to-cart {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  text-align: center;
}

.checkout-error {
  grid-column: 1 / -1;
}

.checkout-status {
  grid-column: 1 / -1;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  color: #334155;
  background: #f8fafc;
  font-size: 0.88rem;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .checkout-container {
    grid-template-columns: minmax(0, 1fr) minmax(275px, 330px);
  }
}

@media (max-width: 680px) {
  .checkout-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .checkout-header {
    grid-column: 1;
  }

  .order-summary {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 420px) {
  .checkout-container {
    width: min(100% - 1rem, 1200px);
    padding-block: 0.75rem 2rem;
  }

  .checkout-item {
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .payment-choice-row {
    grid-template-columns: 0.9rem minmax(0, 1fr) minmax(5rem, auto);
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .payment-choice-indicator {
    width: 0.9rem;
    height: 0.9rem;
  }

  .payment-method-state {
    font-size: 0.62rem;
  }

  .payment-method-price {
    font-size: 0.78rem;
  }

  .checkout-help-button {
    right: 0.6rem;
    bottom: 0.6rem;
  }

  .payment-brands {
    gap: 0.2rem 0.35rem;
  }

  .payment-brand {
    padding-inline: 0.15rem;
  }

  .payment-brand img {
    max-width: 4.75rem;
    height: 1.75rem;
  }

  .payment-brand img.payment-brand-emphasis {
    max-width: 5.5rem;
    height: 2.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-container * {
    scroll-behavior: auto;
  }
}
