.checkout-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.checkout-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 18, 15, 0.34);
  backdrop-filter: blur(8px);
}

.checkout-sheet {
  position: absolute;
  inset: calc(10px + var(--safe-top)) 0 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99) 0%, rgba(255, 248, 241, 0.99) 100%);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 44px rgba(120, 82, 53, 0.16);
  overflow: hidden;
  transform: translateY(28px);
  transition: transform 240ms ease;
}

.checkout-overlay.is-open .checkout-sheet {
  transform: translateY(0);
}

.checkout-chrome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 251, 247, 0.94);
  border-bottom: 1px solid rgba(255, 185, 145, 0.2);
}

.checkout-chrome__copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.checkout-close-button {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 181, 137, 0.2);
  box-shadow: var(--shadow-float);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.checkout-close-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkout-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px calc(20px + var(--safe-bottom));
  display: grid;
  align-content: start;
  gap: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.checkout-scroll::-webkit-scrollbar {
  display: none;
}

.checkout-content {
  display: grid;
  gap: 14px;
}

.checkout-product-card,
.checkout-panel,
.profile-status-card,
.profile-address-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 185, 145, 0.18);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.checkout-product-card {
  display: none;
  padding: 12px;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
}

.checkout-product-card.is-visible {
  display: grid;
}

.checkout-product-card__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff0e4 0%, #ffe1cd 100%);
}

.checkout-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-product-card__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(93, 68, 49, 0.55);
  font-size: 22px;
  font-weight: 800;
}

.checkout-product-card__body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.checkout-product-card__title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.checkout-product-card__meta {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.checkout-product-card__price {
  font-size: 17px;
  font-weight: 800;
}

.checkout-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.checkout-panel__header {
  display: grid;
  gap: 4px;
}

.checkout-panel__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.checkout-panel__header h2,
.profile-status-card h2,
.profile-address-card h2 {
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: 800;
}

.checkout-panel__header p,
.checkout-helper,
.checkout-inline-note,
.checkout-address-copy,
.profile-status-card p,
.profile-address-card p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.checkout-form {
  display: grid;
  gap: 12px;
}

.checkout-field {
  display: grid;
  gap: 7px;
}

.checkout-field label {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-deep);
}

.checkout-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 184, 137, 0.24);
  background: rgba(255, 252, 247, 0.98);
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.checkout-field input:focus {
  outline: none;
  border-color: rgba(249, 115, 82, 0.46);
  box-shadow: 0 0 0 3px rgba(249, 115, 82, 0.12);
}

.checkout-field--inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkout-field--inline .checkout-field {
  gap: 7px;
}

.checkout-actions {
  display: grid;
  gap: 10px;
}

.checkout-actions .primary-button,
.checkout-actions .secondary-button {
  width: 100%;
}

.checkout-text-button {
  justify-self: start;
  padding: 0;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
}

.checkout-error,
.checkout-success {
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.checkout-error {
  background: rgba(255, 117, 117, 0.12);
  color: #b94040;
}

.checkout-success {
  background: rgba(124, 201, 107, 0.16);
  color: #3f7c32;
}

.checkout-otp-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.checkout-otp-input {
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255, 184, 137, 0.24);
  background: rgba(255, 252, 247, 0.98);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.checkout-otp-input:focus {
  outline: none;
  border-color: rgba(249, 115, 82, 0.46);
  box-shadow: 0 0 0 3px rgba(249, 115, 82, 0.12);
}

.checkout-summary-grid {
  display: grid;
  gap: 10px;
}

.checkout-summary-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 248, 242, 0.92);
  border: 1px solid rgba(255, 185, 145, 0.16);
  display: grid;
  gap: 4px;
}

.checkout-summary-item span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.checkout-summary-item strong {
  font-size: 15px;
  line-height: 1.45;
}

.payment-options {
  display: grid;
  gap: 10px;
}

.payment-option {
  width: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 184, 137, 0.22);
  background: rgba(255, 252, 247, 0.98);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.payment-option.is-active {
  background: rgba(255, 145, 102, 0.12);
  border-color: rgba(249, 115, 82, 0.34);
  box-shadow: 0 12px 22px rgba(249, 115, 82, 0.1);
}

.payment-option__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.payment-option__copy strong {
  font-size: 14px;
  line-height: 1.35;
}

.payment-option__copy span {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.payment-option__badge {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 145, 102, 0.12);
  color: var(--brand-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-summary,
.profile-address-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.profile-summary__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-chip {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.profile-chip.is-verified {
  background: rgba(124, 201, 107, 0.18);
  color: #3f7c32;
}

.profile-chip.is-pending {
  background: rgba(255, 145, 102, 0.14);
  color: var(--brand-deep);
}

.profile-summary__mobile {
  font-size: 18px;
  font-weight: 800;
}

.profile-actions {
  display: grid;
  gap: 10px;
}

.profile-highlights__icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 145, 102, 0.12);
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.checkout-actions--split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-confirm-card,
.checkout-cart-card,
.order-state-card,
.buyer-order-card,
.order-success-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 188, 148, 0.18);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 34px rgba(59, 36, 18, 0.06);
}

.checkout-confirm-card,
.checkout-cart-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.checkout-confirm-card strong,
.checkout-cart-card__header strong {
  font-size: 14px;
}

.checkout-confirm-card p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.checkout-cart-card__header,
.checkout-cart-card__item,
.checkout-cart-card__footer,
.buyer-order-card__top,
.buyer-order-card__footer,
.order-success-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.buyer-order-card__footer {
  flex-wrap: wrap;
}

.buyer-order-card__issue {
  min-height: 36px;
  padding: 8px 12px;
}

.checkout-cart-card__header span,
.checkout-cart-card__more,
.buyer-order-card__meta,
.buyer-order-card__order-id,
.order-success-card__copy,
.order-success-card__order-id {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.checkout-cart-card__list,
.order-history-list {
  display: grid;
  gap: 12px;
}

.checkout-cart-card__item strong,
.checkout-cart-card__footer strong {
  font-size: 14px;
}

.order-state-card,
.order-success-card {
  padding: 18px;
}

.order-state-card {
  text-align: center;
  color: var(--text-soft);
}

.order-state-card--error {
  color: #b94040;
  background: rgba(255, 117, 117, 0.1);
}

.buyer-order-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
}

.buyer-order-card__media {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff0e4 0%, #ffe1cd 100%);
  display: grid;
  place-items: center;
  color: rgba(93, 68, 49, 0.55);
  font-size: 15px;
  font-weight: 800;
}

.buyer-order-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buyer-order-card__body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.buyer-order-card__top strong {
  font-size: 15px;
  line-height: 1.4;
}

.buyer-order-card__badge,
.buyer-order-card__status {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.buyer-order-card__badge {
  background: rgba(255, 145, 102, 0.12);
  color: var(--brand-deep);
}

.buyer-order-card__status.status-new {
  background: rgba(255, 145, 102, 0.14);
  color: var(--brand-deep);
}

.buyer-order-card__status.status-accepted {
  background: rgba(64, 154, 255, 0.12);
  color: #2162b1;
}

.buyer-order-card__status.status-packed {
  background: rgba(255, 184, 77, 0.16);
  color: #a35b05;
}

.buyer-order-card__status.status-ready {
  background: rgba(124, 201, 107, 0.18);
  color: #3f7c32;
}

.buyer-order-card__status.status-delivered {
  background: rgba(44, 128, 81, 0.12);
  color: #2c8051;
}

.order-success-card {
  display: grid;
  gap: 16px;
  text-align: center;
}

.order-success-card__icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(124, 201, 107, 0.18) 0%, rgba(94, 176, 77, 0.1) 100%);
  display: grid;
  place-items: center;
}

.order-success-card__icon svg {
  width: 34px;
  height: 34px;
  stroke: #2c8051;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  fill: none;
}

.order-success-card h2 {
  font-size: 24px;
  line-height: 1.2;
}

.order-success-card__actions {
  display: grid;
  gap: 10px;
}

@media (max-width: 370px) {
  .checkout-scroll {
    padding-left: 14px;
    padding-right: 14px;
  }

  .checkout-panel,
  .profile-summary,
  .profile-address-card {
    padding: 16px;
  }

  .checkout-field--inline {
    grid-template-columns: 1fr;
  }

  .checkout-otp-row {
    gap: 8px;
  }

  .checkout-actions--split,
  .buyer-order-card {
    grid-template-columns: 1fr;
  }
}
