/* POS layout — full-height flex column chain: body → pos-main → pos-content → pos-content-root */

html, body {
  height: 100dvh;
}

.pos-body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.pos-main {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pos-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Applied to the outermost wrapper in each view (e.g. #posEntryModalRoot) */
.pos-content-root {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pos-screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
}

/* Screens that don't have an internal scroller scroll as a whole */
.pos-screen--scrollable {
  overflow-y: auto;
}

/* Scrollable content sections are centred; header/footer bleed full-width */
.pos-totals-bar,
.pos-entries-section {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Centre non-screen content (login, confirmation, etc.) */
.pos-content:not(:has(.pos-screen)) {
  align-items: center;
  justify-content: center;
}

/* Header — full-width background, inner .container centres content */
.pos-header {
  border-bottom: 1px solid var(--bs-secondary-bg);
  padding: 0.75rem 0;
}

.pos-header > .container {
  max-width: 640px;
  padding-left: 1rem;
  padding-right: 1rem;
}

.pos-header-side {
  width: 2.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.pos-header-centre {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.pos-header-meta {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .pos-header-meta { font-size: 0.8rem; }
}

/* Totals bar */
.pos-totals-bar {
  border-bottom: 1px solid var(--bs-secondary-bg);
  padding: 0.6rem 1rem;
}

.pos-totals-bar .pos-total-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pos-totals-bar .pos-total-item + .pos-total-item {
  border-left: 1px solid var(--bs-secondary-bg);
}

.pos-totals-bar .pos-total-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.pos-totals-bar .pos-total-amount {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Entries */
.pos-entries-section {
  flex: 1 1 0;
  padding: 0.75rem 1rem;
}

.pos-entry-item {
  border: 1px solid var(--bs-secondary-bg);
  padding: 0.6rem 0.75rem;
  gap: 0.6rem;
}

.pos-entry-sub   { font-size: 0.75rem; }
.pos-entry-amount { font-size: 0.95rem; }

/* Payment method toggle */
.pos-method-btn.active {
  background: var(--bs-primary);
  color: #fff;
  border-color: var(--bs-primary);
}

/* Action bar — full-width background; inner .container centres the buttons */
.pos-action-bar {
  border-top: 1px solid var(--bs-secondary-bg);
  padding: 0.75rem 0;
}

.pos-action-bar-inner {
  gap: 0.6rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

.pos-action-bar-inner .btn-add  { flex: 0 0 auto; white-space: nowrap; }
.pos-action-bar-inner .btn-main { flex: 1; }

/* Footer */
.pos-footer {
  background: #1e4d35;
}
