/* POS workspace inspired by the approved cashier reference */

.pos-top-close {
  min-height: 40px;
  padding: 9px 18px;
  border-color: #e6534f;
  background: #e6534f;
  color: #fff;
}

.pos-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pos-metric-card {
  min-width: 0;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(23, 43, 33, .04);
}

.pos-metric-card span {
  color: #7a817d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pos-metric-card strong {
  overflow: hidden;
  color: #202522;
  font-size: clamp(18px, 2vw, 23px);
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-metric-card.is-success strong,
.pos-metric-card.is-cash strong {
  color: #239e68;
}

.pos-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.45fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.pos-catalog-card,
.pos-checkout-card,
.pos-history-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(23, 43, 33, .04);
}

.pos-catalog-card,
.pos-checkout-card {
  min-height: 620px;
}

.pos-catalog-card {
  display: flex;
  flex-direction: column;
}

.pos-panel-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.pos-panel-head h2 {
  margin: 0 0 3px;
  font-size: 17px;
}

.pos-panel-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.pos-panel-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pos-product-count {
  flex: 0 0 auto;
}

.pos-search-field {
  width: min(100%, 300px);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d9dfdb;
  border-radius: 10px;
  background: #fafbfa;
}

.pos-search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 159, 75, .09);
  background: #fff;
}

.pos-search-field span {
  color: #8b938e;
  font-size: 18px;
}

.pos-search-field input {
  min-height: 38px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding: 16px;
}

.pos-product-card {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 13px;
  border: 1px solid #dfe4e1;
  border-radius: 13px;
  background: #fff;
  color: #202522;
  text-align: left;
  cursor: pointer;
  transition: .16s ease;
}

.pos-product-card:hover,
.pos-product-card:focus-visible {
  border-color: #82caa2;
  outline: 0;
  background: #fbfffc;
  box-shadow: 0 8px 18px rgba(23, 43, 33, .07);
  transform: translateY(-1px);
}

.pos-product-card strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-card small {
  overflow: hidden;
  color: #888f8b;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-card b {
  color: #bf6900;
  font-size: 14px;
}

.pos-catalog-empty {
  grid-column: 1 / -1;
  min-height: 190px;
}

.pos-catalog-pagination {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.pos-checkout-card {
  display: flex;
  flex-direction: column;
}

.pos-checkout-card > form {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0;
}

.pos-cart-head-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #dde1df;
  border-radius: 10px;
  background: #f5f6f5;
  color: #343936;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.pos-cart-list {
  min-height: 112px;
  max-height: 210px;
  overflow-y: auto;
  padding: 8px 16px;
}

.pos-cart-empty {
  min-height: 100px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.pos-cart-empty strong {
  color: var(--ink);
}

.pos-cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px auto auto;
  gap: 9px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #edf0ee;
}

.pos-cart-product {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.pos-cart-product strong,
.pos-cart-product small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-product strong {
  font-size: 12px;
}

.pos-cart-product small {
  color: var(--muted);
  font-size: 10px;
}

.pos-cart-row input[type="number"] {
  min-height: 34px;
  padding: 5px 8px;
  text-align: center;
}

.pos-cart-total {
  font-size: 12px;
  white-space: nowrap;
}

.pos-remove-item {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #e94d50;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.pos-payment-area {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.pos-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #5f6662;
  font-size: 11px;
  font-weight: 800;
}

.pos-payment-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pos-payment-methods input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pos-payment-methods label {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid #dfe3e0;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pos-payment-methods input:checked + label {
  border-color: #22a16b;
  color: #08764a;
  background: #ecf9f2;
  box-shadow: inset 0 0 0 1px #22a16b;
}

.pos-method-icon {
  font-size: 15px;
}

.pos-payment-help {
  margin: 0;
  color: #757d78;
  font-size: 10px;
  line-height: 1.35;
}

.pos-discount-select {
  min-height: 40px;
}

.pos-cash-input {
  min-height: 52px;
  padding: 7px 12px;
  border: 2px solid #ce7700;
  border-radius: 11px;
  background: #fffdf9;
  font-size: 26px;
  font-weight: 850;
  text-align: right;
}

.pos-cash-input:focus {
  border-color: #b36600;
  box-shadow: 0 0 0 4px rgba(206, 119, 0, .1);
}

.pos-quick-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.pos-quick-amounts button {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #dfe3e0;
  border-radius: 9px;
  background: #fff;
  color: #303532;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.pos-quick-amounts button:hover {
  border-color: #85c8a4;
  background: #f5fcf8;
}

.pos-bill-summary {
  padding: 13px;
  border-radius: 12px;
  background: #111;
  color: #fff;
}

.pos-bill-total,
.pos-bill-change {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.pos-bill-total {
  padding-bottom: 10px;
  border-bottom: 1px solid #353535;
}

.pos-bill-change {
  padding-top: 10px;
}

.pos-bill-summary span,
.pos-bill-summary small {
  color: #c9c9c9;
  font-size: 10px;
}

.pos-bill-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  line-height: 1;
}

.pos-bill-change > strong {
  color: #ff8588;
}

.pos-bill-change > strong.is-positive {
  color: #67d7a0;
}

.pos-discount-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 0;
  color: #aeb5b1;
  font-size: 10px;
}

.pos-submit {
  min-height: 46px;
  background: #2fa66f;
  border-color: #2fa66f;
}

.pos-submit:hover {
  background: #238c5c;
  border-color: #238c5c;
}

.pos-history-head {
  min-height: 66px;
}

.pos-history-card .data-table td,
.pos-history-card .data-table th {
  padding-block: 11px;
}

.pos-status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  text-transform: lowercase;
}

.pos-status-paid {
  color: #08764a;
  background: #dff5eb;
}

.pos-status-void {
  color: #c53636;
  background: #ffe4e4;
}

.pos-dialog {
  width: min(92vw, 430px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.pos-dialog::backdrop {
  background: rgba(10, 21, 15, .5);
  backdrop-filter: blur(3px);
}

.pos-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.pos-dialog-head h2 {
  margin: 0;
}

.pos-dialog-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #f1f3f2;
  cursor: pointer;
}

.pos-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.pos-dialog-body label {
  display: grid;
  gap: 7px;
  color: #555f59;
  font-size: 11px;
  font-weight: 750;
}

@media (max-width: 1440px) {
  .pos-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .pos-workspace {
    grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr);
  }

  .pos-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .pos-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-workspace {
    grid-template-columns: 1fr;
  }

  .pos-catalog-card,
  .pos-checkout-card {
    min-height: auto;
  }

  .pos-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .pos-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-panel-actions,
  .pos-search-field {
    width: 100%;
  }

  .pos-product-count {
    display: none;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .pos-product-card {
    min-height: 92px;
  }

  .pos-payment-methods,
  .pos-quick-amounts {
    grid-template-columns: 1fr;
  }

  .pos-cart-row {
    grid-template-columns: minmax(0, 1fr) 64px auto;
  }

  .pos-cart-total {
    display: none;
  }
}

@media (max-width: 440px) {
  .pos-metric-grid {
    grid-template-columns: 1fr;
  }

  .pos-product-grid {
    grid-template-columns: 1fr;
  }

  .pos-cart-row {
    grid-template-columns: minmax(0, 1fr) 62px auto;
  }
}
