.tx-scope .tx-checkout-shell {
  display: grid;
  gap: var(--tx-s4);
  padding-block-end: var(--tx-s7);
}

.tx-scope .tx-checkout-shell .tx-btn {
  min-height: 44px;
}

.tx-scope .tx-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
  gap: var(--tx-s5);
  align-items: start;
}

.tx-scope .tx-checkout-flow,
.tx-scope .tx-checkout-payment,
.tx-scope .tx-checkout-advanced {
  min-width: 0;
}

.tx-scope .tx-checkout-scan {
  position: sticky;
  z-index: 20;
  inset-block-start: 0;
  box-shadow: var(--tx-shadow-1);
}

.tx-scope .tx-checkout-scan-row,
.tx-scope .tx-checkout-cash-entry {
  display: flex;
  align-items: end;
  gap: var(--tx-s2);
}

.tx-scope .tx-checkout-scan-row .tx-btn,
.tx-scope .tx-checkout-cash-entry .tx-btn,
.tx-scope .tx-checkout-remove {
  min-height: 44px;
}

.tx-scope .tx-checkout-scan-actions {
  display: flex;
  gap: var(--tx-s2);
}

.tx-scope .tx-checkout-camera-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.tx-scope .tx-camera-dialog {
  width: min(36rem, calc(100% - (2 * var(--tx-s4))));
}

.tx-scope .tx-camera-preview {
  position: relative;
  overflow: hidden;
  margin-block: var(--tx-s4);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--tx-border);
  border-radius: var(--tx-r-lg);
  background: var(--tx-text);
}

.tx-scope .tx-camera-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tx-scope .tx-camera-frame {
  position: absolute;
  inset: 22% 10%;
  border: 3px solid var(--tx-primary);
  border-radius: var(--tx-r-md);
  box-shadow: 0 0 0 999px var(--tx-overlay);
  pointer-events: none;
}

.tx-scope .tx-checkout-basket {
  overflow: hidden;
}

.tx-scope .tx-checkout-basket .tx-panel-heading {
  margin: 0;
  border-block-end: 1px solid var(--tx-border);
}

.tx-scope .tx-checkout-list {
  min-height: 13rem;
  max-height: calc(100vh - 20rem);
  overflow-y: auto;
}

.tx-scope .tx-checkout-list .tx-cardrow:last-child {
  border-block-end: 0;
}

.tx-scope .tx-checkout-item {
  min-height: 68px;
  align-items: center;
}

.tx-scope .tx-checkout-item .tx-cardrow__r {
  flex-direction: row;
  align-items: center;
}

.tx-scope .tx-checkout-payment {
  position: sticky;
  inset-block-start: var(--tx-s4);
  display: grid;
  gap: var(--tx-s4);
  box-shadow: var(--tx-shadow-2);
}

.tx-scope .tx-checkout-total {
  display: grid;
  gap: var(--tx-s1);
  padding: var(--tx-s4);
  border-radius: var(--tx-r-lg);
  background: var(--tx-primary-soft);
  color: var(--tx-primary);
}

.tx-scope .tx-checkout-total strong {
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  line-height: 1;
  text-align: start;
}

.tx-scope .tx-checkout-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tx-scope .tx-checkout-fieldset legend {
  margin-block-end: var(--tx-s2);
  font-weight: 650;
}

.tx-scope .tx-checkout-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.tx-scope .tx-checkout-methods span {
  min-height: 44px;
  border-block-end: 1px solid var(--tx-border);
}

.tx-scope .tx-checkout-methods label:nth-child(2n) span {
  border-inline-end: 0;
}

.tx-scope .tx-checkout-methods label:nth-last-child(-n + 2) span {
  border-block-end: 0;
}

.tx-scope .tx-checkout-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tx-s2);
}

.tx-scope .tx-checkout-money-grid .tx-kpi {
  min-width: 0;
  padding: var(--tx-s2) var(--tx-s3);
}

.tx-scope .tx-checkout-money-grid .tx-kpi b {
  font-size: var(--tx-fs-h2);
}

.tx-scope .tx-checkout-actionbar {
  margin: 0 calc(-1 * var(--tx-s4)) calc(-1 * var(--tx-s4));
}

.tx-scope .tx-checkout-actionbar .tx-btn {
  min-height: 52px;
  font-size: var(--tx-fs-h3);
}

.tx-scope .tx-checkout-actionbar .tx-hint {
  flex-basis: 100%;
  text-align: center;
}

.tx-scope .tx-checkout-receipt {
  display: grid;
  gap: var(--tx-s3);
}

.tx-scope .tx-checkout-receipt .tx-dl {
  grid-template-columns: 9rem minmax(0, 1fr);
}

.tx-scope .tx-checkout-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tx-s6);
  padding-block-start: var(--tx-s4);
}

.tx-scope .tx-checkout-secondary-grid > section + section {
  padding-inline-start: var(--tx-s6);
  border-inline-start: 1px solid var(--tx-border);
}

.tx-scope .tx-checkout-advanced > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.tx-scope dialog.tx-dialog {
  max-width: min(34rem, calc(100% - (2 * var(--tx-s4))));
  border: 1px solid var(--tx-border);
}

.tx-scope dialog.tx-dialog::backdrop {
  background: var(--tx-overlay);
}

.tx-scope dialog.tx-dialog .tx-alert {
  margin-block-start: var(--tx-s4);
}

.tx-scope dialog.tx-dialog .tx-btn {
  min-height: 44px;
}

@media (max-width: 1099px) {
  .tx-scope .tx-checkout-shell {
    padding-block-end: calc(7rem + env(safe-area-inset-bottom));
  }

  .tx-scope .tx-checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tx-scope .tx-checkout-list {
    max-height: none;
  }

  .tx-scope .tx-checkout-payment {
    position: static;
  }

  .tx-scope .tx-checkout-actionbar {
    position: fixed;
    z-index: 65;
    inset: auto 0 0;
    margin: 0;
    border-radius: var(--tx-r-lg) var(--tx-r-lg) 0 0;
  }

  .tx-scope .tx-checkout-scan {
    inset-block-start: 0;
  }
}

@media (max-width: 699px) {
  .tx-scope .tx-checkout-shell {
    padding-block-end: calc(11rem + env(safe-area-inset-bottom));
  }

  .tx-scope .tx-page-header {
    align-items: start;
  }

  .tx-scope .tx-checkout-scan-row,
  .tx-scope .tx-checkout-cash-entry,
  .tx-scope .tx-checkout-item,
  .tx-scope .tx-checkout-item .tx-cardrow__r {
    align-items: stretch;
    flex-direction: column;
  }

  .tx-scope .tx-checkout-scan-row .tx-btn,
  .tx-scope .tx-checkout-cash-entry .tx-btn {
    width: 100%;
  }

  .tx-scope .tx-checkout-scan-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .tx-scope .tx-checkout-scan-row .tx-checkout-camera-button {
    width: 44px;
  }

  .tx-scope .tx-checkout-item .tx-cardrow__r {
    min-width: 100%;
  }

  .tx-scope .tx-checkout-item .tx-price {
    text-align: start;
  }

  .tx-scope .tx-checkout-total strong {
    font-size: clamp(2.25rem, 14vw, 3.5rem);
  }

  .tx-scope .tx-checkout-money-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tx-scope .tx-checkout-money-grid .tx-kpi {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--tx-s2);
  }

  .tx-scope .tx-checkout-actionbar {
    position: fixed;
    z-index: 65;
    inset: auto 0 calc(64px + env(safe-area-inset-bottom));
    margin: 0;
    border-radius: var(--tx-r-lg) var(--tx-r-lg) 0 0;
  }

  .tx-scope .tx-checkout-actionbar .tx-hint {
    display: none;
  }

  .tx-scope .tx-checkout-secondary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tx-scope .tx-checkout-secondary-grid > section + section {
    padding-block-start: var(--tx-s5);
    padding-inline-start: 0;
    border-block-start: 1px solid var(--tx-border);
    border-inline-start: 0;
  }

  .tx-scope .tx-checkout-receipt .tx-dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .tx-scope dialog.tx-dialog .tx-dialog__f {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .tx-scope .tx-checkout-methods {
    grid-template-columns: minmax(0, 1fr);
  }

  .tx-scope .tx-checkout-methods span {
    border-inline-end: 0;
    border-block-end: 1px solid var(--tx-border);
  }

  .tx-scope .tx-checkout-methods label:nth-last-child(-n + 2) span {
    border-block-end: 1px solid var(--tx-border);
  }

  .tx-scope .tx-checkout-methods label:last-child span {
    border-block-end: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tx-scope .tx-checkout-scan {
    scroll-behavior: auto;
  }
}
