/* ================================================================
   Sportshop Search — Frontend Styles
   ================================================================ */

/* ----------------------------------------------------------------
   Форма поиска (.ss-search)
   ---------------------------------------------------------------- */

.ss-search {
	position: relative;
	width: 100%;
}

.ss-search__inner {
	display: flex;
	align-items: center;
	background: transparent;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 5px 10px;
	gap: 8px;
	transition: border-color .15s, background .15s;
}

.ss-search__inner:focus-within {
	background: #fff;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, .18);
}

.ss-search__icon {
	flex-shrink: 0;
	color: #1d2327;
}

.ss-search__input {
	flex: 1;
	border: none !important;
	box-shadow: none !important;
	background: transparent;
	outline: none;
	font-size: 14px;
	line-height: 1;
	padding: 10px 0;
	color: #1d2327;
	min-width: 0;
}

.ss-search__input::placeholder {
	color: #787c82;
}

.ss-search__clear {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 2px;
	color: #787c82;
	border-radius: 50%;
	transition: color .15s, background .15s;
}

.ss-search__clear:hover {
	color: #1d2327;
	background: rgba(0,0,0,.06);
}

/* ----------------------------------------------------------------
   Варианты контекста
   ---------------------------------------------------------------- */

/* В шапке — фон прозрачный, под стиль темы */
.ss-search--header .ss-search__inner {
	background: rgba(255,255,255,.12);
	border-color: #dcdcde;
}


.ss-search--header .ss-search__inner:focus-within {
	background: rgba(255,255,255,.22);
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34,113,177,.18);
}


/* ----------------------------------------------------------------
   Выпадающий список (.ss-search__dropdown)
   Прикреплён к document.body — не зависит от overflow родителей
   ---------------------------------------------------------------- */

.ss-search__dropdown {
	position: absolute; /* top/left/width задаются через JS */
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0,0,0,.14);
	z-index: 99999;
	overflow: hidden;
	max-height: 420px;
	overflow-y: auto;
	min-width: 520px;
}

/* Статус: «Поиск...» / «Ничего не найдено» */
.ss-dropdown__status {
	display: block;
	padding: 12px 16px;
	font-size: 13px;
	color: #787c82;
}

/* Элемент результата */
.ss-dropdown__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 14px;
	text-decoration: none;
	color: #1d2327;
	transition: background .12s;
}

.ss-dropdown__item:hover {
	background: #f6f7f7;
	color: #1d2327;
	text-decoration: none;
}

.ss-dropdown__img {
	flex-shrink: 0;
	width: 46px;
	height: 46px;
	object-fit: contain;
	border-radius: 4px;
	border: 1px solid #f0f0f1;
	background: #fafafa;
}

.ss-dropdown__img--placeholder {
	background: #f0f0f1;
}

.ss-dropdown__info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ss-dropdown__title {
	font-size: 12px;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ss-dropdown__price {
	font-size: 12px;
	color: #2271b1;
	font-weight: 600;
}

.ss-dropdown__price .woocommerce-Price-amount {
	color: inherit;
}

/* ---- Кастомные цены (custom-prices-woocommerce) внутри dropdown ---- */

.ss-dropdown__price .custom-price-wrap {
	display: flex;
	flex-direction: row;
	gap: 10px;
	flex-wrap: wrap;
}

.ss-dropdown__price .file_wrap_item.price_wrap {
	display: flex;
	align-items: baseline;
	gap: 4px;
	flex-wrap: nowrap;
}

/* Метка «Цена (от рулона):» — серая, мелкая */
.ss-dropdown__price .file_wrap-weght {
	font-size: 11px;
	font-weight: 400;
	color: #787c82;
	white-space: nowrap;
}

/* Мобильный дубль метки — скрыть в dropdown */
.ss-dropdown__price .file_wrap-weght--mobile {
	display: none;
}

/* Сама цифра цены внутри .price_wrap */
.ss-dropdown__price .file_wrap_item .price {
	font-size: 13px;
	font-weight: 700;
	color: #000;
	white-space: nowrap;
}

.ss-dropdown__price .file_wrap_item .price .woocommerce-Price-amount {
	color: inherit;
}

/* Плашка исправления раскладки в dropdown */
.ss-dropdown__corrected {
	display: block;
	padding: 6px 14px;
	font-size: 12px;
	color: #787c82;
	background: #f6f7f7;
	border-bottom: 1px solid #f0f0f1;
}

.ss-dropdown__corrected em {
	font-style: normal;
	color: #2271b1;
	font-weight: 600;
}

/* Плашка исправления на странице результатов */
.ss-results-page__corrected {
	margin-bottom: 12px;
	font-size: 14px;
	color: #787c82;
}

.ss-results-page__corrected em {
	font-style: normal;
	color: #2271b1;
	font-weight: 600;
}

/* Ссылка «Показать все результаты» */
.ss-dropdown__all {
	display: block;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #2271b1;
	text-decoration: none;
	border-top: 1px solid #f0f0f1;
	text-align: center;
	transition: background .12s;
}

.ss-dropdown__all:hover {
	background: #f6f7f7;
	color: #135e96;
	text-decoration: none;
}

/* ================================================================
   Страница результатов ([ss_search_page])
   ================================================================ */

.ss-results-page {
	width: 100%;
}

/* ---- Поисковое поле на странице результатов ---- */

.ss-results-page__search-form {
	margin-bottom: 28px;
}

.ss-results-page__search-wrap {
	display: flex;
	align-items: center;
	gap: 0;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 5px 16px;
	transition: border-color .15s, box-shadow .15s;
}

.ss-results-page__search-wrap:focus-within {
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34,113,177,.18);
}

.ss-results-page__search-icon {
	flex-shrink: 0;
	color: #1d2327;
	margin-right: 10px;
}

.ss-results-page__search-input {
	flex: 1;
	border: none !important;
	box-shadow: none !important;
	outline: none;
	background: transparent;
	font-size: 16px;
	padding: 14px 0;
	color: #1d2327;
	min-width: 0;
}

.ss-results-page__search-input::placeholder {
	color: #787c82;
}

.ss-results-page__search-btn {
	flex-shrink: 0;
	padding: 8px 20px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
	white-space: nowrap;
}

.ss-results-page__search-btn:hover {
	background: #135e96;
}

/* ---- Панель фильтров (не используется, сохранена для возможного возврата) ---- */

.ss-filters {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 28px;
}

.ss-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.ss-filters__search {
	flex: 1 1 200px;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 0 10px;
	color: #787c82;
}

.ss-filters__search:focus-within {
	border-color: #2271b1;
}

.ss-filters__input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 14px;
	padding: 9px 0;
	color: #1d2327;
	background: transparent;
}

.ss-filters__select {
	flex: 0 1 180px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 9px 10px;
	font-size: 14px;
	background: #fff;
	color: #1d2327;
	cursor: pointer;
}

.ss-filters__price {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 1 auto;
}

.ss-filters__price-input {
	width: 90px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 9px 10px;
	font-size: 14px;
	color: #1d2327;
}

.ss-filters__btn {
	padding: 9px 22px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	transition: background .15s;
	white-space: nowrap;
}

.ss-filters__btn:hover {
	background: #135e96;
}

/* ---- Сводка ---- */

.ss-results-page__summary {
	margin-bottom: 20px;
	font-size: 14px;
	color: #50575e;
}

/* ---- Сетка товаров ---- */

.ss-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 32px;
}

.ss-product-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: #1d2327;
	transition: box-shadow .2s, transform .2s;
	background: #fff;
}

.ss-product-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,.1);
	transform: translateY(-2px);
	color: #1d2327;
	text-decoration: none;
}

.ss-product-card__img-wrap {
	aspect-ratio: 1;
	overflow: hidden;
	background: #f6f7f7;
}

.ss-product-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	padding: 8px;
}

.ss-product-card__img--placeholder {
	width: 100%;
	height: 100%;
	background: #ececec;
}

.ss-product-card__body {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ss-product-card__title {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ss-product-card__price {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #2271b1;
}

.ss-product-card__price .woocommerce-Price-amount {
	color: inherit;
}

/* ---- Пагинация ---- */

.ss-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.ss-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	font-size: 14px;
	text-decoration: none;
	color: #1d2327;
	background: #fff;
	transition: background .15s, border-color .15s;
}

.ss-pagination__btn:hover {
	background: #f6f7f7;
	color: #1d2327;
	text-decoration: none;
}

.ss-pagination__btn--active {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.ss-pagination__btn--active:hover {
	background: #135e96;
	border-color: #135e96;
	color: #fff;
}

.ss-results-page__empty {
	color: #787c82;
	font-size: 15px;
}

/* ----------------------------------------------------------------
   Адаптив
   ---------------------------------------------------------------- */

@media (max-width: 768px) {
	.ss-filters__row {
		flex-direction: column;
		align-items: stretch;
	}

	.ss-filters__select,
	.ss-filters__btn {
		flex: 1 1 auto;
		width: 100%;
	}

	.ss-filters__price {
		width: 100%;
	}

	.ss-filters__price-input {
		flex: 1;
		width: auto;
	}

	.ss-results-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 12px;
	}
}
