/* ЖАРА — практичная версия: светлая, быстрая, корзина всегда под рукой. */

:root {
  --bg: #fff7ed;
  --card: #ffffff;
  --ink: #1f1a17;
  --muted: #6b5f57;
  --line: #f1e3d3;
  --soft: #fdeedd;
  --primary: #c2410c;      /* кнопки: белый текст, контраст 5.2:1 */
  --primary-hover: #a8380a;
  --orange: #f97316;
  --green: #16a34a;
  --error: #dc2626;

  --f: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 26, 23, .06), 0 8px 24px -12px rgba(31, 26, 23, .18);
  --shadow-hover: 0 2px 4px rgba(31, 26, 23, .06), 0 18px 40px -14px rgba(194, 65, 12, .35);
  --header-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 72px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 16px; background: var(--primary); color: #fff; border-radius: 10px; }
.skip:focus { left: 8px; }
.wrap { width: min(1280px, 100% - 32px); margin-inline: auto; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
  font: 600 16px/1 var(--f);
  transition: background-color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); box-shadow: 0 8px 18px -8px rgba(194, 65, 12, .6); }
.btn--ghost { border-color: var(--line); background: var(--card); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--soft); flex: none; transition: background-color .2s; }
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Шапка ---------- */
.header { position: sticky; top: 0; z-index: 30; background: rgba(255, 247, 237, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.logo__mark { width: 30px; height: 30px; border-radius: 9px; background: url("favicon.svg") center / cover; }
.header__meta { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.header__sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status__dot.is-closed { background: var(--error); }
.search { position: relative; flex: 1; max-width: 360px; margin-left: auto; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); font: 16px var(--f); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(194, 65, 12, .12); }
.header__phone { font-weight: 600; white-space: nowrap; transition: color .2s; }
.header__phone:hover { color: var(--primary); }

.orders-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-weight: 600; transition: border-color .2s, color .2s;
}
.orders-btn:hover { border-color: var(--primary); color: var(--primary); }
.orders-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.orders-btn__count { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- Промо ---------- */
.promos { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; padding: 22px 0 6px; }
.promo {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 22px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.promo:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.promo p:not([class]) { color: var(--muted); font-size: 15px; }
.promo__big { font-size: 34px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.promo--main { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 0 26px; overflow: hidden; background: var(--ink); color: #fff; min-height: 150px; }
.promo--main img { width: 42%; height: 100%; object-fit: cover; align-self: stretch; transition: transform .6s var(--ease); }
.promo--main:hover img { transform: scale(1.06); }
.promo__kicker { color: #fdba74; font-size: 14px; font-weight: 600; }
.promo__title { margin: 4px 0 10px; font-size: 22px; font-weight: 700; line-height: 1.25; }
.promo__link { font-weight: 600; font-size: 15px; }

/* ---------- Категории ---------- */
.cats { position: sticky; top: var(--header-h); z-index: 20; padding: 12px 0; background: rgba(255, 247, 237, .94); backdrop-filter: blur(12px); }
.cats__row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.cats__row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; height: 42px; padding: 0 18px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-weight: 500; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Раскладка ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; padding-bottom: 60px; }

/* ---------- Меню ---------- */
.cat { padding-top: 22px; }
.cat h2 { margin-bottom: 16px; font-size: 26px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.item {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s;
  animation: rise .45s var(--ease) both;
}
.item:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-hover); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.item__img { position: relative; display: block; width: 100%; aspect-ratio: 5 / 4; overflow: hidden; background: var(--soft); }
.item__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.item:hover .item__img img { transform: scale(1.07); }
.badge { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.badge--new { color: var(--green); }
.badge--spicy { background: var(--error); color: #fff; }
.item__body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 14px 16px 16px; }
.item__name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.item__desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.item__weight { color: var(--muted); font-size: 13px; }
.item__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.item__price { font-size: 18px; font-weight: 700; }
.item__price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.add { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 40px; padding: 0 16px; border-radius: 12px; background: var(--soft); color: var(--primary); font-weight: 600; transition: background-color .2s, color .2s; }
.add:hover { background: var(--primary); color: #fff; }
.qty { display: inline-flex; align-items: center; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; animation: pop .3s var(--ease); }
.qty button { width: 38px; height: 40px; font-size: 20px; font-weight: 500; border-radius: 12px; transition: background-color .15s; }
.qty button:hover { background: rgba(255, 255, 255, .15); }
.qty output { min-width: 22px; text-align: center; font-weight: 700; }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.nothing { padding: 40px 0; color: var(--muted); font-size: 17px; }

/* ---------- Корзина ---------- */
.cart {
  position: sticky; top: calc(var(--header-h) + 76px);
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 96px);
  margin-top: 22px;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  overflow: hidden;
}
.cart__head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.cart__head h2 { margin-right: auto; font-size: 22px; font-weight: 700; }
.cart__close { display: none; }
.cart__step { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.cart__foot { padding: 14px 20px 20px; border-top: 1px solid var(--line); background: var(--card); }
.empty { display: grid; justify-items: center; gap: 4px; padding: 20px 24px 30px; text-align: center; color: var(--muted); }
.empty img { width: 120px; height: 96px; object-fit: cover; border-radius: 16px; margin-bottom: 8px; opacity: .9; }
.empty b { color: var(--ink); font-size: 17px; }
.lines { padding: 0 20px; }
.line-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); animation: rise .3s var(--ease) both; }
.line-item img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.line-item__name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.line-item__sub { color: var(--muted); font-size: 13px; }
.line-item .qty { height: 34px; background: var(--soft); color: var(--ink); animation: none; }
.line-item .qty button { width: 32px; height: 34px; font-size: 18px; }
.line-item .qty button:hover { background: var(--line); }
.free { margin-bottom: 12px; }
.free p { font-size: 14px; margin-bottom: 6px; }
.free p b { color: var(--primary); }
.free__bar { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.free__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--orange); transition: width .5s var(--ease); }
.sum { display: grid; gap: 4px; margin-bottom: 12px; }
.sum div { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; }
.sum dd { color: var(--ink); font-weight: 500; }
.sum .sum__total { margin-top: 4px; font-size: 19px; color: var(--ink); font-weight: 700; }
.sum .sum__total dd { font-weight: 700; }
.hint { margin-bottom: 10px; color: var(--primary); font-size: 14px; }
.bump { animation: pop .35s var(--ease); }

/* ---------- Доставка / самовывоз ---------- */
.mode { margin: 0 20px 6px; }
.mode span { flex-direction: column; gap: 0; padding: 8px 10px; line-height: 1.2; }
.mode span small { display: block; margin-top: 2px; }
.addr { display: grid; gap: 12px; }
.pickup-info { display: grid; gap: 4px; padding: 14px; border-radius: var(--r-sm); background: var(--soft); font-size: 15px; }

/* ---------- Форма ---------- */
.form { gap: 12px; padding: 4px 20px 0; }
.form .cart__foot { margin: 6px -20px 0; position: sticky; bottom: 0; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-size: 14px; font-weight: 500; color: var(--muted); }
.field legend { margin-bottom: 6px; }
.field .opt { opacity: .7; }
.field input:not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
  font: 16px var(--f); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(194, 65, 12, .12); background: #fff; }
.field.is-invalid input { border-color: var(--error); }
.field--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.field--row > div { display: grid; gap: 6px; min-width: 0; }
.err { color: var(--error); font-size: 13px; }
.err:empty { display: none; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: grid; place-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg); font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: border-color .2s, background-color .2s, color .2s;
}
.seg span small { color: var(--muted); font-size: 12px; }
.seg label:hover span { border-color: var(--primary); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:checked + span small { color: rgba(255, 255, 255, .7); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.form__error { color: var(--error); font-size: 14px; margin-bottom: 8px; }
.form__error:empty { display: none; }

.done { align-items: center; gap: 10px; padding: 24px 24px 30px; text-align: center; }
.done__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 32px; font-weight: 700; animation: pop .5s var(--ease); }
.done h3 { font-size: 22px; }
.done p { color: var(--muted); }

/* ---------- Окно опций ---------- */
.modal { width: min(440px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(31, 26, 23, .35); }
.modal::backdrop { background: rgba(31, 26, 23, .45); }
.modal[open] { animation: modal-in .3s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.modal__inner { position: relative; }
.modal__close { position: absolute; right: 12px; top: 12px; background: rgba(255, 255, 255, .9); }
.modal__img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.modal__body { display: grid; gap: 12px; padding: 20px 22px 22px; }
.modal__body h2 { font-size: 24px; }

/* ---------- Мои заказы ---------- */
.track { width: min(540px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(31, 26, 23, .35); }
.track::backdrop { background: rgba(31, 26, 23, .45); }
.track[open] { animation: modal-in .3s var(--ease); }
.t-inner { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.t-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 2px; }
.t-top h2 { font-size: 22px; font-weight: 700; }
.t-close { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); font-size: 16px; }
.t-close:hover { background: var(--line); }
.t-time { padding: 0 20px 10px; color: var(--muted); font-size: 13px; }
.t-body { display: grid; gap: 12px; padding: 0 20px 20px; overflow-y: auto; }
.t-empty { padding: 28px 0; color: var(--muted); text-align: center; }
.t-warn { padding: 10px 12px; border-radius: 12px; background: #fee2e2; color: var(--error); font-size: 14px; }
.t-order { display: grid; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.t-order.is-active { border-color: #fdba74; }
.t-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.t-head h3 { font-size: 18px; }
.t-badge { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--primary); color: #fff; }
.t-badge--done { background: var(--green); }
.t-badge--cancelled { background: var(--error); }
.t-meta { color: var(--muted); font-size: 14px; margin-top: -2px; }
.t-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; }
.t-steps li { padding-top: 8px; border-top: 4px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.25; }
.t-steps li.is-done { border-color: var(--orange); }
.t-steps li.is-current { border-color: var(--primary); color: var(--ink); font-weight: 700; }
.t-note { font-weight: 500; }
.t-items { margin: 0; padding: 10px 12px; list-style: none; border-radius: 12px; background: var(--card); font-size: 15px; }
.t-items li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.t-total { color: var(--muted); font-size: 14px; }
.t-total b { color: var(--ink); font-size: 17px; }

/* ---------- Нижняя панель (телефон) ---------- */
.cartbar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(31, 26, 23, .45); }

/* ---------- Подвал ---------- */
.footer { padding: 28px 0 40px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.footer__inner .logo { font-size: 20px; margin-bottom: 4px; }
.footer__right { display: grid; gap: 4px; justify-items: end; font-size: 15px; }
.footer__right a:hover { color: var(--primary); }
.footer__order { color: var(--primary); font-weight: 600; }

.toast {
  position: fixed; left: 50%; top: calc(var(--header-h) + 14px); z-index: 60;
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; font-size: 15px;
  white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 12px 30px rgba(31, 26, 23, .3);
  transform: translate(-50%, -12px); opacity: 0; visibility: hidden;
  transition: transform .3s var(--ease), opacity .3s, visibility 0s .3s;
  pointer-events: none;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .3s var(--ease), opacity .3s; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .header__meta { display: none; }
  .layout { grid-template-columns: 1fr; }
  .cart {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50;
    max-height: 88vh; margin: 0; border-radius: 22px 22px 0 0;
    transform: translateY(105%); visibility: hidden;
    transition: transform .4s var(--ease), visibility 0s .4s;
  }
  .cart.is-open { transform: none; visibility: visible; transition: transform .4s var(--ease); }
  .cart__close { display: grid; }
  .cartbar {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 35;
    display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px;
    border-radius: 16px; background: var(--primary); color: #fff; font-weight: 600;
    box-shadow: 0 12px 30px -8px rgba(194, 65, 12, .6);
    animation: rise .35s var(--ease);
  }
  .cartbar[hidden] { display: none; }
  .cartbar b { margin-left: auto; font-size: 17px; }
  .cartbar__count { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: rgba(255, 255, 255, .2); }
  body:has(.cartbar:not([hidden])) .footer { padding-bottom: 100px; }
}
@media (max-width: 760px) {
  .header__phone { display: none; }
  .orders-btn__text { display: none; }
  .orders-btn { padding: 0 11px; }
  .header__inner { gap: 12px; }
  .search { max-width: none; }
  .logo { font-size: 0; gap: 0; }
  .logo__mark { width: 36px; height: 36px; }
  .promos { grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 14px; }
  .promo--main { grid-column: 1 / -1; min-height: 120px; padding-left: 18px; }
  .promo__title { font-size: 17px; }
  .promo { padding: 14px; }
  .promo__big { font-size: 24px; }
  .promo p:not([class]) { font-size: 13px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .item__body { padding: 10px 12px 12px; }
  .item__name { font-size: 15px; }
  .item__desc { display: none; }
  .item__foot { flex-wrap: wrap; }
  .item__price { font-size: 16px; }
  .item:hover { transform: none; }
  .footer__right { justify-items: start; }
  .cat h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Водяной знак демо-сайта */
.watermark {
  position: fixed; inset: 0; z-index: 9989; pointer-events: none; user-select: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='220'%3E%3Ctext x='180' y='120' fill='%231f1a17' font-family='monospace' font-size='18' font-weight='700' letter-spacing='2' text-anchor='middle' transform='rotate(-24 180 110)'%3E@sorators · DEMO%3C/text%3E%3C/svg%3E");
}
