/* Страница филиала: меню, корзина, шкала подарка */

/* ---------- Шапка ---------- */
.head { position: sticky; top: 0; z-index: 40; background: var(--graphite); }
.head__row { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.head__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.head__brand img { width: 52px; height: 52px; }
.head__brand b { font: 800 21px/1 var(--display); letter-spacing: -.02em; }

/* Филиал — просто подпись: выбранный филиал на сайте не меняется (просьба клиента) */
.branch-tag { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 14px; background: var(--coal); }
.branch-tag b { display: block; font: 700 15px/1.2 var(--display); }
.branch-tag span { display: block; font-size: 13px; color: var(--ash); }

.back { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; min-height: 44px; padding: 0 16px 0 10px; border-radius: var(--r-control); background: var(--coal); text-decoration: none; font-weight: 600; font-size: 15px; }
.back svg { width: 18px; height: 18px; color: var(--mandarin); }
.back:hover { background: var(--graphite-2); }

.tag-gift { margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--chopstick); color: #fff; font: 600 12px/1.4 var(--text); vertical-align: 2px; }

.mode { display: flex; margin-right: auto; padding: 4px; border-radius: var(--r-control); background: var(--coal); }
.mode button { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-control); background: none; cursor: pointer; font-weight: 500; font-size: 15px; color: var(--ash); }
.mode button[aria-pressed="true"] { background: var(--mandarin); color: var(--ink); font-weight: 600; }

.head__phone { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.head__phone svg { width: 18px; height: 18px; color: var(--mandarin); }

.cart-btn { min-height: 48px; padding: 0 20px; gap: 10px; font-size: 16px; }
.cart-btn__count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--ink); color: var(--mandarin); font: 700 14px/26px var(--display); text-align: center; }
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.06); } }

/* ---------- Шкала подарка ---------- */
.gift { position: relative; min-height: 34px; background: var(--coal); overflow: hidden; }
.gift__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 138, 0, .22); transition: width .5s ease, background-color .3s; }
.gift__fill::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--mandarin); }
.gift__text { position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 0; font-size: 14px; line-height: 1.3; }
.gift__text b { font-weight: 600; color: var(--mandarin); }
.gift__text img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.gift.is-done .gift__fill { width: 100% !important; background: var(--chopstick); }
.gift.is-done .gift__fill::after { display: none; }
.gift.is-done .gift__text b { color: #fff; }

/* ---------- Категории ---------- */
.cats { position: sticky; top: var(--head-h, 110px); z-index: 30; background: var(--mandarin); }
.cats__list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.cats__list::-webkit-scrollbar { display: none; }
.cats__list a {
  display: block; padding: 13px 14px; white-space: nowrap; text-decoration: none;
  color: var(--ink); font: 700 15px/1 var(--display); border-radius: 10px;
}
.cats__list a:hover { background: rgba(27, 25, 24, .1); }
.cats__list a.is-active { background: var(--ink); color: var(--mandarin); }

/* ---------- Баннеры ---------- */
.promos { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin-top: 24px; }
.promo { position: relative; overflow: hidden; border-radius: var(--r-photo); text-decoration: none; min-width: 0; }
.promo img { width: 100%; height: 100%; object-fit: cover; }
.promo--main { aspect-ratio: 2 / 1; }
.promo--card { display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; padding: 20px; background: var(--graphite); }
.promo--card img { position: absolute; inset: 0; z-index: 0; }
.promo--card::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 30%, rgba(27, 25, 24, .92) 85%); }
.promo--card h3, .promo--card p { position: relative; z-index: 2; margin: 0; }
.promo--card h3 { font: 800 24px/1.1 var(--display); letter-spacing: -.02em; }
.promo--card p { margin-top: 6px; color: var(--rice); opacity: .85; font-size: 15px; }

/* ---------- Плитки категорий (как на действующем сайте) ---------- */
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 12px; margin: 28px 0 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tiles a { display: block; border-radius: 14px; overflow: hidden; text-decoration: none; background: var(--mandarin); }
.tiles img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tiles span { display: block; padding: 9px 12px; color: var(--ink); font: 700 15px/1.2 var(--display); }

/* ---------- Меню ---------- */
.menu-section { padding-top: 48px; scroll-margin-top: calc(var(--head-h, 110px) + 56px); }
.menu-section > h2 { margin: 0 0 20px; font: 800 clamp(28px, 3vw, 40px)/1.1 var(--display); letter-spacing: -.02em; }
.menu-section__note { margin: -8px 0 20px; color: var(--ash); max-width: 60ch; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 20px; }

.dish { display: flex; flex-direction: column; }
.dish__photo { position: relative; border-radius: var(--r-photo); overflow: hidden; background: #000; aspect-ratio: 1; }
.dish__photo img { width: 100%; height: 100%; object-fit: cover; }
.dish__body { display: flex; flex-direction: column; flex: 1; padding-top: 14px; }
.dish h3 { margin: 0; font: 700 18px/1.2 var(--display); letter-spacing: -.01em; }
.dish__weight { margin-left: 6px; font: 500 14px var(--text); color: var(--ash); white-space: nowrap; }
.dish__desc { margin: 6px 0 0; color: var(--ash); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dish__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.dish__price { font: 800 22px/1 var(--display); letter-spacing: -.02em; }
.dish__inhouse { font-size: 14px; color: var(--ash); }

.add { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--mandarin); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.add:hover { background: #ff9d26; }
.add svg, .qty svg { width: 20px; height: 20px; }
.qty { display: flex; align-items: center; height: 48px; border-radius: var(--r-control); background: var(--graphite); }
.qty button { width: 44px; height: 48px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--mandarin); }
.qty output { min-width: 22px; text-align: center; font: 700 17px/1 var(--display); }

/* ---------- Корзина ---------- */
.cart-shade { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s; }
.cart {
  position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  display: flex; flex-direction: column; background: var(--graphite);
  transform: translateX(100%); transition: transform .3s ease; visibility: hidden;
}
body.cart-open .cart { transform: none; visibility: visible; }
body.cart-open .cart-shade { opacity: 1; pointer-events: auto; }
body.cart-open { overflow: hidden; }

.cart__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 12px; }
.cart__head h2 { margin: 0; font: 800 28px/1 var(--display); letter-spacing: -.02em; }
.cart__head p { margin: 6px 0 0; color: var(--ash); font-size: 14px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--coal); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }

.cart__list { flex: 1; overflow-y: auto; margin: 0; padding: 4px 24px 12px; list-style: none; }
.cart__item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart__item img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #000; }
.cart__item b { display: block; font: 700 15px/1.25 var(--display); }
.cart__item span { font-size: 14px; color: var(--ash); }
.cart__item .qty { height: 40px; background: var(--coal); }
.cart__item .qty button { width: 36px; height: 40px; }
.cart__item--gift b::after { content: "Подарок"; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--chopstick); color: #fff; font: 600 12px/1.4 var(--text); vertical-align: 2px; }
.cart__item--gift .cart__gift-price { font: 700 15px var(--display); color: var(--chopstick); }

.cart__empty { padding: 40px 24px; color: var(--ash); }
.cart__empty b { display: block; margin-bottom: 6px; color: var(--rice); font: 700 19px/1.3 var(--display); }

.cart__foot { padding: 16px 24px 24px; border-top: 1px solid var(--line); }
.cart__row { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--ash); font-size: 15px; }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 16px; }
.cart__total span { font-size: 17px; }
.cart__total b { font: 800 30px/1 var(--display); letter-spacing: -.02em; }
.cart__foot .btn { width: 100%; }

/* ---------- Нижняя кнопка корзины на телефоне ---------- */
.cart-bar { display: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .head__phone span { display: none; }
}
@media (max-width: 980px) {
  .promos { grid-template-columns: 1fr 1fr; }
  .promo--main { grid-column: 1 / -1; }
  .head__phone { display: none; }
  .head__brand b { display: none; }
}
@media (max-width: 760px) {
  /* На телефоне шапка уезжает, липкой остаётся полоса категорий; подарок — в нижней кнопке */
  .head { position: relative; }
  .head__row { flex-wrap: wrap; gap: 10px; min-height: 0; padding: 10px 0; }
  .head__brand img { width: 44px; height: 44px; }
  .branch-tag { flex: 1; min-width: 0; min-height: 44px; }
  .head--inner .branch-tag { display: none; }
  .back { margin-left: auto; margin-right: 0; }
  .mode { order: 3; width: 100%; }
  .mode button { flex: 1; min-height: 36px; }
  .gift__text { font-size: 13px; }
  .cats__list a { padding: 13px 12px; font-size: 14px; }
  .head .cart-btn { display: none; }
  .menu-section { padding-top: 36px; }
  .promos { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  .promo--card { min-height: 150px; padding: 12px; }
  .promo--card h3 { font-size: 16px; }
  .promo--card p { font-size: 12px; }
  .tiles { grid-auto-columns: 132px; margin-top: 20px; }
  .tiles span { font-size: 13px; }

  /* Меню списком: фото слева, текст справа */
  .grid { grid-template-columns: 1fr; gap: 0; }
  .dish { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .dish__photo { border-radius: 14px; }
  .dish__body { padding-top: 0; }
  .dish h3 { font-size: 16px; }
  .dish__desc { -webkit-line-clamp: 2; font-size: 13px; }
  .dish__foot { padding-top: 8px; }
  .dish__price { font-size: 19px; }
  .add, .qty { height: 40px; }
  .add { width: 40px; }
  .qty button { width: 36px; height: 40px; }

  .cart { top: auto; width: 100%; max-height: 88svh; border-radius: 22px 22px 0 0; transform: translateY(100%); }

  .cart-bar {
    position: fixed; z-index: 50; left: 12px; right: 12px; bottom: 12px; overflow: hidden;
    display: flex; justify-content: space-between; align-items: center; width: auto; min-height: 60px; padding: 0 22px;
    text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  .cart-bar__left b { display: block; font-size: 16px; line-height: 1.2; }
  .cart-bar__left small { display: block; font-size: 13px; font-weight: 500; line-height: 1.2; opacity: .8; }
  .cart-bar .cart-sum { font: 800 19px/1 var(--display); }
  .cart-bar::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: var(--gift-pct, 0%); background: var(--ink); opacity: .35; transition: width .5s ease; }
  .cart-bar.is-gift { background: var(--chopstick); color: #fff; }
  .cart-bar.is-gift::after { display: none; }
  .cart-bar[hidden] { display: none; }
  body { padding-bottom: 84px; }
  .cookie { bottom: 84px; }
}
