/* ИНЬ ЯН — меню напитков для гостей: слоновая кость, тёмный эспрессо, золото логотипа */
:root {
  --bg: #f8f3ed;
  --surface: #fffdfa;
  --surface-2: #fbf7f2;
  --ink: #2a2420;
  --muted: #6b6159;
  --line: #ece2d7;
  --accent: #2a2420;
  --accent-dark: #17130f;
  --accent-soft: #f1e8dd;
  --gold: #cfae7b;
  --gold-text: #87622f;
  --gold-gradient: linear-gradient(90deg, #f3e2a9 0%, #cfae7b 50%, #a87e4f 100%);
  --placeholder: #857c72;
  --ok: #87622f;
  --ok-soft: #f3e9d6;
  --danger: #a4493d;
  --danger-soft: #fbe9e6;

  --radius: 20px;
  --radius-lg: 28px;
  --radius-inner: 12px;
  --h-control: 56px;
  --h-chip: 48px;
  --shadow: 0 6px 24px rgba(42, 36, 32, .07);
  --dur-fast: .15s;
  --dur: .25s;

  /* шрифты брендбука: Unbounded — основной; Vetrino и Bella Script заменены ближайшими
     из Google Fonts (Forum, Great Vibes), пока нет файлов оригиналов */
  --font: Unbounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: Forum, Georgia, "Times New Roman", serif;
  --font-script: "Great Vibes", "Snell Roundhand", cursive;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 30px;
  --pic-bg: linear-gradient(160deg, #fffdf9 0%, #f1e8dd 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 var(--fs-md)/1.55 var(--font);
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(168, 126, 79, .6); outline-offset: 3px; }

body.kiosk { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
body.kiosk input, body.kiosk textarea { -webkit-user-select: text; user-select: text; }
body.noscroll { overflow: hidden; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h-control); padding: 0 28px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-weight: 500; font-size: var(--fs-md); letter-spacing: .01em;
  transition: transform var(--dur-fast) ease, background-color var(--dur) ease, opacity var(--dur);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--surface); box-shadow: 0 8px 20px rgba(42, 36, 32, .2); letter-spacing: .02em; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-ghost { background: var(--accent-soft); color: var(--ink); }

/* ---------- шапка ---------- */
.hero {
  position: relative; text-align: center; color: var(--surface);
  padding: max(28px, env(safe-area-inset-top)) 24px 30px;
  background: radial-gradient(ellipse at 50% 0%, #4a3f38 0%, var(--ink) 55%, var(--accent-dark) 100%);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold-gradient); opacity: .85; }
.hero-logo { display: block; height: 116px; width: auto; margin: 0 auto 18px; }
.hero h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1.15; letter-spacing: .02em; }
.hero-sub { margin: 0 auto; max-width: 420px; color: rgba(255, 253, 250, .74); font-weight: 300; font-size: var(--fs-sm); }

/* ---------- категории ---------- */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 18px; background: linear-gradient(var(--bg) 80%, rgba(248, 243, 237, 0));
}
.tabs::-webkit-scrollbar { display: none; }
.tabs-inner { display: contents; }
.tab {
  flex: none; min-height: var(--h-chip); padding: 0 24px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer; transition: all var(--dur) ease;
}
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* ---------- напитки ---------- */
.grid {
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-width: 1200px; margin: 0 auto; padding: 6px 18px 24px;
}
.loading, .empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }
.card {
  display: flex; flex-direction: column; text-align: left;
  border: 0; padding: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur) ease;
  animation: rise var(--dur) ease both;
}
.card:active { transform: scale(.98); }
.card[disabled] { cursor: default; opacity: .55; }
.card[disabled] .photo img { filter: grayscale(1); }
.photo { position: relative; aspect-ratio: 4 / 3; background: var(--pic-bg); overflow: hidden; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo.placeholder { display: grid; place-items: center; }
.photo.placeholder img { position: static; width: 26%; height: auto; opacity: .55; }
.badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  background: rgba(42, 36, 32, .82); color: var(--surface); font-size: var(--fs-xs); font-weight: 600;
}
.card-body { display: block; padding: 12px 18px 18px; }
.card-title { display: block; margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.2; }
.card-desc {
  display: -webkit-box; margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.outro { padding: 18px 24px max(36px, env(safe-area-inset-bottom)); text-align: center; }
.motto { margin: 0 0 4px; font-family: var(--font-display); font-size: var(--fs-lg); color: var(--ink); letter-spacing: .02em; }
.sign { margin: 0; color: var(--gold-text); font-family: var(--font-script); font-size: 28px; line-height: 1.3; }

/* ---------- окно напитка ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(51, 48, 43, .38); animation: fade var(--dur) ease; }
.sheet {
  position: fixed; z-index: 21; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%); max-height: 94vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 0 max(18px, env(safe-area-inset-bottom));
  animation: up var(--dur) cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 760px) and (min-height: 640px) {
  .sheet { top: 50%; bottom: auto; transform: translate(-50%, -50%); border-radius: var(--radius-lg); max-height: 90vh; animation: pop var(--dur) ease; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }

.sheet-head { position: relative; }
.sheet .photo { aspect-ratio: 16 / 9; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(251, 248, 244, .92); color: var(--ink); box-shadow: var(--shadow);
}
.sheet-close svg { width: 20px; height: 20px; }
.sheet-inner { padding: 18px 24px 6px; }
.sheet h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.15; }
.sheet .lead { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }

.group { margin-top: 24px; }
.group-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; font-size: var(--fs-sm); font-weight: 500; }
.group-hint { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: var(--h-chip); padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-size: var(--fs-sm); font-weight: 400;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.chip:disabled { opacity: .4; text-decoration: line-through; }
.divider { height: 1px; margin: 26px 0 0; background: var(--line); border: 0; }

.field { display: block; margin-top: 14px; }
.input {
  width: 100%; min-height: var(--h-control); padding: 12px 22px; font-size: var(--fs-md);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(207, 174, 123, .25); }
.error { margin: 14px 0 0; padding: 12px 18px; border-radius: var(--radius-inner); background: var(--danger-soft); color: var(--danger); font-size: var(--fs-sm); }
.sheet-actions { position: sticky; bottom: 0; padding: 18px 24px 4px; background: linear-gradient(rgba(251, 248, 244, 0), var(--surface) 30%); }
.sheet-actions .btn { width: 100%; }

/* ---------- экран после заказа ---------- */
.status { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.status-card { max-width: 440px; text-align: center; animation: rise var(--dur) ease both; }
.status-icon {
  display: grid; place-items: center; width: 120px; height: 120px; margin: 0 auto 22px;
  border-radius: 50%; background: var(--surface); color: var(--gold-text); box-shadow: var(--shadow);
}
.status-icon svg { width: 60px; height: 60px; }
.status-icon.wait { animation: breathe 2.4s ease-in-out infinite; }
.status-icon.ok { color: var(--ok); background: var(--ok-soft); }
.status h1 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 6vw, 44px); line-height: 1.15; }
.status p { margin: 0 0 28px; color: var(--muted); font-size: var(--fs-md); }
.status .sign { margin-top: 28px; }
@keyframes breathe { 50% { transform: scale(1.05); } }

/* ---------- уведомление ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 48px); padding: 12px 24px; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: var(--fs-sm); box-shadow: var(--shadow);
  animation: rise var(--dur) ease both;
}

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 4px 16px 18px; }
  .tabs { padding: 12px 16px; }
  .hero-logo { height: 96px; margin-bottom: 14px; }
  .card-body { padding: 12px; }
  .card-title { font-size: 19px; }
  .hero h1 { font-size: 30px; }
  .card-desc { font-size: var(--fs-xs); -webkit-line-clamp: 4; }
  .sheet-inner { padding: 16px 18px 6px; }
  .sheet-actions { padding: 16px 18px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
