/* ====== Общие стили ====== */
::-webkit-scrollbar {
  width: 0;
}
body {
  background-color: #121212;
  color: #f0f0f0;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

/* Контейнер меню */
.container {
  max-width: 1200px;
}

/* Заголовок */
h1 {
  color: #f8f9fa;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ====== Навигация ====== */
.nav-pills .nav-link {
  background-color: #1f1f1f;
  color: #ccc;
  margin-right: 6px;
  border-radius: 50px;
  padding: 8px 16px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-pills .nav-link.active {
  background-color: #ffc107;
  color: #000;
  font-weight: 600;
}

/* ====== Поиск ====== */
#search-input {
  background-color: #1f1f1f;
  border: 1px solid #333;
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
}

#search-input::placeholder {
  color: #888;
}

/* ====== Подкатегории ====== */
h3 {
  color: #ffc107;
  font-size: 1.4rem;
  font-weight: 500;
  margin-top: 2rem;
  position: relative;
  padding-left: 16px;
}

h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(to bottom, #ffc107, #ff9800);
  border-radius: 2px;
}

/* ====== Карточки ====== */
.card {
  background-color: #1e1e1e;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 280px; /* Уменьшили высоту карточки */
  display: flex;
  flex-direction: column;
  cursor: pointer;
  margin-bottom: 20px; /* Добавили отступ снизу */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(255, 193, 7, 0.2);
}

.card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card-text {
  color: #aaa;
  font-size: 0.85rem;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card .text-warning {
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: auto;
}

/* ====== Изображения ====== */
.menu-img {
  width: 100%;
  height: 200px; /* Уменьшили высоту изображения */
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

/* ====== Подкатегории iOS стиль ====== */
.subcategory-container {
  background: linear-gradient(145deg, #1a1a1a, #252525);
  border-radius: 20px;
  padding: 25px 20px; /* Увеличили внутренние отступы */
  margin-bottom: 35px; /* Увеличили отступ снизу */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
}

.subcategory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px; /* Увеличили отступ снизу */
  padding-bottom: 12px; /* Увеличили отступ снизу */
  border-bottom: 1px solid #333;
}

.subcategory-header h3 {
  margin: 0;
  padding-left: 0;
}

.subcategory-header h3::before {
  display: none;
}

/* Контейнер для карточек внутри подкатегории */
.subcategory-container .menu-row {
  margin-left: -10px; /* Компенсация отступов карточек */
  margin-right: -10px;
}

/* ====== iOS Шторка ====== */
.menu-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  z-index: 1001;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  height: 85vh; /* Фиксированная высота 85% экрана */
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
}

.menu-sheet.active {
  transform: translateY(0);
}

.sheet-header {
  padding: 16px 20px 12px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.sheet-indicator {
  width: 40px;
  height: 5px;
  background: #444;
  border-radius: 3px;
  margin: 0 auto 12px;
  cursor: pointer;
}

.sheet-close {
  position: absolute;
  right: 20px;
  top: 16px;
  background: #333;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 1002;
}

.sheet-close:hover {
  background: #444;
}

.sheet-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Слайдер для контента */
.sheet-slider {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 20px;
}

.sheet-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 16px;
  margin: 20px 0;
}

.sheet-title {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.2;
}

.sheet-price {
  color: #ffc107;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-price-tag {
  background: rgba(255, 193, 7, 0.1);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.sheet-description {
  color: #ccc;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}

.sheet-details {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.5;
}

.sheet-details p {
  margin-bottom: 10px;
}

.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(5px);
}

.sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Индикатор скролла */
.sheet-scroll-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}

.sheet-scroll-indicator.active {
  opacity: 1;
}

.sheet-scroll-progress {
  height: 100%;
  background: #ffc107;
  width: 0%;
  transition: width 0.1s;
}

/* ====== Поиск результатов ====== */
#search-results .card {
  background-color: #222;
}

/* ====== Адаптация для мобильных сеток ====== */
@media (max-width: 767px) {
  .menu-grid-1 .menu-item {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .menu-grid-2 .menu-item {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  .menu-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px; /* Уменьшили компенсацию для мобильных */
    margin-right: -8px;
  }
  
  .menu-item {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 20px; /* Добавили отступ снизу для мобильных */
  }
  
  .card {
    height: 260px;
    margin-bottom: 0; /* Убираем margin-bottom, т.к. есть у .menu-item */
  }
  
  .menu-img {
    height: 120px;
  }
  
  .subcategory-container {
    padding: 20px 15px; /* Адаптивные отступы */
    border-radius: 16px;
    margin-bottom: 30px;
  }
  
  .menu-sheet {
    height: 80vh;
    max-height: 80vh;
  }
  
  .sheet-slider {
    padding: 0 15px 15px;
  }
  
  .sheet-image {
    height: 250px;
    margin: 15px 0;
  }
  
  .sheet-title {
    font-size: 1.6rem;
  }
  
  .sheet-price {
    font-size: 1.6rem;
  }
}

/* Десктоп и планшеты */
@media (min-width: 768px) {
  .menu-row {
    margin-left: -12px;
    margin-right: -12px;
  }
  
  .menu-item {
    padding-left: 12px;
    padding-right: 12px;
    margin-bottom: 24px; /* Больше отступ на десктопе */
  }
  
  .card {
    margin-bottom: 0; /* Убираем margin-bottom, т.к. есть у .menu-item */
  }
  
  #toggleView {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 0.75rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  #menuTabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .nav-link {
    white-space: nowrap;
  }
  
  .card {
    height: 250px;
  }
  
  .menu-img {
    height: 150px;
  }
  
  .menu-sheet {
    height: 75vh;
    max-height: 75vh;
  }
  
  .sheet-image {
    height: 300px;
  }
  
  .sheet-title {
    font-size: 1.4rem;
  }
  
  .sheet-price {
    font-size: 1.4rem;
  }
  
  .sheet-description {
    font-size: 1rem;
  }
  
  .menu-item {
    margin-bottom: 16px; /* Немного меньше на очень маленьких экранах */
  }
}

/* ====== Переключатель вида ====== */
#toggleView {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

#toggleView.active {
  background-color: #ffc107;
  color: white;
}

.menu-logo {
  height: 200px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 576px) {
  .menu-logo {
    height: 150px;
  }
}

/* Карточка без описания */
.card-text:empty {
  display: none;
}

.card-text:empty + .text-warning {
  margin-top: 0;
}

/* Улучшенные отступы для поиска */
#search-results .row {
  margin-left: -10px;
  margin-right: -10px;
}

#search-results .col-12,
#search-results .col-sm-6,
#search-results .col-md-4,
#search-results .col-lg-3 {
  padding-left: 10px;
  padding-right: 10px;
  margin-bottom: 20px;
}

/* Стили для пустых сообщений */
.text-muted {
  padding: 20px;[118;1:3u
  text-align: center;
  font-style: italic;
  color: #666 !important;
}
