/**
 * Crosses Search Modal
 * Модальное окно для отображения результатов поиска кроссов
 */

/* Overlay модального окна */
.crosses-search-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 10000;
	display: none;
	justify-content: center;
	align-items: center;
}

/* Контейнер модального окна */
.crosses-search-modal__container {
	--theme-page-width-padding: 0;
	width: 90%;
	height: 90%;
	background: #fff;
	border-radius: 8px;
	position: relative;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Заголовок модального окна */
.crosses-search-modal__header {
	padding: 20px 60px 20px 50px;
	background: var(--theme-base-color, #365edc);
	border-bottom: 1px solid var(--theme-base-color, #365edc);
	position: relative;
}

/* Заголовок текст */
.crosses-search-modal__title {
	margin: 0;
	font-size: 24px;
	font-weight: bold;
	color: #fff;
}

/* Поисковый запрос в заголовке */
.crosses-search-modal__query {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.9);
	margin-top: 8px;
	/*padding: 8px 12px;*/
	background-color: rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	font-weight: normal;
	line-height: 1.4;
}

.crosses-search-modal__query strong {
	color: #fff;
	font-weight: 600;
}

/* Кнопка закрытия */
.crosses-search-modal__close {
	position: absolute;
	top: 15px;
	right: 20px;
	background: transparent;
	border: none;
	font-size: 32px;
	cursor: pointer;
	color: #fff;
	line-height: 1;
	padding: 0;
	width: 32px;
	height: 32px;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.crosses-search-modal__close:hover {
	opacity: 0.8;
}

/* Контейнер для результатов */
.crosses-search-modal__content {
	padding: 20px 20px 20px 50px;
	overflow-y: auto;
	height: calc(100% - 81px);
}

/* Модификатор видимости */
.crosses-search-modal--visible {
	display: flex !important;
}


.search-fixed {
    top: 0 !important;
    right: 162px !important;
    /*border: 1px solid #fff !important;*/
}

.search-crosses-site-popup {
    flex:1;
    min-width:0;
}

.search-maxwidth-wrapper .search-flex-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
}
.search-maxwidth-wrapper .search-flex-wrapper .bx_searche {
    flex: 1;
    min-width: 0;
}

/* Делайте видимым весь контейнер результатов, прокручивается только .bx_searche */
.title-search-result {
    overflow: visible !important;
    height: 60vh !important;
    max-height: 60vh !important;
    /*border: 2px solid var(--stroke_black) !important;*/
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.3s ease, visibility 1.3s ease;
    z-index: 10000 !important;
    pointer-events: none;
}

.title-search-result.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.title-search-result.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Гарантируем, что именно .bx_searche остаётся с прокруткой */
.title-search-result .search-maxwidth-wrapper {
    overflow: visible !important;
}

/* Обеспечиваем соответствующую высоту для внутренних элементов */
.title-search-result .search-maxwidth-wrapper,
.title-search-result .search-flex-wrapper {
    height: 100%;
}

/* Сохраняем прокрутку для внутренних блоков */
.title-search-result .bx_searche.scrollblock {
    max-height: 100% !important; /* Используем всю доступную высоту родителя */
    overflow-y: auto !important; /* Сохраняем вертикальную прокрутку */

    flex:1;
    min-width:0;
    overflow:auto;
    position: relative;
}



.title-search-result__head {
    text-align: center;
    line-height: 1.2em;
    font-weight: bold;
}



/* Стили для индикатора загрузки */
/*.loading-indicator {*/
/*    position: relative;*/
/*    width: 40px;*/
/*    height: 40px;*/
/*    border: 3px solid rgba(54, 94, 220, 0.3);*/
/*    border-radius: 50%;*/
/*    border-top-color: #365edc;*/
/*    animation: spin 1s ease-in-out infinite;*/
/*}*/

/*@keyframes spin {*/
/*    to { transform: rotate(360deg); }*/
/*}*/

/**
 * История поиска
 * Блок с историей поисковых запросов пользователя
 */

/* Контейнер истории поиска */
.search-history-block {
    position: absolute; /* ВАЖНО: устанавливаем сразу, чтобы избежать reflow при показе */
    /* top, left, width устанавливаются динамически через JavaScript */
    background: #fff;
    z-index: 10000 !important;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    max-height: 400px;
    max-width: 600px;
}

.search-history-block.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Обёртка истории поиска */
.search-history-wrapper {
    padding: 0;
}

/* Заголовок блока истории */
.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

/* Кнопка очистки всей истории */
.search-history-clear {
    font-size: 16px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 2px 6px;
    line-height: 1;
}

.search-history-clear:hover {
    color: #dc3545;
}

/* Контейнер элементов истории */
.search-history-content {
    max-height: 320px;
    overflow-y: auto;
}

/* Элемент истории */
.search-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f5;
}

.search-history-item:hover {
    background-color: #f8f9fa;
}

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

/* Текст запроса */
.search-history-query {
    flex: 1;
    font-size: 14px;
    color: #212529;
    margin-right: 10px;
}

/* Информация о частоте использования */
.search-history-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-history-count {
    font-size: 12px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Кнопка удаления элемента */
.search-history-remove {
    font-size: 14px;
    color: #adb5bd;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 2px 6px;
    line-height: 1;
}

.search-history-remove:hover {
    color: #dc3545;
}

/* Сообщение о пустой истории */
.search-history-empty {
    padding: 24px 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* Анимация появления элементов */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-history-item {
    animation: slideIn 0.2s ease;
}