:root {
  --cashdesk-nav-height: 60px;
}

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.nav-hidden {
  --cashdesk-nav-height: 0px;
}

body.nav-hidden .navbar {
  display: none;
}

.navbar {
  flex: 0 0 auto;
}


.cashdesk-main {
  flex: 1 1 auto;
  padding: 12px;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cashdesk-row {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  height: 100%;
  overflow: hidden;
}

.cashdesk-goods-col,
.cashdesk-cart-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.goods-panel,
.cart-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.goods-panel .card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.goods-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.goods-bottom-anchor {
  height: 1px;
}

.cart-bottom-anchor {
  height: 1px;
}

.goods-view-toggle .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0;
}

.goods-settings .goods-view-toggle {
  gap: 8px;
}

.goods-settings .goods-view-toggle .btn {
  width: auto;
  min-width: 110px;
  height: auto;
  padding: 0.4rem 0.9rem;
  justify-content: center;
}

.goods-settings .btn-gray-200,
.goods-settings .btn-gray-100 {
  width: auto;
  justify-content: center;
  gap: 8px;
}

.goods-settings .nav-toggle-btn {
  width: auto;
  min-width: 200px;
  justify-content: flex-start;
  align-self: flex-start;
}

.goods-settings .categories-view-toggle .btn {
  width: auto;
  min-width: 110px;
  height: auto;
  padding: 0.4rem 0.9rem;
  justify-content: center;
}

.goods-settings .goods-view-toggle .btn,
.goods-settings .categories-view-toggle .btn {
  border-color: #e5e7eb;
}

.goods-settings .goods-view-toggle .btn.active,
.goods-settings .categories-view-toggle .btn.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.scan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: block;
  padding: 10px;
  z-index: 1200;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .scan-overlay {
    width: 100dvw;
    height: 100dvh;
  }
}

.scan-overlay-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(94vw, 440px);
}

.scan-video-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
}

.scan-video-wrap video {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: #000;
  object-fit: cover;
}

.scan-video-wrap .scan-frame {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(13, 110, 253, 0.7);
  border-radius: 14px;
  pointer-events: none;
  z-index: 1;
}

.scan-overlay .scan-hint {
  color: #e5e7eb;
  font-weight: 600;
  text-align: center;
}

.scan-overlay .scan-actions {
  display: flex;
  gap: 10px;
}

.categories-list {
  scroll-behavior: smooth;
}

body.categories-inline .categories-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  margin-left: 0;
  margin-right: 0;
  padding-bottom: 6px;
}

body.categories-inline .categories-list > div {
  flex: 0 0 auto;
  width: 120px;
}

body.categories-inline .tile-img {
  height: 60px;
}

body.categories-inline .category-tile .card-body {
  padding: 0.35rem 0.4rem;
}

body.categories-inline .category-tile .tile-title {
  font-size: 0.8rem;
}

.cashier-keypad .btn {
  width: 92%;
  height: 44px;
  padding: 0.4rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.cashier-keypad .btn i {
  line-height: 1;
}

.goods-view-toggle .btn.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

body.goods-view-list .goods-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 0;
  margin-right: 0;
  padding-right: 8px;
}

body.goods-view-list .goods-grid > div {
  flex: 0 0 100%;
  max-width: 100%;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

body.goods-view-list .good-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

body.goods-view-list .good-tile .tile-img,
body.goods-view-list .good-tile .tile-img.placeholder {
  width: 64px;
  height: 64px;
  border-radius: 0.5rem;
  flex: 0 0 64px;
}

body.goods-view-list .good-tile .card-body {
  padding: 0.5rem 0.75rem;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name price"
    "code code";
  align-items: center;
  column-gap: 12px;
}

body.goods-view-list.cashdesk-has-quant .good-tile .card-body {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "name price price"
    "code quant quant";
}

body.goods-view-list .good-name {
  grid-area: name;
  min-width: 0;
  min-height: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  margin-top: 0;
}

body.goods-view-list .good-code,
body.goods-view-list .good-quant,
body.goods-view-list .good-price {
  font-size: 0.875rem;
  letter-spacing: normal;
  margin-top: 0;
  font-weight: 500;
}

body.goods-view-list .good-code {
  grid-area: code;
  text-align: left;
  font-size: 0.8rem;
}

body.goods-view-list .good-quant {
  grid-area: quant;
  text-align: right;
  font-size: 0.8rem;
}

body.goods-view-list .good-price {
  grid-area: price;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.cart-panel .cart-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.cart-discount {
  background: #fff7ed;
  border-left: 3px solid #f59e0b;
}

.cart-discount-manual {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.tile-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.tile-img.placeholder {
  background: #f5f8fb;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.category-tile,
.good-tile {
  border-radius: 0.5rem;
}

.good-tile {
  position: relative;
  overflow: hidden;
}

.category-tile:hover,
.good-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.125rem 0.75rem rgba(46, 54, 80, 0.15);
}

.good-tile.good-added {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25), 0 0.125rem 0.75rem rgba(46, 54, 80, 0.15);
}

.good-tile.good-added::after {
  content: "\f00c";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 12px;
  box-shadow: 0 0.25rem 0.6rem rgba(34, 197, 94, 0.35);
  opacity: 0;
  transform: scale(0.6);
  animation: goodAddedPop 0.8s ease;
  pointer-events: none;
}

@keyframes goodAddedPop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

.tile-title {
  line-height: 1.1;
}

.good-tile .card-body {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "code quant"
    "name name"
    "price price";
  row-gap: 4px;
}

.good-code {
  grid-area: code;
  font-size: 0.5rem;
  letter-spacing: 0.02em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.good-quant {
  grid-area: quant;
  font-size: 0.5rem;
  white-space: nowrap;
  justify-self: end;
}

.good-name {
  grid-area: name;
  line-height: 1.2;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.good-price {
  grid-area: price;
  font-weight: 700;
}

.cart-qty {
  min-width: 52px;
  display: inline-block;
  text-align: center;
}

/* Weight modal */
.weight-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.weight-input .form-control {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: right;
}

.weight-input .form-control:focus {
  box-shadow: none;
  border-color: var(--bs-border-color, #e5e7eb);
}

.weight-input:focus-within .form-control,
.weight-input:focus-within .input-group-text {
  box-shadow: none;
}

.weight-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.weight-keypad {
  margin-top: 0.25rem;
}

/* Size search modal */
.size-search-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.size-search-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.size-search-summary__item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 1));
  min-width: 0;
}

.size-search-summary__item--wide {
  grid-column: span 2;
}

.size-search-summary__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.size-search-summary__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.size-search-columns {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1.25fr;
  gap: 1rem;
  flex: 1 1 auto;
  align-items: stretch;
  height: clamp(24rem, 52vh, 30rem);
  min-height: 0;
}

.size-search-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  overflow: hidden;
  background: #ffffff;
}

.size-search-pane__title {
  padding: 0.8rem 0.95rem;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.size-search-list {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.size-search-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

.size-search-list .list-group-item:first-child {
  border-top: 0;
}

.size-search-list .list-group-item:last-child {
  border-bottom: 0;
}

.size-search-list .list-group-item.active,
.size-search-list .list-group-item.list-group-item-action.active {
  background: #eaf3ff;
  border-color: rgba(13, 110, 253, 0.3);
  color: #0f172a;
  z-index: auto;
}

.size-search-list .list-group-item.list-group-item-action.active:hover,
.size-search-list .list-group-item.list-group-item-action.active:focus {
  background: #dcecff;
  color: #0f172a;
}

.size-search-list .list-group-item.active .size-search-type-name,
.size-search-list .list-group-item.active .size-search-entry-main,
.size-search-list .list-group-item.active .size-search-good-name {
  color: #0f172a;
}

.size-search-list .list-group-item.active .size-search-type-code,
.size-search-list .list-group-item.active .size-search-entry-meta,
.size-search-list .list-group-item.active .size-search-good-meta,
.size-search-list .list-group-item.active .size-search-good-action {
  color: #475569;
}

.size-search-type-name,
.size-search-entry-main,
.size-search-good-name {
  font-weight: 600;
  color: #0f172a;
}

.size-search-type-code,
.size-search-entry-meta,
.size-search-good-meta,
.size-search-good-action {
  font-size: 0.78rem;
  color: #64748b;
}

.size-search-good {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.size-search-good__body,
.size-search-good__aside {
  min-width: 0;
}

.size-search-good__aside {
  text-align: right;
}

.size-search-good-price {
  font-weight: 700;
  color: #0f172a;
}

.size-search-good-action {
  color: #0d6efd;
}

@media (max-width: 991.98px) {
  .size-search-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .size-search-summary__item--wide {
    grid-column: span 2;
  }

  .size-search-columns {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .size-search-pane {
    min-height: 14rem;
  }
}

@media (max-width: 991.98px) {
  body {
    overflow: auto;
    overflow-x: hidden;
  }

  .cashdesk-main {
    overflow: auto;
    overflow-x: hidden;
    height: auto;
    padding-left: 12px;
    padding-right: 12px;
  }

  .cashdesk-row {
    display: block !important;
    flex-direction: column;
    height: auto;
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
  }

  .cashdesk-row > * {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0;
    padding-right: 0;
  }

  .cashdesk-goods-col,
  .cashdesk-cart-col,
  .goods-panel,
  .cart-panel {
    height: auto;
    min-width: 0;
  }

  .cashdesk-goods-col,
  .cashdesk-cart-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .cashdesk-goods-col {
    margin-bottom: 12px;
  }

  .goods-panel .card-body {
    overflow: visible;
  }

  .goods-scroll {
    overflow: visible;
    max-height: none;
  }

  .cart-panel .cart-body {
    overflow: visible;
    max-height: none;
  }

  /* Extra space for mobile browser toolbars */
  .cart-panel .card-footer {
    padding-bottom: 1.25rem;
  }

  #btnCheckout {
    margin-bottom: 0.25rem;
  }
}

/* Checkout modal */
.checkout-modal .modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.checkout-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.checkout-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.checkout-tab {
  border: 1px solid var(--bs-border-color, #e5e7eb);
  background: var(--bs-gray-100, #f8f9fa);
  color: var(--bs-gray-700, #495057);
  border-radius: 0.85rem;
  padding: 0.65rem 0.9rem;
  text-align: left;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-weight: 600;
}

.checkout-tab-title {
  font-size: 0.95rem;
}

.checkout-tab-sub {
  font-size: 0.75rem;
  color: var(--bs-gray-600, #6c757d);
  font-weight: 500;
}

.checkout-tab.is-active {
  background: var(--bs-primary, #0d6efd);
  border-color: var(--bs-primary, #0d6efd);
  color: #ffffff;
}

.checkout-tab.is-active .checkout-tab-sub {
  color: rgba(255, 255, 255, 0.8);
}

.checkout-summary {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--bs-border-color, #e5e7eb);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(248, 249, 250, 0.95), rgba(255, 255, 255, 1));
  text-align: left;
}

.checkout-summary-main {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  min-width: 0;
  flex-wrap: wrap;
}

.checkout-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}

.checkout-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-gray-600, #6c757d);
}

.checkout-total {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.checkout-sub {
  font-size: 0.85rem;
  color: var(--bs-gray-600, #6c757d);
  margin-top: 0;
  white-space: nowrap;
}

.checkout-breakdown {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.checkout-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.checkout-breakdown-compact {
  flex-direction: row;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.checkout-breakdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: var(--bs-gray-100, #f8f9fa);
  color: var(--bs-gray-700, #495057);
  line-height: 1.2;
}

.checkout-breakdown-chip strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bs-gray-900, #111827);
}

.checkout-breakdown-chip-discount {
  background: rgba(13, 110, 253, 0.08);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.checkout-grid.checkout-grid-no-keypad {
  grid-template-columns: 1fr;
}

.checkout-grid.checkout-grid-no-keypad .checkout-right {
  display: none;
}

#checkoutModal.checkout-no-keypad .checkout-grid {
  grid-template-columns: 1fr !important;
}

#checkoutModal.checkout-no-keypad .checkout-left {
  grid-column: 1 / -1;
  width: 100%;
}

#checkoutModal.checkout-no-keypad .checkout-right {
  display: none !important;
}

.checkout-card {
  border: 1px solid var(--bs-border-color, #e5e7eb);
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 1rem;
}

.checkout-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.checkout-card-title {
  font-weight: 700;
}

.checkout-card-sub {
  font-size: 0.85rem;
  color: var(--bs-gray-600, #6c757d);
}

.checkout-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkout-badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color, #e5e7eb);
  background: var(--bs-gray-100, #f8f9fa);
  color: var(--bs-gray-700, #495057);
  white-space: nowrap;
}

.checkout-badge.is-ok {
  color: var(--bs-success, #198754);
  border-color: rgba(25, 135, 84, 0.3);
  background: rgba(25, 135, 84, 0.12);
}

.checkout-badge.is-bad {
  color: var(--bs-danger, #dc3545);
  border-color: rgba(220, 53, 69, 0.35);
  background: rgba(220, 53, 69, 0.12);
}

.checkout-badge.is-warn {
  color: var(--bs-warning, #ffc107);
  border-color: rgba(255, 193, 7, 0.4);
  background: rgba(255, 193, 7, 0.15);
}

.checkout-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkout-chip {
  min-width: 68px;
}

.checkout-chip-ghost {
  border-style: dashed;
}

.checkout-money .form-control {
  font-size: 1.4rem;
  font-weight: 700;
}

.checkout-money .form-control:focus {
  /* Bootstrap focus ring looks too heavy in the checkout modal */
  box-shadow: none;
}

.checkout-money .input-group-text {
  font-weight: 700;
}

.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.checkout-change {
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 0.7rem;
  background: rgba(25, 135, 84, 0.12);
  color: var(--bs-success, #198754);
  min-width: 140px;
  text-align: right;
}

.checkout-change.is-bad {
  background: rgba(220, 53, 69, 0.12);
  color: var(--bs-danger, #dc3545);
}

.checkout-total-sm {
  font-weight: 700;
}

.checkout-terminal {
  border: 1px dashed var(--bs-border-color, #e5e7eb);
  border-radius: 0.8rem;
  padding: 0.75rem;
  background: var(--bs-gray-100, #f8f9fa);
}

.checkout-terminal-title {
  font-weight: 600;
}

.checkout-terminal-text {
  font-size: 0.85rem;
  color: var(--bs-gray-600, #6c757d);
  margin-top: 0.25rem;
}

.mono-pay-qr-wrap {
  border: 1px dashed var(--bs-border-color, #e5e7eb);
  border-radius: 0.8rem;
  padding: 0.75rem;
  background: var(--bs-gray-100, #f8f9fa);
  margin-bottom: 0.25rem;
}

.mono-pay-qr {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mono-pay-qr img,
.mono-pay-qr canvas {
  width: 180px;
  height: 180px;
}

#monoPayStatusBadge,
#liqpayPayStatusBadge {
  min-width: 170px;
  text-align: center;
}

.checkout-options {
  margin-top: 0.75rem;
}

.checkout-bonus-panel {
  margin-top: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--bs-border-color, #e5e7eb);
  border-radius: 0.8rem;
  background: var(--bs-gray-100, #f8f9fa);
}

.checkout-bonus-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.checkout-bonus-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-gray-600, #6c757d);
}

.checkout-bonus-card {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bs-gray-800, #343a40);
  text-align: right;
}

.checkout-bonus-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.checkout-bonus-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--bs-gray-700, #495057);
  font-size: 0.78rem;
  line-height: 1.2;
}

.checkout-bonus-chip strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bs-gray-900, #111827);
}

.manual-discount-keypad {
  margin-top: 0.5rem;
}

.checkout-prro {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkout-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.checkout-key {
  border: 1px solid var(--bs-border-color, #e5e7eb);
  background: var(--bs-gray-100, #f8f9fa);
  color: var(--bs-gray-900, #111827);
  border-radius: 0.85rem;
  padding: 0.75rem 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.checkout-key:hover {
  background: var(--bs-gray-200, #e9ecef);
}

.checkout-key-alt {
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.35);
  color: var(--bs-primary, #0d6efd);
}

.checkout-key-danger {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.35);
  color: var(--bs-danger, #dc3545);
}

.checkout-hint {
  font-size: 0.8rem;
  color: var(--bs-gray-600, #6c757d);
  margin-top: 0.5rem;
}

.btn-pay {
  background: #14532d;
  border-color: #14532d;
  color: #ffffff;
  min-width: 200px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.btn-pay:hover,
.btn-pay:focus {
  background: #166534;
  border-color: #166534;
  color: #ffffff;
}

.btn-pay:disabled {
  opacity: 0.6;
}

#btnCheckout {
  background: #14532d;
  border-color: #14532d;
  color: #ffffff;
}

#btnCheckout:hover,
#btnCheckout:focus {
  background: #166534;
  border-color: #166534;
  color: #ffffff;
}

#btnCheckout:disabled {
  opacity: 0.6;
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 1050;
  background: rgba(21, 128, 61, 0.95);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: cartToastPop 1.8s ease forwards;
}

.cart-toast i {
  font-size: 1rem;
}

@keyframes cartToastPop {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@media (max-width: 991.98px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .checkout-breakdown-compact {
    justify-content: flex-start;
  }

  .checkout-summary-main,
  .checkout-summary-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .checkout-bonus-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .checkout-bonus-card {
    text-align: left;
  }

  .checkout-tab {
    min-width: 0;
    flex: 1 1 160px;
  }
}

.prro-print-dialog {
  max-width: 420px;
}

.prro-print-content .modal-body {
  padding: 1.25rem 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.prro-receipt {
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  color: #111111;
  max-width: 360px;
  margin: 0 auto;
}

.prro-receipt-body {
  display: block;
}

.prro-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  white-space: pre-wrap;
}

.prro-line.prro-align-center {
  justify-content: center;
  text-align: center;
}

.prro-line.prro-align-left {
  justify-content: flex-start;
  text-align: left;
}

.prro-line.prro-align-right {
  justify-content: flex-end;
  text-align: right;
}

.prro-line.prro-empty {
  min-height: 8px;
}

.prro-seg {
  flex: 1;
  min-width: 0;
}

.prro-seg.prro-align-right {
  text-align: right;
}

.prro-seg.prro-align-center {
  text-align: center;
}

.prro-bold {
  font-weight: 700;
}

.prro-font-medium {
  font-size: 1.05em;
}

.prro-font-tall {
  font-size: 1.15em;
}

.prro-hr {
  border-top: 1px dashed #222222;
  margin: 6px 0;
}

.prro-qr {
  text-align: center;
  margin-top: 10px;
}

.prro-qr img,
.prro-qr canvas {
  width: 180px;
  height: 180px;
  display: block;
  margin: 0 auto;
}

/* Center QR in the preview modal as well (it is outside .prro-qr there). */
#prroPrintQr {
  text-align: center;
}

#prroPrintQr > div {
  display: inline-block;
}

#prroPrintQr img,
#prroPrintQr canvas {
  display: block;
  margin: 0 auto;
}
