/* Кнопка поиска в шапке */
.header__top {
    position: relative;
}
.search-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: #333;
    transition: color 0.3s ease;
    margin: 3px 5px 0 0;
}
.header__iconsTxt {
    width: 338px !important;
}
.search-toggle-btn:hover {
    color: #007cba;
}
@media (max-width: 1024px) {
  .search-toggle-btn {
    position: absolute;
    right: 50px;
    top: 15px;
  }
  .header:has(.search-toggle) .header__iconsTxt {
    display: block;
  }
  .header:has(.search-toggle) .header__iconsTxt .header__icons {
    display: none;
  }
  .header:has(.search-toggle) .header__iconsTxt .header__txt {
    display: none;
  }
  .header__contacts {
    width: 62.52% !important;
  }
}

/* Затемненный фон */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 9998;
}

/* Всплывающее окно */
.search-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    width: 90%;
    max-width: 600px;
}

.search-popup.active, .search-overlay.active {
    display: block;
}

/* Крестик закрытия */
.search-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    color: #333;
}

/* Форма поиска */
.search-form {
    display: flex;
    gap: 10px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007cba;
}

/* Крестик очистки */
.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    display: none;
}

.search-clear.visible {
    display: block;
}

/* Кнопка поиска */
.search-submit {
    background: #007cba;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: #005a87;
}

/* Результаты автодополнения */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 10000;
}

.search-autocomplete.active {
    display: block;
}

.autocomplete-item {
    display: block;
    color: #333;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}