/* ===== Фирменный стиль ABDULLAH (брендбук, редакция 2.0) =====
   Палитра: тёмно-зелёный #173A2C · молочный #F3EBDD · старое золото #A98B55 · тёплый беж #D7C7AA
   Шрифты: EB Garamond — заголовки; Lato — текст (в вебе Carlito: та же форма, но с кириллицей) */
:root {
  --brand: #173A2C;          /* тёмно-зелёный — главный */
  --brand-ink: #F3EBDD;      /* молочный текст на зелёном */
  --gold: #A98B55;           /* старое золото — акценты, линии, крупные заголовки */
  --beige: #D7C7AA;          /* тёплый беж — фоновый */
  --brand-soft: #E8DDC9;     /* беж посветлее — кнопки «+», метки */
  --bg: #F3EBDD;             /* молочный фон страницы */
  --surface: #FBF7F0;        /* карточки */
  --muted: #F0E7D7;          /* плашки, поля */
  --line: #E2D6C0;
  --text: #173A2C;           /* по брендбуку текст тёмно-зелёный, не чёрный */
  --text-2: #5E6E62;
  --danger: #9B3B2A;
  --radius: 20px;
  --radius-sm: 14px;
  --font: 'Lato', 'Carlito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'EB Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 96px; }

/* ===== Загрузка ===== */
.loader { display: grid; place-items: center; min-height: 80vh; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--beige); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { padding: 40px 24px; text-align: center; color: var(--text-2); }

/* ===== Главная ===== */
.cover {
  position: relative; background: var(--brand);
  padding: 64px 16px 36px; display: flex; justify-content: center;
}
/* Арка с тонкой золотой линией — графический язык бренда */
.arch {
  padding: 14px; border: 1px solid var(--gold); border-radius: 999px 999px 18px 18px;
  padding-top: 40px;
}
.logo {
  width: 220px; height: 220px; border-radius: 12px;
  background: var(--brand) center/cover;
  display: grid; place-items: center;
}
.logo.text { font: 600 34px var(--font-head); letter-spacing: .12em; color: var(--gold); }
.cover .lang-switch { position: absolute; right: 12px; top: 12px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 20px 16px; margin-top: 12px; }
.intro { border-radius: 0 0 var(--radius) var(--radius); margin-top: 0; padding: 24px 20px; text-align: center; }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.intro h1 { font: 500 30px/1.15 var(--font-head); margin: 0; }
.rule { display: block; width: 48px; height: 1px; background: var(--gold); margin: 14px auto; }
.desc { margin: 0; color: var(--text-2); white-space: pre-line; }

.btn-primary {
  display: flex; align-items: center; gap: 12px;
  background: var(--brand); color: var(--brand-ink);
  border-radius: var(--radius-sm); padding: 18px 18px;
  font-weight: 700; font-size: 18px; letter-spacing: .02em;
  transition: transform .15s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary .ico { width: 26px; height: 26px; color: var(--gold); }
.btn-primary span { flex: 1; }
.chev { width: 22px; height: 22px; color: var(--gold); }
.chev path { stroke: var(--brand); }

.links { display: grid; gap: 10px; }
.link-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--muted); border-radius: var(--radius-sm); padding: 16px;
  font-weight: 700; font-size: 16px;
}
.link-row > span { flex: 1; }
.link-row .ico { width: 20px; height: 20px; color: var(--gold); flex: none; }
.link-row .chev { color: var(--brand); }
.link-row .chev path { stroke: var(--brand-ink); }

.info h3 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
.info p { margin: 0; font-weight: 700; }
.info .row + .row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.info a { display: block; }

.socials { display: flex; justify-content: center; gap: 14px; padding: 24px 0 8px; }
.socials a {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand); color: var(--gold);
  display: grid; place-items: center;
}
.socials svg { width: 22px; height: 22px; }

/* ===== Переключатель языка ===== */
.lang-switch { display: flex; background: var(--surface); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.lang-switch button { padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.lang-switch button.on { background: var(--brand); color: var(--brand-ink); }
.cover .lang-switch { background: transparent; border-color: rgba(169, 139, 85, .6); }
.cover .lang-switch button { color: var(--beige); }
.cover .lang-switch button.on { background: var(--gold); color: var(--brand); }

/* ===== Меню ===== */
.menu-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.back svg { width: 30px; height: 30px; }
.back path { stroke: var(--brand-ink); }
.menu-title { flex: 1; font: 600 24px var(--font-head); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.banners { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 16px; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 86%; scroll-snap-align: center;
  min-height: 150px; border-radius: var(--radius); overflow: hidden; position: relative;
  background: var(--brand) center/cover; box-shadow: inset 0 0 0 1px var(--gold);
  color: var(--brand-ink); display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
}
.banner.has-photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(23, 58, 44, .85)); }
.banner > * { position: relative; }
.banner b { font: 500 22px/1.15 var(--font-head); }
.banner small { opacity: .9; margin-top: 4px; font-size: 14px; }
.banners:has(.banner:only-child) .banner { flex-basis: 100%; }

.search {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 16px 4px; padding: 0 14px; height: 46px;
  background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--line);
  color: var(--text-2);
}
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: none; height: 100%; font-size: 16px; color: var(--text); }
.search input::placeholder { color: var(--text-2); }

.sections { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 0; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.section-tile {
  flex: 0 0 31%; min-width: 108px; aspect-ratio: 1 / 1.1;
  border-radius: var(--radius-sm); background: var(--surface) center/cover;
  display: flex; align-items: flex-end; padding: 10px; position: relative; overflow: hidden;
  font-size: 14px; font-weight: 700; line-height: 1.2; text-align: left;
}
.section-tile.has-photo { color: var(--brand-ink); }
.section-tile.has-photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(23, 58, 44, .8)); }
.section-tile span { position: relative; }
.section-tile.on { background-color: var(--brand); color: var(--brand-ink); }
.section-tile.on.has-photo { box-shadow: inset 0 0 0 2px var(--gold); }

.chips {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 16px; background: var(--bg);
}
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; font-weight: 700; white-space: nowrap; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.menu-list { padding: 0 16px; }
.cat { scroll-margin-top: 64px; padding-top: 8px; }
.cat h2 { font: 500 28px var(--font-head); margin: 12px 0 0; }
.cat h2::after { content: ''; display: block; width: 40px; height: 1px; background: var(--gold); margin-top: 6px; }
.note { color: var(--text-2); margin: 8px 0; }

.item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item h3 { font-size: 18px; font-weight: 700; margin: 0 0 4px; line-height: 1.25; }
.item p { margin: 0 0 10px; color: var(--text-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.price { font-weight: 700; font-size: 17px; }
.weight { color: var(--text-2); font-size: 14px; }
.item-foot .stepper, .item-foot .add { margin-left: auto; }
.item-photo { width: 112px; height: 112px; flex: none; border-radius: var(--radius-sm); background: var(--muted) center/cover; }
.item.off { opacity: .55; }
.item.off .badge-off { margin-left: auto; font-size: 13px; color: var(--text-2); }

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: #7A6336; }

.add {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 22px; line-height: 1;
}
.stepper { display: inline-flex; align-items: center; background: var(--brand); color: var(--brand-ink); border-radius: 999px; height: 34px; }
.stepper button { width: 34px; height: 34px; font-size: 20px; color: inherit; }
.stepper b { min-width: 18px; text-align: center; font-size: 15px; }

.empty { text-align: center; color: var(--text-2); padding: 48px 0; }

/* ===== Плашка корзины ===== */
.cart-bar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: calc(min(480px, 100vw) - 32px); z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--brand); color: var(--brand-ink);
  border-radius: var(--radius-sm); padding: 15px 18px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(23, 58, 44, .3);
  animation: rise .25s ease-out;
}
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
.cart-bar > span:nth-child(2) { flex: 1; text-align: left; }
.cart-count { background: var(--gold); color: var(--brand); border-radius: 999px; min-width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; padding: 0 6px; }

/* ===== Шторки (блюдо, корзина) ===== */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 35, 27, .55); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .25s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--muted); font-size: 22px; line-height: 1; z-index: 2; }

.dish-photo { margin: -20px -16px 16px; aspect-ratio: 1; background: var(--muted) center/cover; border-radius: var(--radius) var(--radius) 0 0; }
.dish h2 { font: 500 28px/1.15 var(--font-head); margin: 0 40px 6px 0; }
.dish .weight { margin-bottom: 10px; display: block; }
.dish p { color: var(--text-2); margin: 0 0 20px; white-space: pre-line; }
.dish-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.dish-foot .price { font-size: 22px; flex: 1; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--brand); color: var(--brand-ink);
  border-radius: var(--radius-sm); padding: 15px 22px; font-weight: 700; font-size: 17px; width: 100%;
}
.btn:disabled { opacity: .5; }
.dish-foot .btn { width: auto; }
.dish-foot .stepper { height: 48px; }
.dish-foot .stepper button { width: 46px; height: 48px; }

.cart-head { display: flex; align-items: baseline; gap: 12px; margin: 0 40px 12px 0; }
.cart-head h2 { font: 500 28px var(--font-head); margin: 0; flex: 1; }
.cart-head button { color: var(--text-2); font-size: 14px; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .nm { flex: 1; min-width: 0; }
.cart-line .nm b { display: block; font-weight: 700; font-size: 16px; }
.cart-line .nm small { color: var(--text-2); font-size: 14px; }

.form { margin-top: 18px; display: grid; gap: 12px; }
.form h3 { margin: 6px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.seg { display: flex; background: var(--muted); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; padding: 10px 4px; border-radius: 9px; font-size: 15px; }
.seg button.on { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.field { display: grid; gap: 4px; }
.field span { font-size: 14px; color: var(--text-2); }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--muted);
  border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus { border-color: var(--gold); background: var(--surface); }
.field.invalid input { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: 13px; }

.summary { margin: 18px 0 14px; display: grid; gap: 6px; }
.summary div { display: flex; justify-content: space-between; color: var(--text-2); }
.summary .grand { color: var(--text); font-weight: 700; font-size: 19px; padding-top: 8px; border-top: 1px solid var(--gold); margin-top: 4px; }
.btn.wa svg { width: 22px; height: 22px; color: var(--gold); }
.hint { font-size: 13px; color: var(--text-2); text-align: center; margin: 10px 0 0; }

body.locked { overflow: hidden; }
.info a.tel { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; }
.info a.tel span { color: var(--text-2); }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 10px); z-index: 50;
  background: var(--brand); color: var(--brand-ink); border: 1px solid var(--gold);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
