/* Общие стили: меню для гостей (светлая тема), экран кухни (тёмная), генератор QR. */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --ink: #1b1a17;
  --muted: #6f6a61;
  --line: #e7e2d9;
  --accent: #9a4a26;
  --accent-ink: #ffffff;
  --danger: #b4232a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(27, 26, 23, 0.06), 0 8px 24px rgba(27, 26, 23, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans Hebrew', 'Noto Sans', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  line-height: 1.45;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ меню гостя */

.guest-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 10px;
}

.guest-header__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.restaurant-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.table-badge--empty {
  background: #efe9de;
  color: var(--ink);
}

.welcome {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 6px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.search {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 15px;
  outline: none;
}

.search:focus {
  border-color: var(--accent);
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.lang-switch button {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.lang-switch button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-ink);
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  position: sticky;
  top: 96px;
  z-index: 15;
  background: linear-gradient(var(--bg) 70%, rgba(247, 245, 241, 0));
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--muted);
}

.chip[aria-current='true'] {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.menu-main {
  padding: 4px 16px 140px;
  max-width: 760px;
  margin: 0 auto;
}

.category-title {
  font-size: 20px;
  font-weight: 700;
  margin: 22px 0 4px;
  scroll-margin-top: 150px;
}

.category-note {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 10px;
}

.item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.item__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-2);
  flex: 0 0 auto;
}

.item__body {
  flex: 1;
  min-width: 0;
}

.item__name {
  font-size: 16px;
  font-weight: 600;
}

.item__desc {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}

.item__tags {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(15, 107, 79, 0.09);
  border-radius: 999px;
  padding: 2px 9px;
}

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

.item__price {
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
}

.qty {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}

.qty button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
  display: grid;
  place-items: center;
}

.qty button:disabled {
  color: var(--line);
}

.qty__value {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.add-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.cart-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(247, 245, 241, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  transform: translateY(120%);
  transition: transform 0.22s ease;
}

.cart-bar[data-visible='true'] {
  transform: translateY(0);
}

.cart-bar__inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-bar__info {
  flex: 1;
  min-width: 0;
}

.cart-bar__title {
  font-weight: 700;
  font-size: 15px;
}

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

.button {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button:disabled {
  opacity: 0.55;
}

.button--ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button--danger {
  background: var(--danger);
  color: #fff;
}

.button--block {
  width: 100%;
}

/* модальное окно корзины и экран «заказ принят» */

.sheet {
  border: none;
  padding: 0;
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sheet::backdrop {
  background: rgba(20, 18, 15, 0.45);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line);
}

.sheet__title {
  font-size: 17px;
  font-weight: 700;
}

.sheet__body {
  padding: 14px 18px;
  max-height: 58vh;
  overflow-y: auto;
}

.sheet__foot {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.line:last-child {
  border-bottom: none;
}

.line__body {
  flex: 1;
  min-width: 0;
}

.line__name {
  font-weight: 600;
}

.line__sum {
  color: var(--muted);
  font-size: 13.5px;
}

.line__note {
  margin-top: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
  background: var(--surface-2);
  resize: vertical;
}

.line__remove {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13.5px;
  color: var(--muted);
}

.field input,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 16px;
  background: var(--surface-2);
  width: 100%;
  resize: vertical;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
}

.total-row strong {
  font-size: 20px;
}

.notice {
  background: rgba(180, 35, 42, 0.08);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
}

.success {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  text-align: center;
}

.success__icon {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(15, 107, 79, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 36px;
  margin: 0 auto 18px;
}

.success__title {
  font-size: 26px;
  font-weight: 700;
}

.success__number {
  font-size: 44px;
  font-weight: 800;
  color: var(--accent);
  margin: 6px 0 4px;
}

.receipt {
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 20px 0;
}

.receipt .line {
  padding: 7px 0;
}

.skeleton {
  background: linear-gradient(90deg, #efece6 25%, #f6f4f0 37%, #efece6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius);
  height: 74px;
  margin-bottom: 10px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ------------------------------------------------------------------ экран кухни */

body.kitchen {
  background: #0e1014;
  color: #eef1f6;
  min-height: 100vh;
}

.kitchen-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: #151922;
  border-bottom: 1px solid #232936;
}

.kitchen-header__title {
  font-size: 18px;
  font-weight: 700;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: #9aa4b6;
}

.status-dot::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
}

.status-dot[data-online='false'] {
  color: #fca5a5;
}

.status-dot[data-online='false']::before {
  background: #ef4444;
}

.kitchen-header__spacer {
  flex: 1;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e2430;
  border: 1px solid #2b3342;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 14px;
  color: #d6dce8;
}

.toggle[aria-pressed='true'] {
  border-color: #22c55e;
  color: #86efac;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 18px 40px;
  align-items: start;
}

@media (max-width: 1000px) {
  .board {
    grid-template-columns: 1fr;
  }
}

.column__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa4b6;
  margin-bottom: 10px;
}

.column__count {
  background: #1e2430;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  letter-spacing: 0;
}

.order-card {
  background: #171c25;
  border: 1px solid #262e3c;
  border-left: 5px solid #3b82f6;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.order-card[data-status='accepted'] {
  border-left-color: #f59e0b;
}

.order-card[data-status='done'] {
  border-left-color: #22c55e;
  opacity: 0.72;
}

.order-card[data-fresh='true'] {
  animation: flash 1.1s ease-in-out 3;
}

@keyframes flash {
  0%,
  100% {
    background: #171c25;
  }
  50% {
    background: #1d3350;
  }
}

.order-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.order-card__table {
  font-size: 22px;
  font-weight: 800;
}

.order-card__meta {
  color: #9aa4b6;
  font-size: 13px;
  text-align: end;
}

.order-card__items {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.order-card__items li {
  padding: 5px 0;
  border-bottom: 1px dashed #262e3c;
  font-size: 16px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.order-card__items li:last-child {
  border-bottom: none;
}

.order-card__items .qty-cell {
  font-weight: 700;
  color: #93c5fd;
  min-width: 34px;
}

.order-card__note {
  color: #fcd34d;
  font-size: 14px;
  margin-top: 2px;
}

.order-card__comment {
  background: #1e2430;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14.5px;
  margin-bottom: 10px;
  color: #e5e9f0;
}

.order-card__total {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #9aa4b6;
  margin-bottom: 10px;
}

.order-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kbtn {
  flex: 1;
  min-width: 96px;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 600;
  background: #232b39;
  color: #eef1f6;
  border: 1px solid #2f3849;
}

.kbtn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.kbtn--ok {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.kbtn--danger {
  background: transparent;
  border-color: #4b1f22;
  color: #fca5a5;
}

.empty-column {
  border: 1px dashed #2b3342;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  color: #6b7486;
  font-size: 14px;
}

.pin-screen {
  max-width: 360px;
  margin: 18vh auto;
  padding: 26px;
  background: #171c25;
  border: 1px solid #262e3c;
  border-radius: 18px;
  text-align: center;
}

.pin-screen h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.pin-screen input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.3em;
  font-size: 22px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #2f3849;
  background: #10141b;
  color: #fff;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------ QR-страница */

.qr-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.qr-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.qr-form h1 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 22px;
}

.qr-form p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.qr-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  break-inside: avoid;
}

.qr-card__place {
  font-weight: 700;
  font-size: 17px;
}

.qr-card__hint {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 10px;
}

.qr-card svg {
  width: 100%;
  max-width: 190px;
  height: auto;
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .qr-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .qr-card {
    border: 1px dashed #999;
  }
}
