/* Shared ordering geometry. Themes continue to own colors, fonts and decoration. */
html body.m-body #tableOrders [data-menu-services]:not([hidden]) {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

html body.m-body #tableOrders [data-menu-services] > button[data-menu-service]:not([hidden]) {
  display: block !important;
  /* A narrow panel gets full-width controls instead of tall, squeezed labels. */
  flex: 1 1 8rem !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 46px !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  text-overflow: clip !important;
  overflow: visible !important;
  padding: 12px !important;
  line-height: 1.4 !important;
  text-align: center !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

html body.m-body [data-menu-cartbar]:not([hidden]) {
  display: flex !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

html body.m-body [data-menu-cartbar] #cartBtn:not([hidden]) {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  white-space: normal !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

html body.m-body #cartBtn [data-menu-cart-summary]:not([hidden]) {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  min-width: 0 !important;
}

html body.m-body #cartBtn [data-menu-cart-label] {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  text-align: start !important;
}

html body.m-body #cartBtn [data-menu-cart-summary] > svg,
html body.m-body #cartBtn #cartCount,
html body.m-body #cartBtn #cartTotalBar {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* The runtime measures the real sticky navigation and fixed cart, including wraps. */
html body.m-body #tableOrders,
html body.m-body .m-section[id] {
  scroll-margin-top: var(--tm-menu-scroll-offset, 128px) !important;
}

html body.m-body[data-menu-has-cart] {
  padding-bottom: var(--tm-menu-cart-clearance) !important;
}

/* Only layout is protected here; JavaScript owns the bar's live bottom/animation. */
html body.m-body #tmUndoBar:not([hidden]) {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  box-sizing: border-box !important;
  width: calc(100% - 28px) !important;
  min-width: 0 !important;
  max-width: 420px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

html body.m-body #tmUndoBar > span:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

html body.m-body #tmUndoBar > button:not([hidden]) {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 44px !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
