/* RusaPOS Customer — persistent dine-in workspace.
   Mobile: fixed thumb dock + contextual bottom sheet.
   Desktop: anchored contextual inspector; menu stays visible.
   No client-side payment authority or duplicated menu data. */
.app-shell {
  max-width: 1040px;
  background: #fff;
}
.app-shell .masthead {
  position: sticky;
  top: 0;
  z-index: 51;
  min-height: 64px;
  padding: 9px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid #e0e8f2;
  box-shadow: 0 3px 14px rgba(17,27,43,.035);
}
.app-shell .masthead .brand-logo {
  width: 38px;
  height: 38px;
}
.app-shell .welcome { display: none; }
.app-shell .tabs { top: 64px; z-index: 45; }
.app-shell .body { padding-top: 16px; }
.app-shell .table-hub-hero { min-height: 168px !important; }
.app-shell .table-hub-art { max-height: 168px; }
.app-shell .table-hub { margin-bottom: 20px; }
.app-shell #menu-catalog { scroll-margin-top: 172px; }
.app-shell .category-dock {
  position: sticky;
  top: 139px;
  z-index: 39;
  margin: 8px -4px 16px;
  padding: 8px 4px 5px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #e7edf5;
  box-shadow: 0 6px 12px -14px rgba(17,27,43,.5);
}
.app-shell .category-dock .categories {
  margin: 0;
  padding: 3px 2px 5px;
  scroll-padding-inline: 12px;
}
.app-shell .category-dock .chip { min-height: 39px; }
.app-shell.has-workspace .floating-cart { display: none; }

.customer-workspace {
  position: fixed;
  inset: 0;
  z-index: 58;
  pointer-events: none;
}
.customer-workspace .workspace-scrim {
  position: absolute;
  inset: 0;
  top: 145px; /* Keep the desktop tab rail visible and clickable. */
  width: 100%;
  border: 0;
  padding: 0;
  background: rgba(9,25,43,.33);
  cursor: default;
  pointer-events: auto;
}
.customer-workspace .workspace-panel {
  position: absolute;
  top: 148px;
  bottom: 18px;
  right: max(18px, calc((100vw - 1040px) / 2 + 18px));
  width: min(480px, calc(100vw - 28px));
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2eaf3;
  border-radius: 22px;
  box-shadow: 0 26px 72px rgba(10,28,46,.24);
  overflow: hidden;
  pointer-events: auto;
}
.customer-workspace .workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex: none;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #e6edf5;
}
.customer-workspace .workspace-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .115em;
  color: #667f97;
}
.customer-workspace .workspace-head h2 {
  margin: 4px 0 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.035em;
  font-weight: 850;
  color: #111b2b;
}
.customer-workspace .workspace-close {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid #dbe5ef;
  background: #f4f7fa;
  color: #233e59;
  font-size: 26px;
  cursor: pointer;
}
.customer-workspace .workspace-close:hover {
  background: #e9f2fb;
  border-color: #b6d2ef;
}
.customer-workspace .workspace-close:focus-visible {
  outline: 3px solid #0066cd;
  outline-offset: 2px;
}
.customer-workspace .workspace-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px calc(26px + env(safe-area-inset-bottom,0px));
  scrollbar-gutter: stable;
}
.customer-workspace .workspace-content > .page-title:first-child { display: none; }
.customer-workspace .workspace-content > .page-title.orders-heading:first-child {
  display: flex;
  margin: 0 0 16px;
}
.customer-workspace .workspace-content .checkout-ui {
  max-width: 100%;
  padding: 0 0 24px;
}
.customer-workspace .workspace-content .checkout {
  margin-bottom: 18px;
}
/* Checkout lives in a 480px inspector even on a 1440px desktop.
   Scope these rules to the workspace instead of viewport media queries:
   the full-page receipt layout must never squeeze payment choices to 80px. */
.customer-workspace .workspace-content .checkout-content-grid,
.customer-workspace .workspace-content .checkout-content-with-receipt {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.customer-workspace .workspace-content .checkout-payment-column,
.customer-workspace .workspace-content .checkout-methods,
.customer-workspace .workspace-content .checkout-method-copy,
.customer-workspace .workspace-content .checkout-receipt {
  min-width: 0;
}
.customer-workspace .workspace-content .checkout-method {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas: "icon copy" ". state";
  align-items: center;
  gap: 5px 12px;
  padding: 13px 15px;
}
.customer-workspace .workspace-content .checkout-method-icon {
  grid-area: icon;
  width: 42px;
  height: 42px;
}
.customer-workspace .workspace-content .checkout-method-copy {
  grid-area: copy;
  overflow-wrap: break-word;
}
.customer-workspace .workspace-content .checkout-method-state {
  grid-area: state;
  justify-self: start;
  max-width: 100%;
  white-space: normal;
}
.customer-workspace .workspace-content .checkout-balance-top,
.customer-workspace .workspace-content .checkout-receipt-header,
.customer-workspace .workspace-content .checkout-receipt-total,
.customer-workspace .workspace-content .checkout-receipt-row {
  flex-wrap: wrap;
}
.customer-workspace .workspace-content .checkout-receipt-price {
  min-width: 0;
  margin-left: auto;
}
.customer-workspace .workspace-content .checkout-receipt-total strong {
  font-size: clamp(18px, 4vw, 22px);
}
.customer-workspace .workspace-content .checkout-method-preview > div {
  min-width: 0;
  overflow-wrap: break-word;
}
.customer-workspace .workspace-content .checkout-actions,
.customer-workspace .workspace-content .checkout-cashier-options {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell .modal-backdrop { z-index: 95; }
@media (min-width: 1000px) {
  .app-shell.has-workspace .body { padding-right: 515px; }
  .app-shell.has-workspace .category-dock { z-index: 39; }
}
@media (max-width: 719px) {
  .app-shell .masthead {
    min-height: 59px;
    padding: 8px 12px;
    gap: 8px;
  }
  .app-shell .masthead .brand-logo { width: 33px; height: 33px; }
  .app-shell .tabs {
    top: auto;
    z-index: 76;
    border-radius: 19px 19px 0 0;
  }
  .app-shell .body { padding: 10px 14px calc(145px + env(safe-area-inset-bottom,0px)); }
  .app-shell .table-hub { margin-bottom: 14px; }
  .app-shell .table-hub-hero { min-height: 146px !important; }
  .app-shell .table-hub-art { max-height: 146px; }
  .app-shell #menu-catalog { scroll-margin-top: 74px; }
  .app-shell .category-dock {
    top: 59px;
    margin: 8px -14px 14px;
    padding: 7px 14px 4px;
    border-bottom-color: #e0e8f3;
  }
  .app-shell .category-dock .chip {
    min-height: 41px;
    padding: 8px 15px;
    font-size: 12px;
  }
  .customer-workspace {
    bottom: calc(72px + env(safe-area-inset-bottom,0px));
    z-index: 58;
  }
  .customer-workspace .workspace-scrim { top: 0; }
  .customer-workspace .workspace-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(77dvh, 780px);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    box-shadow: 0 -16px 42px rgba(10,28,46,.2);
  }
  .customer-workspace .workspace-panel::before {
    content: '';
    align-self: center;
    width: 38px;
    height: 4px;
    border-radius: 6px;
    background: #d9e4ef;
    margin-top: 9px;
  }
  .customer-workspace .workspace-head { padding: 12px 16px; }
  .customer-workspace .workspace-content {
    padding: 12px 16px 28px;
    scrollbar-gutter: auto;
  }
  .customer-workspace .workspace-content .checkout-ui { padding: 0 0 30px; }
  .app-shell .modal-backdrop { z-index: 110; }
}
@media (max-width: 360px) {
  .customer-workspace .workspace-head h2 { font-size: 19px; }
  .customer-workspace .workspace-content { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .customer-workspace * { scroll-behavior: auto !important; }
}
