:root {
  --color-primary: #ff6000;
  --color-primary-soft: #ffba33;
  --color-primary-dark: #7a3a00;
  --color-text: #212121;
  --color-muted: #757575;
  --color-subtle: #9a9a9a;
  --color-bg: #f7f7f7;
  --color-surface: #ffffff;
  --color-border: #eeeeee;
  --color-placeholder-bg: #ff6000;
  --color-placeholder-bg-soft: #ffba33;
  --color-placeholder-text: #ffffff;
  --color-badge-bg: #fff3e8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-6: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-sheet: 0 -12px 38px rgba(0, 0, 0, 0.18);
  --header-height: 58px;
  --content-max: 1080px;
  --ease-standard: 0.22s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-bg);
  overflow-x: hidden;
}

html.drawer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.drawer-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.menu-app {
  width: min(100%, var(--content-max));
  min-height: 100vh;
  margin: 0 auto;
  padding-top: var(--header-height);
  background: var(--color-bg);
}

.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 100;
  width: min(100%, var(--content-max));
  height: var(--header-height);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.icon-button {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--ease-standard), transform var(--ease-standard);
}

.button-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.search-toggle-close {
  display: none;
}

#searchToggleBtn[data-icon="close"] .search-toggle-search {
  display: none;
}

#searchToggleBtn[data-icon="close"] .search-toggle-close {
  display: block;
}

.icon-button:hover {
  background: #f2f2f2;
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button:focus-visible,
.text-button:focus-visible,
.category-card:focus-visible,
.product-card:focus-visible,
.drawer-close:focus-visible,
.clear-search:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
  outline-offset: 2px;
}

.header-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 4px;
}

.header-title {
  display: block;
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-form {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 12px;
  background: #f2f2f2;
}

.search-form-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--color-muted);
}

.search-form-icon .button-icon {
  width: 17px;
  height: 17px;
}

#searchInput {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
}

#searchInput::placeholder {
  color: var(--color-subtle);
  font-weight: 500;
}

#searchInput::-webkit-search-decoration,
#searchInput::-webkit-search-cancel-button,
#searchInput::-webkit-search-results-button,
#searchInput::-webkit-search-results-decoration {
  display: none;
}

.clear-search {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #cfcfcf;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.clear-search .button-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.view {
  padding: 0 12px 18px;
}

.restaurant-hero {
  margin: 14px 0 16px;
  padding: 18px 16px;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-2);
}

.restaurant-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.restaurant-logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.restaurant-logo {
  width: 100%;
  height: 100%;
  padding: 7px;
  object-fit: contain;
}

.restaurant-initial {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.restaurant-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.restaurant-copy h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.34rem, 7vw, 2.2rem);
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.restaurant-powered {
  margin: 4px 0 0;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.restaurant-description {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

.restaurant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
}

.restaurant-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.restaurant-meta-icon {
  color: var(--color-primary);
}

.content-section {
  margin: 0 0 16px;
}

.subcategory-section {
  margin-top: 0;
}

.subcategory-grid {
  margin-bottom: 4px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category-card {
  appearance: none;
  position: relative;
  min-width: 0;
  height: 148px;
  border: 0;
  border-radius: var(--radius-lg);
  background: #ececec;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: box-shadow var(--ease-standard), transform var(--ease-standard);
}

.category-card:hover {
  box-shadow: var(--shadow-6);
  transform: translateY(-1px);
}

.category-card-image,
.category-card-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.category-card-image {
  background: #f3f1ee;
  object-fit: contain;
  padding: 10px;
}

.category-card-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-placeholder-bg), var(--color-placeholder-bg-soft));
  color: var(--color-placeholder-text);
  font-size: 2rem;
  font-weight: 900;
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.12) 62%, transparent);
}

.category-card-copy {
  position: absolute;
  right: 12px;
  bottom: 11px;
  left: 12px;
  min-width: 0;
  color: #fff;
}

.category-card-title,
.category-card-count {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.18;
  white-space: nowrap;
}

.category-card-count {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.category-hero {
  position: relative;
  height: 188px;
  margin: 14px 0 14px;
  border-radius: var(--radius-lg);
  background: #ececec;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.category-hero-image,
.category-hero-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.category-hero-image {
  background: #f3f1ee;
  object-fit: contain;
  padding: 12px;
}

.category-hero-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-placeholder-bg), var(--color-placeholder-bg-soft));
  color: var(--color-placeholder-text);
  font-size: 3rem;
  font-weight: 900;
}

.category-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.12) 62%, transparent);
}

.category-hero-copy {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  color: #fff;
}

.category-hero-copy h1 {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.1;
}

.category-hero-copy p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 600;
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card {
  appearance: none;
  min-width: 0;
  width: 100%;
  height: 112px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-2);
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: box-shadow var(--ease-standard), transform var(--ease-standard);
}

.product-card:hover {
  box-shadow: var(--shadow-6);
  transform: translateY(-1px);
}

.product-card-media {
  position: relative;
  height: 112px;
  background: #f3f1ee;
  overflow: hidden;
}

.product-card-image,
.product-card-placeholder {
  width: 100%;
  height: 100%;
}

.product-card-image {
  object-fit: contain;
  padding: 8px;
  background: #f3f1ee;
}

.product-card-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-placeholder-bg), var(--color-placeholder-bg-soft));
  color: var(--color-placeholder-text);
  font-size: 1.7rem;
  font-weight: 900;
}

.product-card-body {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.product-card-top {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.product-card-title {
  min-width: 0;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card-price {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.product-card-desc {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card-category {
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-badge-bg);
  color: var(--color-primary);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-panel,
.empty-state {
  margin: 16px 12px;
  border: 1px dashed #dddddd;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-muted);
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 30px 18px;
  text-align: center;
  box-shadow: var(--shadow-2);
}

.empty-state {
  margin: 0;
  min-height: 132px;
}

.state-panel h1,
.state-panel p,
.empty-state p {
  margin: 0;
}

.state-panel h1 {
  color: var(--color-text);
  font-size: 1.1rem;
}

.state-mark,
.empty-state-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--color-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.text-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.menu-footer {
  width: calc(100% - 24px);
  margin: 8px auto 0;
  padding: 16px 0 22px;
  border-top: 1px solid var(--color-border);
  color: var(--color-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.72rem;
  font-weight: 600;
}

.product-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: end center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease-standard);
  overscroll-behavior: contain;
  touch-action: none;
}

.product-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: none;
}

.drawer-sheet {
  --drawer-drag-y: 0px;
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: min(85vh, 820px);
  border-radius: 24px 24px 0 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(calc(100% + var(--drawer-drag-y)));
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.product-drawer.is-open .drawer-sheet {
  transform: translateY(var(--drawer-drag-y));
}

.drawer-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #dddddd;
  margin: 12px auto 8px;
  flex: 0 0 auto;
}

.drawer-close {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.drawer-close .button-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.drawer-media {
  position: relative;
  height: 224px;
  margin: 0 16px;
  border-radius: var(--radius-md);
  background: #f3f1ee;
  overflow: hidden;
  flex: 0 0 auto;
}

.drawer-product-image,
.drawer-product-placeholder {
  width: 100%;
  height: 100%;
}

.drawer-product-image {
  object-fit: contain;
  padding: 10px;
  background: #f3f1ee;
}

.drawer-product-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-placeholder-bg), var(--color-placeholder-bg-soft));
  color: var(--color-placeholder-text);
  font-size: 2.5rem;
  font-weight: 900;
}

.drawer-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 20px 30px;
}

.drawer-title-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title-row h2 {
  min-width: 0;
  margin: 0;
  color: var(--color-text);
  font-size: 1.38rem;
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.drawer-product-price {
  margin: 0;
  color: var(--color-primary);
  flex: 0 0 auto;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.drawer-product-category {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.drawer-product-description {
  margin: 12px 0 0;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.drawer-portion-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.drawer-portion-block h3 {
  margin: 0 0 10px;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 900;
}

.drawer-portion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-portion-item {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fafafa;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-portion-item.is-default {
  border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-border));
  background: var(--color-badge-bg);
}

.drawer-portion-name {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-portion-price {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 370px) {
  .category-grid {
    gap: 8px;
  }

  .category-card {
    height: 132px;
  }

  .product-card {
    grid-template-columns: 98px minmax(0, 1fr);
    height: 104px;
  }

  .product-card-media {
    height: 104px;
  }

  .product-card-body {
    padding: 10px;
  }

  .product-card-top {
    flex-direction: column;
    gap: 4px;
  }
}

@media (min-width: 640px) {
  .menu-app {
    padding-bottom: 20px;
  }

  .view {
    padding-inline: 18px;
  }

  .app-header {
    padding-inline: 18px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .category-card {
    height: 168px;
  }

  .product-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .product-card {
    height: 124px;
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .product-card-media {
    height: 124px;
  }

  .menu-footer {
    width: calc(100% - 36px);
  }
}

@media (min-width: 1024px) {
  .menu-app {
    min-height: auto;
    padding-top: calc(var(--header-height) + 18px);
  }

  .app-header {
    top: 14px;
    width: calc(100% - 36px);
    max-width: calc(var(--content-max) - 36px);
    margin: 0 auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
  }

  #homeView {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding-top: 18px;
  }

  #homeView.hidden {
    display: none !important;
  }

  .restaurant-hero {
    position: sticky;
    top: 92px;
    margin: 0;
  }

  .restaurant-main {
    flex-direction: column;
  }

  .restaurant-logo-wrap {
    width: 58px;
    height: 58px;
  }

  .restaurant-copy h1 {
    font-size: 1.5rem;
  }

  .content-section {
    margin-bottom: 0;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-card {
    height: 176px;
  }

  .category-hero {
    height: 232px;
    margin-top: 18px;
  }

  .category-products .product-list,
  #homeSearchResults.product-list {
    grid-template-columns: 1fr;
    max-width: 760px;
    margin-inline: auto;
  }

  .product-card {
    grid-template-columns: 132px minmax(0, 1fr);
    height: 132px;
  }

  .product-card-media {
    height: 132px;
  }
}

@media (min-width: 1180px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
