/* Floating menu surfaces: customer and counter menu surfaces. */
@media (max-width: 760px) {
  .app-frame--orders:has(.orders-menu-shell),
  .app-frame--orders:has(.orders-menu-shell)::after,
  .app-frame--orders .orders-menu-shell {
    background: #f6f6f8 !important;
  }

  .app-frame--orders:has(.orders-menu-shell)::after {
    content: none;
  }

  .app-frame--orders .orders-menu-background {
    display: none;
  }

  .app-frame--orders .orders-menu-shell,
  .app-frame--orders .orders-menu-shell--upsale {
    width: min(100%, 520px);
    max-width: 520px;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .app-frame--orders .orders-menu-header.orders-screen-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 56px;
    height: auto;
    flex: 0 0 auto;
    margin: 10px 12px;
    padding: 0;
    overflow: visible;
    background: transparent !important;
    border: 0;
  }

  .app-frame--orders .orders-menu-shell--upsale .orders-menu-header {
    --upsale-header-height: auto;
    height: auto;
    min-height: 56px;
    margin-bottom: 0;
    padding: 0;
  }

  .app-frame--orders .orders-menu-header .orders-screen-topbar__action.orders-menu-back {
    order: 0;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.94) !important;
    color: #3c3a38;
    box-shadow: 0 6px 18px rgba(27, 25, 22, 0.12);
  }

  .app-frame--orders .orders-menu-header .orders-category-scroll {
    order: 1;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
  }

  .app-frame--orders .orders-menu-header .orders-category-scroll::-webkit-scrollbar {
    display: none;
  }

  .app-frame--orders .orders-menu-header .category-tabs {
    display: flex !important;
    align-items: center;
    width: max-content;
    min-width: 100%;
    gap: 4px !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .app-frame--orders .orders-menu-header .category-tab,
  .app-frame--orders .orders-menu-header .category-tab.is-active {
    flex: 0 0 auto;
    min-width: 0 !important;
    min-height: 42px;
    padding: 8px 14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #55514d !important;
    font-size: clamp(0.82rem, 3.5vw, 0.98rem);
    font-weight: 600;
    white-space: nowrap;
  }

  .app-frame--orders .orders-menu-header .category-tab.is-active {
    background: #fff3e6 !important;
    color: #d97724 !important;
    font-weight: 750;
  }

  .app-frame--orders .orders-menu-header .category-tab.is-active::after {
    content: none;
  }

  .app-frame--orders .orders-menu-shell .menu-stage,
  .app-frame--orders .orders-menu-shell .menu-stage--upsale {
    padding: 8px 0 calc(96px + env(safe-area-inset-bottom, 0px));
    gap: 18px;
    background: transparent;
  }

  .app-frame--orders .orders-menu-shell--upsale .menu-stage--upsale {
    padding-top: 0;
  }

  .app-frame--orders .orders-menu-shell .upsale-banner-carousel {
    width: auto;
    margin: 8px 16px 18px;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  }

  .app-frame--orders .orders-menu-shell .upsale-banner-carousel__image {
    border-radius: inherit;
  }

  .app-frame--orders .orders-menu-shell .menu-categories-container {
    width: 100%;
    padding-inline: 16px;
    box-sizing: border-box;
  }

  .app-frame--orders .orders-menu-shell .menu-category-section {
    margin-bottom: 22px;
  }

  .app-frame--orders .orders-menu-shell .menu-grid {
    grid-auto-columns: calc((100% - 20px) / 2.8);
    gap: 10px;
    padding: 4px 2px 12px;
  }

  .app-frame--orders .orders-menu-shell .menu-card {
    box-sizing: border-box;
    padding: 9px;
    border: 0 !important;
    border-radius: 20px !important;
    background: transparent !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.035) !important;
    overflow: hidden;
  }

  .app-frame--orders .orders-menu-shell .menu-card:hover,
  .app-frame--orders .orders-menu-shell .menu-card:focus-within {
    border: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.075) !important;
  }

  .app-frame--orders .orders-menu-shell .menu-card__content {
    display: flex;
    height: 100%;
    flex-direction: column;
  }

  .app-frame--orders .orders-menu-shell .menu-card__click {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: right;
  }

  .app-frame--orders .orders-menu-shell .menu-card__visual {
    width: 100%;
    height: auto;
    aspect-ratio: 1.2 / 1;
    flex: 0 0 auto;
    margin: 0 0 8px;
    border-radius: 14px;
    background: #f6f6f8;
    overflow: hidden;
  }

  .app-frame--orders .orders-menu-shell .menu-card__image {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
  }

  .app-frame--orders .orders-menu-shell .menu-card__body {
    min-height: 112px;
    padding: 0 2px 2px;
    gap: 1px;
    justify-content: flex-start;
  }

  .app-frame--orders .orders-menu-shell .menu-card__name {
    display: -webkit-box;
    width: 100%;
    margin: 0;
    overflow: hidden;
    color: #282522;
    font-size: clamp(0.82rem, 3.5vw, 1rem);
    font-weight: 700;
    line-height: 1.25;
    text-align: right;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .app-frame--orders .orders-menu-shell .menu-card__description {
    display: -webkit-box;
    width: 100%;
    margin: 0;
    overflow: hidden;
    color: rgba(40, 37, 34, 0.68);
    font-size: clamp(0.66rem, 2.65vw, 0.78rem);
    line-height: 1.3;
    text-align: right;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .app-frame--orders .orders-menu-shell .menu-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    margin-top: auto;
    padding-top: 5px;
  }

  .app-frame--orders .orders-menu-shell .menu-card__price {
    width: auto;
    margin: 0;
    padding: 6px 9px;
    border-radius: 999px;
    background: transparent;
    color: #a84e13;
    font-size: clamp(0.78rem, 3.2vw, 0.94rem);
    font-weight: 750;
    line-height: 1;
    text-align: center;
  }

  .app-frame--orders .orders-menu-shell .menu-card__add-wrap {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .app-frame--orders .orders-menu-shell .menu-card__add {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 12px !important;
    background: #d97724;
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 119, 36, 0.3);
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }

  .app-frame--orders .orders-menu-shell .menu-card__add:focus-visible {
    outline: 3px solid rgba(217, 119, 36, 0.35);
    outline-offset: 2px;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart {
    left: 16px;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: 488px;
    transform: none;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__button {
    height: 58px;
    padding-inline: 18px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px !important;
    background: #d97724;
    box-shadow: 0 10px 26px rgba(98, 48, 13, 0.22);
  }
}

@media (max-width: 360px) {
  .app-frame--orders .orders-menu-shell .menu-grid {
    grid-auto-columns: calc((100% - 14px) / 2.8);
  }

  .app-frame--orders .orders-menu-shell .menu-card {
    padding: 7px;
  }
}

/* Menu cards keep their layout and elevation without a filled card surface. */
.app-frame--orders .orders-menu-shell .menu-card,
.app-frame--orders .orders-menu-shell .menu-card__content,
.app-frame--orders .orders-menu-shell .menu-card__click,
.app-frame--orders .orders-menu-shell .menu-card__body {
  background: transparent !important;
}

.app-frame--orders .orders-menu-shell .menu-card__body {
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start !important;
  gap: 0 !important;
}

.app-frame--orders .orders-menu-shell .menu-card__actions {
  margin-top: 6px !important;
  padding-top: 0;
}

.app-frame--orders .orders-menu-shell .menu-card__name,
.app-frame--orders .orders-menu-shell .menu-card__description {
  margin-block: 0 !important;
}

.app-frame--orders .orders-menu-shell .menu-card__name {
  flex: 0 0 auto !important;
  align-self: stretch;
}

/* Keep the same floating surfaces on wide counter and desktop viewports. */
@media (min-width: 761px) {
  .app-frame--orders:has(.orders-menu-shell),
  .app-frame--orders .orders-menu-shell {
    background: #f6f6f8 !important;
  }

  .app-frame--orders .orders-menu-header.orders-screen-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    margin: 12px 20px;
    padding: 0;
    background: transparent !important;
    border: 0;
  }

  .app-frame--orders .orders-menu-header .orders-screen-topbar__action.orders-menu-back {
    order: 0;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 6px 18px rgba(27, 25, 22, 0.12);
  }

  .app-frame--orders .orders-menu-header .orders-category-scroll {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 7px;
    overflow-x: auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
  }

  .app-frame--orders .orders-menu-header .category-tabs {
    display: flex !important;
    align-items: center;
    width: max-content;
    min-width: 100%;
    gap: 6px !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .app-frame--orders .orders-menu-header .category-tab,
  .app-frame--orders .orders-menu-header .category-tab.is-active {
    flex: 0 0 auto;
    min-width: 0 !important;
    min-height: 52px;
    padding: 10px 20px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #55514d !important;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .app-frame--orders .orders-menu-header .category-tab.is-active {
    background: #fff3e6 !important;
    color: #d97724 !important;
    font-weight: 750;
  }

  .app-frame--orders .orders-menu-header .category-tab.is-active::after {
    content: none;
  }

  .app-frame--orders .menu-stage {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .app-frame--orders .orders-menu-shell .upsale-banner-carousel {
    width: auto;
    margin: 12px 20px 24px;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  }

  .app-frame--orders .orders-menu-shell .upsale-banner-carousel__image {
    border-radius: inherit;
  }

  .app-frame--orders .orders-menu-shell .menu-card {
    padding: 12px !important;
    border: 0 !important;
    border-radius: 20px !important;
    background: transparent !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.035) !important;
  }

  .app-frame--orders .orders-menu-shell .menu-card__content {
    display: flex;
    height: 100%;
    flex-direction: column;
  }

  .app-frame--orders .orders-menu-shell .menu-card__click {
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    text-align: right;
  }

  .app-frame--orders .orders-menu-shell .menu-card__visual {
    width: 100%;
    height: auto;
    aspect-ratio: 1.2 / 1;
    flex: 0 0 auto;
    margin: 0 0 10px;
    border-radius: 14px;
    background: #f6f6f8;
    overflow: hidden;
  }

  .app-frame--orders .orders-menu-shell .menu-card__image {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
  }

  .app-frame--orders .orders-menu-shell .menu-card__body {
    min-height: 0 !important;
    padding: 0 2px 2px !important;
    gap: 2px !important;
    justify-content: flex-start !important;
  }

  .app-frame--orders .orders-menu-shell .menu-card__name {
    flex: 0 0 auto !important;
    font-size: clamp(1rem, 1.6vw, 1.35rem) !important;
    line-height: 1.25;
  }

  .app-frame--orders .orders-menu-shell .menu-card__description {
    font-size: clamp(0.82rem, 1.1vw, 1rem) !important;
  }

  .app-frame--orders .orders-menu-shell .menu-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px !important;
    padding: 0 2px 2px;
  }

  .app-frame--orders .orders-menu-shell .menu-card__price {
    width: auto;
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: transparent;
    color: #a84e13;
    font-size: clamp(0.95rem, 1.4vw, 1.2rem) !important;
    font-weight: 750;
  }

  .app-frame--orders .orders-menu-shell .menu-card__add {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 12px !important;
    background: #d97724;
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 119, 36, 0.3);
    font: inherit;
    font-size: 1.6rem;
    cursor: pointer;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart {
    left: 20px;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: 1400px;
    transform: none;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__button {
    height: 68px;
    padding-inline: 24px;
    border-radius: 999px !important;
    background: #d97724;
    box-shadow: 0 10px 26px rgba(98, 48, 13, 0.22);
  }
}

/* Beat the legacy sharp-corner reset shared by the orders surfaces. */
body:has(.app-frame--orders .orders-menu-shell) .app-frame--orders .orders-menu-shell .menu-card {
  border-radius: 20px !important;
}

body:has(.app-frame--orders .orders-menu-shell) .app-frame--orders .orders-menu-shell .menu-card__add {
  border-radius: 12px !important;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  height: auto !important;
  min-height: 72px;
  gap: 8px;
  padding: 4px 8px;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__cart-summary {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  line-height: 1;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__icon-wrap {
  width: 40px;
  height: 40px;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__icon {
  width: 40px;
  height: 40px;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__items {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.82rem, 3.5vw, 1rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__total {
  margin: 0;
  direction: ltr;
  font-size: clamp(0.82rem, 3.5vw, 1rem);
  line-height: 1;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__checkout {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-inline-start: auto;
  padding: 11px 15px;
  border-radius: 12px;
  background: #f49a3c;
  color: #fff;
  box-shadow: 0 5px 14px rgba(85, 42, 12, 0.2);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__checkout svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  transform: rotate(180deg);
}

body:has(.app-frame--orders .orders-menu-shell) .floating-cart__checkout:hover {
  background: #e88324;
}

@media (min-width: 761px) {
  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__button {
    min-height: 84px;
    padding-inline: 10px;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__cart-summary {
    min-width: 0;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__icon-wrap,
  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__icon {
    width: 50px;
    height: 50px;
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__items {
    font-size: clamp(1rem, 1.6vw, 1.35rem);
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__total {
    font-size: clamp(1rem, 1.6vw, 1.35rem);
  }

  body:has(.app-frame--orders .orders-menu-shell) .floating-cart__checkout {
    padding: 13px 18px;
    font-size: 0.9rem;
  }
}
