/* ============================================================
   Море Хинкали — стили
   Палитра в духе живописи Нико Пиросмани (грузинский примитив):
   тёмный фон ночи, охра/золото, винный красный, оливковая зелень.
   ============================================================ */

:root {
  --ink:        #17120D;  /* почти чёрный фон Пиросмани */
  --ink-2:      #221A12;  /* панель/карточка на тёмном */
  --ink-3:      #2C2218;
  --paper:      #F4ECD8;  /* бумага меню */
  --paper-2:    #EBE0C7;
  --cream:      #FBF6EA;
  --gold:       #C8923D;  /* охра/золото */
  --gold-soft:  #E0B05A;
  --wine:       #8C2F2A;  /* грузинское вино */
  --wine-deep:  #6E231F;
  --olive:      #6E754A;  /* зелень акварельных пейзажей */
  --muted:      #8C7C63;
  --line:       rgba(140,124,99,.32);
  --line-dark:  rgba(244,236,216,.14);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 18px 40px -22px rgba(0,0,0,.55);

  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: #2A2018;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap { width: min(1140px, 92vw); margin-inline: auto; }

.main { min-height: 50vh; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(23,18,13,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-dark);
  color: var(--cream);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 68px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--cream); }
.brand__logo { height: 44px; width: auto; display: block; border-radius: 10px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.6); }
@media (max-width: 560px){ .brand__logo { height: 36px; } }
.brand__mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1.5px solid var(--gold); color: var(--gold);
  border-radius: 50%; font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: .02em;
}
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1; display: flex; flex-direction: column; }
.brand__ka { font-family: var(--body); font-weight: 500; font-size: .62rem; letter-spacing: .18em; color: var(--gold); text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 1.1rem; }
.nav__link {
  text-decoration: none; color: var(--cream); font-weight: 600; font-size: .92rem;
  opacity: .82; transition: opacity .15s, color .15s; background: none; border: 0; cursor: pointer;
  font-family: var(--body); padding: 0;
}
.nav__link:hover { opacity: 1; color: var(--gold-soft); }
.nav__link.is-active { opacity: 1; color: var(--gold); }
.nav__logout { margin: 0; }

.cart-pill {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  color: var(--ink); background: var(--gold); text-decoration: none;
  width: 42px; height: 42px; justify-content: center; border-radius: 50%;
  transition: transform .15s, background .15s;
}
.cart-pill:hover { background: var(--gold-soft); transform: translateY(-1px); }
.cart-pill__count {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px;
  background: var(--wine); color: #fff; border-radius: 999px; font-size: .72rem;
  font-weight: 800; display: grid; place-items: center; padding: 0 5px;
  border: 2px solid var(--ink);
}
.cart-pill__count[hidden] { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 60; padding: .7rem 1.2rem; border-radius: 999px;
  font-weight: 700; font-size: .9rem; box-shadow: var(--shadow);
  animation: toastIn .3s ease, toastOut .4s ease 3.4s forwards;
}
.toast--ok { background: var(--olive); color: #fff; }
.toast--err { background: var(--wine); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -12px); } }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 120% at 70% -10%, rgba(200,146,61,.18), transparent 55%),
    var(--ink);
  color: var(--cream); position: relative; overflow: hidden;
}
.hero__inner { padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(3rem, 7vw, 4.5rem); position: relative; z-index: 2; }
.hero__eyebrow {
  font-weight: 700; letter-spacing: .26em; text-transform: uppercase;
  font-size: .72rem; color: var(--gold); margin-bottom: 1rem;
}
.hero__title {
  font-family: var(--display); font-weight: 700; line-height: .98;
  font-size: clamp(3rem, 11vw, 6.6rem); margin: 0; letter-spacing: -.01em;
}
.hero__ka { font-family: var(--display); font-weight: 500; font-style: italic; color: var(--gold-soft); font-size: clamp(1.2rem, 4vw, 2rem); margin-top: .3rem; }
.hero__lead { max-width: 38ch; margin: 1.4rem 0 2rem; color: rgba(251,246,234,.82); font-size: 1.05rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 1.4rem 2.2rem; }
.hero__meta-item { display: flex; flex-direction: column; gap: .15rem; }
.hero__meta-label { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.hero__meta-val { font-size: 1rem; color: var(--cream); font-weight: 600; }
.hero__meta-val a { text-decoration: none; }
.hero__meta-star { color: var(--gold); }
.hero__note { margin: 1.1rem 0 0; font-size: .82rem; color: rgba(251,246,234,.6); }
.hero__band {
  position: absolute; inset-inline: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--wine), var(--gold), var(--olive), var(--wine));
  opacity: .9;
}

/* ---------- Category nav (sticky) ---------- */
.catnav {
  position: sticky; top: 68px; z-index: 30; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.catnav__inner { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0; scrollbar-width: none; }
.catnav__inner::-webkit-scrollbar { display: none; }
.catnav__link {
  white-space: nowrap; text-decoration: none; font-weight: 700; font-size: .9rem;
  color: #5A4B36; padding: .45rem .9rem; border-radius: 999px; transition: all .15s;
  border: 1px solid transparent;
}
.catnav__link:hover { background: var(--paper-2); }
.catnav__link.is-active { background: var(--ink); color: var(--gold); }

/* ---------- Menu ---------- */
.menu { padding: 2.6rem 0 5rem; }
.menu__category { margin-bottom: 3.2rem; scroll-margin-top: 130px; }
.cat-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.4rem; padding-bottom: .8rem; border-bottom: 2px solid var(--ink); }
.cat-head__title { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.7rem); margin: 0; color: var(--ink); line-height: 1; }
.cat-head__ka { font-family: var(--display); font-style: italic; color: var(--wine); font-size: 1.05rem; margin-left: auto; opacity: .85; }

.dish {
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline;
  gap: .4rem 1rem; padding: .85rem 0; border-bottom: 1px dotted var(--line);
}
.dish__main { display: flex; flex-direction: column; }
.dish__name { font-weight: 700; font-size: 1.08rem; color: #241B12; }
.dish__desc { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.dish__weight { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; align-self: center; }
.dish__right { display: flex; align-items: center; gap: .8rem; }
.dish__price { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--wine); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dish__price small { font-family: var(--body); font-size: .85rem; font-weight: 700; }

.add-btn {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1.5px solid var(--gold);
  background: transparent; color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: all .15s; font-weight: 600;
}
.add-btn:hover { background: var(--gold); transform: scale(1.06); }
.add-btn:active { transform: scale(.94); }
.add-btn.is-added { background: var(--olive); border-color: var(--olive); color: #fff; }

/* ---------- Sticky cart bar (mobile/all) ---------- */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 35;
  width: min(560px, 92vw); background: var(--ink); color: var(--cream);
  border-radius: 999px; padding: .55rem .65rem .55rem 1.4rem; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: transform .25s, opacity .25s;
}
.cartbar[hidden] { display: none; }
.cartbar.is-hidden { transform: translate(-50%, 120%); opacity: 0; }
.cartbar__info { display: flex; flex-direction: column; line-height: 1.15; }
.cartbar__count { font-size: .72rem; color: var(--gold); font-weight: 700; letter-spacing: .04em; }
.cartbar__total { font-weight: 800; font-size: 1.1rem; }
.cartbar__btn {
  background: var(--gold); color: var(--ink); text-decoration: none; font-weight: 800;
  padding: .7rem 1.5rem; border-radius: 999px; font-size: .95rem;
}
.cartbar__btn:hover { background: var(--gold-soft); }

/* ---------- Generic page ---------- */
.page { padding: 2.6rem 0 4rem; }
.page__head { margin-bottom: 1.8rem; }
.page__title { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 6vw, 3rem); margin: 0; color: var(--ink); }
.page__sub { color: var(--muted); margin-top: .3rem; }

/* ---------- Cards / forms ---------- */
.card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.4rem; }
.card + .card { margin-top: 1.2rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; font-size: .82rem; margin-bottom: .35rem; color: #4A3C2A; letter-spacing: .01em; }
.field input, .field textarea, .field select {
  width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--body); font-size: 1rem; background: #fff; color: #2A2018;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field textarea { min-height: 80px; resize: vertical; }
.field__hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--ink); color: var(--cream); border: 0; border-radius: 999px;
  padding: .85rem 1.7rem; font-weight: 800; font-size: .98rem; cursor: pointer;
  text-decoration: none; font-family: var(--body); transition: all .15s;
}
.btn:hover { background: var(--ink-3); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-soft); }
.btn--wine { background: var(--wine); color: #fff; }
.btn--wine:hover { background: var(--wine-deep); }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--block { width: 100%; }
.btn--sm { padding: .5rem 1rem; font-size: .85rem; }

.auth { max-width: 440px; margin: 0 auto; }
.auth__alt { text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: .92rem; }
.auth__alt a { color: var(--wine); font-weight: 700; text-decoration: none; }

/* ---------- Cart ---------- */
.cart-grid { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cart-line__name { font-weight: 700; }
.cart-line__meta { font-size: .82rem; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--paper-2); }
.stepper span { min-width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-line__sum { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 80px; text-align: right; }
.cart-line__rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .82rem; }
.cart-line__rm:hover { color: var(--wine); }

.summary { background: var(--ink); color: var(--cream); border-radius: var(--r-md); padding: 1.5rem; position: sticky; top: 90px; }
.summary__row { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .95rem; color: rgba(251,246,234,.85); }
.summary__row--total { border-top: 1px solid var(--line-dark); margin-top: .5rem; padding-top: 1rem; font-size: 1.3rem; font-weight: 800; color: var(--cream); }
.summary__note { font-size: .8rem; color: var(--gold-soft); margin: .6rem 0 1.2rem; }

.empty { text-align: center; padding: 4rem 1rem; }
.empty__icon { font-size: 3rem; }
.empty__title { font-family: var(--display); font-size: 1.8rem; font-weight: 700; margin: .6rem 0 .3rem; }
.empty__text { color: var(--muted); margin-bottom: 1.4rem; }

/* ---------- Order success / history ---------- */
.success { max-width: 640px; margin: 0 auto; text-align: center; }
.success__check { width: 72px; height: 72px; margin: 0 auto 1.2rem; border-radius: 50%; background: var(--olive); color: #fff; display: grid; place-items: center; font-size: 2.2rem; }
.order-card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem 1.4rem; text-align: left; }
.order-card + .order-card { margin-top: 1rem; }
.order-card__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.order-card__id { font-weight: 800; font-size: 1.05rem; }
.order-card__date { color: var(--muted); font-size: .85rem; }
.order-items { list-style: none; padding: 0; margin: 0; }
.order-items li { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .92rem; border-bottom: 1px dotted var(--line); }
.order-card__total { margin-top: .8rem; text-align: right; font-weight: 800; font-size: 1.1rem; }

/* ---------- Badges (status) ---------- */
.badge { display: inline-block; padding: .25rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .01em; }
.badge--new { background: var(--gold); color: var(--ink); }
.badge--confirmed { background: #4C6B8A; color: #fff; }
.badge--cooking { background: var(--wine); color: #fff; }
.badge--delivering { background: #B5742A; color: #fff; }
.badge--done { background: var(--olive); color: #fff; }
.badge--cancelled { background: #6B6258; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(251,246,234,.78); padding: 3rem 0 1.5rem; margin-top: 2rem; }
.site-footer__inner { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; }
.site-footer__name { font-family: var(--display); font-weight: 700; font-size: 1.8rem; color: var(--cream); }
.site-footer__ka { font-size: .8rem; color: var(--gold); letter-spacing: .1em; margin-top: .2rem; }
.site-footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.site-footer__label { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: 800; margin-bottom: .4rem; }
.site-footer__cols p { margin: 0; font-size: .92rem; }
.site-footer__cols a { color: var(--gold-soft); text-decoration: none; }
.site-footer__bottom { border-top: 1px solid var(--line-dark); margin-top: 2rem; padding-top: 1.2rem; font-size: .8rem; color: rgba(251,246,234,.5); }

.error-page { text-align: center; padding: 5rem 1rem; }
.error-page__title { font-family: var(--display); font-size: 2.4rem; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .cart-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__cols { grid-template-columns: 1fr; }
  .nav { gap: .7rem; }
  .nav__link:not(.is-active):not(.nav__link--auth) { display: none; }
  .nav .nav__link.is-active { display: inline; }
}
@media (max-width: 560px) {
  .dish { grid-template-columns: 1fr auto; }
  .dish__weight { grid-column: 1; grid-row: 2; align-self: start; }
  .dish__right { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; gap: .5rem; }
  .cat-head__ka { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
