/* WooCommerce Auto Parts Search — оранжево-сива тема */

.abp-search-widget {
	--abp-orange: #e8541e;
	--abp-orange-dark: #cc4315;
	--abp-gray-900: #3d4045;
	--abp-gray-700: #6b6f76;
	--abp-gray-400: #9a9ea5;
	--abp-gray-200: #d8dade;
	--abp-gray-100: #eef0f2;
	--abp-white: #ffffff;

	box-sizing: border-box;
	background: var(--abp-gray-100);
	border: 1px solid var(--abp-gray-200);
	border-radius: 6px;
	padding: 28px 28px 24px;
	max-width: 920px;
	margin: 0 auto 28px;
	font-family: inherit;
}

.abp-search-widget *,
.abp-search-widget *::before,
.abp-search-widget *::after {
	box-sizing: border-box;
}

.abp-search-widget .abp-title {
	margin: 0 0 16px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--abp-gray-700);
	text-align: center;
}

.abp-row-vehicle {
	display: flex;
	gap: 12px;
}

.abp-field {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
}

.abp-field select.abp-locked {
	opacity: 0.55;
	cursor: not-allowed;
	background-color: var(--abp-gray-100);
}

.abp-field-hint {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 6px;
	background: #fff4ea;
	border: 1px solid #f3c8b3;
	color: #8a4322;
	font-size: 12px;
	line-height: 1.4;
	padding: 6px 10px;
	border-radius: 4px;
	z-index: 15;
	box-shadow: 0 4px 10px rgba(61, 64, 69, 0.1);
}

.abp-field select {
	width: 100%;
	height: 46px;
	padding: 0 36px 0 14px;
	border: 1px solid var(--abp-gray-200);
	border-radius: 4px;
	background-color: var(--abp-white);
	color: var(--abp-gray-900);
	font-size: 14px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6f76'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.abp-field select:hover {
	border-color: var(--abp-gray-400);
}

.abp-field select:focus-visible,
.abp-field-with-btn input:focus-visible,
.abp-btn-search:focus-visible,
.abp-btn-garage:focus-visible {
	outline: 2px solid var(--abp-orange);
	outline-offset: 1px;
}

.abp-btn-search {
	flex: 0 0 46px;
	width: 46px;
	height: 46px;
	background: var(--abp-orange);
	border: none;
	border-radius: 4px;
	color: var(--abp-white);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}

.abp-btn-search:hover {
	background: var(--abp-orange-dark);
}

.abp-row-secondary {
	display: flex;
	gap: 28px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--abp-gray-200);
}

.abp-row-secondary .abp-search-block {
	flex: 1 1 0;
	min-width: 0;
}

.abp-row-secondary .abp-title {
	text-align: left;
}

.abp-title-accent {
	color: var(--abp-orange);
}

.abp-field-with-btn {
	display: flex;
	gap: 8px;
}

.abp-field-with-btn input[type='text'] {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--abp-gray-200);
	border-radius: 4px;
	background: var(--abp-white);
	color: var(--abp-gray-900);
	font-size: 14px;
	transition: border-color 0.15s ease;
}

.abp-field-with-btn input[type='text']:hover {
	border-color: var(--abp-gray-400);
}

.abp-field-with-btn input[type='text']::placeholder {
	color: var(--abp-gray-400);
}

.abp-garage-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 22px;
	text-align: center;
}

.abp-btn-garage {
	flex: 0 0 auto;
	background: var(--abp-gray-700);
	color: var(--abp-white);
	border: none;
	padding: 11px 20px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.abp-btn-garage:hover {
	background: var(--abp-gray-900);
}

.abp-garage-hint {
	color: var(--abp-gray-400);
	font-size: 13px;
}

.abp-garage-panel {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	text-align: left;
	margin-top: 10px;
	background: var(--abp-white);
	border: 1px solid var(--abp-gray-200);
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(61, 64, 69, 0.12);
	padding: 14px;
	width: 300px;
	max-width: 90vw;
	z-index: 20;
}

.abp-garage-list {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}

.abp-garage-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 9px 6px;
	border-bottom: 1px solid var(--abp-gray-100);
	font-size: 13px;
	color: var(--abp-gray-900);
	cursor: pointer;
}

.abp-garage-item:last-child {
	border-bottom: none;
}

.abp-garage-item:hover {
	background: var(--abp-gray-100);
}

.abp-garage-item-label {
	flex: 1 1 auto;
}

.abp-garage-item-remove {
	flex: 0 0 auto;
	background: none;
	border: none;
	color: var(--abp-gray-400);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}

.abp-garage-item-remove:hover {
	color: var(--abp-orange);
}

.abp-garage-empty {
	color: var(--abp-gray-400);
	font-size: 13px;
	margin: 4px 0 10px;
}

.abp-garage-save {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--abp-gray-900);
	cursor: pointer;
	border-top: 1px solid var(--abp-gray-100);
	padding-top: 10px;
}

.abp-active-filters {
	background: #fff2ea;
	border: 1px solid #f3c6ab;
	color: #8a4322;
	padding: 11px 16px;
	border-radius: 4px;
	margin: 0 0 20px;
	font-size: 14px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (max-width: 720px) {
	.abp-search-widget {
		padding: 20px 16px;
	}
	.abp-row-vehicle {
		flex-wrap: wrap;
	}
	.abp-row-vehicle .abp-field {
		flex: 1 1 100%;
	}
	.abp-row-vehicle .abp-btn-search {
		flex: 1 1 100%;
		width: 100%;
	}
	.abp-row-secondary {
		flex-direction: column;
		gap: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.abp-search-widget * {
		transition: none !important;
	}
}

/* Резултати като категории (режим "търси по категории") */

.abp-category-results {
	max-width: 1140px;
	margin: 0 auto 28px;
}

.abp-category-results-intro {
	font-size: 15px;
	color: #3d4045;
	margin: 0 0 18px;
}

.abp-category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 16px;
}

.abp-category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 20px 12px;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.abp-category-card:hover {
	border-color: #e8541e;
	box-shadow: 0 6px 16px rgba(61, 64, 69, 0.1);
}

.abp-category-card-img {
	width: 76px;
	height: 76px;
	object-fit: contain;
	margin-bottom: 12px;
}

.abp-category-card-name {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #3d4045;
}

@media (max-width: 480px) {
	.abp-category-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 12px;
	}
}

/* Страничен филтър по атрибути (Производител, Капацитет и т.н.) */

.abp-attr-filters {
	background: #eef0f2;
	border: 1px solid #d8dade;
	border-radius: 6px;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.abp-attr-group {
	padding-bottom: 0;
	border-bottom: none;
	margin-bottom: 0;
}

.abp-attr-group-title {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #3d4045;
	margin: 0 0 10px;
}

.abp-attr-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}

.abp-attr-list li {
	padding: 4px 0;
}

.abp-attr-list label {
	display: block;
	font-size: 13px;
	color: #3d4045;
	cursor: pointer;
	font-weight: normal;
}

.abp-attr-list input[type="checkbox"] {
	margin-right: 6px;
	vertical-align: middle;
}

.abp-attr-count {
	color: #9a9ea5;
}

.abp-attr-apply {
	width: 100%;
	background: #e8541e;
	color: #ffffff;
	border: none;
	padding: 11px;
	border-radius: 4px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 12px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.abp-attr-apply:hover {
	background: #cc4315;
}

/* ============================================================
   Двуколонна структура: филтър + продукти. Две независими
   настройки (Продукти → Търсачка авточасти) решават дали филтърът
   е вграден постоянно, или скрит зад плаващ бутон с лупа — отделно
   за мобилни (клас .abp-mtoggle) и за компютър (клас .abp-dtoggle).
   Класовете седят директно върху бутона/фона/панела (не върху
   външна обвивка), затова работят еднакво и при автоматичното
   показване (над продуктите), и при шорткода [abp_attribute_filters]
   поставен ръчно (напр. в Elementor колона, без .abp-layout-with-filters
   изобщо да съществува в тази страница).
   ============================================================ */

.abp-layout-with-filters {
	margin-bottom: 24px;
}

.abp-layout-products-col {
	min-width: 0;
}

/* Бутонът, фонът и бутонът за затваряне тръгват скрити по подразбиране;
   само правилата по-долу (според клас + ширина на екрана) ги показват. */
.abp-filter-toggle-btn,
.abp-filter-backdrop,
.abp-layout-filter-col .abp-filter-close-btn {
	display: none !important;
}

/* ---------- Компютър (≥783px) ---------- */
@media (min-width: 783px) {

	/* Автоматичният режим слага филтъра и продуктите един до друг. Ако
	   бутонът с лупа е активен (.abp-dtoggle), самата колона на филтъра
	   излиза от нормалния поток (position:fixed по-долу), затова редът
	   продължава да работи коректно и в двата случая. */
	.abp-layout-with-filters {
		display: flex;
		gap: 28px;
		align-items: flex-start;
	}
	.abp-layout-filter-col:not(.abp-dtoggle) {
		flex: 0 0 260px;
		max-width: 260px;
	}
	.abp-layout-products-col {
		flex: 1;
	}

	/* С активна отметка за компютър — филтърът става плъзгащ панел зад
	   бутон с лупа, също като на мобилни. Важи еднакво в автоматичния
	   режим и при шорткода. */
	.abp-filter-toggle-btn.abp-dtoggle,
	.abp-filter-backdrop.abp-dtoggle {
		display: block !important;
	}
	.abp-filter-toggle-btn.abp-dtoggle {
		display: flex !important;
	}
	.abp-layout-filter-col.abp-dtoggle {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: 360px;
		max-width: 90vw;
		background: #ffffff;
		z-index: 100002;
		overflow-y: auto;
		padding: 24px;
		box-shadow: -6px 0 18px rgba(61, 64, 69, 0.2);
		transform: translateX(100%);
		transition: transform 0.25s ease;
	}
	.abp-layout-filter-col.abp-dtoggle.abp-filter-open {
		transform: translateX(0);
	}
	.abp-layout-filter-col.abp-dtoggle .abp-filter-close-btn {
		display: block !important;
	}
}

/* ---------- Мобилни (≤782px) ---------- */
@media (max-width: 782px) {
	.abp-layout-with-filters {
		display: block;
	}
	.abp-layout-products-col {
		width: 100%;
	}

	/* Без отметка "показвай бутон... мобилна" — филтърът стои вграден,
	   на цяла ширина, постоянно видим над продуктите. */
	.abp-layout-filter-col:not(.abp-mtoggle) {
		width: 100%;
		margin-bottom: 20px;
	}

	/* С активна отметка за мобилни (по подразбиране Е активна) —
	   плъзгащ панел зад бутон с лупа. Важи еднакво в автоматичния
	   режим и при шорткода. */
	.abp-filter-toggle-btn.abp-mtoggle,
	.abp-filter-backdrop.abp-mtoggle {
		display: block !important;
	}
	.abp-filter-toggle-btn.abp-mtoggle {
		display: flex !important;
	}
	.abp-layout-filter-col.abp-mtoggle {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: 85%;
		max-width: 320px;
		background: #ffffff;
		z-index: 100002;
		overflow-y: auto;
		padding: 20px;
		box-shadow: -6px 0 18px rgba(61, 64, 69, 0.2);
		transform: translateX(100%);
		transition: transform 0.25s ease;
	}
	.abp-layout-filter-col.abp-mtoggle.abp-filter-open {
		transform: translateX(0);
	}
	.abp-layout-filter-col.abp-mtoggle .abp-filter-close-btn {
		display: block !important;
	}
}

/* ---------- Общ вид на плъзгащия панел (и двата случая) ---------- */

.abp-layout-filter-col.abp-mtoggle .abp-attr-filters,
.abp-layout-filter-col.abp-dtoggle .abp-attr-filters {
	background: none;
	border: none;
	padding: 0;
	margin-top: 34px;
}

.abp-filter-close-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: none;
	background: #eef0f2;
	color: #3d4045;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

/* Затъмнен фон зад панела, когато е отворен. */
.abp-filter-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(29, 30, 32, 0.5);
	z-index: 100001;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
}

.abp-filter-backdrop.abp-filter-open {
	opacity: 1;
	visibility: visible;
}

/* Плаващ бутон "Филтър" — фиксиран вдясно, вертикално центриран, стои
   на едно място независимо от скрола. !important навсякъде, защото
   общи стилове на бутони от темата/Elementor иначе го "прегазват". */
.abp-filter-toggle-btn {
	position: fixed !important;
	top: 50% !important;
	left: auto !important;
	right: 0 !important;
	bottom: auto !important;
	margin: 0 !important;
	transform: translateY(-50%) !important;
	z-index: 100000 !important;
	box-sizing: border-box !important;
	width: 56px !important;
	height: 56px !important;
	min-width: 56px !important;
	max-width: 56px !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 2px !important;
	background: #df8438 !important;
	background-color: #df8438 !important;
	color: #ffffff !important;
	border: none !important;
	outline: none !important;
	border-radius: 6px 0 0 6px !important;
	box-shadow: -2px 2px 10px rgba(61, 64, 69, 0.25) !important;
	cursor: pointer !important;
	padding: 0 !important;
	line-height: 1 !important;
	text-align: center !important;
}

.abp-filter-toggle-btn svg {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
	margin: 0 auto !important;
	fill: #ffffff !important;
	color: #ffffff !important;
}

.abp-filter-toggle-btn span {
	display: block !important;
	width: 100% !important;
	font-size: 10px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.02em !important;
	line-height: 1 !important;
	color: #ffffff !important;
	text-align: center !important;
}

body.abp-filter-noscroll {
	overflow: hidden;
}
