/* ==================================================================
   ВЕРХНЯЯ ПАНЕЛЬ (TOP HEADER)
   ================================================================== */

.top-header {
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6 !important;
  position: relative !important;
  z-index: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.top-header .container {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}

.top-header .container > .row {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  width: 100% !important;
  margin: 0 !important;
}

.top-header .col-md-6 {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  padding: 0 !important;
}

/* Левая часть - ссылки */
.top-header .col-md-6:first-child .d-flex {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 8px !important;
}

.top-header .col-md-6:first-child .nav-link {
  padding: 4px 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 6px !important;
  background-color: rgba(255, 255, 255, 0.7) !important;
  color: #565657 !important;
  font-weight: 500 !important;
  font-size: 0.8rem !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.top-header .col-md-6:first-child .nav-link:hover {
  background-color: rgba(248, 249, 250, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #232528 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-1px) !important;
}

.top-header .col-md-6:first-child .nav-link:active {
  transform: translateY(0) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

/* Правая часть - контакты */
.top-header .col-md-6.text-md-end {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  height: 100% !important;
}

.top-header .col-md-6.text-md-end > .d-flex {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 15px !important;
}

.top-header .d-flex.align-items-center {
  padding: 4px 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 6px !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
  transition: all 0.2s ease !important;
  height: 28px !important;
  gap: 6px !important;
}

.top-header .d-flex.align-items-center:hover {
  background-color: rgba(248, 249, 250, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Внутренние элементы */
.top-header .d-flex > *,
.top-header .d-flex.flex-column.flex-md-row > *,
.top-header .d-flex.align-items-center > * {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}

.top-header a,
.top-header .nav-link,
.top-header .small,
.top-header .text-muted {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.top-header .bi {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  margin: 0 !important;
  font-size: 0.75rem !important;
  color: #6c757d !important;
}

.top-header .small.text-muted {
  color: #56595e !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
}

.top-header a.small.text-decoration-none {
  color: #56595e !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}

.top-header a.small.text-decoration-none:hover {
  color: #232528 !important;
  text-decoration: underline !important;
}

.top-header * {
  box-sizing: border-box !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Мобильная версия */
@media (max-width: 768px) {
  .top-header {
    height: auto !important;
    min-height: 44px !important;
    padding: 5px 0 !important;
  }
  
  .top-header .container > .row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  
  .top-header .col-md-6 {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  
  .top-header .col-md-6:first-child .d-flex {
    gap: 5px !important;
    flex-wrap: wrap !important;
  }
  
  .top-header .col-md-6:first-child .nav-link {
    padding: 3px 8px !important;
    height: 26px !important;
    font-size: 0.75rem !important;
  }
  
  .top-header .col-md-6.text-md-end > .d-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }
  
  .top-header .d-flex.align-items-center {
    padding: 3px 6px !important;
    height: 26px !important;
  }
}

@media (max-width: 576px) {
  .top-header .col-md-6:first-child .nav-link {
    margin-bottom: 2px !important;
  }
  
  .top-header .d-flex.align-items-center {
    margin-bottom: 2px !important;
  }
}

/* Анимация появления */
.top-header,
.top-header * {
  animation: fadeIn 0.3s ease-in !important;
}

@keyframes fadeIn {
  from { opacity: 0.9; }
  to { opacity: 1; }
}

/* ==================================================================
   ПЕРЕОПРЕДЕЛЕНИЕ СТАРЫХ СТИЛЕЙ ПОИСКА (ДЛЯ БЕЗОПАСНОСТИ)
   ================================================================== */
.search-container,
.search-toggle-btn,
.search-form-container,
.search-form,
.search-input,
.search-close {
  /* Сбрасываем или игнорируем старые стили, 
     т.к. теперь используем новые классы .search-wrapper и т.д. */
  display: none;
}