.restaurant-menu-mobile-wrapper {
  padding: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Більші відступи на планшетах і ПК */
@media (min-width: 768px) {
  .restaurant-menu-mobile-wrapper { padding: 20px; }
}
@media (min-width: 1024px) {
  .restaurant-menu-mobile-wrapper { padding: 24px 32px; }
}

.mobile-menu-anchor-nav {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  /* На мобільних лишаємо фул-bleed для зручності скролу */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
/* На ПК прибираємо фул-bleed і вирівнюємо всередині контейнера */
@media (min-width: 1024px) {
  .mobile-menu-anchor-nav {
    width: auto;
    margin-left: 0;
    margin-right: 0;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px;
  }
  .mobile-menu-anchor-nav .anchor-items { padding: 12px 24px; }
}
.mobile-menu-anchor-nav .anchor-items {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 55px;
  scroll-snap-type: x mandatory;
}
.mobile-menu-anchor-nav .anchor-items::-webkit-scrollbar { display: none; }
.mobile-menu-anchor-nav .anchor-items { scrollbar-width: none; }
.anchor-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  text-decoration: none !important;
  font-style: normal;
  color: #222;
  white-space: nowrap;
  min-height: 44px;
  scroll-snap-align: start;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.mobile-menu-anchor-nav .anchor-item::before { content: none !important; }
.anchor-item.active {
  background: #fff8e6;
  border-color: #f7c948;
  box-shadow: 0 3px 10px rgba(247, 201, 72, 0.35);
}
.anchor-item.active .anchor-name { font-weight: 600; }
.anchor-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.anchor-icon { 
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  font-size: 16px;
  line-height: 1;
  min-width: 20px;
  height: 20px;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.anchor-count { font-size: 12px; color: #666; }

.mobile-menu-content {
  margin-top: 10px;
}
.category-block {
  margin: 16px 0 24px;
}
.category-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.category-title {
  font-size: clamp(18px, 2vw, 22px);
  margin: 0;
  display: flex;
  align-items: center;
  font-weight: 800;
  color: #0f172a;
}

.category-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 20px;
  line-height: 1;
  min-width: 24px;
  height: 24px;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Оптимізація для мобільних пристроїв */
@media (max-width: 767px) {
  .category-icon {
    min-width: 20px;
    height: 20px;
    margin-right: 6px;
  }
}
.category-icon img.emoji { 
  width: 20px; 
  height: 20px; 
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  font-display: swap;
  contain: paint;
}
.restaurant-menu-mobile-wrapper .products.columns-3 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}
/* На планшетах — 2 колонки */
@media (min-width: 768px) {
  .restaurant-menu-mobile-wrapper .products.columns-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}
/* На десктопі — 3 колонки і трохи більший відступ */
@media (min-width: 1024px) {
  .restaurant-menu-mobile-wrapper .products.columns-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}
.restaurant-menu-mobile-wrapper .product { list-style: none; }

/* Карточка товару */
.restaurant-menu-mobile-wrapper ul.products li.product {
  background: #ffffff;
  border: 1px solid #eee;
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* На великих екранах обмежуємо ширину контенту всередині картки */
@media (min-width: 1024px) {
  .restaurant-menu-mobile-wrapper ul.products li.product {
    padding: 14px;
  }
  .restaurant-menu-mobile-wrapper .woocommerce-loop-product__title { font-size: 1.1rem; }
  .restaurant-menu-mobile-wrapper .product-image-wrapper img.lazy-load { height: 160px; }
}

.restaurant-menu-mobile-wrapper ul.products li.product:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* Зона зображення */
.restaurant-menu-mobile-wrapper .product-image-wrapper {
  margin-bottom: 12px;
}

.restaurant-menu-mobile-wrapper .product-image-wrapper img.lazy-load {
  border-radius: 16px;
  background: #f7f7f7;
}

/* Контент карточки */
.restaurant-menu-mobile-wrapper .product-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Заголовок товару */
.restaurant-menu-mobile-wrapper .woocommerce-loop-product__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
  margin: 8px 0 6px;
  padding: 0;
  border: none;
}
.restaurant-menu-mobile-wrapper .woocommerce-loop-product__title::after { display: none; }

/* Значки ваги та калорій */
.restaurant-menu-mobile-wrapper .product-nutrition-info {
  display: flex;
  gap: 8px;
  align-items: center;
}
.restaurant-menu-mobile-wrapper .product-weight,
.restaurant-menu-mobile-wrapper .product-calories {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 1px solid currentColor;
}
.restaurant-menu-mobile-wrapper .product-weight { color: #16a34a; /* зелений */ }
.restaurant-menu-mobile-wrapper .product-calories { color: #ef4444; /* червоний */ }

/* Опис товару */
.restaurant-menu-mobile-wrapper .product-short-description {
  color: #4b5563;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  overflow-x: hidden;
  line-height: 1.5;
}
.restaurant-menu-mobile-wrapper .description-toggle {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  color: #374151;
}

/* Ціна */
.restaurant-menu-mobile-wrapper .price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

/* Блок кількості та кнопки — узгоджений із десктопним стилем */
.restaurant-menu-mobile-wrapper .quantity-cart-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 16px;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  margin-top: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.restaurant-menu-mobile-wrapper .quantity-cart-wrapper:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.restaurant-menu-mobile-wrapper .quantity-cart-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #FAD067, #f5c842, #e6b73a);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.restaurant-menu-mobile-wrapper .quantity-cart-wrapper:hover::before {
  opacity: 1;
}

/* Поле кількості */
.restaurant-menu-mobile-wrapper .quantity-input {
  flex: 0 0 auto;
  position: relative;
}

.restaurant-menu-mobile-wrapper .quantity-input .qty {
  width: 65px;
  height: 48px;
  text-align: center;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  z-index: 1;
}

.restaurant-menu-mobile-wrapper .quantity-input .qty:focus {
  outline: none;
  border-color: #FAD067;
  box-shadow: 0 0 0 3px rgba(250, 208, 103, 0.2), 0 4px 12px rgba(0,0,0,0.1);
  background: #ffffff;
  transform: scale(1.05);
}

.restaurant-menu-mobile-wrapper .quantity-input .qty:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.restaurant-menu-mobile-wrapper .quantity-input::before {
  content: 'Кількість';
  position: absolute;
  top: -8px;
  left: 8px;
  background: #ffffff;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.restaurant-menu-mobile-wrapper .quantity-input:hover::before,
.restaurant-menu-mobile-wrapper .quantity-input .qty:focus + ::before {
  opacity: 1;
}

/* Кнопка "В кошик" */
.restaurant-menu-mobile-wrapper .custom_add_to_cart_button {
  background: linear-gradient(135deg, #FAD067 0%, #f5c842 100%) !important;
  color: #1a1a1a !important;
  border: 2px solid transparent !important;
  padding: 12px 20px !important;
  border-radius: 12px !important;
  cursor: pointer;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  text-transform: none;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-height: 48px;
  min-width: 120px;
  text-decoration: none !important;
  white-space: nowrap;
  flex: 1;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(250, 208, 103, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.restaurant-menu-mobile-wrapper .custom_add_to_cart_button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s;
}

.restaurant-menu-mobile-wrapper .custom_add_to_cart_button:hover::before {
  left: 100%;
}

.restaurant-menu-mobile-wrapper .custom_add_to_cart_button:hover {
  background: linear-gradient(135deg, #f5c842 0%, #e6b73a 100%) !important;
  box-shadow: 0 6px 20px rgba(250, 208, 103, 0.4);
  transform: translateY(-2px) scale(1.02);
  border-color: #e6b73a !important;
}

.restaurant-menu-mobile-wrapper .custom_add_to_cart_button:active {
  background: linear-gradient(135deg, #e6b73a 0%, #d4a532 100%) !important;
  box-shadow: 0 2px 8px rgba(250, 208, 103, 0.3);
  transform: translateY(0) scale(1);
}

.restaurant-menu-mobile-wrapper .custom_add_to_cart_button.loading {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
  color: #64748b !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  opacity: 0.8;
}

.restaurant-menu-mobile-wrapper .custom_add_to_cart_button.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #64748b;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}


.category-count {
  color: #334155;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 700;
}

@media (min-width: 1024px) {
  .category-block-header {
    padding: 12px 16px;
    border-radius: 20px;
  }
}

/* Використовуємо WooCommerce клас списку товарів */
/* Узгоджуємо з мобільним врапером і уникаємо конфлікту специфічності */
.products.columns-3 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .products.columns-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .products.columns-3 { grid-template-columns: repeat(3, 1fr); }
}

.product .product-image-wrapper { position: relative; }
.product .product-image-wrapper img.lazy-load {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
}
.product-new-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ff4757;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.product-short-description.collapsed { max-height: 60px; overflow: hidden; }
.description-toggle { margin-top: 6px; }
@media (min-width: 1024px) {
  .category-block { margin: 28px 0 48px; }
}

/* Центрування зображення у картці (більш специфічні правила) */
.restaurant-menu-mobile-wrapper ul.products li.product .product-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.restaurant-menu-mobile-wrapper ul.products li.product .product-image-wrapper img.lazy-load {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .restaurant-menu-mobile-wrapper ul.products li.product .product-image-wrapper {
    min-height: 160px;
  }
  .restaurant-menu-mobile-wrapper ul.products li.product .product-image-wrapper img.lazy-load {
    max-height: 160px;
    height: auto;
    width: auto;
  }
}

/* Додаткові правила для запобігання горизонтальному скролу в описі */
.restaurant-menu-mobile-wrapper .product-short-description * {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  max-width: 100% !important;
}

.restaurant-menu-mobile-wrapper .product-short-description pre {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  font-family: inherit !important;
  font-size: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.restaurant-menu-mobile-wrapper .product-short-description p,
.restaurant-menu-mobile-wrapper .product-short-description div,
.restaurant-menu-mobile-wrapper .product-short-description span {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  max-width: 100% !important;
}