:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #f9fbff;
  --ink: #10143f;
  --muted: #667085;
  --line: #dfe6f6;
  --primary: #3048f4;
  --primary-dark: #11145a;
  --success: #16a34a;
  --shadow: 0 18px 50px rgba(17, 20, 90, 0.1);
  --radius: 8px;
  --topbar-height: 74px;
  --mobile-topbar-height: 108px;
  --mobile-categories-height: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 12px clamp(14px, 3vw, 28px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__logo {
  width: 130px;
  height: auto;
  mix-blend-mode: multiply;
}

.brand__text {
  display: grid;
  gap: 2px;
}

.brand__name {
  font-weight: 800;
  letter-spacing: 0;
}

.brand__sub {
  color: var(--muted);
  font-size: 13px;
}

.search {
  position: relative;
  min-width: 0;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

.search input:focus {
  border-color: rgba(48, 72, 244, 0.55);
  box-shadow: 0 0 0 4px rgba(48, 72, 244, 0.1);
}

.lang-switch {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(17, 20, 90, 0.08);
}

.lang-switch button {
  min-width: 48px;
  height: 34px;
  color: var(--primary-dark);
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.lang-switch button.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 16px rgba(48, 72, 244, 0.28);
}

.hero {
  width: min(1180px, calc(100% - 28px));
  margin: calc(var(--topbar-height) + 22px) auto 22px;
  padding: clamp(20px, 3vw, 30px);
  background: linear-gradient(135deg, #fff, #f7f9ff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.05;
}

.hero p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  background: var(--primary);
  border: 0;
  border-radius: var(--radius);
  white-space: nowrap;
}

.button.secondary {
  color: var(--primary-dark);
  background: #eef2ff;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 120px;
}

.categories {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: calc(100vh - 92px);
  padding: 10px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(17, 20, 90, 0.06);
}

.cat-link {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
}

.cat-link:hover,
.cat-link.active {
  background: #eef2ff;
}

.cat-link img {
  width: 46px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
}

.cat-link span {
  min-width: 0;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-section {
  scroll-margin-top: 90px;
  margin-bottom: 34px;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.section-title span {
  color: var(--muted);
  font-weight: 700;
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dish-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(17, 20, 90, 0.08);
}

.dish-card__image {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e9eef8;
  border: 0;
}

.dish-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-card__body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dish-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.dish-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}

.price {
  color: var(--primary);
  font-weight: 900;
  white-space: nowrap;
}

.meta {
  min-height: 21px;
  color: var(--muted);
  font-size: 14px;
}

.description {
  min-height: 21px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dish-card__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
}

.icon-button {
  width: 44px;
  height: 44px;
  color: var(--primary-dark);
  background: #eef2ff;
  border: 0;
  border-radius: var(--radius);
}

.cart-bar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.cart-bar button {
  pointer-events: auto;
  width: min(520px, 100%);
  min-height: 54px;
  color: #fff;
  font-weight: 900;
  background: var(--primary);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 18px 42px rgba(48, 72, 244, 0.28);
}

.drawer,
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  background: rgba(12, 18, 46, 0.38);
}

.drawer {
  justify-items: end;
}

.drawer__panel,
.modal__panel {
  width: min(460px, 100%);
  height: 100%;
  padding: 18px;
  overflow: auto;
  background: var(--surface);
}

.modal {
  place-items: center;
  padding: 16px;
}

.modal__panel {
  width: min(760px, 100%);
  height: auto;
  max-height: min(760px, 92vh);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
}

.close {
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: #eef2ff;
  border: 0;
  border-radius: var(--radius);
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  width: 64px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}

.qty {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.qty button {
  width: 32px;
  height: 32px;
  color: var(--primary-dark);
  background: #eef2ff;
  border: 0;
  border-radius: 6px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-strong);
  border-radius: var(--radius);
}

.modal-dish {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.modal-dish img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
}

.powered {
  margin: -70px auto 30px;
  color: var(--muted);
  text-align: center;
}

.powered a {
  color: var(--primary);
  font-weight: 800;
}

@media (min-width: 981px) {
  .hero {
    width: min(906px, calc(100% - 302px));
    margin-right: auto;
    margin-left: calc(max(14px, (100vw - 1180px) / 2) + 274px);
  }

  .layout {
    display: block;
  }

  .categories {
    position: fixed;
    top: calc(var(--topbar-height) + 24px);
    left: max(14px, calc((100vw - 1180px) / 2));
    z-index: 25;
    width: 250px;
    max-height: calc(100vh - 124px);
  }

  .menu-content {
    margin-left: 274px;
  }
}

@media (max-width: 980px) {
  .topbar__inner {
    grid-template-columns: 1fr auto;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
  }

  .layout {
    display: block;
  }

  .categories {
    position: fixed;
    top: var(--mobile-topbar-height);
    right: 0;
    left: 0;
    z-index: 30;
    display: flex;
    gap: 8px;
    width: 100%;
    max-height: none;
    margin: 0;
    padding: 10px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }

  .categories::-webkit-scrollbar {
    display: none;
  }

  .cat-link {
    grid-template-columns: 34px auto;
    flex: 0 0 auto;
    width: auto;
    min-width: 128px;
  }

  .cat-link img {
    width: 34px;
    height: 30px;
  }

  .dish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout {
    padding-top: calc(var(--mobile-categories-height) + 12px);
  }

  .menu-content {
    padding-top: 0;
  }

  .category-section {
    scroll-margin-top: calc(var(--mobile-topbar-height) + var(--mobile-categories-height) + 14px);
  }
}

@media (max-width: 640px) {
  .topbar,
  .hero,
  .layout,
  .menu-content,
  .category-section,
  .dish-grid,
  .dish-card {
    max-width: 100vw;
  }

  .topbar__inner {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 12px;
    overflow: hidden;
  }

  .topbar {
    min-height: var(--mobile-topbar-height);
  }

  .brand__logo {
    width: 96px;
  }

  .brand__text {
    display: none;
  }

  .lang-switch button {
    min-width: 38px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .lang-switch {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
  }

  .brand {
    padding-right: 168px;
  }

  .search {
    grid-column: auto;
    order: 2;
  }

  .hero {
    width: min(calc(100vw - 24px), 366px);
    max-width: min(calc(100vw - 24px), 366px);
    margin: calc(var(--mobile-topbar-height) + 14px) 12px 14px;
    overflow: hidden;
  }

  .hero p {
    overflow-wrap: anywhere;
  }

  .hero__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero__actions .button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .layout {
    width: min(calc(100vw - 24px), 366px);
    max-width: min(calc(100vw - 24px), 366px);
    margin-right: 12px;
    margin-left: 12px;
    overflow: hidden;
  }

  .categories {
    top: var(--mobile-topbar-height);
    padding: 8px 12px;
  }

  .layout {
    padding-top: calc(var(--mobile-categories-height) + 12px);
  }

  .dish-grid {
    grid-template-columns: 1fr;
  }

  .dish-card__top {
    grid-template-columns: 1fr;
  }

  .price {
    white-space: normal;
  }

  .modal-dish {
    grid-template-columns: 1fr;
  }
}
