/**
 * Общие стили для фронтенда
 * 
 * Зачем:
 * - Единый стиль для всех страниц
 * - Мобильная адаптация
 * - Переиспользуемые компоненты
 */

/* Reset и базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a1a1a;
  --primary-accent: #2563eb;
  --secondary-color: #6b7280;
  --background-color: #ffffff;
  --background-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --hover-color: #f3f4f6;
  --success-color: #10b981;
  --error-color: #ef4444;
  --border-radius: 16px;
  --border-radius-sm: 12px;
  --border-radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-secondary);
  color: var(--primary-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Контейнеры - строго мобильная версия */
.container {
  max-width: 428px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 428px;
  margin: 0 auto;
  background-color: var(--background-color);
  box-shadow: 0 0 0 1px var(--border-color);
  position: relative;
  overflow-x: hidden;
}

/* Заголовки - мобильная версия */
.header {
  background-color: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 428px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

/* Кнопки */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  background-color: #2d2d2d;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--background-color);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--hover-color);
}

/* Формы */
.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--secondary-color);
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Удалено - стили перенесены выше в .search-container */

/* Экран выбора гостей - мобильная версия */
.guests-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  max-width: 428px;
  margin: 0 auto;
  width: 100%;
}

.guests-container {
  max-width: 100%;
  width: 100%;
  text-align: center;
}

.guests-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 32px;
}

.guests-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.quantity-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  background-color: var(--background-color);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background-color: var(--hover-color);
}

.quantity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quantity-display {
  font-size: 48px;
  font-weight: 600;
  min-width: 80px;
}

/* Экран меню - строго мобильная версия */
.menu-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  width: 100%;
  max-width: 428px;
  margin: 0 auto;
}

.categories-container {
  width: 100%;
  background-color: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories-container::-webkit-scrollbar {
  display: none;
}

.categories-header {
  display: none;
}

.categories-title {
  display: none;
}

.categories-list {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding-bottom: 4px;
}

.category-item {
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-color);
  background-color: var(--background-secondary);
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.category-item:hover {
  background-color: var(--hover-color);
  color: var(--primary-color);
  transform: none;
  box-shadow: none;
}

.category-item.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow);
  transform: none;
}

.products-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: var(--background-color);
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.products-header {
  margin-bottom: 20px;
  padding: 0 4px;
}

.products-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-card {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 0;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.product-image-container {
  position: relative;
  width: 120px;
  min-width: 120px;
  height: 120px;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-image {
  transform: scale(1.02);
}

.product-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 3px;
}

.product-rating::before {
  content: '★';
  color: #fbbf24;
  font-size: 12px;
}

.product-info {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  min-width: 0;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  font-size: 13px;
  color: var(--secondary-color);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  flex: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
}

.btn-add-to-cart {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.btn-add-to-cart:hover {
  background-color: #2d2d2d;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Детальная страница продукта - мобильная версия */
.product-detail-container {
  max-width: 428px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}

.product-detail-image {
  width: 100%;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  object-fit: cover;
  max-height: 400px;
  background-color: #f5f5f5;
}

.product-image-thumbnail {
  flex-shrink: 0;
}

.product-image-thumbnail:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.product-detail-name {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
}

.product-detail-description {
  font-size: 16px;
  color: var(--secondary-color);
  margin-bottom: 24px;
  line-height: 1.8;
}

.product-detail-price {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 32px;
}

.product-variants {
  margin: 0 0 24px;
}

.product-variants-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.product-variants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.variant-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--background-secondary);
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.variant-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.variant-btn.active {
  background: var(--primary-color);
  color: var(--background-color);
  border-color: var(--primary-color);
  cursor: default;
  box-shadow: var(--shadow-md);
}

.variant-btn:disabled {
  opacity: 1;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: 64px 32px;
}

.loading.active,
.loading[style*="display: block"] {
  display: block !important;
}

.loading p {
  margin-top: 16px;
  color: var(--secondary-color);
  font-size: 15px;
  font-weight: 500;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--secondary-color);
  font-size: 16px;
  background-color: var(--background-secondary);
  border-radius: var(--border-radius-lg);
  margin: 24px 0;
}

/* Скрытие элементов */
.hidden {
  display: none !important;
}

/* Корзина */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  text-align: center;
  flex: 1;
  max-width: 428px;
  margin: 0 auto;
  width: 100%;
}

.empty-cart-icon {
  font-size: 64px;
  margin-bottom: 16px;
  color: var(--secondary-color);
}

.empty-cart-icon i {
  font-size: 64px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  padding: 0 16px;
  max-width: 428px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.cart-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  gap: 10px;
  max-width: 428px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.cart-item--new {
  position: relative;
  animation: cartItemPulse 2.2s ease-out;
  z-index: 0;
}

@keyframes cartItemPulse {
  0% {
    box-shadow: var(--shadow), 0 0 0 0 rgba(16, 185, 129, 0.6);
    transform: translateY(-2px);
  }
  60% {
    box-shadow: var(--shadow), 0 0 0 14px rgba(16, 185, 129, 0);
    transform: translateY(0);
  }
  100% {
    box-shadow: var(--shadow), 0 0 0 0 rgba(16, 185, 129, 0);
    transform: translateY(0);
  }
}

.cart-item--new::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  background: rgba(16, 185, 129, 0.14);
  opacity: 0;
  animation: cartItemGlow 2.2s ease-out;
  pointer-events: none;
  z-index: -1;
}

@keyframes cartItemGlow {
  0% {
    opacity: 0.9;
  }
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.cart-item:last-child {
  margin-bottom: 0;
}

.cart-item-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cart-item-image-container {
  width: 70px;
  height: 70px;
  min-width: 70px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  flex-shrink: 0;
}

.cart-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--primary-color);
  line-height: 1.3;
}

.cart-item-quantity-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
}

.cart-item-nutrition {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--secondary-color);
  margin-top: 4px;
}

.cart-item-nutrition span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item-composition {
  margin-top: 8px;
}

.cart-item-composition-label {
  font-size: 12px;
  color: var(--secondary-color);
  margin-bottom: 6px;
  font-weight: 500;
}

.cart-item-composition-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cart-item-composition-tag {
  padding: 6px 12px;
  background-color: var(--background-secondary);
  border-radius: 16px;
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.cart-item-modifiers {
  font-size: 12px;
  color: var(--secondary-color);
  margin-top: 4px;
  line-height: 1.4;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 4px;
}

.cart-item-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  margin-top: 2px;
}

.cart-item-price-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item-price-unit {
  font-size: 12px;
  color: var(--secondary-color);
  font-weight: 400;
}

.cart-item-price-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 3px;
}

.quantity-btn-small {
  width: 32px;
  height: 32px;
  border: none;
  background-color: var(--background-color);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--primary-color);
  box-shadow: var(--shadow);
}

.quantity-btn-small:hover:not(:disabled) {
  background-color: var(--hover-color);
  transform: scale(1.05);
}

.quantity-btn-small:active:not(:disabled) {
  transform: scale(0.95);
}

.quantity-btn-small:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.item-quantity {
  font-size: 14px;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
  color: var(--primary-color);
}

.btn-remove-item {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.4;
  transition: var(--transition);
  color: var(--secondary-color);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-remove-item:hover {
  opacity: 0.7;
  background-color: var(--hover-color);
  color: var(--error-color);
}

.cart-summary {
  background-color: var(--background-color);
  border-top: 2px solid var(--border-color);
  padding: 20px 16px;
  position: sticky;
  bottom: 0;
  max-width: 428px;
  margin: 0 auto;
  width: 100%;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 15px;
}

.summary-row:last-of-type {
  margin-bottom: 0;
}

.summary-row.summary-total {
  border-top: 2px solid var(--border-color);
  padding-top: 16px;
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
}

.summary-row-label {
  color: var(--secondary-color);
  font-weight: 500;
}

.summary-value {
  font-weight: 600;
  color: var(--primary-color);
}

.summary-total-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.guests-selector-small {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 4px;
}

.guests-count {
  font-size: 16px;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
  color: var(--primary-color);
}

.cart-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius);
  background-color: var(--background-secondary);
  transition: var(--transition);
  cursor: pointer;
}

.cart-badge:hover {
  background-color: var(--hover-color);
  transform: scale(1.05);
}

.cart-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  border: 2px solid var(--background-color);
}

/* Стили для страницы списка ресторанов - мобильная версия */
.restaurants-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-width: 428px;
  margin: 0 auto;
  width: 100%;
}

.restaurant-card {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  width: 100%;
}

.restaurant-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.restaurant-card-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.restaurant-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.restaurant-info {
  flex: 1;
  min-width: 0;
}

.restaurant-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.restaurant-city {
  font-size: 14px;
  color: var(--secondary-color);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.restaurant-city::before {
  content: '📍';
  font-size: 12px;
}

.restaurant-menu-info {
  font-size: 13px;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.restaurant-menu-info.has-menu {
  color: var(--success-color);
  font-weight: 500;
}

.restaurant-menu-info.no-menu {
  color: var(--error-color);
  font-weight: 500;
}

.restaurant-arrow {
  font-size: 24px;
  color: var(--secondary-color);
  flex-shrink: 0;
  transition: var(--transition);
}

.restaurant-card:hover .restaurant-arrow {
  color: var(--primary-color);
  transform: translateX(4px);
}

/* Стили для публичного меню ресторана */
.view-mode-notice {
  margin-top: 12px;
  padding: 12px;
  background-color: #fff9e6;
  border-radius: 8px;
  border: 1px solid #ffd700;
}

.info-badge {
  display: inline-block;
  padding: 4px 12px;
  background-color: #ffd700;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.info-text {
  font-size: 13px;
  color: var(--secondary-color);
  margin: 0;
}

.product-card.view-only {
  cursor: pointer;
}

.product-card.view-only:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.back-button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
  color: var(--primary-color);
  transition: opacity 0.2s;
}

.back-button:hover {
  opacity: 0.7;
}

.subtitle {
  font-size: 14px;
  color: var(--secondary-color);
  margin-top: 4px;
}

.search-container {
  padding: 16px;
  margin: 0;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-color);
  width: 100%;
  max-width: 428px;
  margin: 0 auto;
}

.search-input {
  position: relative;
  width: 100%;
}

.search-input input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  font-size: 15px;
  transition: var(--transition);
  background-color: var(--background-secondary);
  box-shadow: none;
}

.search-input input:focus {
  outline: none;
  border-color: var(--primary-accent);
  background-color: var(--background-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary-color);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 1;
}

.category-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.products-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 16px;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--secondary-color);
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--primary-color);
}

.categories-container.hidden .categories-list {
  display: none;
}

/* Модификаторы */
.modifiers-container {
  margin: 24px 0;
}

.modifier-group {
  margin-bottom: 24px;
  padding: 16px;
  background-color: var(--hover-color);
  border-radius: var(--border-radius);
}

.modifier-group-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.modifier-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modifier-option {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: var(--background-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.modifier-option:hover {
  border-color: var(--primary-color);
  background-color: var(--hover-color);
}

.modifier-option input[type="radio"],
.modifier-option input[type="checkbox"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.modifier-option input[type="radio"]:checked + .modifier-option-label,
.modifier-option input[type="checkbox"]:checked + .modifier-option-label {
  font-weight: 600;
}

.modifier-option:has(input:checked) {
  border-color: var(--primary-color);
  background-color: #f0f0f0;
}

.modifier-option-label {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.modifier-price {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
}

/* Строго мобильная версия - применяется всегда */
@media (min-width: 429px) {
  body {
    background-color: var(--background-secondary);
  }
  
  .page-container {
    box-shadow: 0 0 0 1px var(--border-color), 0 4px 24px rgba(0, 0, 0, 0.1);
  }
}

/* Дополнительные мобильные стили */
@media (max-width: 428px) {
  /* Убираем отступы по краям, контент на всю ширину */
  .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .page-container {
    width: 100%;
  }

  /* Header на всю ширину без отступов */
  .header {
    padding: 16px;
    width: 100%;
    margin: 0;
  }

  .header-content {
    padding: 0;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-title {
    font-size: 18px;
  }
  
  .header-content > div {
    gap: 12px;
  }
  
  .header-content button {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Меню - вертикальная раскладка */
  .menu-layout {
    flex-direction: column;
    width: 100%;
  }

  .categories-container {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    max-height: 200px;
    padding: 16px;
    background-color: var(--background-color);
  }
  
  .categories-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  
  .categories-title {
    font-size: 16px;
  }
  
  .category-item {
    padding: 12px 14px;
    font-size: 14px;
  }
  
  .category-item.active {
    transform: none;
  }

  .categories-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .category-item {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .products-container {
    width: 100%;
    padding: 20px 16px;
  }
  
  .products-title {
    font-size: 24px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .product-card {
    border-radius: var(--border-radius);
  }
  
  .product-info {
    padding: 16px;
  }
  
  .product-name {
    font-size: 17px;
  }
  
  .product-price {
    font-size: 20px;
  }

  .products-list {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px;
  }

  /* Поиск на всю ширину */
  .search-container {
    padding: 12px 16px;
  }

  .search-input input {
    padding: 12px 14px 12px 44px;
    font-size: 14px;
  }

  /* Гости - центрирование */
  .guests-screen {
    padding: 24px 16px;
    width: 100%;
  }

  .guests-container {
    max-width: 100%;
    width: 100%;
  }

  .guests-selector {
    gap: 16px;
  }

  .quantity-display {
    font-size: 36px;
  }

  /* Корзина */
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .cart-item-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Список ресторанов */
  .restaurants-list {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .restaurant-card {
    width: 100%;
    margin: 0;
  }

  /* Заголовки категорий */
  .category-title {
    padding: 0 16px;
  }

  .products-header {
    padding: 0 16px;
  }

  /* Уведомления */
  .view-mode-notice {
    margin: 12px 16px;
  }

  /* Кнопка назад */
  .back-button {
    margin-left: 16px;
  }

  /* Пустые состояния */
  .empty-state {
    padding: 32px 16px;
    text-align: center;
  }

  /* Сообщения об ошибках */
  .error-message {
    margin: 16px;
    padding: 12px 16px;
  }

  /* Детальная страница продукта */
  .product-detail-container {
    max-width: 100%;
    padding: 16px;
    margin: 0;
  }

  .product-detail-image {
    width: 100%;
    margin-bottom: 16px;
    max-height: 300px;
  }

  .product-detail-name {
    font-size: 24px;
  }

  /* Карточки продуктов */
  .product-card {
    width: 100%;
    margin: 0;
  }

  .product-info {
    padding: 12px;
  }

  .product-name {
    font-size: 16px;
  }

  .product-description {
    font-size: 13px;
  }

  .product-price {
    font-size: 16px;
  }

  /* Кнопки */
  .btn {
    padding: 14px 20px;
    font-size: 16px;
    width: 100%;
  }

  .btn-add-to-cart {
    padding: 10px 16px;
    font-size: 14px;
    width: auto;
  }

  /* Заголовки */
  h1 {
    font-size: 24px;
    padding: 0 16px;
  }

  h2 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
    padding: 0 16px;
  }

  /* Индикатор загрузки */
  .loading {
    padding: 32px 16px;
  }

  /* Landing страница */
  .landing {
    padding: 24px 16px;
  }

  .landing-logo {
    font-size: 56px;
  }

  .landing-title {
    font-size: 32px;
  }

  .landing-subtitle {
    font-size: 16px;
  }

  .landing-actions {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .landing-btn {
    width: 100%;
  }

  /* Корзина */
  .container[style*="padding"] {
    padding: 0 !important;
  }

  .cart-items {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  .cart-summary {
    padding: 16px;
    margin: 0;
    width: 100%;
    position: sticky;
    bottom: 0;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  }

  .cart-empty {
    padding: 48px 16px;
    text-align: center;
  }

  .empty-cart-icon {
    font-size: 64px;
    margin-bottom: 16px;
  }

  /* Сводка корзины */
  .summary-row {
    padding: 12px 0;
    font-size: 14px;
  }

  .summary-total {
    font-size: 18px;
  }

  .summary-total-value {
    font-size: 20px;
  }

  /* Селектор гостей в корзине */
  .guests-selector-small {
    gap: 12px;
  }

  .quantity-btn-small {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .guests-count {
    font-size: 16px;
    min-width: 40px;
  }

  /* Поиск в menu.html */
  .search-input {
    position: relative;
    width: 100%;
    margin: 0;
  }

  .search-input input {
    width: 100%;
    padding-left: 40px;
  }

  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    width: 20px;
    height: 20px;
    z-index: 1;
  }


  /* Корзина badge в header */
  .cart-badge {
    font-size: 24px;
  }

  .cart-badge-count {
    font-size: 12px;
    width: 18px;
    height: 18px;
  }

  /* Модификаторы */
  .modifiers-container {
    margin: 24px 0;
  }

  .modifier-group {
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--hover-color);
    border-radius: var(--border-radius);
  }

  .modifier-group-label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--primary-color);
  }

  .modifier-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .modifier-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .modifier-option:hover {
    border-color: var(--primary-color);
    background-color: var(--hover-color);
  }

  .modifier-option input[type="radio"],
  .modifier-option input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
  }

  .modifier-option input[type="radio"]:checked + .modifier-option-label,
  .modifier-option input[type="checkbox"]:checked + .modifier-option-label {
    font-weight: 600;
  }

  .modifier-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: #f0f0f0;
  }

  .modifier-option-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
  }

  .modifier-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
  }
}

/* Баннеры - мобильная версия */
.banners-container {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  width: 100%;
  max-width: 428px;
  margin: 0 auto;
}

.banners-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.banners-slider:active {
  cursor: grabbing;
}

.banners-slider::-webkit-scrollbar {
  display: none;
}

.banner-item {
  min-width: 100%;
  scroll-snap-align: start;
  position: relative;
  cursor: pointer;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  touch-action: pan-y pinch-zoom;
  -webkit-touch-callout: none;
}

.banner-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 20px 16px 16px;
  color: white;
}

.banner-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.banner-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

.banners-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 16px;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-color);
  cursor: pointer;
  transition: background-color 0.3s;
}

.banner-dot.active {
  background-color: var(--primary-color);
}

@media (max-width: 768px) {
  .banner-image {
    height: 180px;
  }

  .banner-title {
    font-size: 18px;
  }

  .banner-subtitle {
    font-size: 13px;
  }
}

/* Формы */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary-color);
  font-size: 14px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: var(--background-color);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--secondary-color);
}

.checkout-form {
  background: #f9f9f9;
  padding: 24px;
  border-radius: var(--border-radius);
}

.checkout-section {
  background: #f9f9f9;
  padding: 24px;
  border-radius: var(--border-radius);
}

.checkout-total {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border-color);
}

.error-message {
  background-color: #fee;
  color: #c33;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  border: 1px solid #fcc;
}
