.kp-legacy-checkout__payment-card {
  display: grid;
  gap: var(--kp-space-4);
}

/* New-card "Pay with" summary card is revealed only when JS collapses a
   completed card, which is a drawer-only behaviour (see drawer.css). Hidden by
   default everywhere so the full-page checkout never shows an empty card. */
.kp-legacy-checkout__newcard-summary {
  display: none;
}

.kp-legacy-checkout__saved-cards,
.kp-legacy-checkout__saved-cvv {
  display: grid;
  gap: var(--kp-space-4);
}

.kp-legacy-checkout__saved-cards-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kp-space-4);
}

.kp-legacy-checkout__saved-cards > .kp-legacy-checkout__saved-cards-head {
  display: none;
}

.kp-legacy-checkout__saved-cards-title {
  margin: 0;
  font-size: 1rem;
}

.kp-legacy-checkout__saved-cards-list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.65rem;
  scrollbar-width: none;
}

.kp-legacy-checkout__saved-cards-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.kp-legacy-checkout__saved-card-item {
  position: relative;
  display: block;
  flex: 0 0 226px;
}

.kp-legacy-checkout__saved-card {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 236px;
  padding: 0.95rem 1rem 1rem;
  border: 3px solid rgba(145, 23, 242, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, #c50dff 0%, #7700e2 100%);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.kp-legacy-checkout__saved-card:hover {
  transform: translateY(-1px);
}

.kp-legacy-checkout__saved-card.is-active {
  border-color: rgba(145, 23, 242, 0.55);
  box-shadow: 0 0 0 4px rgba(145, 23, 242, 0.12);
}

.kp-legacy-checkout__saved-card::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 116px;
  height: 101px;
  background: linear-gradient(225deg, transparent 48%, #ffffff 49%);
}

.kp-legacy-checkout__saved-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kp-legacy-checkout__saved-card-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 54px;
}

.kp-legacy-checkout__saved-card-brand-image {
  display: block;
  width: auto;
  max-width: 64px;
  max-height: 30px;
  object-fit: contain;
}

/* Inline brand badge for the "Pay with" line and the saved-card selector rows.
   Card-network logos ship at mixed aspect ratios (square 20x20 badges vs wide
   wordmarks like Discover at 127x22), so constrain them to one box and let
   object-fit scale wordmarks down instead of overflowing the row. */
.kp-legacy-checkout__card-brand-logo {
  display: inline-block;
  height: 20px;
  width: auto;
  max-width: 40px;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 auto;
}

.kp-legacy-checkout__saved-card-pill {
  position: absolute;
  right: 1rem;
  bottom: 4.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: #a5f38f;
  color: #2d8a2b;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.kp-legacy-checkout__saved-card-mark {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kp-legacy-checkout__saved-card-mark-image {
  display: block;
  width: 46px;
  height: auto;
}

.kp-legacy-checkout__saved-card-bottom {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 0.25rem;
}

.kp-legacy-checkout__saved-card-holder {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  color: #ffffff;
}

.kp-legacy-checkout__saved-card-meta {
  font-size: 0.76rem;
  color: #ffffff;
}

.kp-legacy-checkout__saved-card-actions {
  position: absolute;
  top: 0.8rem;
  right: 0.7rem;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
}

.kp-legacy-checkout__saved-card-remove {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #ffffff;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.kp-legacy-checkout__saved-card-item:hover .kp-legacy-checkout__saved-card-remove,
.kp-legacy-checkout__saved-card-item:focus-within .kp-legacy-checkout__saved-card-remove {
  opacity: 1;
  transform: translateY(0);
}

.kp-legacy-checkout__saved-card-remove-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.24));
}

.kp-legacy-checkout__saved-card-remove:hover,
.kp-legacy-checkout__saved-card-remove:focus {
  color: #ffffff;
  transform: none;
}

.kp-legacy-checkout__saved-card-item--add {
  align-self: start;
}

.kp-legacy-checkout__saved-card-add {
  width: 100%;
  min-height: 236px;
  border: 1.5px dashed var(--kp-hair);
  border-radius: var(--kp-radius-lg);
  background: var(--kp-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kp-legacy-checkout__saved-card-add-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
}

.kp-legacy-checkout__saved-cvv {
  width: min(304px, 100%);
  margin-left: auto;
  padding: 1.4rem 1.5rem;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
}

.kp-legacy-checkout__saved-cvv label {
  text-align: center;
}

.kp-legacy-checkout__saved-cvv .kp-legacy-checkout__input {
  width: min(194px, 100%);
  margin: 0 auto;
}

.kp-legacy-checkout__saved-cvv[hidden],
.kp-legacy-checkout__payment-card[hidden] {
  display: none !important;
}

.kp-legacy-checkout .krepling-guest-card-fields {
  display: grid;
  gap: var(--kp-space-4);
}

.kp-legacy-checkout .krepling-guest-card-fields__title {
  margin: 0;
  font-size: 1rem;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-information {
  display: flex;
  width: 100%;
  gap: 0;
  align-items: start;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-info-1,
.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-info-2,
.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-info-3 {
  margin: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-info-1 {
  width: 60%;
  margin-right: 5px;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-info-2 {
  width: 25%;
  margin-right: 5px;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-info-3 {
  width: 25%;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-holder {
  margin-top: 0;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .krepling-hosted-field__label,
.kp-legacy-checkout .krepling-guest-card-fields--legacy .card_details_heading {
  display: block;
  margin-bottom: 8px;
  color: var(--kp-text-color);
  font-size: 13px;
  line-height: 12px;
  font-weight: 300;
  font-family: "PPRadioGrotesk-Light", "Helvetica Neue", Arial, sans-serif;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card_label-1 {
  display: block;
  margin: 0;
  line-height: 0;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card_label-1 .card_number {
  display: block;
  margin: 0 0 8px;
  line-height: 12px;
}

.kp-legacy-checkout .krepling-hosted-field__mount,
.kp-legacy-checkout #card_holder_name {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--kp-hair);
  border-radius: var(--kp-radius-md);
  background: var(--kp-input-color);
  box-shadow: var(--kp-raise-sm), var(--kp-bevel);
}

.kp-legacy-checkout .krepling-hosted-field__mount {
  display: block;
}

.kp-legacy-checkout .krepling-hosted-field__mount--card-number {
  padding-left: 45px;
}

.kp-legacy-checkout .krepling-hosted-field__mount--cvv {
  padding-right: 40px;
}

.kp-legacy-checkout .krepling-hosted-field__mount.is-error {
  border-color: var(--kp-error-color);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.kp-legacy-checkout #card_holder_name.is-error {
  border-color: var(--kp-error-color);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.kp-legacy-checkout .krepling-hosted-field__mount.is-complete {
  border-color: var(--kp-success-color);
}

.kp-legacy-checkout #cardlogo {
  position: absolute;
  left: 7px;
  right: auto;
  bottom: 0;
  top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none;
  pointer-events: none;
}

.kp-legacy-checkout #securitylogo {
  position: absolute;
  right: 5px;
  bottom: 2px;
  top: auto;
  transform: none;
  margin-top: 0;
}

.kp-legacy-checkout #cardlogo svg,
.kp-legacy-checkout #securitylogo svg {
  max-width: 30px;
}

.kp-legacy-checkout #credit-card-type-text,
.kp-legacy-checkout #cardDetailsError,
.kp-legacy-checkout #cardHolderNameError {
  display: none;
  min-height: 0;
  margin: 0;
  font-size: 0.88rem;
}

.kp-legacy-checkout #credit-card-type-text:not(:empty),
.kp-legacy-checkout #cardDetailsError:not(:empty),
.kp-legacy-checkout #cardHolderNameError:not(:empty) {
  display: block;
  margin-top: 8px;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .krepling-hosted-field__mount {
  width: 100%;
  height: 34px;
  min-height: 34px;
  margin-top: 0;
  padding: 0;
  box-shadow: none !important;
  overflow: hidden;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .krepling-hosted-field__mount--card-number,
.kp-legacy-checkout .krepling-guest-card-fields--legacy .krepling-hosted-field__mount--cvv {
  padding: 0;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .krepling-hosted-field__mount iframe {
  display: block;
  width: 100%;
  height: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy .card-holder label {
  display: block;
  margin-bottom: 8px;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy #card_holder_name {
  padding: 6px 12px 5px;
  line-height: 1.2;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy #cardlogo {
  top: calc(100% - 17px);
  left: 0;
  bottom: auto;
  padding-left: 7px;
  line-height: 0;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy #cardlogo img {
  position: static;
  bottom: auto;
}

.kp-legacy-checkout .krepling-guest-card-fields--legacy #securitylogo {
  top: calc(100% - 17px);
  right: 5px;
  bottom: auto;
  line-height: 0;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
}

.kp-legacy-checkout #cardDetailsError,
.kp-legacy-checkout #cardHolderNameError {
  color: var(--kp-error-color);
}

.kp-legacy-checkout #credit-card-type-text {
  color: var(--kp-muted-color);
}

@media (min-width: 760px) {
  .kp-legacy-checkout .card-information {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 760px) {
  .kp-legacy-checkout__saved-card-item {
    flex-basis: 190px;
  }

  .kp-legacy-checkout__saved-card,
  .kp-legacy-checkout__saved-card-add {
    min-height: 210px;
  }

  .kp-legacy-checkout__saved-cvv {
    width: 100%;
  }
}
