/* ============================================================
   Общие
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #23201c;
  background: #faf8f5;
}
img { max-width: 100%; display: block; }
a { color: #b34700; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Шапка сайта
   ============================================================ */
.site-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 12px 22px;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.site-bar .brand { font-weight: 700; font-size: 18px; color: #23201c; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: #444; font-weight: 500; }
.site-nav .cart-link { position: relative; }
.site-nav .hello { color: #888; font-size: 13px; }
.cart-badge {
  display: inline-block; min-width: 20px; padding: 1px 7px;
  margin-left: 4px; background: #b34700; color: #fff;
  border-radius: 999px; font-size: 12px; text-align: center;
  vertical-align: middle;
}
.inline-form { display: inline; margin: 0; }
.link-btn {
  background: none; border: 0; padding: 0; color: #b34700;
  cursor: pointer; font: inherit;
}
.link-btn:hover { text-decoration: underline; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 340px;
  display: grid; place-items: center;
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.6)),
              url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=1600") center/cover;
  color: #fff; text-align: center; padding: 60px 20px;
}
.hero h1 { font-size: clamp(32px, 5vw, 58px); margin: 0 0 12px; letter-spacing: .5px; }
.hero p  { font-size: clamp(15px, 2vw, 20px); opacity: .9; margin: 0 0 26px; }

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
  display: inline-block; padding: 12px 26px; border: 0; cursor: pointer;
  background: #b34700; color: #fff; border-radius: 8px;
  font-size: 15px; font-weight: 600; transition: .2s;
}
.btn:hover { background: #8f3800; text-decoration: none; }
.btn.ghost { background: #eee; color: #333; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { background: #c0392b; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   Публичное меню
   ============================================================ */
main { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }
.category { margin-bottom: 50px; }
.category h2 {
  font-size: 26px; margin: 0 0 22px; padding-bottom: 10px;
  border-bottom: 2px solid #b34700; display: inline-block;
}
.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); transition: .25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.12); }
.card__img { height: 190px; background: #f1ede8; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { height: 100%; display: grid; place-items: center; font-size: 44px; opacity: .35; }
.card__body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.card__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card__top h3 { margin: 0; font-size: 18px; }
.price { color: #b34700; font-weight: 700; white-space: nowrap; }
.weight { font-size: 13px; color: #888; margin-top: 4px; }
.comp { font-size: 14px; color: #555; margin: 10px 0 0; }

/* Кнопка «В корзину» на карточке */
.btn-add { width: 100%; margin-top: auto; padding-top: 12px; margin-top: 12px; }
.add-form { margin: 0; }

.empty { text-align: center; padding: 60px 20px; color: #777; }

/* ============================================================
   О нас / Контакты / Футер
   ============================================================ */
.about, .contacts {
  max-width: 1100px; margin: 0 auto 50px; padding: 0 20px;
}
.about h2, .contacts h2 { font-size: 24px; margin-bottom: 14px; }
.contacts__grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.contacts__grid > div {
  background: #fff; padding: 16px 18px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.contacts__grid span { display: block; font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: .5px; }
.contacts__grid b { display: block; margin-top: 4px; font-weight: 600; }

footer {
  text-align: center; padding: 26px 20px; color: #888; font-size: 14px;
  border-top: 1px solid #eee;
}

/* ============================================================
   Auth-страницы (вход/регистрация)
   ============================================================ */
.auth-page { max-width: 420px; margin: 60px auto; padding: 0 20px; }
.auth-box {
  background: #fff; padding: 28px; border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.auth-box h1 { margin: 0 0 18px; font-size: 22px; }
.auth-box label {
  display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600;
}
.auth-box input {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #d9d4cd; border-radius: 8px; font: inherit;
}
.auth-box .btn { width: 100%; margin-top: 6px; }

/* ============================================================
   Корзина
   ============================================================ */
.cart-page { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.cart-page h1 { margin: 0 0 24px; }
.cart-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.cart-table th, .cart-table td {
  padding: 12px 14px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid #f0ece6;
}
.cart-table th { background: #faf7f3; font-size: 13px; color: #777; font-weight: 600; }
.cart-table tr:last-child td { border-bottom: 0; }
.cart-img img, .noimg.small {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
}
.noimg.small { background: #f1ede8; display: grid; place-items: center; }
.cart-table .num { white-space: nowrap; text-align: right; }
.cart-table .qty-cell { text-align: center; }
.qty-form { display: inline-flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 28px; height: 28px; padding: 0; border: 1px solid #d9d4cd;
  border-radius: 6px; background: #fff; cursor: pointer; font: inherit;
}
.qty-btn:hover { background: #f6f3ee; }
.qty-val { min-width: 22px; text-align: center; display: inline-block; }
.remove-form { margin: 0; }

.cart-summary {
  margin-top: 22px; padding: 18px 20px; background: #fff;
  border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.cart-summary .total { font-size: 20px; color: #b34700; }
.cart-actions { display: flex; gap: 10px; }
.cart-actions form { margin: 0; }

/* ============================================================
   Админка
   ============================================================ */
body.admin { background: #f3f1ee; }
.admin-bar {
  background: #23201c; color: #fff; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 10;
}
.admin-bar nav a { color: #ffb27a; margin-left: 18px; font-size: 14px; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
  padding: 10px 18px; border-radius: 8px; background: #fff; color: #444;
  font-weight: 600; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.tabs a.active { background: #b34700; color: #fff; }
.tabs a:hover { text-decoration: none; }

.two-col {
  display: grid; gap: 24px;
  grid-template-columns: minmax(320px, 460px) 1fr;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: #fff; border-radius: 14px; padding: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.panel.narrow { max-width: 460px; }
.panel h2 { margin: 0 0 18px; font-size: 19px; }

.form label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: #444; }
.form input[type=text], .form input[type=number], .form input[type=password],
.form input:not([type]), .form textarea, .form input[type=file] {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #d9d4cd; border-radius: 8px; font: inherit; font-weight: 400;
  background: #fdfcfa;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid #ffcaa6; border-color: #b34700; }
.form .row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 620px) { .form .row { grid-template-columns: 1fr; } }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form .check input { width: auto; margin: 0; }
.actions { display: flex; gap: 10px; margin-top: 6px; }

.thumb { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; }
.thumb img { width: 90px; height: 70px; object-fit: cover; border-radius: 8px; }
.thumb span { font-size: 12px; color: #999; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.ok  { background: #e5f6ea; color: #1d6b32; border: 1px solid #b9e3c4; }
.alert.err { background: #fdeaea; color: #a01f1f; border: 1px solid #f3c2c2; }

.dish-list { display: flex; flex-direction: column; gap: 10px; }
.dish-row {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 1px solid #eee; border-radius: 10px; background: #fdfcfa;
}
.dish-row.off { opacity: .5; }
.dish-row__img {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  background: #f1ede8; display: grid; place-items: center; flex: 0 0 auto;
}
.dish-row__img img { width: 100%; height: 100%; object-fit: cover; }
.dish-row__main { flex: 1; min-width: 0; }
.dish-row__main b { display: block; font-size: 15px; }
.dish-row__main small { color: #888; font-size: 12.5px; }
.dish-row__actions { display: flex; gap: 6px; }

.hint { font-size: 13px; color: #888; }

/* ============================================================
   Страница входа в админку
   ============================================================ */
body.login-page {
  display: grid; place-items: center; min-height: 100vh;
  background: linear-gradient(135deg, #2b2521, #4a3b30); margin: 0;
}
.login-box {
  background: #fff; padding: 32px 30px; border-radius: 16px;
  width: min(380px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.login-box h1 { margin: 0 0 20px; font-size: 20px; }
.login-box label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.login-box input {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #d9d4cd; border-radius: 8px; font: inherit;
}
.login-box .btn { width: 100%; }

/* ============================================================
   Тост-уведомления
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: #23201c; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #c0392b; }
/* ============================================================
   Checkout + Success + Admin Orders
   ============================================================ */
.checkout-page { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.checkout-page h1 { margin: 0 0 24px; }

.checkout-grid {
  display: grid; gap: 24px;
  grid-template-columns: 1fr 380px;
}
@media (max-width: 800px) { .checkout-grid { grid-template-columns: 1fr; } }

.checkout-form {
  background: #fff; padding: 22px; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.checkout-form select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #d9d4cd; border-radius: 8px; font: inherit;
  background: #fdfcfa;
}

.checkout-side {
  background: #fff; padding: 22px; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  align-self: flex-start; position: sticky; top: 80px;
}
.checkout-side h2 { margin: 0 0 16px; font-size: 18px; }

.cart-table--compact { box-shadow: none; border: 1px solid #f0ece6; }
.cart-table--compact th, .cart-table--compact td { padding: 8px 10px; font-size: 14px; }

.success-box {
  max-width: 640px; margin: 0 auto; background: #fff;
  padding: 32px; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  text-align: center;
}
.success-box h1 { margin: 0 0 12px; color: #1d6b32; font-size: 22px; }
.success-box h2 { margin: 24px 0 12px; font-size: 18px; text-align: left; }
.success-box .cart-table--compact { text-align: left; }

/* Подтабы заказов */
.tabs--sub { font-size: 13px; }
.tabs--sub a { padding: 6px 12px; }

/* Статусы */
.status {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status--new        { background: #fff3cd; color: #856404; }
.status--confirmed  { background: #cfe2ff; color: #084298; }
.status--cooking    { background: #ffe5b4; color: #8a4b00; }
.status--delivering { background: #d1ecf1; color: #0c5460; }
.status--done       { background: #d1e7dd; color: #0f5132; }
.status--cancelled  { background: #f8d7da; color: #842029; }

/* Карточка заказа в админке */
.order-meta {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}
.order-meta > div {
  padding: 10px 14px; background: #fdfcfa; border-radius: 10px;
  border: 1px solid #f0ece6;
}
.order-meta span {
  display: block; font-size: 11px; color: #999;
  text-transform: uppercase; letter-spacing: .5px;
}
.order-meta b { display: block; margin-top: 2px; font-weight: 600; }

.back-link { display: inline-block; margin-bottom: 12px; font-size: 14px; }