:root{
  --bg:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#eef2f7;
  --shadow:0 10px 22px rgba(15, 23, 42, .08);
  --shadow-soft:0 6px 18px rgba(15, 23, 42, .06);
  --radius:18px;
  --radius-sm:14px;
  --accent:#ff3b7c;
  --accent-weak:#ffe5ef;
  --accent-text:#ff2f76;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}

/* Ensure the HTML `hidden` attribute always wins (prevents `.cartbar{display:flex}` overrides). */
[hidden]{display:none !important}

body{
  margin:0;
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:linear-gradient(#fff, #fff) fixed;
  color:var(--text);
}

/* Prevent background scroll when any modal is open. */
html.is-modal-open,
body.is-modal-open{
  overflow:hidden;
}

.page{
  min-height:100dvh;
  min-height:100vh;
  display:flex;
  justify-content:center;
  padding:0 14px 90px;
  background:#fff;
}

.app{
  width:100%;
  max-width:420px;
}

.layout{
  width:100%;
}

.menu-col{
  width:100%;
}

.side-col{
  /* On mobile, running order stays as a modal (fixed), so this column doesn't affect layout */
  height:0;
}

/* Footer is desktop/tablet-only (enabled inside breakpoints). */
.footer{
  display:none;
}

.header{
  background:#fff;
}

.hero{
  height:150px;
  border-bottom-left-radius:26px;
  border-bottom-right-radius:26px;
  overflow:hidden;
  position:relative;
  background:#fff;
}

.hero__img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.header-row{
  padding:14px 10px 8px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.header__content{
  min-width:0;
  text-align:left;
}

.title{
  margin:0;
  font-size:20px;
  letter-spacing:-.02em;
  font-weight:700;
}

.subtitle{
  margin:6px 0 0;
  font-size:11px;
  letter-spacing:.22em;
  color:#94a3b8;
  font-weight:600;
}

.running-order-btn{
  flex:0 0 auto;
  height:40px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid #ffd0e0;
  background:#fff;
  box-shadow:0 8px 18px rgba(15, 23, 42, .06);
  color:var(--accent-text);
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  font-size:12px;
  cursor:pointer;
  position:relative;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space:nowrap;
}
.running-order-btn:hover{
  box-shadow:0 12px 24px rgba(15, 23, 42, .10);
  background:rgba(255, 59, 124, .04);
}
.running-order-btn:active{transform:scale(.99)}

.running-order-btn__icon{
  display:grid;
  place-items:center;
  color:var(--accent-text);
}

.badge{
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:linear-gradient(135deg, #ff2f76 0%, #ff5b8e 80%);
  color:#fff;
  font-weight:950;
  font-size:11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 16px rgba(255, 59, 124, .28);
}

.controls{
  padding:10px 8px 0;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:10px;
}

.label{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
}

.select{
  width:100%;
  height:42px;
  border-radius:999px;
  border:1px solid var(--line);
  padding:0 14px;
  background:#fff;
  box-shadow:0 1px 0 rgba(15, 23, 42, .02);
  outline:none;
  font-weight:600;
  color:var(--text);
}
.select--hidden{
  position:absolute;
  opacity:0;
  pointer-events:none;
  height:1px;
  width:1px;
  padding:0;
  border:0;
  margin:0;
}

.select:focus{
  border-color:#ffd0e0;
  box-shadow:0 0 0 4px rgba(255, 59, 124, .10);
}

.dropdown{
  position:relative;
}

.dropdown__btn{
  width:100%;
  height:42px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:0 2px 10px rgba(15, 23, 42, .03);
  padding:0 12px 0 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
  font-weight:800;
  color:var(--text);
  transition:border-color .12s ease, box-shadow .12s ease, transform .12s ease, background .12s ease;
}
.dropdown__btn:hover{
  border-color:#ffe0ea;
  background:rgba(255, 59, 124, .03);
}
.dropdown__btn:active{transform:scale(.99)}
.dropdown__btn:focus{
  outline:none;
  border-color:#ffd0e0;
  box-shadow:0 0 0 4px rgba(255, 59, 124, .10);
}
.dropdown__btn[disabled]{
  opacity:.65;
  cursor:not-allowed;
}

.dropdown__value{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}

.dropdown__chev{
  display:grid;
  place-items:center;
  color:#94a3b8;
}

.dropdown__panel{
  position:absolute;
  z-index:20;
  top:calc(100% + 8px);
  left:0;
  right:0;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 20px 44px rgba(15, 23, 42, .12);
  overflow:auto;
  max-height:280px;
  padding:8px;
  -webkit-overflow-scrolling:touch;
}

.dropdown__opt{
  width:100%;
  border:none;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:14px;
  cursor:pointer;
  font-weight:900;
  color:var(--text);
  transition:background .12s ease, transform .12s ease;
}
.dropdown__opt:hover{
  background:rgba(255, 59, 124, .06);
}
.dropdown__opt:active{transform:scale(.99)}
.dropdown__opt[aria-selected="true"]{
  background:var(--accent-weak);
  color:var(--accent-text);
}
.dropdown__opt:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(255, 59, 124, .14);
}

.dropdown__pill{display:none}

.search{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  border-radius:999px;
  height:46px;
  padding:0 14px;
  box-shadow:0 2px 10px rgba(15, 23, 42, .03);
}

.search__icon{
  color:#94a3b8;
  display:flex;
}

.search__input{
  border:none;
  outline:none;
  width:100%;
  font-size:14px;
  font-weight:500;
}
.search__input:disabled{
  background:transparent;
  cursor:not-allowed;
}

.tabs{
  margin-top:12px;
}

.tabs__list{
  display:flex;
  gap:10px;
  overflow:auto;
  padding:4px 2px 10px;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.tabs__list::-webkit-scrollbar{display:none}

.tab{
  border:none;
  background:transparent;
  color:#0f172a;
  font-weight:700;
  font-size:13px;
  padding:8px 14px;
  border-radius:999px;
  white-space:nowrap;
  box-shadow:0 0 0 rgba(0,0,0,0);
  transition:background .15s ease, color .15s ease, transform .12s ease;
}
.tab:disabled{
  opacity:.55;
  cursor:not-allowed;
}
.tab:active{transform:scale(.98)}
.tab--active{
  background:var(--accent-weak);
  color:var(--accent-text);
}

.menu{
  padding:6px 8px 0;
}

.menu__list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-bottom:calc(14px + var(--cartbar-space, 0px));
}

.card{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  border-radius:22px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:12px;
  box-shadow:var(--shadow-soft);
  cursor:pointer;
  user-select:none;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover{
  border-color:#ffe0ea;
  box-shadow:0 10px 28px rgba(15, 23, 42, .08);
}
.card:active{transform:scale(.99)}

.thumb{
  width:58px;
  height:58px;
  border-radius:18px;
  flex:0 0 auto;
  overflow:hidden;
  border:1px solid rgba(15, 23, 42, .06);
  background:#f8fafc;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.item-image-fallback{
  width:58px;
  height:58px;
  border-radius:18px;
  background:#fff1f5;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
}

.card--skeleton{
  cursor:default;
}
.card--skeleton:active{transform:none}
.card--skeleton:hover{
  border-color:var(--line);
  box-shadow:var(--shadow-soft);
}
.skeleton-line{
  height:10px;
  border-radius:999px;
  background:linear-gradient(90deg, #edf2f7 0%, #f6f7fb 50%, #edf2f7 100%);
  background-size:200% 100%;
  animation:skeleton 1.2s ease-in-out infinite;
}
.skeleton-box{
  width:58px;
  height:58px;
  border-radius:18px;
  background:linear-gradient(90deg, #edf2f7 0%, #f6f7fb 50%, #edf2f7 100%);
  background-size:200% 100%;
  animation:skeleton 1.2s ease-in-out infinite;
}
.skeleton-pill{
  width:64px;
  height:28px;
  border-radius:999px;
  background:linear-gradient(90deg, #edf2f7 0%, #f6f7fb 50%, #edf2f7 100%);
  background-size:200% 100%;
  animation:skeleton 1.2s ease-in-out infinite;
}
.w40{width:40px}
.w60{width:90px}
.w90{width:140px}

@keyframes skeleton{
  0%{background-position:0% 0%}
  100%{background-position:200% 0%}
}

.card__mid{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.name{
  font-size:14px;
  font-weight:750;
  letter-spacing:-.01em;
  line-height:1.2;
  white-space:normal;
  overflow:hidden;
  text-overflow:clip;
  word-break:break-word;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  /* Reserve space for two lines so right-side controls stay aligned. */
  min-height:2.4em;
}

.desc{
  font-size:11px;
  color:#6b7280;
  line-height:1.25;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

.card__right{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}

.price{
  font-weight:900;
  color:var(--accent-text);
  font-size:13px;
}

.qty{
  display:flex;
  align-items:center;
  gap:10px;
}

.qty__btn{
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid #ffd0e0;
  background:#fff;
  color:var(--accent-text);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.qty__btn:active{transform:scale(.98)}
.qty__value{
  min-width:18px;
  text-align:center;
  font-weight:800;
  font-size:13px;
}

.addbtn{
  height:30px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid #ffd0e0;
  background:rgba(255, 59, 124, .08);
  color:var(--accent-text);
  font-weight:900;
  font-size:12px;
  cursor:pointer;
}
.addbtn:active{transform:scale(.99)}

.cartbar{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:10px;
  width:calc(100% - 28px);
  max-width:420px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow);
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  z-index:999;
}

/* Strong hide state used when the order sheet is open (prevents overlap/duplicate actions). */
.cartbar--suppressed{
  display:none !important;
  pointer-events:none !important;
}

.cartbar__meta{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.cartbar__count{
  font-weight:800;
  font-size:13px;
}
.cartbar__total{
  font-weight:900;
  font-size:14px;
  color:var(--accent-text);
}

.btn{
  border:none;
  border-radius:14px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
}
.btn--primary{
  background:linear-gradient(135deg, #ff2f76 0%, #ff5b8e 60%, #ff3b7c 100%);
  color:#fff;
  box-shadow:0 10px 24px rgba(255, 59, 124, .28);
}
.btn--primary:active{transform:scale(.99)}
.btn--ghost{
  background:#fff;
  color:#0f172a;
  border:1px solid var(--line);
}

.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:92px;
  width:calc(100% - 28px);
  max-width:420px;
  background:rgba(15, 23, 42, .92);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  font-weight:700;
  font-size:13px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  z-index:40;
}
.toast--show{
  opacity:1;
  transform:translateX(-50%) translateY(-2px);
}

.modal{
  position:fixed;
  inset:0;
  z-index:50;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
}
.modal--open{
  opacity:1;
  pointer-events:auto;
}

.modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(2, 6, 23, .42);
}

.po-modal{
  position:fixed;
  inset:0;
  z-index:60;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
}
.po-modal--open{
  opacity:1;
  pointer-events:auto;
}
.po-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(2, 6, 23, .50);
}

.po-dialog{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  width:calc(100% - 28px);
  max-width:420px;
  background:#fff;
  border-radius:18px;
  box-shadow:0 22px 60px rgba(15, 23, 42, .18);
  max-height:calc(100dvh - 28px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.po-dialog__header{
  padding:14px 14px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(#fff, rgba(255, 255, 255, .96));
}
.po-dialog__title{
  font-weight:950;
  letter-spacing:-.02em;
}
.po-dialog__subtitle{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}
.po-dialog__content{
  padding:14px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.po-dialog__content--center{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  text-align:center;
}
.po-dialog__footer{
  border-top:1px solid var(--line);
  padding:12px 14px 14px;
  background:linear-gradient(#fff, rgba(255, 255, 255, .96));
}

.po-label{
  display:block;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  margin-bottom:6px;
}
.po-input{
  width:100%;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  padding:0 12px;
  outline:none;
  font-weight:800;
  letter-spacing:.04em;
}
.po-input:focus{
  border-color:#ffd0e0;
  box-shadow:0 0 0 4px rgba(255, 59, 124, .10);
}
.po-error{
  margin-top:10px;
  background:rgba(255, 59, 124, .08);
  border:1px solid rgba(255, 59, 124, .16);
  color:#b42318;
  padding:10px 12px;
  border-radius:14px;
  font-weight:800;
  font-size:12px;
}

.po-otp{
  display:flex;
  justify-content:center;
  gap:10px;
  padding:6px 0 2px;
}
.po-otp__box{
  width:44px;
  height:48px;
  border-radius:14px;
  border:1px solid var(--line);
  text-align:center;
  font-weight:950;
  font-size:18px;
  outline:none;
  background:#fff;
  box-shadow:0 1px 0 rgba(15, 23, 42, .02);
}
.po-otp__box:focus{
  border-color:#ffd0e0;
  box-shadow:0 0 0 4px rgba(255, 59, 124, .10);
}

.po-otp-actions{
  margin-top:10px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
}
.po-otp-timer{
  font-size:12px;
  font-weight:850;
  color:var(--muted);
}
.po-otp-resend{
  padding:8px 12px;
}

.po-success{
  width:56px;
  height:56px;
  border-radius:999px;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow:0 16px 30px rgba(22, 163, 74, .22);
}

@media (max-width: 360px){
  .po-otp{gap:8px}
  .po-otp__box{width:40px; height:46px}
}

.sheet{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width:100%;
  max-width:420px;
  background:#fff;
  border-top-left-radius:24px;
  border-top-right-radius:24px;
  box-shadow:0 -18px 40px rgba(15, 23, 42, .14);
  max-height:78dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.sheet__header{
  padding:14px 14px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
}
.sheet__title{
  font-weight:900;
  letter-spacing:-.02em;
}
.sheet__subtitle{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}

.iconbtn{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.iconbtn:active{transform:scale(.99)}

.sheet__content{
  padding:10px 12px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.orderlist{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.orderrow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--line);
  border-radius:18px;
  padding:10px 10px;
  box-shadow:0 6px 16px rgba(15, 23, 42, .05);
}
.orderrow__left{
  min-width:0;
  flex:1 1 auto;
}
.orderrow__name{
  font-weight:900;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.orderrow__meta{
  margin-top:4px;
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.orderrow__right{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.orderrow__subtotal{
  font-weight:900;
  color:var(--accent-text);
  font-size:13px;
}

.sheet__footer{
  border-top:1px solid var(--line);
  padding:12px 12px 14px;
  background:linear-gradient(#fff, rgba(255, 255, 255, .96));
}

.totals{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.totals__label{
  color:var(--muted);
  font-weight:800;
  font-size:12px;
}
.totals__value{
  font-weight:950;
  color:var(--accent-text);
}

.actions{
  display:flex;
  gap:10px;
}
.actions .btn{flex:1 1 0}

.empty{
  padding:14px 0;
}
.empty__card{
  border:1px dashed #e2e8f0;
  border-radius:18px;
  padding:16px;
  text-align:center;
  color:#334155;
  background:#fafbff;
}
.empty__title{
  font-weight:900;
  margin-bottom:4px;
}
.empty__sub{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
}
.empty--sheet{padding:6px 0 10px}

@media (min-width: 768px){
  /* Tablet layout (do not affect mobile) */
  .page{
    padding:12px 18px 122px;
  }
  .app{
    max-width:1120px;
  }
  .layout{
    display:grid;
    grid-template-columns: minmax(0, 1fr);
    gap:16px;
    align-items:start;
    height:auto;
  }
  .menu-col{
    min-width:0;
    overflow:visible;
    padding-right:12px;
    -webkit-overflow-scrolling:touch;
  }
  /* Keep the running-order modal in the DOM (it's nested under `.side-col` in HTML),
     but remove its sidebar footprint on tablet. */
  .side-col{
    display:block;
    height:0;
    overflow:visible;
  }
  .side-col__inner{
    height:0;
  }
  .hero{height:160px}

  /* Tablet uses modal/drawer order flow (like mobile). */
  .running-order-btn{display:inline-flex}

  /* Two-column item grid on tablet */
  .menu__list{
    display:grid;
    grid-template-columns: repeat(2, 1fr);
    gap:16px;
    padding-bottom:calc(26px + var(--cartbar-space, 0px));
  }
  .card{
    padding:12px 14px;
    min-height:126px;
  }
  .desc{
    font-size:12px;
    color:#55657a;
  }

  /* Hide horizontal scrollbar for category tabs on tablet/desktop */
  .tabs__list{
    scrollbar-width:none; /* Firefox */
    -ms-overflow-style:none; /* IE/Edge Legacy */
  }
  .tabs__list{
    gap:12px;
    padding:6px 14px 14px;
    scroll-padding-left:14px;
    scroll-padding-right:14px;
  }
  .tab{padding:9px 16px}

  /* Running Order behaves as modal on tablet (not a permanent sidebar). */
  #runningModal{
    position:fixed;
    inset:0;
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
  }
  #runningModal.modal--open{
    opacity:1;
    pointer-events:auto;
  }
  #runningModal .modal__backdrop{
    display:block;
  }
  #runningModal .sheet{
    position:absolute;
    left:50%;
    top:50%;
    bottom:auto;
    transform:translate(-50%, -50%);
    width:calc(100% - 36px);
    max-width:740px;
    border-radius:22px;
    max-height:84vh;
    box-shadow:var(--shadow);
    border:1px solid var(--line);
    min-width:0;
  }
  #runningModal .sheet__content{
    max-height:calc(84vh - 170px);
  }
  #runningModal #closeRunningBtn{display:grid}
  /* Keep header button visible on tablet for Running Order */
  .running-order-btn{
    height:44px;
    padding:0 14px;
    font-size:13px;
  }
  .header-row{
    padding-top:12px;
    padding-bottom:10px;
    align-items:center;
  }

  /* Footer visible tablet/desktop only */
  .footer{
    margin-top:14px;
    color:var(--muted);
    font-weight:700;
    font-size:12px;
    display:flex;
    justify-content:space-between;
    gap:10px;
  }
  .cartbar{
    max-width:1120px;
    width:calc(100% - 36px);
    bottom:14px;
    padding:7px 12px;
  }
  .cartbar .btn--primary{
    min-height:44px;
    padding:11px 14px;
    border-radius:16px;
  }
  .cartbar__count{font-size:13px}
  .cartbar__total{font-size:15px}
  .footer{
    max-width:1120px;
    margin-left:auto;
    margin-right:auto;
  }

  /* Tablet "Your Order" modal: wider + lighter overlay + centered */
  #modal .modal__backdrop{
    background:rgba(2, 6, 23, .30);
  }
  #modal .sheet{
    top:50%;
    bottom:auto;
    transform:translate(-50%, -50%);
    width:calc(100% - 36px);
    max-width:740px;
    max-height:84vh;
    border-radius:22px;
  }
  #modal .qty__btn{
    width:36px;
    height:36px;
  }

  /* Tablet banner crop tuning */
  .hero__img{
    object-position:36% 32%;
  }

  /* Cleaner spacing between search and categories on tablet */
  .tabs{margin-top:18px}
}

@media (max-width: 340px){
  .running-order-btn{padding:0 8px; height:38px; gap:6px}
  .running-order-btn__text{display:none}
}

@media (max-width: 767px){
  /* Mobile-only safe-area + cartbar visibility fixes (do not affect tablet/desktop) */
  html, body{
    overflow-x:hidden;
    width:100%;
  }

  .page{
    min-height:100dvh;
    min-height:100vh;
    overflow-y:auto;
    padding-bottom:calc(90px + var(--cartbar-space, 0px));
  }

  .app{
    min-height:100dvh;
    min-height:100vh;
  }

  .menu__list{
    padding-bottom:calc(14px + var(--cartbar-space, 0px));
  }

  .cartbar{
    left:12px;
    right:12px;
    width:auto;
    max-width:none;
    transform:none;
    bottom:calc(12px + env(safe-area-inset-bottom));
    bottom:calc(12px + constant(safe-area-inset-bottom));
    z-index:9999;
  }
}

@media (min-width: 1200px){
  /* Desktop POS layout (match reference; desktop-only overrides). */
  body{
    background:#f8f8fb;
  }
  .page{
    background:#f8f8fb;
    padding:0 28px 26px;
  }
  .app{
    max-width:1440px;
  }

  /* Desktop uses modal/drawer order flow (no permanent sidebar). */
  .layout{
    grid-template-columns:minmax(0, 1fr);
    gap:24px;
    height:auto;
  }
  .menu-col{
    overflow:visible;
    padding-right:0;
  }

  /* Desktop header spans full width (across both columns). */
  .menu-col,
  .header{
    display:contents;
  }
  .header-row{
    grid-column:1 / -1;
    grid-row:1;
    height:72px;
    padding:14px 30px;
    background:#fff;
    border-bottom:1px solid #e5e7eb;
    box-shadow:0 8px 24px rgba(15, 23, 42, .04);
    border-radius:0 0 18px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    position:sticky;
    top:0;
    z-index:30;
  }
  .header__content{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
  }
  .header__content::before{
    content:"";
    width:38px;
    height:38px;
    border-radius:14px;
    background:linear-gradient(135deg, #ffe8ef 0%, #fff 70%);
    border:1px solid #ffd0e0;
    box-shadow:0 10px 18px rgba(255, 59, 124, .14);
    flex:0 0 auto;
  }
  .title{
    font-size:18px;
  }
  .subtitle{
    font-size:11px;
  }

  /* Promo banner (desktop only) */
  .hero{
    grid-column:1 / 2;
    grid-row:2;
    margin-top:14px;
    height:200px;
    border-radius:24px;
    box-shadow:0 16px 34px rgba(15, 23, 42, .08);
    border:1px solid rgba(15, 23, 42, .06);
  }
  .hero::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .64) 42%, rgba(255, 255, 255, 0) 70%);
    pointer-events:none;
  }
  /* Banner image already contains typography; avoid overlay collisions on desktop. */
  .hero::after{
    content:"";
    display:none;
  }
  .hero__img{
    filter:saturate(1.02) contrast(1.02);
    /* Keep embedded promo heading fully visible (image contains text). */
    object-position:28% 40%;
  }
  /* Controls (table + search) in a neat card-like stack. */
  .controls{
    grid-column:1 / 2;
    grid-row:3;
    padding:18px 0 0;
    margin-top:0;
    min-width:0;
  }
  .field{
    margin-bottom:14px;
  }
  .dropdown__btn,
  .search{
    height:54px;
    border-radius:18px;
    border:1px solid #e5e7eb;
    box-shadow:0 10px 20px rgba(15, 23, 42, .05);
    background:#fff;
  }
  .dropdown__btn{
    padding:0 14px 0 16px;
  }
  .search{
    padding:0 16px;
  }
  .tabs{
    margin-top:18px;
  }
  .tabs__list{
    gap:12px;
    padding:6px 14px 14px;
    overflow-x:auto;
    overflow-y:hidden;
    max-width:100%;
    overscroll-behavior-x:contain;
    cursor:grab;
    scroll-padding-left:14px;
    scroll-padding-right:14px;
  }
  .tabs__list:active{cursor:grabbing}
  .tab{
    background:#fff;
    border:1px solid #eef2f7;
    box-shadow:0 10px 18px rgba(15, 23, 42, .04);
    padding:10px 16px;
  }
  .tab--active{
    background:linear-gradient(135deg, rgba(255, 59, 124, .14) 0%, rgba(255, 59, 124, .08) 80%);
    border-color:#ffd0e0;
    color:var(--accent-text);
  }

  /* Menu area as a clean 4-col grid of cards. */
  .menu{
    grid-column:1 / 2;
    grid-row:4;
    padding:10px 0 0;
  }
  .menu__list{
    /* Laptop/Laptop-L: keep cards spacious */
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px;
    padding-bottom:calc(18px + var(--cartbar-space, 0px));
  }
  .card{
    border-radius:20px;
    padding:18px 16px;
    gap:16px;
    align-items:flex-start;
    box-shadow:0 14px 26px rgba(15, 23, 42, .06);
    min-height:144px;
  }
  .card__right{
    min-width:96px;
    align-items:flex-end;
  }
  .addbtn{
    align-self:flex-end;
  }
  .card:hover{
    transform:translateY(-2px);
  }
  .thumb,
  .item-image-fallback{
    width:72px;
    height:72px;
    border-radius:20px;
    background:linear-gradient(135deg, #ffe8ef 0%, #fff 70%);
    border:1px solid rgba(255, 59, 124, .14);
  }
  .name{
    font-size:14px;
    line-height:1.25;
  }
  .desc{
    font-size:12px;
    color:#64748b;
  }
  .price{
    font-size:14px;
  }
  .addbtn{
    height:36px;
    padding:0 16px;
    border-radius:999px;
    background:var(--accent-weak);
    border-color:#ffd0e0;
  }

  /* Keep the running-order modal in the DOM (it's nested under `.side-col` in HTML),
     but remove sidebar footprint on desktop. */
  .side-col{
    display:block;
    height:0;
    overflow:visible;
  }
  .side-col__inner{
    height:0;
  }

  /* Running Order behaves as modal on desktop. */
  #runningModal{
    position:fixed;
    inset:0;
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
  }
  #runningModal.modal--open{
    opacity:1;
    pointer-events:auto;
  }
  #runningModal .modal__backdrop{
    display:block;
    background:rgba(2, 6, 23, .22);
  }
  #runningModal .sheet{
    top:50%;
    bottom:auto;
    transform:translate(-50%, -50%);
    width:calc(100% - 56px);
    max-width:860px;
    max-height:84vh;
    border-radius:24px;
    box-shadow:0 22px 60px rgba(15, 23, 42, .18);
    border:1px solid #e5e7eb;
  }
  #runningModal .sheet__header{padding:18px 20px 12px}
  #runningModal .sheet__content{padding:14px 18px}
  #runningModal .sheet__footer{padding:16px 18px 18px}

  /* Desktop cart bar: keep functionality, but size it for desktop (still respects `[hidden]`). */
  #cartBar.cartbar{
    max-width:1440px;
    width:calc(100% - 56px);
    bottom:18px;
    padding:10px 14px;
    border-radius:22px;
    z-index:45;
  }
  #cartBar.cartbar[aria-hidden="true"]{
    display:none !important;
  }

  /* Desktop "Your Order" modal (wider + more breathable). */
  #modal .modal__backdrop{
    background:rgba(2, 6, 23, .24);
  }
  #modal .sheet{
    top:50%;
    bottom:auto;
    transform:translate(-50%, -50%);
    width:calc(100% - 56px);
    max-width:860px;
    max-height:84vh;
    border-radius:24px;
    box-shadow:0 22px 60px rgba(15, 23, 42, .18);
  }
  #modal .sheet__header{
    padding:18px 20px 12px;
  }
  #modal .sheet__content{
    padding:14px 18px;
  }
  #modal .orderlist{
    gap:12px;
  }
  #modal .orderrow{
    padding:14px 14px;
    border-radius:18px;
  }
  #modal .qty{
    gap:12px;
  }
  #modal .qty__btn{
    width:38px;
    height:38px;
  }
  #modal .qty__value{
    font-size:14px;
    min-width:22px;
  }
  #modal .sheet__footer{
    padding:16px 18px 18px;
  }
  #modal .actions{
    gap:12px;
  }
  #modal .btn{
    padding:12px 16px;
    border-radius:16px;
    min-height:48px;
    font-size:14px;
  }

  /* Footer like reference */
  .footer{
    max-width:1440px;
    margin:10px auto 0;
  }
}

@media (min-width: 1441px) and (max-width: 1699px){
  /* Laptop-L range: keep 3 columns for readability (match 1024px feel). */
  .menu__list{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:16px;
  }
}

@media (min-width: 1700px) and (max-width: 1919px){
  /* Very wide desktop: allow 4 columns when there's enough space. */
  .menu__list{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1920px){
  /* Very large desktop (2K+): allow 3 columns without compressing cards. */
  .menu__list{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) and (max-width: 2000px){
  /* Laptop + Laptop-L: keep hero + spacing consistent and use 4 columns if readable. */
  .hero{
    width:100%;
    height:200px;
    min-height:240px;
    max-height:250px;
    border-radius:24px;
    overflow:hidden;
    margin-top:14px;
    background:#fff;
  }
  /* Reduce "washed out" look from the desktop overlay gradient on laptop. */
  .hero::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.22) 42%, rgba(255,255,255,0) 72%);
    pointer-events:none;
    z-index:1;
  }
  .hero__img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:25% 30%;
    display:block;
    filter:saturate(1.06) contrast(1.03) brightness(.99);
    transform:none;
  }

  .menu__list{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:16px;
  }
  .card{
    padding:16px 14px;
    min-height:136px;
  }
  .thumb,
  .item-image-fallback{
    width:68px;
    height:68px;
  }
}
