/* ============================================================
 * Стили для страницы Меню (menu.html)
 * ============================================================ */
.menu-controls-wrapper {
  max-width: var(--content);
  margin: 0 auto 30px;
  padding: 0 28px;
}

/* Кнопки категорий */
.category-switcher {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; scrollbar-width: none;
}
.category-switcher::-webkit-scrollbar { display: none; }
.category-switch {
  padding: 10px 22px; border-radius: 30px; font-size: 14px; font-weight: 700; white-space: nowrap;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); color: #b5a9c6;
  cursor: pointer; transition: 0.2s;
}
.category-switch:hover { border-color: rgba(168, 121, 255, 0.5); color: #fff; }
.category-switch.active { background: #a879ff; border-color: #a879ff; color: #1a1027; box-shadow: 0 0 20px rgba(168, 121, 255, 0.3); }

/* Табы дней */
.category-day-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(220, 204, 255, 0.05);
}
.day-tab {
  padding: 8px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: transparent; border: none; color: #a49ab8; cursor: pointer; transition: 0.2s;
}
.day-tab:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.day-tab.active { background: rgba(168, 121, 255, 0.15); color: #c6a6ff; }

/* ============================================================
 * Карточка товара
 * ============================================================ */
.product-card {
  user-select: none;
  -webkit-user-drag: none;
  display: flex;
  flex-direction: column;
}

.product-image-wrap {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1.04;
  overflow: hidden;
  background: #21182e;
  cursor: pointer;
}

.product-image-wrap img {
  display: block; /* ВАЖНО: Показываем картинку обратно */
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.055);
}

/* Кнопка избранного */
.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #f4eaff;
  background: rgba(17, 11, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(9px);
  transition: 0.2s;
  z-index: 2;
}

.favorite-button svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
 * Счетчик количества (Плюс / Минус) и Кнопка добавления
 * ============================================================ */
.card-action-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 38px; /* Чтобы при появлении плюс/минуса карточка не прыгала */
}

.qty-counter {
  display: flex;
  align-items: center;
  background: rgba(168, 121, 255, 0.1);
  border: 1px solid rgba(168, 121, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  height: 38px;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #f6f1ff;
  width: 34px;
  height: 100%;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.qty-btn:hover {
  background: rgba(168, 121, 255, 0.3);
  color: #a879ff;
}

.qty-value {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #f6f1ff;
  pointer-events: none;
}

/* Кнопка добавления (когда товара нет) */
.add-cart {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 121, 255, 0.1);
  border: 1px solid rgba(168, 121, 255, 0.3);
  border-radius: 10px;
  color: #d6bdff;
  cursor: pointer;
  transition: all 0.2s;
}

.add-cart:hover {
  background: #a879ff;
  color: #1a1027;
}

.add-cart svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
 * Галерея столовой (если она на этой же странице)
 * ============================================================ */
.gallery-grid { 
  display: grid; 
  grid-template-columns: repeat(6, minmax(0, 1fr)); 
  gap: 16px; 
}

.gallery-grid figure { 
  position: relative; 
  grid-column: span 2; 
  margin: 0; 
  min-height: 210px; 
  overflow: hidden; 
  border: 1px solid rgba(183,145,255,.22); 
  border-radius: 18px; 
  background-color: #1a1128; 
  box-shadow: 0 15px 40px rgba(0,0,0,.2);
  transition: transform 0.5s ease;
}

.gallery-grid figure:nth-child(4) { grid-column: 2/span 2; }
.gallery-grid figure:nth-child(5) { grid-column: 4/span 2; }

.gallery-grid figure:hover { transform: scale(1.03); }

.gallery-grid figcaption { 
  position: absolute; 
  right: 0; bottom: 0; left: 0; 
  padding: 30px 16px 14px; 
  background: linear-gradient(transparent, rgba(16,8,28,.95)); 
  font-size: 11px; font-weight: 800; 
  color: #f6efff; letter-spacing: .06em; 
  z-index: 2; pointer-events: none;
}

@media(max-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gallery-grid figure, .gallery-grid figure:nth-child(4), .gallery-grid figure:nth-child(5) { grid-column: auto; min-height: 160px; }
}

/* Кнопка избранного на карточке */
.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #f4eaff;
  background: rgba(17, 11, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(9px);
  transition: all 0.2s ease;
  z-index: 2;
  cursor: pointer;
}

.favorite-button:hover {
  background: rgba(255, 120, 200, 0.2);
  border-color: rgba(255, 120, 200, 0.5);
}

.favorite-button.active {
  color: #ff78c8;
  background: rgba(255, 120, 200, 0.15);
  border-color: rgba(255, 120, 200, 0.4);
}

.favorite-button.active svg {
  fill: #ff78c8;
}

.favorite-button svg {
  width: 18px;
  height: 18px;
  transition: fill 0.2s;
}