/* ================== БАЗА ================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff9f0; /* тёплый светлый фон */
  color: #2f2a25;
}

/* Обёртка для мобилки */
.content {
  padding: 14px;
  max-width: 480px;
  margin: 0 auto;
}

/* чтобы контент не прятался под нижней панелью */
.page-menu .content,
.page-cart .content,
.page-orders .content {
  padding-bottom: 80px;
}

/* ================== HEADER (клиент) ================== */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(90deg, #ffb347, #ff7746);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.header-light {
  background: #ffffff;
  color: #2f2a25;
  border-bottom: 1px solid #f0e3d5;
  box-shadow: none;
}

.logo-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px dashed rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.12);
}

.header-light .logo-placeholder {
  border-color: #e0cbb0;
  background: #fdf1e1;
}

.site-title {
  font-weight: 700;
  font-size: 17px;
}

.table-badge {
  background: rgba(255,255,255,0.18);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.header-light .table-badge {
  background: #ffe1c2;
}

/* ================== HERO (welcome / index) ================== */

.page-welcome .hero {
  text-align: center;
  margin-top: 18px;
}

.page-welcome h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.hero-sub {
  color: #7b6a5a;
  margin-bottom: 12px;
  font-size: 14px;
}

.hero-small {
  font-size: 13px;
  color: #9a8570;
}

/* ================== КНОПКА КОРЗИНЫ (старый FAB, можно оставить) ================== */

.cart-fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: #ff8a3d;
  color: #fff;
  padding: 11px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  z-index: 999;
}

/* ================== ВЕРХНЯЯ ПАНЕЛЬ (Меню) ================== */

.menu-topbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.btn-top {
  flex: 1;
  padding: 9px 12px;
  border-radius: 999px;
  border: none;
  background: #ff8a3d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.16);
}

.btn-top-secondary {
  background: #ffe4c5;
  color: #7b4f2a;
  box-shadow: none;
}

/* ================== ПОИСК ================== */

.menu-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.input,
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid #e0cbb0;
  background: #fffdf8;
  color: #2f2a25;
  outline: none;
  font-size: 14px;
}

.input::placeholder,
input::placeholder {
  color: #b49b84;
}

.link-orders {
  font-size: 13px;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: #ffe7cb;
  color: #985028;
}

/* ================== TABS (если где-то используются) ================== */

.tabs {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #f0d6b7;
  background: #fffaf3;
  color: #7b5b3b;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.tab.active {
  background: #ff8a3d;
  color: #fff;
  border-color: #ff8a3d;
}

.grid {
  margin-top: 4px;
}

/* ================== КАТЕГОРИИ И КАРТОЧКИ ================== */

.category-block h2 {
  font-size: 18px;
  margin: 14px 0 8px;
  color: #4b3421;
}

/* по умолчанию 1 колонка для мобилки */
/* ================== КАТЕГОРИИ И КАРТОЧКИ ================== */

.category-block h2 {
  font-size: 18px;
  margin: 14px 0 8px;
  color: #4b3421;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* даже на широком экране оставляем одну колонку, но центрируем */
.cards .card {
  width: 100%;
}

/* карточка блюда */
.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border: 1px solid #f4e0cb;
}

/* фото блюда */
.card-img-wrap {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
  background: #f5e2cf;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* фото: единый размер, почти 3x4, кроп по центру */
.card-img-wrap {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
  background: #f5e2cf;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-title {
  font-weight: 600;
  margin-bottom: 3px;
  font-size: 15px;
}

/* короткий текст + “Подробнее” для полного состава */
.card-desc {
  font-size: 13px;
  color: #8c7662;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* максимум 2 строки */
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.price {
  font-weight: 700;
  font-size: 15px;
  color: #e96b2b;
}

/* кнопка Добавить */
.btn-add {
  border-radius: 999px;
  border: none;
  background: #ff8a3d;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.btn-add.btn-added {
  transform: scale(1.04);
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

/* кнопка Подробнее */
.btn-more {
  margin-top: 8px;
  width: 100%;
  border-radius: 999px;
  border: 1px solid #f0d6b7;
  background: #fffdf8;
  color: #7b4f2a;
  font-size: 13px;
  padding: 7px 10px;
  cursor: pointer;
}

/* ================== ВЫБОР СТОЛА (index тест/официанты) ================== */

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.table-card {
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: #ffffff;
  color: #4b3421;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ================== НИЖНЯЯ ПАНЕЛЬ: КОРЗИНА + МОИ ЗАКАЗЫ ================== */

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 10px;
  background: #ffffff;
  border-top: 1px solid #f0e3d5;
  display: flex;
  gap: 8px;
  z-index: 900;
}

.bottom-btn {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: #ffe4c5;
  color: #7b4f2a;
}

.bottom-btn-secondary {
  background: #fff9f0;
  color: #8b6c4e;
  border: 1px solid #f0e3d5;
}

.bottom-btn-active {
  background: #ff8a3d;
  color: #fff;
}

/* ================== КОРЗИНА ================== */

.page-cart .cart-summary {
  margin: 14px 0;
  font-size: 15px;
  font-weight: 500;
  color: #4b3421;
}

.cart-service-note {
  font-size: 12px;
  color: #9a8570;
  margin-top: 4px;
}

.cart-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cart-item {
  padding: 7px 0;
  border-bottom: 1px solid #f1dec8;
  font-size: 14px;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-qty {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #ffe4c5;
  color: #7b4f2a;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.cart-qty-value {
  min-width: 20px;
  text-align: center;
  font-size: 14px;
}

.cart-item-price {
  font-weight: 600;
  font-size: 14px;
  color: #e96b2b;
}

.btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #f44336;
  color: #fff;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  margin-left: 8px;
  cursor: pointer;
}

/* форма корзины */
.cart-form {
  margin-top: 14px;
}

.cart-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.cart-form input[type="text"] {
  margin-top: 4px;
}

/* ================== КНОПКИ ================== */

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.btn-primary {
  background: #ff8a3d;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.btn-secondary {
  background: #ffe4c5;
  color: #7b4f2a;
}

.btn-danger {
  background: #f44336;
  color: #fff;
}

/* назад из корзины */
.btn-back {
  display: inline-block;
  color: #7b4f2a;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffe4c5;
  margin-bottom: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

/* ================== АЛЕРТЫ ================== */

.alert {
  padding: 8px 12px;
  border-radius: 10px;
  margin: 8px 0 14px;
  font-size: 14px;
}

.alert.error {
  background: #ffe1dd;
  color: #b23a2f;
}

.alert.success {
  background: #dbf4de;
  color: #2e7d32;
}

/* ================== TOAST ================== */

#toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 9999;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ================== ЛИЧНЫЙ КАБИНЕТ (my_orders) ================== */

.order-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.order-money {
  font-size: 13px;
  color: #4b3421;
}

.order-total-line {
  margin-top: 4px;
  font-size: 14px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9a8570;
  margin-top: 4px;
}

.orders-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ================== BADGE СТАТУСА ================== */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
}

.status-new {
  background: #9e9e9e;
}

.status-accepted {
  background: #42a5f5;
}

.status-cooking {
  background: #ffb300;
}

.status-ready {
  background: #43a047;
}

.status-served {
  background: #6d4c41;
}

.status-cancelled {
  background: #e53935;
}

/* подсветка строк заказов в админке */
.status-row-new {
  background: #fffdf5;
}
.status-row-ready {
  background: #e5f7e7;
}
.status-row-cancelled {
  background: #ffe1dd;
}

/* ================== АДМИНКА ================== */

.page-admin {
  background: #faf4ec;
}

/* header админки */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #f0e3d5;
}

.admin-logo {
  font-weight: 600;
  color: #4b3421;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-nav a {
  color: #8b6c4e;
  text-decoration: none;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 999px;
}

.admin-nav a.active {
  background: #ffe4c5;
  color: #ff8a3d;
}

.admin-content {
  padding: 12px;
  max-width: 980px;
  margin: 0 auto;
}

/* карточки статистики */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  min-width: 130px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-label {
  font-size: 12px;
  color: #9a8570;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #4b3421;
}

/* панели / блоки */
.panel-block {
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* таблицы в админке */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}

.table th,
.table td {
  padding: 5px 6px;
  border-bottom: 1px solid #f1dec8;
}

.table th {
  text-align: left;
  color: #9a8570;
}

.row-actions form {
  display: inline-block;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-inline input[type="text"],
.form-inline input[type="number"],
.form-inline select {
  flex: 1;
}

/* ================== ЛОГИН АДМИНКИ ================== */

.page-admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fff2de;
}

.admin-login-card {
  background: #ffffff;
  padding: 18px;
  border-radius: 16px;
  width: 260px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.admin-login-card h1 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #4b3421;
  font-size: 18px;
}

.admin-login-card label {
  display: block;
  margin-bottom: 9px;
}

.admin-login-card input {
  margin-top: 4px;
}

/* Итого в корзине */
.cart-final {
  margin-top: 4px;
  font-weight: 600;
  font-size: 15px;
  color: #4b3421;
}

/* ================== ОКНО КАТЕГОРИЙ (кнопка “Меню”) ================== */

.cat-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.cat-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.cat-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 10px 14px 14px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.18);
  max-width: 480px;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.2s ease-out;
}

.cat-overlay.open .cat-sheet {
  transform: translateY(0);
}

.cat-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cat-sheet-header span {
  font-weight: 600;
  color: #4b3421;
}

.btn-icon {
  border: none;
  background: #ffe4c5;
  color: #7b4f2a;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  cursor: pointer;
}

.cat-sheet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-item {
  flex: 1 1 45%;
  padding: 7px 8px;
  border-radius: 999px;
  border: 1px solid #f0d6b7;
  background: #fffdf8;
  color: #7b4f2a;
  font-size: 13px;
  cursor: pointer;
}

.cat-item.active {
  background: #ff8a3d;
  color: #fff;
}

/* ================== МОДАЛКА "ПОДРОБНЕЕ" ================== */

.details-overlay {
  position: fixed;
  inset: 0;
  z-index: 960;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.details-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.details-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.details-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 10px 14px 16px;
  max-width: 480px;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.2s ease-out;
}

.details-overlay.open .details-sheet {
  transform: translateY(0);
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.details-header span {
  font-weight: 600;
  color: #4b3421;
}

.details-body {
  font-size: 14px;
  color: #4b3421;
}

.details-img-wrap {
  width: 100%;
  height: 170px;
  border-radius: 14px;
  overflow: hidden;
  background: #f5e2cf;
  margin-bottom: 8px;
}

.details-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-price {
  font-weight: 700;
  color: #e96b2b;
  margin-bottom: 4px;
}

.details-desc {
  font-size: 14px;
  color: #7b6a5a;
}
/* --- Состав в карточке убираем (только через "Подробнее") --- */
.card-desc {
  display: none;
}

/* --- Общий стиль для select и file в админке и формах --- */
select,
.page-admin input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e0cbb0;
  background: #fffdf8;
  font-size: 13px;
  color: #4b3421;
}

/* чтобы в админке формы на телефоне не разваливались */
.admin-form {
  max-width: 520px;
  margin: 0 auto;
}

.admin-form .form-row {
  margin-bottom: 10px;
}

.admin-form label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #7b6a5a;
}

.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e0cbb0;
  background: #fffdf8;
  font-size: 13px;
  resize: vertical;
}

/* маленькая превьюшка блюда в списке */
.admin-product-img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  background: #f5e2cf;
}

/* кнопки-радио для "Кухня / Бар" можно красиво выстроить */
.type-toggle {
  display: flex;
  gap: 8px;
}

.type-toggle label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fffaf3;
  border: 1px solid #f0d6b7;
  font-size: 13px;
  cursor: pointer;
}

.type-toggle input {
  margin: 0;
}
/* Скрывать названия категорий ТОЛЬКО когда включён режим "Все" */
.page-menu.mode-all .category-block h2 {
  display: none;
}


