/* Мобильные фиксы для клонированного сайта Chili's */

/* Навбар — показываем на мобилке, делаем компактным */
@media (max-width: 1023px) {
  /* Скрываем десктопную навигацию (ссылки меню) */
  header .gap-32 {
    gap: 8px !important;
  }
  
  header .gap-32 > .inline-flex {
    display: none !important;
  }
  
  /* Сетка хедера — простой flex в ряд */
  header .dsktp-xl\:grid,
  header [class*="grid-cols-12"] {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 12px !important;
    width: 100% !important;
  }
  
  header .dsktp-xl\:col-span-9,
  header [class*="col-span-9"] {
    width: auto !important;
    flex: 0 0 auto !important;
  }
  
  header .dsktp-xl\:col-span-3,
  header [class*="col-span-3"] {
    width: auto !important;
    flex: 0 0 auto !important;
  }
  
  /* Высота хедера */
  header .h-\[105px\] {
    height: 56px !important;
    padding: 0 12px !important;
  }

  /* Логотип — меньше */
  header svg[viewBox="0 0 97 50"] {
    width: 60px !important;
    height: 32px !important;
  }
  
  header .w-\[96\.89px\] {
    width: 60px !important;
  }
  
  header .h-50 {
    height: 32px !important;
  }
  
  /* Кнопка Order Now — компактнее */
  header .px-24.py-16.rounded-full,
  header .bg-chilis-red-AA {
    padding: 6px 14px !important;
    height: 34px !important;
    font-size: 12px !important;
  }
  
  header button[id="navbar-cta"],
  header [data-testid="desktop-navbar-cta-button"] {
    font-size: 12px !important;
  }
  
  /* Корзина — компактнее */
  header .w-56 {
    width: 36px !important;
    padding: 4px !important;
  }
  
  /* Гамбургер — слева, лого по центру, кнопки справа */
  header .justify-start.items-end.gap-32 {
    gap: 8px !important;
    align-items: center !important;
  }
  
  /* Убираем лишние отступы */
  header .gap-24 {
    gap: 8px !important;
  }
  
  header .px-12 {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  /* Контент — не выходит за экран */
  body {
    overflow-x: hidden !important;
  }
  
  .builder-columns {
    flex-direction: column !important;
  }
  
  /* Карточки товаров — одна колонка */
  .dsktp\:grid-cols-5,
  .dsktp\:grid-cols-4,
  .dsktp\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  /* Карточки product-card */
  [data-testid^="product-card"] {
    min-width: unset !important;
    max-width: unset !important;
    width: 100% !important;
  }
  
  #product-card {
    height: auto !important;
  }
  
  /* Цена в карточке — видна */
  [data-testid^="product-card"] [style*="color: #e81b23"] {
    display: block !important;
    font-size: 16px !important;
  }
  
  /* Контейнер карточек — не обрезает */
  [data-testid^="product-card"] .flex-col {
    overflow: visible !important;
  }
  
  /* Мини-карточки — цена видна, текст не обрезается */
  .cart-upsell-module__mnNVzq__truncate {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
  }
  
  /* Горизонтальный скролл секций */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Промо-карточки на главной */
  .css-17gq90s,
  .css-1koeyw4 {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: unset !important;
  }
  
  /* Горизонтальный ряд карточек — вертикальный на мобилке */
  .css-1ty1ml5 {
    flex-direction: column !important;
  }
  
  /* Секция "What's New" — вертикально */
  [class*="flex-row"][class*="overflow"] {
    flex-direction: column !important;
    overflow: visible !important;
    padding: 0 16px !important;
  }
  
  /* Футер — одна колонка */
  footer .grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Текст не выходит за экран */
  h1, h2, h3, h4, h5, h6, p, span, div {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  /* Builder blocks — адаптивность */
  [class*="builder-block"] {
    max-width: 100% !important;
  }
  
  /* Изображения */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Кнопки */
  a[role="button"],
  button {
    max-width: 100% !important;
  }
  
  /* Меню навигация (тёмная полоса) */
  #menu-nav-desktop {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Locations — сетка штатов */
  .dsktp\:grid-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Совсем маленькие экраны */
@media (max-width: 640px) {
  .dsktp\:grid-cols-5,
  .dsktp\:grid-cols-4,
  .dsktp\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  
  /* Карточки товаров — полная ширина, авто-высота */
  [aria-label^="Product"] {
    min-width: unset !important;
    max-width: 100% !important;
    height: auto !important;
  }
  
  [aria-label^="Product"] .h-\[344px\] {
    height: auto !important;
  }
  
  [aria-label^="Product"] .dsktp\:h-\[150px\],
  [aria-label^="Product"] .dsktp-lg\:h-\[179px\] {
    height: 150px !important;
  }
  
  /* Промо секция */
  .css-1ty1ml5 {
    padding: 0 !important;
  }
}

/* Мобильное меню (гамбургер) */
.mobile-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #22235b;
  border-radius: 2px;
  transition: transform 0.2s;
}

@media (max-width: 1023px) {
  .mobile-menu-btn {
    display: flex !important;
  }
}

/* Мобильное выпадающее меню */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 9999;
  padding: 20px;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-nav-overlay.open {
  display: flex;
}

.mobile-nav-overlay a {
  display: block;
  padding: 16px 0;
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #22235b;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  text-transform: uppercase;
}

.mobile-nav-close {
  align-self: flex-end;
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  color: #22235b;
  background: none;
  border: none;
  margin-bottom: 16px;
}


/* Глобально — мини-карточки не обрезают цену */
.cart-upsell-module__mnNVzq__truncate {
  overflow: visible !important;
  text-overflow: unset !important;
  white-space: normal !important;
  -webkit-line-clamp: unset !important;
  display: block !important;
}

/* Высота мини-карточки — авто чтобы вместить цену */
[data-testid^="mobile-product-card"] {
  height: auto !important;
  min-height: 72px;
}

[data-testid^="mobile-product-card"] .h-\[72px\] {
  height: auto !important;
  min-height: 72px;
}
