html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
}

.container {
  max-width: 700px;
  margin: 20px auto;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 0 6px rgba(0,0,0,.1);
}

.logo {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto 32px;
}

.input-block {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 16px;
}

input[type="text"],
textarea,
input:not([type="number"]):not([type="submit"]) {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

#contactHandle {
  margin-top: 12px;
}

select {
  appearance: none;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px;
  font-size: 16px;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 12px;
}

.menu-section {
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  background: #f3f1ed;
  border-radius: 12px;
}

.section-title {
  background: #e1ded9;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
  text-align: center;
}

/* ===== dish: выравнивание строго по шаблону ===== */
/* Чёткое выравнивание dish-блока */
.dish {
  display: grid;
  grid-template-columns: 1fr 60px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  margin-bottom: 12px;
}

/* Название блюда — слева сверху */
.dish-name {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  font-weight: normal;
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
}

/* КБЖУ — под названием, не съезжает */
.kbju {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  font-size: 13px;
  color: #666;
  margin-top: 2px;
  line-height: 1.2;
}

/* Селектор — строго справа по центру */
.dish select.qty {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  width: 60px;
  padding: 6px;
  font-size: 16px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

button {
  width: 100%;
  background: #555;
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  background: #222;
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  max-width: 90%;
  text-align: center;
}

.popup-content pre {
  white-space: pre-line;
  text-align: left;
  font-size: 15px;
  line-height: 1.3;
  margin: 15px 0;
}

/* Верхняя плашка с суммой КБЖУ */
#total-kbju-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #ccc;
  padding: 6px 10px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
  z-index: 100;
  letter-spacing: 0.5px;
  word-spacing: 6px;
}

.dish {
  min-height: 48px;
}

.dish-name {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* максимум 2 строки */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  max-height: calc(1.25em * 2); /* 2 строки по line-height */
}

.menu-wrapper {
  background-color: #fffdf9; /* или твой нужный цвет */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}

.menu-wrapper {
  background-color: #fffdf9; /* основной цвет */
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}

/* Убираем лишний белый фон у внутренних блоков */
section,
.input-block {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.dish .price {
  font-size: 13px;
  line-height: 1.2;
  color: #666;
  margin-top: 2px;
}
.lang-switch {
  display: flex;
  gap: 10px;          /* расстояние между кнопками */
  margin-bottom: 20px;
  justify-content: flex-start; /* выравнивание по левому краю */
}

.lang-switch button {
  background-color: #f3f1ed; /* тот же цвет, что и у menu-section */
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: #333;
  transition: background 0.2s;
}

.lang-switch button:hover {
  background-color: #e1ded9; /* чуть темнее при наведении, как у section-title */
}

/* === Исправление нижней панели для размещения кнопок связи === */
#total-kbju-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;              /* расстояние между кнопками и КБЖУ */
  padding: 10px 12px;    /* увеличил чуть-чуть, чтобы все влезло */
}

/* Кнопки связи */
.contact-switch {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.contact-switch a {
  flex: 1;
  text-align: center;
  background: #f3f1ed;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 14px;
  color: #333;
  text-decoration: none;
}
.contact-switch {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin-bottom: 20px; /* вот этот отступ между контактами и языками */
}
.contact-switch a:hover {
  background: #e1ded9;
}

.menu-wrapper {
  background-color: #fffdf9;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px; /* отступ снизу до комментария */
}

.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background: #fff;
  padding: 20px;
  max-width: 400px; /* ограничение ширины */
  width: 90%;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);

}

.popup-content pre {
  white-space: pre-wrap; /* чтобы текст переносился */
  font-family: inherit;
  font-size: 14px;
  margin: 10px 0;
}


.instruction-button {
  display: block;           
  width: 100%;                /* ширина относительно родителя */
  margin: 0 auto 20px auto;  /* центрирование по горизонтали, отступ снизу 20px */
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #f3f1ed;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 20px; /* отступ снизу до комментария */

}

.instruction-button:hover {
  background-color: #e1ded9;
}

.front-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.front-tab {
  font-size: 14px;
  padding: 10px;
  background: #f3f1ed;
  color: #333;
  border: 1px solid #ccc;
}

.front-tab.active {
  background: #333;
  color: #fff;
}

.tab-panel {
  display: none;
  margin-bottom: 20px;
}

.tab-panel-active {
  display: block;
}

.panel-list {
  margin: 12px 0;
}

.panel-item {
  background: #f3f1ed;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}

.home-cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 18px;
}

.legacy-menu {
  display: none;
}

.delivery-menu {
  display: grid;
  gap: 12px;
}

.delivery-section-title {
  font-weight: 700;
  background: #e1ded9;
  border-radius: 8px;
  padding: 8px 10px;
}

.delivery-card {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
}

.delivery-card-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f1f1;
  cursor: pointer;
}

.delivery-card-name {
  font-weight: 600;
  font-size: 14px;
}

.delivery-card-meta {
  color: #666;
  font-size: 12px;
}

.delivery-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.delivery-qty button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  font-size: 16px;
}

.delivery-qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.delivery-add-btn {
  width: auto;
  padding: 8px 10px;
  font-size: 12px;
}

.cart-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.cart-row select {
  margin: 0;
  width: 72px;
  padding: 6px;
  font-size: 14px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #ddd;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 10px;
  z-index: 120;
}

.bottom-nav-btn {
  font-size: 13px;
  padding: 10px 6px;
}

#total-kbju-bar {
  bottom: 58px;
}

.dish {
  position: relative;
  padding-right: 58px;
}

.dish-thumb {
  position: absolute;
  right: 68px;
  top: 4px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #ddd;
  cursor: pointer;
}

.dish-photo-modal-img {
  width: min(90vw, 420px);
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 12px;
}
