/* =====================================================
   Электронное меню «Дагестанской кухни».
   Плитки с фото и ценой + карточка блюда снизу + корзина.
   Палитра и шрифты — те же, что на сайте.
   ===================================================== */
:root {
  --linen: #f4ecdf;
  --linen-2: #ebe0cf;
  --slate: #1d2427;
  --garnet: #8c1c2b;
  --red: #a8232d;
  --gold: #c9954c;
  --ink: #221c1a;
  --muted: #6e625a;
  --body: "Rubik", system-ui, sans-serif;
  --pad: clamp(12px, 4vw, 28px);
  --bar: 64px;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--linen); overflow-x: clip; scroll-behavior: smooth; }
body { font: 400 16px/1.5 var(--body); color: var(--ink); background: var(--linen);
  padding-bottom: calc(96px + env(safe-area-inset-bottom)); overflow-x: clip; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* Шапка */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px var(--pad); background: rgb(244 236 223 / .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid #e0d3c0; }
.bar__logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.bar__logo img { width: 26px; height: auto; }
.bar__mark { width: clamp(110px, 32vw, 150px); }
.bar__table { margin-left: auto; padding: 7px 14px; border-radius: 999px; background: var(--garnet);
  color: #fff; font: 500 14px/1 var(--body); white-space: nowrap; }

/* Разделы — липкая лента */
.tabs { position: sticky; top: 56px; z-index: 19; display: flex; gap: 8px; overflow-x: auto;
  padding: 10px var(--pad); background: rgb(244 236 223 / .94); backdrop-filter: blur(8px);
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 15px; border-radius: 999px; background: #fff; color: var(--ink);
  text-decoration: none; font-size: 15px; box-shadow: inset 0 0 0 1px #e2d6c3; white-space: nowrap; }
.tabs a.is-on { background: var(--garnet); color: #fff; box-shadow: none; }

/* Разделы меню */
.menu { padding: 6px var(--pad) 20px; }
.sec { padding-top: 22px; scroll-margin-top: 108px; }
.sec__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sec h2 { font: 700 clamp(24px, 6vw, 34px)/1.1 var(--body); color: var(--slate); }
.sec__note { font-size: 14px; color: var(--muted); }

/* Плитка блюда: всё сразу на виду */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; text-align: left; border: 0;
  padding: 10px 10px 12px; border-radius: 20px; background: #fff; box-shadow: 0 6px 18px -14px rgb(34 28 26 / .7); }
.tile__img { width: 100%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 8px 10px rgb(0 0 0 / .22)); }
.tile__img--none { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fbf6ee, #e7dcc9); color: var(--gold); }
.tile__img--none svg { width: 46%; height: 46%; }
.tile__name { margin-top: 8px; font-weight: 500; line-height: 1.25; color: var(--ink); }
.tile__w { font-size: 13px; color: var(--muted); }
.tile__row { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile__price { font-weight: 500; color: var(--garnet); white-space: nowrap; }
.tile__price small { font-weight: 400; color: var(--muted); }
.add { width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: var(--garnet);
  color: #fff; font-size: 22px; line-height: 1; display: grid; place-items: center; }
.cnt { display: flex; align-items: center; gap: 6px; }
.cnt button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--linen-2); color: var(--garnet); font-size: 19px; line-height: 1; }
.cnt b { min-width: 16px; text-align: center; font-weight: 500; }
@media (hover: hover) {
  .tile:hover { box-shadow: 0 14px 26px -18px rgb(34 28 26 / .9); }
  .add:hover { background: var(--red); }
}
.tile:active { transform: scale(.985); }

/* Комплексные обеды — широкой строкой */
.lunch .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lunch .tile { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
.lunch .tile__img, .lunch .tile__img--none { width: 84px; flex: none; }
.lunch .tile__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lunch .tile__row { padding-top: 8px; }

/* Карточка блюда снизу */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.sheet[hidden], .cartbar[hidden] { display: none; }   /* иначе display из правила выше перебивает hidden */
.sheet__veil { position: absolute; inset: 0; background: rgb(20 14 12 / .5); backdrop-filter: blur(2px); }
.sheet__body { position: relative; width: 100%; max-height: 92svh; display: flex; flex-direction: column;
  background: var(--linen); border-radius: 26px 26px 0 0; box-shadow: 0 -20px 50px -20px rgb(0 0 0 / .6);
  padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet.is-closing .sheet__body { animation: sheetDown .2s ease-in forwards; }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet__grip { position: relative; align-self: center; width: 54px; height: 22px; border: 0; background: none; }
.sheet__grip::before { content: ""; position: absolute; left: 7px; right: 7px; top: 9px; height: 4px;
  border-radius: 99px; background: #c8b9a4; }
.sheet__scroll { overflow-y: auto; padding: 0 var(--pad) 18px; }

.card__img { width: min(62vw, 240px); margin: 0 auto 10px; filter: drop-shadow(0 14px 18px rgb(0 0 0 / .3)); }
.card h3 { font: 700 clamp(22px, 5.6vw, 28px)/1.15 var(--body); color: var(--slate); }
.card__w { font-size: 14px; color: var(--muted); margin-top: 2px; }
.card__d { margin-top: 10px; color: #4a423c; }
.card__pickT { margin: 16px 0 8px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 10px 15px; border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1px #e2d6c3; font-size: 15px; }
.opt.is-on { background: var(--garnet); color: #fff; box-shadow: none; }
.card__foot { position: sticky; bottom: 0; margin: 18px calc(var(--pad) * -1) 0; padding: 12px var(--pad) 14px;
  background: linear-gradient(to top, var(--linen) 70%, transparent); }
.btn { width: 100%; padding: 16px 20px; border: 0; border-radius: 999px; background: var(--garnet); color: #fff;
  font: 500 17px/1 var(--body); display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn--ghost { background: transparent; color: var(--garnet); box-shadow: inset 0 0 0 1.5px var(--garnet); }
.btn:active { transform: scale(.99); }

/* Корзина */
.cartbar { position: fixed; left: var(--pad); right: var(--pad); bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 0; border-radius: 999px;
  background: var(--garnet); color: #fff; box-shadow: 0 16px 30px -16px rgb(140 28 43 / .9);
  animation: cartUp .3s cubic-bezier(.2,.9,.3,1.2); }
@keyframes cartUp { from { transform: translateY(120%); } }
.cartbar__left { opacity: .85; font-size: 15px; }
.cartbar__mid { margin-left: auto; font-weight: 500; }
.cartbar__sum { font-weight: 500; }
.cart__list { display: grid; gap: 10px; margin-top: 8px; }
.cart__row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: #fff; }
.cart__row img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.cart__row b { display: block; font-weight: 500; }
.cart__row small { color: var(--muted); }
.cart__row .price { margin-left: auto; white-space: nowrap; font-weight: 500; }
.cart__sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px;
  font-size: 17px; }
.cart__sum b { font-size: 26px; font-weight: 700; color: var(--garnet); }
.field { width: 100%; margin-top: 10px; padding: 14px 16px; border: 0; border-radius: 14px;
  background: #fff; box-shadow: inset 0 0 0 1px #e2d6c3; font: 400 16px var(--body); color: var(--ink); }
.field.is-bad { box-shadow: inset 0 0 0 2px #d4544f; }
.status { margin-top: 10px; color: var(--garnet); font-weight: 500; }
.done { text-align: center; padding: 26px 10px; }
.done b { display: block; font: 700 26px/1.2 var(--body); color: var(--garnet); margin-bottom: 8px; }
.hp { position: absolute; left: -9999px; }

.foot { padding: 26px var(--pad) 10px; text-align: center; color: var(--muted); font-size: 15px; }
.foot a { color: var(--garnet); font-weight: 500; }
.foot__note { margin-top: 8px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sheet__body, .cartbar { animation: none; }
}

/* ---------- то, чем управляет админка ---------- */
/* «открыто до 22:00» / «закрыто» в шапке */
.bar__open { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: #e3f1e7; color: #2f7a4a;
  font: 500 13px/1 var(--body); white-space: nowrap; }
.bar__open.is-closed { background: #f6e1df; color: var(--red); }
.bar__open + .bar__table { margin-left: 8px; }
/* плашка дня */
.banner { margin: 10px var(--pad) 0; padding: 12px 16px; border-radius: 16px; background: var(--garnet); color: #fff;
  font-weight: 500; text-align: center; box-shadow: 0 10px 22px -16px rgb(140 28 43 / .9); }
/* блюдо на стопе: видно, но серое и без кнопки */
.tile.is-off .tile__img, .tile.is-off .tile__img--none { filter: grayscale(1); opacity: .55; }
.tile.is-off .tile__name { color: var(--muted); }
.tile__price--off { color: var(--muted); font-weight: 400; font-size: 14px; }
.card .btn:disabled { background: #cfc4b4; color: #fff; }
/* своё фото владельца показываем кругом, как тарелку */
.is-photo { border-radius: 50%; object-fit: cover; aspect-ratio: 1; }
.cart__row img.is-photo, .cart__row img { border-radius: 50%; object-fit: cover; }
/* условия доставки и «сейчас закрыто» в корзине */
.deliv { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: #fff; color: #4a423c; font-size: 14px; }
.deliv--warn { background: #f6e1df; color: var(--red); }

/* ---------- плитка: «+» и счётчик в одном гнезде, ничего не прыгает и не вылезает ---------- */
.tile { cursor: pointer; min-width: 0; }
.tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tile__row { flex-wrap: wrap; row-gap: 6px; }
.tile__price { min-width: 0; }
.tile__act { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; min-height: 38px; flex: none; }
.tile .cnt { gap: 2px; background: var(--linen-2); border-radius: 999px; padding: 3px; }
.tile .cnt button { width: 32px; height: 32px; background: #fff; }
.tile .cnt b { min-width: 20px; }
.tile__name { overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .grid { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 8px 8px 10px; }
  .add { width: 34px; height: 34px; }
  .tile .cnt button { width: 28px; height: 28px; }
}
.lunch .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* ---------- корзина: недоступные блюда, суммы, доставка ---------- */
.cart__row.is-na { background: #f7efe6; }
.cart__row.is-na img { filter: grayscale(1); opacity: .5; }
.cart__txt { min-width: 0; flex: 1; }
.cart__na { display: block; margin-top: 2px; font-style: normal; font-size: 13px; color: var(--red); }
.cart__row .price:empty { display: none; }
.linkbtn { border: 0; background: none; color: var(--garnet); font-weight: 500; text-decoration: underline; padding: 6px 4px; }
.cart__sums { margin-top: 14px; display: grid; gap: 4px; color: var(--muted); }
.cart__sums > div { display: flex; justify-content: space-between; }
.cart__sums .cart__sum { margin-top: 6px; color: var(--ink); }
.cartbar.has-na .cartbar__left::after { content: " · есть недоступные"; font-size: 13px; }
.btn:disabled { background: #cfc4b4; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- мои заказы ---------- */
.foot__acc { margin-top: 10px; }
.hist { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; }
.hist__top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.hist__top b { color: var(--ink); font-size: 16px; }
.hist__st { margin-left: auto; color: var(--garnet); font-weight: 500; }
.hist p { margin-top: 4px; }
.hist__sum { font-weight: 500; }
.cartbar > span { white-space: nowrap; }
@media (max-width: 380px) {
  .cartbar { gap: 8px; padding: 13px 16px; font-size: 15px; }
  .cartbar__mid { font-size: 14px; }
  .cartbar.has-na .cartbar__left::after { content: " · !"; }
}
/* строка корзины: на узком экране счётчик и цена уходят на вторую линию */
.cart__row { flex-wrap: wrap; row-gap: 6px; }
.cart__txt { flex: 1 1 130px; }
.cart__row .cnt, .cart__row .linkbtn { margin-left: auto; }
.cart__row .price { min-width: 64px; text-align: right; margin-left: auto; }
@media (max-width: 380px) { .cart__row img { width: 44px; height: 44px; } }
.cart__sums > [hidden], .field[hidden] { display: none; }

/* ---------- статус заказа, оплата СБП, оценка, вызов официанта ---------- */
.myorder { display: block; width: calc(100% - var(--pad) * 2); margin: 10px var(--pad) 0; padding: 12px 16px; border: 0; border-radius: 16px;
  background: var(--slate); color: #f4ecdf; font: 400 15px/1.3 var(--body); text-align: left; }
.myorder b { color: #f3d9b0; }
.myorder.is-pay { background: var(--garnet); animation: payPulse 1.4s ease-in-out infinite alternate; }
@keyframes payPulse { from { transform: scale(1); } to { transform: scale(1.015); } }
.steps { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.steps li { position: relative; padding-top: 28px; text-align: center; font-size: 13px; color: var(--muted); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px;
  border-radius: 50%; display: grid; place-items: center; background: var(--linen-2); color: var(--muted); font-weight: 700; font-size: 13px; }
.steps li.is-done { color: var(--ink); }
.steps li.is-done::before { content: "✓"; background: #2f7a4a; color: #fff; }
.steps li.is-now { color: var(--garnet); font-weight: 700; }
.steps li.is-now::before { background: var(--garnet); color: #fff; }
.st__big { margin: 12px 0 4px; font: 700 22px/1.2 var(--body); color: var(--slate); }
.st__pay { width: 100%; margin-top: 10px; padding: 17px; font-size: 18px; text-decoration: none; }
.st__warn { margin-top: 8px; font-size: 13px; color: var(--muted); }
.st__ok { margin-top: 10px; font-weight: 700; color: #2f7a4a; }
.rate { margin-top: 14px; }
.rate__stars { display: flex; gap: 6px; }
.rate__stars button { border: 0; background: none; font-size: 40px; line-height: 1; color: #d9ccb8; padding: 2px; }
@media (hover: hover) { .rate__stars:hover button { color: #e2a93a; } .rate__stars button:hover ~ button { color: #d9ccb8; } }
.rate__links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rate__links .btn { width: auto; flex: 1 1 140px; text-decoration: none; }
.callfab { position: fixed; left: var(--pad); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 29; padding: 12px 16px; border: 0; border-radius: 999px;
  background: var(--slate); color: #f4ecdf; font: 500 15px/1 var(--body); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .7); }
.callgrid { display: grid; gap: 8px; margin-top: 12px; }
.callbtn { text-align: left; padding: 15px 16px; font-size: 16px; }
.callbtn:disabled { opacity: .5; }

/* обед: фото меняется под выбранное блюдо */
.card__img { transition: opacity .16s ease; }
@media (prefers-reduced-motion: reduce) { .card__img { transition: none; } }

/* завтраки: фото сняты сбоку — показываем прямоугольником; вне 9–12 блюда видны, но без «+» */
.tile__img.is-rect, .card__img.is-rect { object-fit: cover; border-radius: 16px; filter: none; box-shadow: 0 10px 22px -16px rgb(34 28 26 / .7); }
.card__img.is-rect { width: 100%; max-width: 420px; aspect-ratio: 1; }
.tile.is-later .tile__img { opacity: .85; }
.sec__hours { padding: 4px 10px; border-radius: 999px; background: var(--linen-2); color: var(--muted); font-size: 13px; }
.sec__hours.is-open { background: #e3f1e7; color: #2f7a4a; }

/* самовывоз ко времени */
.when { display: block; margin-top: 10px; }
.when[hidden] { display: none; }
.when span { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.when select { margin-top: 6px; appearance: auto; }

/* расшифровка упаковки */
.cart__pack { display: block; margin: -2px 0 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.cart__pack[hidden] { display: none; }

/* согласие на обработку данных */
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 4px; font-size: 14px; line-height: 1.4; color: var(--muted); cursor: pointer; }
.agree input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--garnet); }
.agree a { color: var(--garnet); }
.agree.is-bad { color: #9b1b16; }
.agree.is-bad input { outline: 2px solid #b3261e; outline-offset: 2px; }

/* заглушка: доставка и самовывоз скоро */
.deliv--soon { padding: 10px 12px; border-radius: 12px; background: #fff6d8; color: var(--ink); }
.deliv--soon a { color: var(--garnet); font-weight: 600; white-space: nowrap; }
.menu__soon { margin: 14px var(--pad) 0; }
.agree[hidden] { display: none; }
