.compact-buy-actions {
  display: grid;
  align-content: center;
  justify-content: start;
}

.checkout-host {
  display: contents;
}

.compact-buy-actions .button {
  min-width: min(100%, 18rem);
}

.no-js-checkout {
  max-width: 24rem;
  margin: 0.75rem 0 0;
  color: #6c625a;
  line-height: 1.5;
}

.has-checkout-modal {
  overflow: hidden;
}

.checkout-dialog {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  background: rgba(47, 42, 38, 0.46);
  backdrop-filter: blur(8px);
}

.checkout-dialog[hidden],
.checkout-step[hidden] {
  display: none;
}

.checkout-panel {
  position: relative;
  display: grid;
  width: min(100%, 720px);
  height: min(720px, calc(100dvh - 1.5rem));
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.99), rgba(247, 243, 236, 0.98)),
    radial-gradient(circle at 100% 0%, rgba(151, 102, 62, 0.13), transparent 16rem);
  box-shadow: 0 28px 80px rgba(47, 42, 38, 0.3);
}

.checkout-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(63, 58, 53, 0.14);
  border-radius: 999px;
  color: #3f3a35;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
}

.checkout-panel > .checkout-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  width: 100%;
  height: 100%;
  max-height: none;
}

.checkout-flow-head {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 5.4rem 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(255, 252, 245, 0.92));
  box-shadow: 0 1px 0 rgba(63, 58, 53, 0.08);
}

.checkout-flow-head h3,
.checkout-step h3 {
  margin: 0;
  color: #3f3a35;
  text-wrap: balance;
}

.checkout-flow-head h3 {
  max-width: 30rem;
  padding-right: 3rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(5.9rem, 1fr));
  gap: 0.45rem;
  margin: 0;
  overflow-x: auto;
  padding: 0;
  list-style: none;
  scrollbar-width: thin;
}

.checkout-steps li {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 0.48rem 0.5rem;
  border-radius: 8px;
  color: #6c625a;
  background: rgba(63, 58, 53, 0.07);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.checkout-steps li.is-active {
  color: #fffaf3;
  background: #4f6b45;
}

.checkout-step {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  min-height: 0;
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.checkout-step-copy {
  margin: 0;
  color: #6c625a;
  line-height: 1.5;
}

.checkout-flow-status {
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0.65rem 1.25rem 0;
}

.checkout-flow-status:empty {
  display: none;
}

.checkout-flow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
  margin: auto -1.25rem -1.25rem;
  padding: 0.9rem 1.25rem 1.05rem;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.84), rgba(255, 252, 245, 0.98) 32%);
}

.checkout-payment-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .buy {
    padding: 1.35rem;
  }

  .compact-buy-actions .button,
  .checkout-payment-actions .button,
  .checkout-flow-actions .button {
    width: 100%;
  }

  .checkout-dialog {
    align-items: end;
    padding: 0;
  }

  .checkout-panel {
    width: 100%;
    height: 94dvh;
    max-height: 94dvh;
    border-radius: 8px 8px 0 0;
  }

  .checkout-close {
    top: 6.62rem;
    right: 0.82rem;
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }

  .checkout-flow-head,
  .checkout-step {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .checkout-flow-head {
    gap: 0.55rem;
    padding-top: 1rem;
  }

  .checkout-step h3 {
    padding-right: 3rem;
  }

  .checkout-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.32rem;
    overflow-x: visible;
  }

  .checkout-steps li {
    min-height: 36px;
    padding: 0.44rem 0.14rem;
    font-size: 0.64rem;
    line-height: 1.1;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .checkout-step .form-grid,
  .checkout-payment-actions {
    grid-template-columns: 1fr;
  }

  .checkout-step[data-checkout-step="3"] .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkout-step[data-checkout-step="3"] .span-2,
  .checkout-step[data-checkout-step="3"] .address-cep,
  .checkout-step[data-checkout-step="3"] .address-district {
    grid-column: 1 / -1;
  }

  .checkout-flow-actions {
    margin-right: -1rem;
    margin-left: -1rem;
    padding-right: 1rem;
    padding-left: 1rem;
  }
}
