/* ========== ХЕДЕР — ПОЛНЫЙ КОД (ИСПРАВЛЕННЫЙ) ========== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  background: rgba(10, 15, 28, 0.95);
  backdrop-filter: blur(12px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Левая часть — логотип */
.header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.company-name {
  display: none; /* Скрываем текст на всех устройствах для компактности */
}

/* Центральная часть — поиск + кнопка админа */
.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* Поисковая строка */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 20, 35, 0.8);
  border-radius: 10px;
  padding: 4px 6px 4px 14px;
  gap: 6px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  transition: all 0.2s ease;
  flex: 1;
  min-width: 0;
}

.header-search:focus-within {
  background: rgba(20, 30, 50, 0.9);
}

.header-search .fa-search {
  color: #5f6b8a;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.global-search-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  flex: 1;
  padding: 8px 0;
}

.global-search-input::placeholder {
  color: #4a5568;
  font-size: 0.85rem;
}

.clear-search-icon {
  color: #5f6b8a;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.clear-search-icon:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* Кнопка поиска */
.search-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-btn i {
  font-size: 0.9rem;
}

.search-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  transform: scale(1.02);
}

/* Кнопка админ-панели */
.admin-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.admin-toggle-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border-color: transparent;
}

/* Выпадающий список результатов */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 20, 35, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 8px 0;
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(59, 130, 246, 0.15);
}

.search-result-item i {
  color: #60a5fa;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.search-result-info {
  flex: 1;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #f0f0f0;
  margin-bottom: 2px;
}

.search-result-price {
  font-size: 0.75rem;
  color: #22c55e;
  font-weight: 700;
}

.search-result-category {
  font-size: 0.65rem;
  color: #6b7a9e;
  margin-top: 2px;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: #6b7a9e;
  font-size: 0.85rem;
}

/* Десктопная навигация */
.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(10, 15, 28, 0.6);
  backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 10px ;
  flex-shrink: 0;
}

.nav-link {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link i {
  font-size: 0.9rem;
}

.nav-link:hover {
  color: white;
  background: rgba(59, 130, 246, 0.15);
}

.nav-link.active {
  color: white;
  background: linear-gradient(105deg, #3b82f6, #4f46e5);
}

/* Скроллбар для выпадающего списка */
.search-results-dropdown::-webkit-scrollbar {
  width: 4px;
}

.search-results-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.search-results-dropdown::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 10px;
}

/* ========== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */

@media (max-width: 768px) {
  .header {
    padding: 6px 10px;
    gap: 6px;
  }
  
  .header-logo {
    height: 28px;
  }
  
  .header-search {
    padding: 2px 4px 2px 10px;
  }
  
  .global-search-input {
    font-size: 0.85rem;
    padding: 6px 0;
  }
  
  .global-search-input::placeholder {
    font-size: 0.8rem;
  }
  
  .search-btn {
    width: 32px;
    height: 32px;
  }
  
  .admin-toggle-btn {
    width: 32px;
    height: 32px;
  }
  
  .search-results-dropdown {
    position: fixed;
    top: 50px;
    left: 10px;
    right: 10px;
    max-height: 60vh;
  }
  
  .nav-links {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .header {
    padding: 4px 8px;
  }
  
  .header-logo {
    height: 24px;
  }
  
  .header-search {
    padding: 2px 4px 2px 8px;
  }
  
  .global-search-input {
    font-size: 0.8rem;
  }
  
  .search-btn {
    width: 30px;
    height: 30px;
  }
  
  .admin-toggle-btn {
    width: 30px;
    height: 30px;
  }
}

/* Показываем десктопную навигацию на больших экранах */
@media (min-width: 769px) {
  .nav-links {
    display: flex;
  }
  
  .bottom-nav {
    display: none !important;
  }
}

/* Скрываем старый поиск на главной */
.home-search {
  display: none;
}

/* Принудительное изменение радиуса у верхней панели */
.nav-links {
  border-radius: 12px !important;
}

.nav-link {
  border-radius: 30px !important;
}