/* Фирменный стиль ИНЬ ЯН (логотип 2024): слоновая кость, тёмный эспрессо, золото */
:root {
  --bg: #f8f3ed;
  --surface: #fffdfa;
  --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%);
  --ok: #87622f;
  --ok-soft: #f3e9d6;
  --danger: #a4493d;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-inner: 12px;
  --h-control: 56px;
  --h-chip: 48px;
  --dur-fast: .15s;
  --dur: .25s;
  --danger-soft: #fbe9e6;
  /* шкала шрифтов: 13 / 15 / 17 / 20 / 25 */
  --fs-xs: 13px;
  --fs-sm: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 25px;
  --pic-bg: linear-gradient(160deg, #fffdf9 0%, #f1e8dd 100%);
  --shadow: 0 6px 24px rgba(42, 36, 32, .07);
  --font: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-md)/1.5 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 24px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: var(--fs-md);
  transition: transform var(--dur-fast) ease, background-color var(--dur) ease, opacity var(--dur);
}
.btn:active { transform: scale(.97); }
.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(--accent-dark); }
.btn-wide { width: 100%; justify-content: space-between; }

/* ---------- шапка и категории ---------- */
.hero {
  position: relative; text-align: center; color: var(--surface);
  padding: max(28px, env(safe-area-inset-top)) 20px 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-salon { margin: 0 0 14px; letter-spacing: .3em; text-transform: uppercase; font-size: var(--fs-sm); font-weight: 500; }
.hero h1 { margin: 0 0 6px; font-size: var(--fs-xl); font-weight: 500; line-height: 1.25; letter-spacing: .02em; }
.hero-sub { margin: 0; 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; }
.tab {
  flex: none; min-height: var(--h-chip); padding: 0 24px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 600; 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));
  padding: 6px 20px 130px; max-width: 1200px; margin: 0 auto;
}
.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; filter: grayscale(1); opacity: .55; }
.pic { position: relative; aspect-ratio: 4 / 3; background: var(--pic-bg); }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic img.art { object-fit: contain; padding: 2% 4%; }
.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 { padding: 12px 18px 18px; }
.card-tag { margin: 0 0 4px; color: var(--gold-text); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.card-title { margin: 0; font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.card-desc {
  margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

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

/* ---------- панель корзины ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 14px 20px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(248, 243, 237, 0), var(--bg) 35%);
  display: flex; justify-content: center;
}
.cartbar .btn { max-width: 560px; font-size: var(--fs-lg); animation: rise var(--dur) ease both; }

/* ---------- всплывающая карточка ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(42, 36, 32, .42); animation: fade var(--dur) ease; }
.sheet {
  position: fixed; z-index: 21; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(640px, 100%); max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
  animation: up var(--dur) cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 760px) and (min-height: 600px) {
  .sheet { top: 50%; bottom: auto; transform: translate(-50%, -50%); border-radius: var(--radius-lg); max-height: 88vh; 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 .pic { aspect-ratio: 16 / 9; }
.sheet .pic img.art { padding: 3% 18%; }
.sheet-close svg, .cart-remove svg { width: 22px; height: 22px; }
.sheet-close, .cart-remove { display: grid; place-items: center; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 48px; height: 48px;
  border-radius: 50%; border: 0; background: rgba(255, 253, 250, .92); color: var(--ink); font-size: var(--fs-lg); cursor: pointer;
  box-shadow: var(--shadow);
}
.sheet-inner { padding: 20px 24px 8px; }
.sheet h2 { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; }
.sheet .lead { margin: 4px 0 0; color: var(--muted); }
.sheet-head { position: relative; }
.sheet-plain-head { position: relative; padding: 24px 24px 0; }
.sheet-plain-head .sheet-close { top: 16px; right: 16px; box-shadow: none; background: var(--accent-soft); }

.group { margin-top: 22px; }
.group-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; font-size: var(--fs-md); font-weight: 600; letter-spacing: .02em; }
.group-hint { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: var(--h-chip); padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 500;
  transition: all var(--dur-fast) ease;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); font-weight: 600; }
.chip:disabled { opacity: .4; text-decoration: line-through; }
.sheet-actions { position: sticky; bottom: 0; padding: 18px 24px 4px; background: linear-gradient(rgba(255, 253, 250, 0), var(--surface) 30%); }
.sheet-actions .btn { width: 100%; }

/* ---------- оформление ---------- */
.cart-list { list-style: none; margin: 18px 0 0; padding: 0; }
.cart-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { position: relative; width: 64px; height: 48px; flex: none; border-radius: var(--radius-inner); overflow: hidden; background: var(--pic-bg); }
.cart-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cart-thumb img.art { object-fit: contain; padding: 2px; }
.cart-text { flex: 1; min-width: 0; }
.cart-text b { display: block; }
.cart-text span { color: var(--muted); font-size: var(--fs-sm); }
.cart-remove { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-dark); font-size: var(--fs-lg); cursor: pointer; }
.field { display: block; margin-top: 20px; }
.field-label { display: block; font-weight: 600; margin-bottom: 8px; }
.field-label small { color: var(--muted); font-weight: 400; }
.input {
  width: 100%; min-height: var(--h-control); padding: 12px 24px; font-size: var(--fs-lg);
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(207, 174, 123, .25); }
textarea.input { min-height: 84px; padding: 12px 18px; border-radius: var(--radius); resize: none; font-size: var(--fs-md); }
.error { margin: 12px 0 0; padding: 12px 18px; border-radius: var(--radius-inner); background: var(--danger-soft); color: var(--danger); }

/* ---------- экран статуса ---------- */
.status { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.status-card { text-align: center; max-width: 520px; animation: rise var(--dur) ease both; }
.status-icon {
  width: 132px; height: 132px; margin: 0 auto 18px; display: grid; place-items: center;
  border-radius: 50%; color: var(--gold-text); background: var(--accent-soft);
}
.status-icon svg { width: 72px; height: 72px; }
.status-icon.wait { animation: breathe 2.2s ease-in-out infinite; }
.status-icon.ok { background: var(--ok-soft); color: var(--ok); }
.status h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 36px); font-weight: 600; line-height: 1.25; }
.status p { margin: 0 0 28px; color: var(--muted); font-size: var(--fs-md); }
@keyframes breathe { 50% { transform: scale(1.06); } }

/* ---------- уведомление ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 110px; transform: translateX(-50%);
  max-width: calc(100% - 36px); padding: 12px 24px; border-radius: var(--radius-inner);
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow); animation: rise var(--dur) ease both;
}

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

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