/* The bar's touch sale screen fills the station: menu tiles on the left, the order and its payment always in reach on the right. */
body.station:has(.bar-register) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.station:has(.bar-register) .station-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 20px;
}

body.station:has(.bar-register) .bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

[data-tag="silver"] {
  --tag: var(--color-silver-500);
}

[data-tag="blue"] {
  --tag: var(--color-note-blue);
}

[data-tag="ice"] {
  --tag: var(--color-tag-ice);
}

[data-tag="violet"] {
  --tag: var(--color-note-violet);
}

[data-tag="rose"] {
  --tag: var(--color-tag-rose);
}

[data-tag="sand"] {
  --tag: var(--color-tag-sand);
}

.bar-tag-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tag, var(--color-silver-600));
}

.bar-shift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.bar-shift p {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-silver-200);
}

.bar-reader-note {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 40;
  max-width: min(640px, calc(100vw - 32px));
  padding: 14px 22px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-raised);
  color: var(--color-silver-100);
  font-weight: 600;
  box-shadow: 0 18px 50px color-mix(in srgb, var(--color-shade) 50%, transparent);
  transform: translateX(-50%);
}

.bar-register {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 32%, 480px);
  gap: 18px;
  min-height: 0;
  margin-top: 16px;
}

.bar-menu {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.bar-categories {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bar-category {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-silver-300);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

.bar-category[aria-pressed="true"] {
  border-color: var(--color-paper);
  background: var(--color-paper);
  color: var(--color-ink);
}

.bar-products {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  grid-auto-rows: minmax(112px, auto);
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 10px 10px 12px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html:has(.touch-keyboard:not([hidden])) .bar-products {
  padding-bottom: 84px;
}

.bar-product {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px 14px 12px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: inset 0 4px 0 var(--tag, var(--color-line));
  color: var(--color-silver-100);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease-out, background-color .12s ease-out, border-color .12s ease-out;
}

.bar-product:hover {
  border-color: var(--color-silver-600);
}

.bar-product:active:not(:disabled) {
  background: var(--color-raised);
  transform: scale(.97);
}

.bar-product.is-added {
  animation: bar-added .4s ease-out;
}

@keyframes bar-added {
  from {
    border-color: var(--color-paper);
    background: color-mix(in srgb, var(--color-paper) 14%, var(--color-surface));
  }
}

.bar-product:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.bar-product-name {
  display: -webkit-box;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.bar-product-price {
  color: var(--color-silver-300);
  font-size: 1rem;
  font-weight: 600;
}

.bar-product-note {
  color: var(--color-caution);
  font-size: .8125rem;
  font-weight: 600;
}

.bar-product-count {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--color-paper);
  box-shadow: 0 0 0 3px var(--color-ink);
  color: var(--color-ink);
  font-size: .9375rem;
  font-weight: 750;
}

.bar-menu-empty {
  border: 1px dashed var(--color-line);
  border-radius: 16px;
}

.bar-order {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-surface);
}

.bar-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-line);
  background: color-mix(in srgb, var(--color-well) 70%, transparent);
  scrollbar-width: none;
}

.bar-tab-list {
  display: flex;
  gap: 8px;
}

.bar-tab {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 96px;
  min-height: 56px;
  padding: 6px 14px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-raised);
  color: var(--color-silver-200);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.bar-tab[aria-pressed="true"] {
  border-color: var(--color-paper);
  box-shadow: inset 0 0 0 1px var(--color-paper);
  color: var(--color-paper);
}

.bar-tab-name {
  max-width: 170px;
  overflow: hidden;
  font-size: .9375rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-tab-total {
  color: var(--color-silver-400);
  font-size: .8125rem;
}

.bar-tab-new .bar-tab-total {
  color: inherit;
}

.bar-order-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}

.bar-order-title {
  color: var(--color-silver-100);
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bar-order-head .hint {
  min-height: 1.25em;
}

.bar-lines {
  flex: 1;
  min-height: 0;
  padding: 0 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bar-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 84px;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-line) 70%, transparent);
}

@container (max-width: 400px) {
  .bar-line {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 6px;
  }

  .bar-line-text {
    grid-column: 1 / -1;
  }
}

.bar-line.is-chosen {
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-paper) 7%, transparent);
}

.bar-line-name {
  display: block;
  color: var(--color-silver-100);
  font-weight: 600;
  overflow-wrap: break-word;
}

.bar-line-price {
  display: block;
  color: var(--color-silver-500);
  font-size: .8125rem;
}

.bar-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bar-step {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-raised);
  color: var(--color-silver-100);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.bar-step:active:not(:disabled) {
  background: color-mix(in srgb, var(--color-paper) 16%, var(--color-raised));
}

.bar-step:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.bar-line-quantity {
  min-width: 40px;
  color: var(--color-silver-100);
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
}

.is-splitting .bar-line-quantity {
  min-width: 64px;
  font-size: .9375rem;
}

.bar-line-total {
  color: var(--color-silver-100);
  font-weight: 600;
  text-align: right;
}

.bar-order-empty {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 24px;
  color: var(--color-silver-500);
  text-align: center;
}

.bar-confirm {
  flex-shrink: 0;
  margin: 0 12px 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-caution);
  border-radius: 12px;
  background: var(--color-raised);
  color: var(--color-silver-100);
}

.bar-confirm div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.bar-order-foot {
  display: grid;
  flex-shrink: 0;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--color-line);
}

.bar-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 2px;
}

.bar-total span {
  color: var(--color-silver-400);
}

.bar-total strong {
  color: var(--color-paper);
  font-size: 2rem;
  font-weight: 750;
  letter-spacing: -.01em;
}

.bar-pay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.station .bar-pay button {
  min-height: 72px;
  border-radius: 14px;
  font-size: 1.25rem;
}

.bar-order-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
}

.station .bar-order-actions button {
  min-height: 56px;
  padding-inline: 10px;
}

.bar-start {
  margin-top: 20px;
}

.bar-stations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 20px;
}

.bar-station-tile {
  display: grid;
  justify-items: start;
  gap: 10px;
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-raised);
  color: var(--color-silver-400);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.bar-station-tile:hover {
  border-color: var(--color-silver-600);
}

.bar-station-tile strong {
  color: var(--color-silver-100);
  font-size: 1.25rem;
}

.bar-station-tile span {
  align-self: end;
  color: var(--color-paper);
  font-weight: 600;
}

.bar-dialog,
.bar-park-dialog {
  width: min(720px, calc(100vw - 32px));
}

.bar-pay-dialog {
  width: min(640px, calc(100vw - 32px));
}

.bar-form,
.bar-pay-form {
  display: grid;
  gap: 16px;
}

.bar-due {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-line);
}

.bar-due span {
  color: var(--color-silver-400);
}

.bar-due strong {
  color: var(--color-paper);
  font-size: 2.5rem;
  font-weight: 750;
  line-height: 1.1;
}

.bar-pay-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bar-tenders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.bar-tender {
  min-height: 64px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-raised);
  color: var(--color-silver-100);
  font-size: 1.125rem;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}

.bar-tender[aria-pressed="true"] {
  border-color: var(--color-paper);
  background: var(--color-paper);
  color: var(--color-ink);
}

.bar-change {
  color: var(--color-silver-100);
  font-size: 1.375rem;
  font-weight: 700;
}

.bar-card-step {
  color: var(--color-silver-200);
  font-size: 1.125rem;
  line-height: 1.5;
}

.bar-reasons span {
  min-height: 52px;
  font-size: .9375rem;
}

.bar-comp-player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-ink);
  color: var(--color-silver-100);
}

.bar-pay-form .cashier-form-actions {
  display: grid;
}

.station .bar-pay-submit {
  min-height: 68px;
  border-radius: 14px;
  font-size: 1.1875rem;
}

.bar-paid {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 24px 28px;
  text-align: center;
}

.bar-paid-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-felt) 18%, transparent);
  color: var(--color-felt);
}

.bar-paid-title {
  color: var(--color-silver-100);
  font-size: 1.375rem;
  font-weight: 700;
}

.bar-paid-change {
  color: var(--color-paper);
  font-size: 2.25rem;
  font-weight: 750;
}

.bar-paid-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

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

.bar-park-existing {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--color-line);
}

.bar-park-existing .bar-tab-list {
  flex-wrap: wrap;
}

.bar-park-existing .bar-tab-list:empty,
.bar-park-existing:has(.bar-tab-list:empty) {
  display: none;
}

.bar-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.bar-void-summary {
  display: grid;
  gap: 4px;
}

.bar-void-summary strong {
  color: var(--color-paper);
  font-size: 1.75rem;
}

.bar-receipt {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-line);
}

.bar-receipt:last-child {
  border-bottom: 0;
}

.bar-receipt-time {
  color: var(--color-silver-500);
}

.bar-receipt-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--color-silver-100);
  font-weight: 600;
}

.bar-receipt-total {
  color: var(--color-silver-100);
  font-size: 1.125rem;
}

.bar-receipt.is-voided :is(.bar-receipt-total, .bar-receipt-title > .tabular) {
  color: var(--color-silver-600);
  text-decoration: line-through;
}

.bar-receipt-void {
  margin-top: 2px;
  color: var(--color-caution);
  font-size: .875rem;
}

.bar-receipt-actions,
.bar-stock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.bar-stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px minmax(0, 300px) minmax(0, 260px);
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-line);
}

.bar-stock-row:last-child {
  border-bottom: 0;
}

.bar-stock-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.bar-stock-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bar-stock-pieces {
  color: var(--color-silver-200);
  font-weight: 600;
  text-align: right;
}

.bar-day-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.bar-day-print {
  margin-left: auto;
}

.bar-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.bar-closing-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  align-items: start;
  gap: 20px;
}

.bar-record-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding-top: 14px;
}

.bar-record-form .cashier-field {
  flex: 1 1 160px;
}

.bar-record-form .bar-field-wide {
  flex: 2 1 240px;
}

.bar-record-form .bar-field-short {
  flex: 0 1 110px;
}

.bar-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  color: var(--color-silver-200);
}

@media (max-width: 1180px) {
  .bar .reception-tab {
    padding: 0 16px;
  }

  .bar .reception-tab svg,
  .bar-shift .hint {
    display: none;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  .bar-register {
    margin-top: 12px;
  }

  .bar-categories {
    padding-bottom: 10px;
  }

  .bar-category {
    min-height: 46px;
  }

  .bar-products {
    grid-auto-rows: minmax(96px, auto);
  }

  .bar-tabs {
    padding: 8px;
  }

  .bar-tab {
    min-height: 48px;
  }

  .bar-order-head {
    padding: 10px 16px 6px;
  }

  .bar-order-title {
    font-size: 1.125rem;
  }

  .bar-line {
    padding: 6px 8px;
  }

  .bar-step {
    width: 44px;
    height: 44px;
  }

  .bar-order-foot {
    gap: 8px;
    padding: 10px 12px;
  }

  .bar-total strong {
    font-size: 1.625rem;
  }

  .station .bar-pay button {
    min-height: 60px;
  }

  .station .bar-order-actions button {
    min-height: 48px;
  }
}

@media (max-width: 1100px) {
  .bar-stock-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bar-stock-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  body.station:has(.bar-register) {
    display: block;
    height: auto;
    overflow: visible;
  }

  .bar-register {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-products {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    overflow: visible;
  }

  .bar-order {
    overflow: visible;
  }

  .bar-order-foot {
    position: sticky;
    bottom: 0;
    background: var(--color-surface);
  }

  .bar-receipt {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bar-receipt-time {
    grid-column: 1 / -1;
  }
}
