/*
 * Foody — ИИ-помощник Foody Vibes (чат-виджет).
 * Использует CSS-переменные сайта (--primary, --secondary, --white, --gray, --text, --text-light,
 * --light, --light-gray, --success, --error, --accent, --radius-*, --shadow-*, --transition).
 */
/* ===== FOODY: ИИ-ПОМОЩНИК ===== */
.foody-launcher { position:fixed; right:24px; bottom:24px; z-index:1500; display:flex; align-items:center; gap:10px; padding:8px 20px 8px 8px; border:none; border-radius:999px; background:linear-gradient(135deg,var(--primary),var(--primary-dark)); color:#fff; font-family:inherit; font-weight:700; font-size:16px; cursor:pointer; box-shadow:0 10px 25px rgba(255,107,53,.45); transition:var(--transition); }
.foody-launcher:hover { transform:translateY(-3px); box-shadow:0 14px 30px rgba(255,107,53,.5); }
.foody-launcher.hidden { display:none; }
.foody-launcher-icon { width:40px; height:40px; border-radius:50%; background:rgba(255,255,255,.22); display:flex; align-items:center; justify-content:center; font-size:19px; }
.foody-launcher-dot { position:absolute; top:4px; left:38px; width:12px; height:12px; border-radius:50%; background:var(--success); border:2px solid #fff; }
.foody-launcher-dot.hidden { display:none; }
.foody-teaser { position:fixed; right:24px; bottom:92px; z-index:1500; max-width:260px; padding:12px 34px 12px 14px; background:var(--white); color:var(--text); border-radius:var(--radius-md) var(--radius-md) 4px var(--radius-md); box-shadow:var(--shadow-xl); font-size:14px; line-height:1.4; cursor:pointer; opacity:0; visibility:hidden; transform:translateY(10px); transition:var(--transition); }
.foody-teaser.show { opacity:1; visibility:visible; transform:none; }
.foody-teaser-close { position:absolute; top:6px; right:6px; width:22px; height:22px; border:none; border-radius:50%; background:var(--light-gray); color:var(--text-light); cursor:pointer; font-size:14px; line-height:1; }
.foody-chat { position:fixed; right:24px; bottom:24px; z-index:2050; width:390px; height:min(640px, calc(100vh - 48px)); display:flex; flex-direction:column; background:var(--light); border-radius:var(--radius-lg); box-shadow:0 20px 50px rgba(0,0,0,.25); overflow:hidden; opacity:0; visibility:hidden; transform:translateY(20px) scale(.98); transform-origin:bottom right; transition:var(--transition); }
.foody-chat.open { opacity:1; visibility:visible; transform:none; }
.foody-chat.expanded { width:min(820px, calc(100vw - 48px)); height:calc(100vh - 48px); }
.foody-chat.expanded .foody-msg { max-width:80%; }
.foody-chat.expanded .foody-dishes, .foody-chat.expanded .foody-form { max-width:560px; }
.foody-head { display:flex; align-items:center; gap:10px; padding:12px 12px 12px 16px; background:linear-gradient(135deg,var(--secondary),var(--secondary-light)); color:#fff; flex-shrink:0; }
.foody-avatar { width:40px; height:40px; border-radius:50%; background:var(--primary); display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.foody-head-text { flex:1; min-width:0; }
.foody-head-text strong { display:block; font-size:16px; line-height:1.2; }
.foody-head-text span { display:block; font-size:12px; opacity:.85; }
.foody-head-text span::before { content:''; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--success); margin-right:5px; vertical-align:middle; }
.foody-head-btn { width:34px; height:34px; border:none; border-radius:50%; background:rgba(255,255,255,.15); color:#fff; cursor:pointer; font-size:15px; flex-shrink:0; }
.foody-head-btn:hover { background:rgba(255,255,255,.28); }
@media (max-width:768px) { #foodyExpand { display:none; } .foody-chat.expanded { width:100%; height:100%; height:100dvh; } }
.foody-body { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding:16px 12px; display:flex; flex-direction:column; gap:10px; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.foody-msg { display:flex; flex-direction:column; gap:6px; max-width:92%; }
.foody-msg.foody-user { align-self:flex-end; align-items:flex-end; }
.foody-msg.foody-bot { align-self:flex-start; align-items:flex-start; }
.foody-bubble { padding:10px 14px; border-radius:16px; font-size:14px; line-height:1.45; word-wrap:break-word; overflow-wrap:anywhere; }
.foody-bot .foody-bubble { background:var(--white); color:var(--text); border-bottom-left-radius:4px; box-shadow:var(--shadow-sm); }
.foody-user .foody-bubble { background:var(--primary); color:#fff; border-bottom-right-radius:4px; }
.foody-bubble a { color:var(--accent); font-weight:600; }
.foody-user .foody-bubble a { color:#fff; }
.foody-typing { display:flex; gap:4px; padding:14px 16px; background:var(--white); border-radius:16px; border-bottom-left-radius:4px; align-self:flex-start; box-shadow:var(--shadow-sm); }
.foody-typing i { width:7px; height:7px; border-radius:50%; background:var(--text-light); animation:foodyDot 1.2s infinite ease-in-out; }
.foody-typing i:nth-child(2) { animation-delay:.15s; } .foody-typing i:nth-child(3) { animation-delay:.3s; }
@keyframes foodyDot { 0%,80%,100%{opacity:.3;transform:translateY(0)} 40%{opacity:1;transform:translateY(-4px)} }
.foody-quick { display:flex; flex-wrap:wrap; gap:6px; }
.foody-chip { border:1px solid var(--primary); background:var(--white); color:var(--primary); border-radius:999px; padding:6px 12px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.foody-chip:hover { background:var(--primary); color:#fff; }
.foody-action { display:inline-flex; align-items:center; gap:8px; border:none; background:var(--accent); color:#fff; border-radius:999px; padding:9px 16px; font-size:14px; font-weight:600; cursor:pointer; text-decoration:none; font-family:inherit; }
.foody-action.order { background:var(--success); }
.foody-msg.foody-msg-wide { max-width:100%; width:100%; }
/* разделы меню */
.foody-cats { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:8px; width:100%; }
.foody-cat { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--gray); border-radius:14px; background:var(--white); cursor:pointer; font-family:inherit; text-align:left; transition:var(--transition); min-width:0; }
.foody-cat:hover { border-color:var(--primary); box-shadow:0 4px 14px -6px rgba(255,107,53,.45); }
.foody-cat-emoji { font-size:20px; line-height:1; flex-shrink:0; }
.foody-cat-name { flex:1; min-width:0; font-size:14px; font-weight:600; color:var(--secondary); line-height:1.25; overflow:hidden; text-overflow:ellipsis; }
.foody-cat-count { flex-shrink:0; min-width:22px; height:22px; padding:0 6px; border-radius:999px; background:var(--light-gray); color:var(--text-light); font-size:12px; font-weight:700; display:grid; place-items:center; }
/* лента карточек */
.foody-carousel { position:relative; width:100%; }
.foody-carousel-title { font-weight:700; color:var(--secondary); font-size:15px; margin:2px 2px 8px; }
.foody-carousel-title span { color:var(--text-light); font-weight:600; font-size:13px; margin-left:4px; }
.foody-track { display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x mandatory; padding:2px 2px 10px; margin:0 -2px; scrollbar-width:none; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
.foody-track::-webkit-scrollbar { display:none; }
.foody-card { flex:0 0 168px; scroll-snap-align:start; display:flex; flex-direction:column; background:var(--white); border:1px solid var(--gray); border-radius:16px; overflow:hidden; }
.foody-card.out { opacity:.55; }
.foody-card-img { position:relative; height:104px; background:linear-gradient(135deg, #FFE7DC, #FFF4EE); display:grid; place-items:center; }
.foody-card-img::before { content:'🍽️'; font-size:30px; opacity:.5; }
.foody-card-img img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.foody-card-hit { position:absolute; left:8px; top:8px; background:rgba(255,255,255,.92); color:var(--secondary); font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; }
.foody-card-body { display:flex; flex-direction:column; gap:6px; padding:10px 10px 10px; flex:1; }
.foody-card-name { font-weight:700; font-size:14px; line-height:1.25; color:var(--secondary); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:35px; }
.foody-card-meta { font-size:12px; color:var(--text-light); margin-top:-3px; }
.foody-opts { display:flex; flex-wrap:wrap; gap:4px; }
.foody-opt { border:1px solid var(--gray); background:var(--white); color:var(--text); border-radius:999px; padding:3px 8px; font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.foody-opt.active { border-color:var(--primary); background:#FFF1EB; color:var(--primary-dark, #E85A26); }
.foody-card-foot { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:auto; }
.foody-card-price { font-size:16px; color:var(--secondary); white-space:nowrap; }
.foody-card-add { width:34px; height:34px; border:none; border-radius:50%; background:var(--primary); color:#fff; cursor:pointer; font-size:14px; flex-shrink:0; display:grid; place-items:center; transition:var(--transition); }
.foody-card-add:hover { background:#E85A26; }
.foody-card-add.done { background:var(--success); }
.foody-more-card { flex:0 0 96px; scroll-snap-align:start; border:1.5px dashed var(--primary); border-radius:16px; background:#FFF8F4; color:var(--primary); cursor:pointer; font-family:inherit; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.foody-more-card b { font-size:20px; }
.foody-more-card span { font-size:12px; font-weight:600; }
.foody-track-nav { display:none; position:absolute; top:calc(50% - 18px); width:32px; height:32px; border:none; border-radius:50%; background:var(--white); color:var(--secondary); box-shadow:0 4px 14px rgba(0,0,0,.18); cursor:pointer; font-size:20px; line-height:1; z-index:2; }
.foody-track-nav.prev { left:-6px; } .foody-track-nav.next { right:-6px; }
@media (hover:hover) and (pointer:fine) { .foody-carousel:hover .foody-track-nav { display:grid; place-items:center; } }
.foody-chip.menu { background:var(--primary); color:#fff; }
.foody-out { font-size:12px; color:var(--error); white-space:nowrap; }
.foody-cartbar { flex-shrink:0; background:var(--white); border-top:1px solid var(--gray); }
.foody-cartbar.hidden { display:none; }
.foody-cart-sum { display:flex; align-items:center; gap:8px; padding:10px 14px; cursor:pointer; font-size:14px; font-weight:600; color:var(--secondary); }
.foody-cart-sum i.fa-shopping-basket { color:var(--primary); }
.foody-cart-sum b { color:var(--primary); margin-left:auto; }
.foody-cart-checkout { border:none; background:var(--primary); color:#fff; border-radius:999px; padding:6px 12px; font-size:13px; font-weight:700; cursor:pointer; font-family:inherit; }
.foody-cart-list { display:none; max-height:160px; overflow-y:auto; padding:0 14px 8px; overscroll-behavior:contain; }
.foody-cartbar.expanded .foody-cart-list { display:block; }
.foody-cart-item { display:flex; align-items:center; gap:8px; font-size:13px; padding:5px 0; border-top:1px dashed var(--gray); }
.foody-cart-item span { flex:1; }
.foody-cart-item button { border:none; background:none; color:var(--error); cursor:pointer; font-size:14px; width:28px; height:28px; flex-shrink:0; }
.foody-input { display:flex; align-items:flex-end; gap:8px; padding:10px 12px; background:var(--white); border-top:1px solid var(--gray); flex-shrink:0; }
.foody-input textarea { flex:1; resize:none; border:1px solid var(--gray); border-radius:20px; padding:9px 14px; font-family:inherit; font-size:15px; line-height:1.35; max-height:110px; outline:none; background:var(--light-gray); }
.foody-input textarea { min-height:40px; }
.foody-form { width:100%; min-width:270px; background:var(--white); border:1px solid var(--gray); border-radius:var(--radius-md); padding:12px 14px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:6px; }
.foody-form [hidden] { display:none !important; }
.foody-form-title { display:flex; align-items:center; gap:8px; font-weight:700; color:var(--secondary); font-size:15px; margin-bottom:4px; }
.foody-form-title b { margin-left:auto; color:var(--primary); }
.foody-label { font-size:12px; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:.3px; margin-top:6px; }
.foody-phone { display:flex; gap:6px; }
.foody-form select, .foody-form input[type=tel], .foody-form input[type=text] { border:1px solid var(--gray); border-radius:var(--radius-sm); padding:9px 10px; font-family:inherit; font-size:16px; background:var(--light-gray); color:var(--text); outline:none; min-width:0; }
.foody-form select:focus, .foody-form input:focus { border-color:var(--primary); background:#fff; }
.foody-phone select { flex:0 0 92px; font-size:14px; }
.foody-phone input { flex:1; }
.foody-radios { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:14px; }
.foody-radios.col { flex-direction:column; gap:6px; }
.foody-radios label, .foody-check { display:flex; align-items:center; gap:6px; cursor:pointer; }
.foody-radios input, .foody-check input { accent-color:var(--primary); width:17px; height:17px; margin:0; }
.foody-radios .fa-whatsapp { color:#25D366; } .foody-radios .fa-telegram { color:#229ED9; }
.foody-seg { display:flex; background:var(--light-gray); border-radius:999px; padding:3px; margin-top:8px; }
.foody-seg button { flex:1; border:none; background:none; border-radius:999px; padding:8px; font-family:inherit; font-size:14px; font-weight:600; color:var(--text-light); cursor:pointer; }
.foody-seg button.active { background:var(--white); color:var(--secondary); box-shadow:var(--shadow-sm); }
.foody-delivery { display:flex; flex-direction:column; gap:6px; margin-top:4px; }
.foody-check { font-size:14px; flex-wrap:wrap; }
.foody-check a { color:var(--accent); font-weight:600; }
.foody-geo-inline { align-self:flex-start; border:1px dashed var(--accent); background:rgba(56,178,172,.08); color:var(--accent); border-radius:999px; padding:7px 12px; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.foody-hint { font-size:12px; color:var(--text-light); line-height:1.35; }
.foody-cash { display:flex; align-items:center; gap:8px; font-size:14px; }
.foody-cash select { flex:1; font-size:14px; }
.foody-err { font-size:12px; color:var(--error); font-weight:600; }
.foody-err:empty { display:none; }
.foody-submit { margin-top:8px; border:none; border-radius:999px; background:var(--success); color:#fff; padding:12px; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; box-shadow:var(--shadow-md); }
.foody-submit:disabled { opacity:.7; cursor:default; }
.foody-form-done { background:rgba(72,187,120,.12) !important; color:var(--success) !important; font-weight:600; }
.foody-input textarea::placeholder { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.foody-input textarea:focus { border-color:var(--primary); background:#fff; }
.foody-geo-btn, .foody-send { width:40px; height:40px; border:none; border-radius:50%; cursor:pointer; flex-shrink:0; font-size:16px; }
.foody-geo-btn { background:var(--light-gray); color:var(--accent); }
.foody-send { background:var(--primary); color:#fff; }
.foody-send:disabled { opacity:.5; cursor:default; }
@media (max-width:768px) {
  /* круглая кнопка без подписи — не перекрывает другие плашки внизу экрана */
  .foody-launcher { right:14px; bottom:80px; width:54px; height:54px; padding:0; justify-content:center; }
  .foody-launcher > span:not(.foody-launcher-icon):not(.foody-launcher-dot) { display:none; }
  .foody-launcher-icon { width:54px; height:54px; background:none; font-size:22px; }
  .foody-launcher-dot { top:3px; left:auto; right:3px; }
  .foody-teaser { right:14px; bottom:146px; max-width:calc(100vw - 28px); }

  /* окно на весь экран; высоту и верх по видимой области (с клавиатурой) ставит JS */
  .foody-chat { left:0; right:0; top:0; bottom:auto; width:100%; max-width:100vw; height:100%; height:100dvh; border-radius:0; overscroll-behavior:contain; transform-origin:bottom center; }
  .foody-head { padding-top:calc(12px + env(safe-area-inset-top, 0px)); }
  .foody-input { padding-bottom:calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* 16px — иначе iPhone увеличивает страницу при фокусе на поле */
  .foody-input textarea, .foody-form select, .foody-form input, .foody-phone select, .foody-cash select { font-size:16px; }
  .foody-form, .foody-dishes { min-width:0; }
  .foody-msg { max-width:94%; }
  body.foody-open { overflow:hidden; }
}
/* без увеличения страницы по двойному касанию (быстрые нажатия «отправить», «+» и т.п.) */
.foody-chat, .foody-chat *, .foody-launcher, .foody-teaser, .foody-inline, .foody-inline * { touch-action:manipulation; }
@media (prefers-reduced-motion:reduce) { .foody-typing i { animation:none; } }
/* ===== Запомненный контакт ===== */
.fv-field { position:relative; display:flex; flex:1 1 auto; min-width:0; width:100%; }
.fv-field > input { flex:1 1 auto; min-width:0; width:100%; padding-right:38px !important; }
.fv-clear { position:absolute; right:8px; top:50%; transform:translateY(-50%); width:26px; height:26px; border:none; border-radius:50%; background:rgba(45,55,72,.08); color:#4A5568; cursor:pointer; display:grid; place-items:center; font-size:17px; line-height:1; padding:0; z-index:1; }
.fv-clear:hover { background:var(--primary); color:#fff; }
.fv-clear[hidden] { display:none; }
.fv-prefill { background:#FFF8F4 !important; border-color:var(--primary) !important; }
.fv-flash { animation:fvFlash 1.6s ease; }
@keyframes fvFlash { 0% { box-shadow:0 0 0 0 rgba(255,107,53,.55); } 30% { box-shadow:0 0 0 6px rgba(255,107,53,.22); } 100% { box-shadow:0 0 0 0 rgba(255,107,53,0); } }
.fv-prefill-banner { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; padding:10px 14px; margin-bottom:14px; border-radius:12px; background:linear-gradient(90deg, #FFEADF, #FFF6F1); color:var(--secondary); font-size:14px; font-weight:600; animation:fvSlide .45s ease; }
.fv-prefill-banner button { margin-left:auto; border:none; background:none; color:#E85A26; font:inherit; font-size:13px; font-weight:700; cursor:pointer; text-decoration:underline; text-underline-offset:3px; padding:0; }
.foody-form .fv-prefill-banner { margin:0 0 4px; padding:8px 10px; font-size:13px; }
@keyframes fvSlide { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

/* ===== Foody внизу меню ===== */
.foody-inline { max-width:720px; margin:48px auto 8px; background:var(--white); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); overflow:hidden; border:1px solid var(--gray); }
.foody-inline-head { display:flex; align-items:center; gap:10px; padding:14px 18px; background:linear-gradient(135deg, var(--secondary), var(--secondary-light)); color:#fff; }
.foody-inline-head strong { display:block; font-size:16px; line-height:1.2; }
.foody-inline-head span { display:block; font-size:12px; opacity:.85; }
.foody-inline-head span::before { content:''; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--success); margin-right:5px; vertical-align:middle; }
.foody-inline-body { padding:18px 18px 8px; display:flex; flex-direction:column; align-items:flex-start; gap:10px; min-height:92px; background:var(--light); }
.foody-inline-body .foody-typing[hidden], .foody-inline-msg[hidden], .foody-inline-chips[hidden] { display:none; }
.foody-inline-msg { max-width:92%; padding:12px 16px; border-radius:18px; border-bottom-left-radius:4px; background:var(--white); color:var(--text); font-size:15px; line-height:1.45; box-shadow:var(--shadow-sm); }
.foody-inline-chips { display:flex; flex-wrap:wrap; gap:8px; }
.foody-inline .pop { animation:foodyPop .45s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes foodyPop { from { opacity:0; transform:translateY(10px) scale(.96); } to { opacity:1; transform:none; } }
.foody-inline-input { display:flex; gap:8px; padding:12px 14px 14px; background:var(--light); }
.foody-inline-input input { flex:1; min-width:0; height:46px; padding:0 16px; border:1px solid var(--gray); border-radius:999px; font:inherit; font-size:16px; background:var(--white); outline:none; }
.foody-inline-input input:focus { border-color:var(--primary); }
.foody-inline-input button { width:46px; height:46px; flex-shrink:0; border:none; border-radius:50%; background:var(--primary); color:#fff; font-size:16px; cursor:pointer; }
body.foody-inline-on .foody-launcher, body.foody-inline-on .foody-teaser { opacity:0; pointer-events:none; transform:scale(.85); }
@media (max-width:768px) { .foody-inline { margin:32px 0 8px; } }
@media (prefers-reduced-motion:reduce) { .fv-flash, .fv-prefill-banner, .foody-inline .pop { animation:none; } }
