﻿/* Контейнер поискового модуля */
.search-module-container {
    display: flex;
    align-items: center;
    width: 100%;
}

/* 1. КРУГЛАЯ КНОПКА ЗАПУСКА ПОИСКА */
.search-open-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.search-open-trigger:hover {
    transform: scale(1.08); /* Легкий интерактивный зум */
}

.search-open-trigger svg {
    display: block;
}

/* 2. РАСКРЫВАЮЩАЯСЯ ПАНЕЛЬ ПОИСКА */
.search-expand-bar {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    /* Легкая плавная анимация развертывания сверху вниз с эффектом появления */
    animation: slideInSearch 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInSearch {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Обертка поля ввода */
.search-input-field-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Входное поле (Стиль пилюли со скриншота) */
.search-expand-bar .search-input {
    width: 100%;
    height: 58px; /* Идеальная высота для сопряжения с шапкой */
    padding: 0 90px 0 25px; /* Отступ справа под блок иконок */
    background-color: #ffffff;
    border: 3px solid var(--lightBlue); /* Фирменный темно-синий/грифельный бортик */
    border-radius: 24px; /* Полуокруглая рамка (пилюля) */
    font-size: 15px;
    color: #23313d;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: box-shadow 0.25s ease;
    margin-top: 1px;
    margin-bottom: 1px;
}

.search-expand-bar .search-input::placeholder {
    color: #8fa0af; /* Красивый приглушенный цвет плейсхолдера */
}

.search-expand-bar .search-input:focus {
    box-shadow: 0 4px 15px rgba(35, 49, 61, 0.15); /* Объемное свечение */
}

/* Блок иконок внутри инпута справа */
.search-bar-icons {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 15px; /* Зазор между лупой и крестиком закрытия */
    z-index: 5;
}

/* Иконка поиска внутри инпута */
.search-submit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    pointer-events: none; /* Лупа внутри поля не кликабельна */
}

/* Кнопка закрытия поиска (Крестик) */
.search-close-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.search-close-trigger:hover {
    transform: scale(1.15) rotate(90deg); /* Плавный красивый поворот крестика при наведении */
}

/* 3. РЕЗУЛЬТАТЫ ПОИСКА (Позиционируются под инпутом) */
.search-expand-bar .search-results-container {
    position: absolute;
    top: calc(100% - 7px);
    left: 10px;
    right: 10px;
    background: #ffffff;
    border: 1px solid #e0e5eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(35, 49, 61, 0.18);
    z-index: 99999;
    max-height: 380px;
    overflow-y: auto;
    padding: 20px;
    text-align: left;
}

/* Адаптивность ширины */
#div6.search-active #global2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1;
    grid-column: 1 / -1;
}

/* Скрываем ненужные элементы при открытом поиске */
#div6.search-active #global0,
#div6.search-active #global1 {
    display: none !important;
}
