/* Online Order UI (Customer) - New Panel style */

/* Base */
* { box-sizing: border-box; }
body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: #ffffff;
}

/* Fill window (stretch with viewport) */
#onlineOrderRoot {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #e0e0e0;
}

/* ===================== DESKTOP layout ===================== */
.menu-container {
  position: absolute;
  left: 1%;
  right: 28%;
  top: 1%;
  bottom: 1%;
  background-color: #ffffff;
  border: none;
  overflow: hidden;
}

/* Desktop Back button in cart actions (next to Next) */
#onlineBackBtn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: #ef4444;
  color: #ffffff;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#onlineBackBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Back is rendered near NEXT card (submenu), not in cart actions */
#cartBox .cart-box-actions #onlineBackBtn {
  display: none !important;
}

.menu-nav-bar {
  position: absolute;
  right: 2%;
  bottom: 2%;
  z-index: 45;
  display: flex;
  gap: 10px;
  align-items: stretch;
  pointer-events: none;
}
.menu-nav-bar > button {
  pointer-events: auto;
  width: clamp(100px, 14vw, 220px);
  height: clamp(44px, 8%, 72px);
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-weight: 900;
  font-size: clamp(18px, 2.4vh, 28px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
#menuNavBackBtn {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.22);
  visibility: hidden;
}
#menuNavBackBtn.show { visibility: visible; }
#menuNavBackBtn:disabled { opacity: 0.55; cursor: not-allowed; }
#menuNavNextBtn {
  display: none !important;
}

.menu-submenu-back-btn {
  display: none !important;
}

/* Menu Card (from new-panel) */
.menu-card {
  position: absolute;
  background-color: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 0.4em;
  cursor: pointer;
  transition: none;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.menu-card:active {
  opacity: 1 !important;
  filter: none !important;
}

.menu-card > * { min-height: 0; }

.menu-card:hover {
  transform: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.menu-card.optional-selected {
  border: 4px solid #16a34a;
  box-shadow: inset 0 0 0 4px rgba(22, 163, 74, 0.18), 0 0 0 2px rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.08);
}
.menu-card.optional-selected::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(22, 163, 74, 0.12);
  z-index: 1;
  pointer-events: none;
}
.menu-card.optional-selected > * {
  position: relative;
  z-index: 2;
}
.menu-card.optional-selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #16a34a;
  background: rgba(255, 255, 255, 0.92);
  color: #16a34a;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

/* OPTIONAL_WITH_LEVEL: level overlay handles visual feedback, suppress green box + checkmark */
.menu-card.optional-with-level-card.optional-selected {
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  background-color: #ffffff;
}
.menu-card.optional-with-level-card.optional-selected::before {
  display: none;
}
.menu-card.optional-with-level-card.optional-selected::after {
  display: none;
}
.menu-card.optional-selected > .optional-level-image-replacement {
  position: absolute;
  z-index: 10;
}

.menu-card.card-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes next-card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 0 10px rgba(37, 99, 235, 0.1); }
  50%      { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.45), 0 0 22px rgba(37, 99, 235, 0.2); }
}
.menu-card.next-card:not(.card-disabled) {
  animation: next-card-pulse 2s ease-in-out infinite;
  border: 2.5px solid rgba(37, 99, 235, 0.55);
}

.menu-card-image-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.3em;
  background: #f8f8f8;
  min-height: 0;
  flex-shrink: 1;
}

.menu-card-image {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.3em;
  display: block;
}

.menu-card-title {
  font-size: var(--menu-view-font-size, clamp(0.85rem, 1.6vh, 1.2rem));
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  padding: 0.25em 0.4em;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  word-break: break-word;
  min-height: 0;
  line-height: 1.2;
}

.menu-card-description {
  font-size: var(--menu-view-font-size, clamp(0.7rem, 1.4vh, 1rem));
  color: rgba(15, 23, 42, 0.62);
  text-align: center;
  padding: 0.25em 0.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  word-break: break-word;
  min-height: 0;
  line-height: 1.3;
}

.menu-card-price {
  font-size: var(--menu-view-font-size, clamp(0.8rem, 1.6vh, 1.05rem));
  font-weight: 900;
  color: #059669;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2em 0.4em;
  margin: 0;
  overflow: hidden;
  word-break: break-word;
  min-height: 0;
  line-height: 1.2;
}

/* OPTIONAL cards: tighten price padding (desktop/kiosk only) */
.menu-container:not(.mobile-grid) .menu-card.optional-card .menu-card-price {
  padding: 0 0.4em;
}

/* Keep text order as written (numbers/latin/rtl) */
.menu-card-title,
.menu-card-description,
.menu-card-price {
  unicode-bidi: plaintext;
  direction: rtl;
}

.menu-card-choice-options {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  width: 100%;
  align-items: center;
  justify-content: center;
  font-size: var(--menu-view-font-size, clamp(0.7rem, 1.2vh, 0.95rem));
  color: #444;
  margin-top: 0.4em;
}

.menu-card-choice-option {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.menu-card-choice-option .choice-label {
  font-weight: 600;
}

.menu-card-choice-option .choice-price {
  color: #16a34a;
  font-weight: 600;
}

.menu-card-choice-option .choice-count {
  background: #0ea5e9;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.05em 0.35em;
  font-weight: 800;
  font-size: 0.85em;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.menu-card-choice-option .choice-count-dec {
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-weight: 800;
  border-radius: 999px;
  width: 1.2em;
  height: 1.2em;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.menu-card-choice-option.choice-selected {
  border: 2.5px solid #16a34a;
  border-radius: 0.45em;
  padding: 0.15em 0.45em;
  background: rgba(22, 163, 74, 0.12);
  position: relative;
}
.menu-card-choice-option.choice-selected::before {
  content: '✓';
  font-weight: 900;
  color: #16a34a;
  font-size: 1.1em;
  margin-right: 0.2em;
}

.menu-card.choice-split .menu-card-description {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.menu-card.choice-split .menu-card-choice-options {
  gap: 0;
  align-items: stretch;
  justify-content: stretch;
  height: 100%;
}

.menu-card.choice-split .menu-card-choice-option {
  flex: 1 1 0;
  width: 100%;
}

/* Optional-with-level overlay (from new-panel) */
.optional-level-image-replacement {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 0.4em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(1.5px);
  z-index: 10;
  pointer-events: auto;
}

.level-option-button {
  background: white;
  border: 0.1em solid #ddd;
  border-radius: 0.3em;
  padding: 0.5em 0.8em;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1em;
  margin: 0.25em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.5em;
  min-width: 70%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.level-option-button.selected {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.level-option-label { font-weight: 800; }
.level-option-price { font-size: 12px; font-weight: 800; opacity: 0.9; }

/* ===================== DESKTOP: Cart box ===================== */
.cart-box {
  position: absolute;
  left: 73%;
  right: 1%;
  top: 1%;
  bottom: 1%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 5000;
  font-size: 14px;
  direction: ltr;
  text-align: left;
}

.cart-box-header {
  padding: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.cart-box-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.cart-item-title {
  font-weight: 800;
  color: #111827;
  text-align: left;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.cart-item-title-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cart-item-meta {
  color: #6b7280;
  font-size: 12px;
  white-space: pre-line;
  display: block;
  text-align: left;
  margin-left: 32px;
}

.cart-item-meta-line {
  line-height: 1.25;
  white-space: pre-line;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}

.cart-qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.cart-price {
  font-weight: 900;
  color: #111827;
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}

.cart-box-summary {
  padding: 8px 10px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.cart-box-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cart-box-row.total { font-weight: 900; }

.cart-box-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px 10px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.cart-box-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
}

.btn-cart-primary { background: #667eea; color: #fff; }
.btn-cart-secondary { background: #e5e7eb; color: #111827; }

/* Keep cart action order stable */
#cartBox .cart-box-actions #cartClearBtn { order: 1; }
#cartBox .cart-box-actions #cartNextBtn {
  order: 2;
  position: static !important;
  display: inline-flex;
}
#cartBox .cart-box-actions #cartCheckoutBtn { order: 3; }

@keyframes checkout-pulse {
  0%, 100% { background: #22c55e; transform: scale(1); }
  50%      { background: #16a34a; transform: scale(1.06); }
}
#cartCheckoutBtn.checkout-pulse,
#mobileCartCheckoutBtn.checkout-pulse {
  animation: checkout-pulse 1.2s ease-in-out infinite;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

/* Simple banner */
#closedBanner {
  position: absolute;
  left: 1%;
  right: 1%;
  top: 1%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff3bf;
  border: 1px solid #ffec99;
  color: #5c3c00;
  font-weight: 800;
  display: none;
  z-index: 9000;
}
#closedBanner.show { display: block; }

#cartToast {
  position: fixed;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font-weight: 900;
  display: none;
  z-index: 9800;
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}
#cartToast.show { display: block; }

/* Order loading overlay */
#orderLoadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
#orderLoadingOverlay.show {
  display: flex;
}
#orderLoadingPanel {
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
#orderLoadingSpinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-top-color: #111827;
  border-radius: 50%;
  animation: orderSpin 0.9s linear infinite;
}
@keyframes orderSpin {
  to { transform: rotate(360deg); }
}

/* ===================== DESKTOP: Mobile bars hidden ===================== */
#mobileTopBar {
  display: none;
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 64px;
  padding: 8px 12px;
  gap: 10px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 9500;
  align-items: center;
}

#mobileBottomBar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  padding: 8px 12px;
  gap: 10px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 9500;
  align-items: center;
}

#mobileCartBtn {
  flex: 1;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 0 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
#mobileCartBtn.cart-flash {
  animation: cartFlash 0.9s ease;
}
#mobileCartBtn.cart-flash #mobileCartBtnCount {
  animation: cartFlashPulse 0.9s ease;
}
#mobileBackBtn {
  flex: 1;
  height: 54px;
  border-radius: 14px;
  border: 1px solid #b91c1c;
  background: #ef4444;
  color: #fff;
  padding: 0 14px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 900;
}
#mobileBackBtn.back-empty {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: transparent;
  cursor: default;
  pointer-events: none;
}
#mobileCartBtnCount {
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 900;
  min-width: 34px;
  text-align: center;
}

#mobileNextBtn {
  flex: 1;
  height: 54px;
  border-radius: 14px;
  border: 1px solid #16a34a;
  background: #16a34a;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: none;
}
#mobileNextBtn.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
#mobileNextBtn.next-empty {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: transparent;
  cursor: default;
  pointer-events: none;
}

.sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9600;
}
.sheet-overlay.show { display: block; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: min(78vh, 720px);
  background: #fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.25);
  display: none;
  transform: translateY(0);
  z-index: 9700;
  flex-direction: column;
  overflow: hidden;
}
.sheet.show { display: flex; }
.sheet-handle {
  width: 44px; height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
  align-self: center;
  margin: 10px 0 6px;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 10px;
  border-bottom: 1px solid #e5e7eb;
}
.sheet-close {
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 900;
}

.mobile-level-sheet {
  height: min(52vh, 420px);
}

.mobile-level-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.mobile-level-option {
  width: 100%;
  min-height: 64px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-level-option.selected {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  box-shadow: inset 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.mobile-level-option-label {
  flex: 1 1 auto;
  text-align: left;
}

.mobile-level-option-price {
  flex: 0 0 auto;
  color: #059669;
  font-weight: 900;
}

/* =====================================================================
   PHONE LAYOUT — Simple 2×3 grid, all cards same size, scroll to see more
   Matches on: small screens OR touch devices.
   ===================================================================== */
@media (max-width: 820px), (pointer: coarse) {
  /* Dark background */
  body.mobile-ui,
  #onlineOrderRoot.mobile-ui {
    background: #ffffff !important;
    overflow: hidden !important;
    --phone-bar-h: 80px;
  }

  /* Menu container = simple 2-column grid, scrollable */
  .menu-container.mobile-grid {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: var(--phone-bar-h) !important;
    bottom: var(--phone-bar-h) !important;
    border: none !important;
    background: #ffffff !important;

    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    --phone-gap: 10px;
    --phone-pad-x: 10px;
    --phone-pad-top: 10px;
    --phone-pad-bottom: calc(10px + var(--phone-bar-h));
    grid-auto-rows: calc((100% - var(--phone-pad-top) - var(--phone-pad-bottom) - (var(--phone-gap) + var(--phone-gap))) / 2) !important;
    gap: var(--phone-gap) !important;
    padding: var(--phone-pad-top) var(--phone-pad-x) var(--phone-pad-bottom) !important;
    align-content: start !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
    scroll-snap-type: none !important;
  }

  /* Every card: same size, no absolute positioning, no cloud sizes */
  .menu-container.mobile-grid .menu-card {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 6px !important;
    gap: 3px !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    justify-content: flex-start !important;
  }

  /* Optional selected: stronger green + clear check */
  .menu-container.mobile-grid .menu-card.optional-selected {
    background: rgba(22, 163, 74, 0.10) !important;
    border: 4px solid #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25) !important;
  }
  .menu-container.mobile-grid .menu-card.optional-selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  }

  /* OPTIONAL_WITH_LEVEL on mobile: suppress green box + checkmark */
  .menu-container.mobile-grid .menu-card.optional-with-level-card.optional-selected {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.14) !important;
    box-shadow: none !important;
  }
  .menu-container.mobile-grid .menu-card.optional-with-level-card.optional-selected::before {
    display: none !important;
  }
  .menu-container.mobile-grid .menu-card.optional-with-level-card.optional-selected::after {
    display: none !important;
  }

  /* ---- Card proportions: 65% image / 12% title / 12% desc / 11% price ---- */
  .menu-container.mobile-grid .menu-card-image-frame {
    flex: 0 0 65% !important;
    height: 65% !important;
    max-height: 65% !important;
    min-height: 0 !important;
  }
  .menu-container.mobile-grid .menu-card-image {
    /* Phone layout only: keep full image visible without cropping */
    object-fit: contain !important;
    object-position: center center !important;
  }

  /* If card has NO description, give that 12% to the image → 80% */
  .menu-container.mobile-grid .menu-card:not(:has(.menu-card-description)) .menu-card-image-frame {
    flex: 0 0 80% !important;
    height: 80% !important;
    max-height: 80% !important;
  }

  /* Title: 12% */
  .menu-container.mobile-grid .menu-card-title {
    flex: 0 0 12% !important;
    height: 12% !important;
    max-height: 12% !important;
    font-size: 13px !important;
    padding: 2px 4px !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
  }

  /* Description: 12% */
  .menu-container.mobile-grid .menu-card-description {
    flex: 0 0 12% !important;
    height: 12% !important;
    max-height: 12% !important;
    font-size: 11px !important;
    padding: 1px 4px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
  }

  /* Price: 11% */
  .menu-container.mobile-grid .menu-card-price {
    flex: 0 0 11% !important;
    height: 11% !important;
    max-height: 11% !important;
    font-size: 13px !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
  }

  /* CHOICE card: title 10% / options 90% */
  .menu-container.mobile-grid .menu-card.choice-card .menu-card-image-frame,
  .menu-container.mobile-grid .menu-card.choice-card .menu-card-price {
    display: none !important;
  }
  .menu-container.mobile-grid .menu-card.choice-card .menu-card-title {
    flex: 0 0 10% !important;
    height: 10% !important;
    max-height: 10% !important;
  }
  .menu-container.mobile-grid .menu-card.choice-card .menu-card-description {
    flex: 1 1 90% !important;
    height: 90% !important;
    max-height: 90% !important;
    padding: 2px 4px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .menu-container.mobile-grid .menu-card.choice-card .menu-card-choice-options {
    flex: 1 1 auto !important;
    height: 100% !important;
    overflow-y: auto !important;
  }

  /* OPTIONAL WITH LEVEL: image 95% / title 5% */
  .menu-container.mobile-grid .menu-card.optional-with-level-card .menu-card-image-frame {
    flex: 0 0 95% !important;
    height: 95% !important;
    max-height: 95% !important;
  }
  .menu-container.mobile-grid .menu-card.optional-with-level-card .menu-card-title {
    flex: 0 0 5% !important;
    height: 5% !important;
    max-height: 5% !important;
  }
  .menu-container.mobile-grid .menu-card.optional-with-level-card .menu-card-description,
  .menu-container.mobile-grid .menu-card.optional-with-level-card .menu-card-price {
    display: none !important;
  }

  /* Choice options: 2-column grid inside card */
  .menu-container.mobile-grid .menu-card-choice-options {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
    font-size: 11px !important;
  }
  .menu-container.mobile-grid .menu-card-choice-option {
    padding: 3px 5px !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
  }
  .menu-container.mobile-grid .menu-card-choice-option.choice-selected {
    border: 2.5px solid #16a34a;
    background: rgba(22,163,74,0.12);
  }

  /* Level overlay: readable on small cards */
  .menu-container.mobile-grid .optional-level-image-replacement {
    padding: 0.4em !important;
    gap: 6px !important;
    overflow-y: auto !important;
  }
  .menu-container.mobile-grid .level-option-button {
    min-width: 0 !important;
    width: 100% !important;
    padding: 0.4em 0.6em !important;
    font-size: 12px !important;
    min-height: 2em !important;
  }

  /* Hide desktop elements */
  body.mobile-ui #onlineBackBtn { display: none !important; }
  body.mobile-ui .cart-box { display: none !important; }

  /* Show mobile bars */
  body.mobile-ui #mobileTopBar,
  body.mobile-ui #mobileBottomBar {
    display: flex !important;
    height: var(--phone-bar-h) !important;
    padding: 10px 12px !important;
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.12) !important;
  }
  body.mobile-ui #mobileCartBtn,
  body.mobile-ui #mobileBackBtn,
  body.mobile-ui #mobileNextBtn {
    height: 60px !important;
  }
}

@keyframes cartFlash {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.0); }
  45% { box-shadow: 0 0 0 10px rgba(34,197,94,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.0); }
}

@keyframes cartFlashPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
