/* Принудительное исправление sticky навигации */
.cat-nav {
  position: fixed !important;
  top: 80px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
  background: white !important;
  padding: 1em 0 !important;
  border-bottom: 1px solid #eee !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  /* Принудительно отключаем все анимации */
  animation: none !important;
  transition: none !important;
  /* Обеспечиваем, что элемент всегда видим */
  visibility: visible !important;
  opacity: 1 !important;
  /* Обеспечиваем правильное отображение */
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  /* Добавляем поддержку для iOS Safari */
  -webkit-transform: translateZ(0) !important;
  transform: translateZ(0) !important;
  /* Обеспечиваем, что навигация всегда поверх контента */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  /* Принудительно обеспечиваем позиционирование */
  will-change: transform !important;
  contain: layout style !important;
}

/* Добавляем отступ для контента под фиксированную навигацию */
.menu-container {
  margin-top: 140px !important; /* 80px header + 60px nav */
}

/* Исправляем отступ для десктопа */
@media (min-width: 769px) {
  .menu-container {
    margin-top: 150px !important; /* 80px header + 70px nav */
  }
}

/* Анимация появления навигации */
@keyframes showNav {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cat-nav {
  animation: showNav 0.3s ease-out !important;
}

/* Принудительное переопределение всех возможных конфликтов */
html body .cat-nav,
html body .cat-nav[style*="position"],
html body .cat-nav[style*="z-index"],
html body .cat-nav[style*="display"],
html body .cat-nav[style*="visibility"],
html body .cat-nav[style*="opacity"] {
  position: fixed !important;
  top: 80px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: white !important;
  padding: 1em 0 !important;
  border-bottom: 1px solid #eee !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  animation: none !important;
  transition: none !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  -webkit-transform: translateZ(0) !important;
  transform: translateZ(0) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  will-change: transform !important;
  contain: layout style !important;
}

/* Максимальная специфичность для переопределения любых попыток скрыть навигацию */
html body .cat-nav[style*="display: none"],
html body .cat-nav[style*="visibility: hidden"],
html body .cat-nav[style*="opacity: 0"],
html body .cat-nav[style*="z-index: -1"],
html body .cat-nav[style*="position: absolute"],
html body .cat-nav[style*="position: static"],
html body .cat-nav[style*="position: relative"] {
  position: fixed !important;
  top: 80px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: white !important;
  padding: 1em 0 !important;
  border-bottom: 1px solid #eee !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  animation: none !important;
  transition: none !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  -webkit-transform: translateZ(0) !important;
  transform: translateZ(0) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  will-change: transform !important;
  contain: layout style !important;
}

/* Мобильные устройства */
@media (max-width: 768px) {
  .cat-nav {
    position: fixed !important;
    top: 72px !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0.5em 0 !important;
    /* Принудительно отключаем все анимации */
    animation: none !important;
    transition: none !important;
    /* Обеспечиваем, что элемент всегда видим */
    visibility: visible !important;
    opacity: 1 !important;
    /* Обеспечиваем правильное отображение */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Планшеты */
@media (max-width: 1024px) and (min-width: 769px) {
  .cat-nav {
    top: 70px !important;
    padding: 0.8em 0 !important;
    /* Принудительно отключаем все анимации */
    animation: none !important;
    transition: none !important;
    /* Обеспечиваем, что элемент всегда видим */
    visibility: visible !important;
    opacity: 1 !important;
    /* Обеспечиваем правильное отображение */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* iOS Safari */
@supports (-webkit-touch-callout: none) {
  .cat-nav {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 72px !important;
    z-index: 100 !important;
    /* Принудительно отключаем все анимации */
    animation: none !important;
    transition: none !important;
    /* Обеспечиваем, что элемент всегда видим */
    visibility: visible !important;
    opacity: 1 !important;
    /* Обеспечиваем правильное отображение */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Добавляем поддержку для iOS Safari */
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    /* Добавляем фон для лучшей видимости */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }
}

/* Экран с низкой высотой */
@media screen and (max-height: 600px) {
  .cat-nav {
    top: 72px !important;
    padding: 0.2em 0.4rem !important;
    margin: 0 0 0.1rem 0 !important;
    /* Принудительно отключаем все анимации */
    animation: none !important;
    transition: none !important;
    /* Обеспечиваем, что элемент всегда видим */
    visibility: visible !important;
    opacity: 1 !important;
    /* Обеспечиваем правильное отображение */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Очень низкие экраны */
@media screen and (max-height: 400px) {
  .cat-nav {
    top: 72px !important;
    padding: 0.1em 0.2rem !important;
    margin: 0 0 0.05rem 0 !important;
    /* Принудительно отключаем все анимации */
    animation: none !important;
    transition: none !important;
    /* Обеспечиваем, что элемент всегда видим */
    visibility: visible !important;
    opacity: 1 !important;
    /* Обеспечиваем правильное отображение */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Экран с очень низкой высотой */
@media screen and (max-height: 300px) {
  .cat-nav {
    top: 72px !important;
    padding: 0.05em 0.1rem !important;
    margin: 0 !important;
    /* Принудительно отключаем все анимации */
    animation: none !important;
    transition: none !important;
    /* Обеспечиваем, что элемент всегда видим */
    visibility: visible !important;
    opacity: 1 !important;
    /* Обеспечиваем правильное отображение */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}
