/* My Little Cashier | Swipeable one-row product shelf above the packing box.
   Product/cart ids and gameplay behaviour intentionally unchanged. */
html body #page-pos .pos-grid.mlc-responsive-pos-grid {
  display: grid !important;
  grid-auto-flow: row !important;
  grid-template-rows: auto !important;
  gap: 12px !important;
  align-items: start !important;
  min-width: 0;
}
/* display:contents makes the two unchanged panels independently placeable. */
html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack {
  display: contents !important;
}
html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack > #mlcProductShelf {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: clamp(12px, 1.2vw, 17px) !important;
  background: linear-gradient(145deg, #fffdfd, #fff1f8) !important;
  border: 1.5px solid #f2c7dc !important;
}
html body #page-pos #mlcProductShelf > .panel-head {
  margin-bottom: 10px;
  flex-wrap: wrap;
}
html body #page-pos #mlcProductShelf .mlc-shelf-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
html body #page-pos #mlcProductShelf .mlc-shelf-swipe-hint {
  color: #b05483;
  font-size: 17px;
  white-space: nowrap;
}
html body #page-pos #mlcProductShelf .mlc-shelf-navigation {
  display: flex;
  gap: 5px;
}
html body #page-pos #mlcProductShelf .mlc-shelf-navigation button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  border: 1px solid #ecc2d8;
  color: #a44979;
  background: #ffedf6;
  font-size: 27px;
  line-height: 20px;
  padding: 0;
  cursor: pointer;
}
html body #page-pos #mlcProductShelf .searchrow {
  display: flex;
  max-width: 510px;
  margin-bottom: 9px;
}
html body #page-pos #mlcProductShelf .category-row {
  margin-bottom: 10px;
  padding-bottom: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap !important;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
/* A true one-row native scroll rail: no paginated or stacked cards on mobile. */
html body #page-pos #mlcProductShelf #foodGrid.food-grid {
  display: flex !important;
  grid-template-columns: none !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 10px !important;
  padding: 2px 2px 12px !important;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #e7a4c7 #fff4f9;
}
html body #page-pos #mlcProductShelf #foodGrid.food-grid:focus-visible {
  outline: 2px solid #e98ab6;
  outline-offset: 2px;
  border-radius: 12px;
}
html body #page-pos #mlcProductShelf #foodGrid > .food-card {
  box-sizing: border-box;
  display: flex !important;
  flex: 0 0 clamp(143px, 12vw, 172px) !important;
  width: clamp(143px, 12vw, 172px) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto;
  align-self: stretch;
  scroll-snap-align: start;
  padding: 9px 8px !important;
}
html body #page-pos #mlcProductShelf #foodGrid > .food-card .food-art {
  box-sizing: border-box;
  height: 95px !important;
  flex-basis: 95px !important;
  max-height: 95px !important;
}
html body #page-pos #mlcProductShelf #foodGrid > .food-card .food-name {
  min-height: 48px !important;
  align-items: center;
}
html body #page-pos #mlcProductShelf #foodGrid > .food-card .food-price {
  margin-top: auto !important;
  margin-bottom: 7px !important;
}
html body #page-pos #mlcProductShelf #foodGrid > .food-card .add-btn {
  min-height: 32px;
  display: grid;
  place-items: center;
}
html body #page-pos #mlcProductShelf #foodGrid > .empty {
  flex: 1;
  min-width: 0;
}
/* All old packing controls remain in the same #packingStation. */
html body #page-pos .pos-grid.mlc-responsive-pos-grid > #packingStation {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  min-width: 0;
  width: 100% !important;
}
html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack > .cart-panel {
  grid-column: 1 / -1 !important;
  grid-row: 4 !important;
  width: 100% !important;
  min-width: 0 !important;
  position: static !important;
  align-self: start !important;
  height: auto !important;
}
html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcFakeOrders,
html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcDay6Online {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
}
html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcFakeOrders[hidden],
html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcDay6Online[hidden] {
  display: none !important;
}
/* Desktop: orders left; shelf spans over box and cart; box and cart below. */
@media (min-width: 1180px) {
  html body #page-pos .pos-grid.mlc-responsive-pos-grid {
    grid-template-columns: minmax(245px, .8fr) minmax(375px, 1.25fr) minmax(290px, .83fr) !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcFakeOrders,
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcDay6Online {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack > #mlcProductShelf {
    grid-column: 2 / 4 !important;
    grid-row: 1 !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > #packingStation {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack > .cart-panel {
    grid-column: 3 !important;
    grid-row: 2 !important;
  }
}
/* Tablet: orders to the left; swipe shelf above box on the right. */
@media (min-width: 800px) and (max-width: 1179px) {
  html body #page-pos .pos-grid.mlc-responsive-pos-grid {
    grid-template-columns: minmax(230px, .8fr) minmax(0, 1.35fr) !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcFakeOrders,
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > #mlcDay6Online {
    grid-column: 1 !important;
    grid-row: 1 / span 3 !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack > #mlcProductShelf {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > #packingStation {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
  html body #page-pos .pos-grid.mlc-responsive-pos-grid > .mlc-products-cart-stack > .cart-panel {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }
}
/* Mobile: order -> horizontal products -> packing box -> cart. */
@media (max-width: 799px) {
  html body #page-pos .pos-grid.mlc-responsive-pos-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body #page-pos #mlcProductShelf .mlc-shelf-swipe-hint {
    font-size: 16px;
  }
  html body #page-pos #mlcProductShelf #foodGrid > .food-card {
    flex-basis: 146px !important;
    width: 146px !important;
  }
  html body #page-pos #mlcProductShelf #foodGrid > .food-card .food-art {
    height: 88px !important;
    flex-basis: 88px !important;
  }
  html body #page-pos #mlcProductShelf .searchrow {
    max-width: none;
  }
  html body #page-pos #mlcProductShelf .mlc-shelf-header-meta {
    gap: 6px;
  }
}
@media (max-width: 420px) {
  html body #page-pos #mlcProductShelf #foodGrid > .food-card {
    flex-basis: 132px !important;
    width: 132px !important;
  }
  html body #page-pos #mlcProductShelf .mlc-shelf-navigation button {
    width: 32px;
    min-width: 32px;
  }
}
