/* 1. Чистый оверлей на весь экран в самом низу документа */
.search-panel-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.5) !important; /* Плотность затемнения */
    z-index: 1500 !important; /* Ложится поверх абсолютно всего сайта */
    
    /* Плавное появление */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Активация оверлея */
.search-panel-backdrop.is-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* 2. Магия управления слоями через тег body */
/* Когда у body есть этот класс, вся шапка сайта принудительно всплывает над оверлеем */
body.search-is-open header, 
body.search-is-open .header {
    position: relative !important;
    z-index: 2000 !important; /* Значение строго выше, чем 1500 у оверлея */
}

/* Гарантируем, что фон у шапки полностью непрозрачный (белый) */
body.search-is-open header {
    background-color: #ffffff !important;
}
/* КОНТЕЙНЕР ФОРМЫ ПОИСКА */
.header__search-panel-overlay {
    width: 100% !important;
    max-width: 1008px !important; /* Ограничение из Figma */
}

.header__search-panel-overlay form {
    position: relative !important;
    width: 100% !important;
    height: 44px !important;
}

/* ИНПУТ ПОИСКА */
.header__search-panel-overlay .search-panel__input {
    width: 100% !important;
    height: 44px !important;
    padding: 0 48px 0 48px !important; /* Отступы для текста от иконок */
    background: #FFFFFF !important;
    border: 1px solid #2C2C2C !important;
    border-radius: 4px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    color: #2C2C2C !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.header__search-panel-overlay .search-panel__input::placeholder {
    color: #B4BBC7 !important;
}

/* ЛУПА СЛЕВА ВНУТРИ ИНПУТА */
.header__search-panel-overlay .search-panel__icon {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
}

/* КРЕСТИК СПРАВА ВНУТРИ ИНПУТА */
.header__search-panel-overlay .search-panel__close {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.search-modal-found, .search-modal-not-found {
    top: unset;
    left: unset;
    margin-top: 20px;
}