/* === WC Product Search === */

.wcps-wrapper {
	position: relative;
	width: 100%;
}

/* --- Bar: search + filters inline --- */
.wcps-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: nowrap;
}

/* --- Search box --- */
.wcps-search-box {
	position: relative;
	flex: 1 1 auto;
	min-width: 200px;
}

.wcps-input {
	width: 100%;
	height: 44px;
	padding: 0 42px 0 16px;
	border: 1px solid #d4d4d4;
	border-radius: 8px;
	font-size: 14px;
	color: #1a1a1a;
	background-color: #fafafa;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.wcps-input::placeholder {
	color: #a3a3a3;
}

.wcps-input:focus {
	outline: none;
	border-color: #737373;
	background-color: #fff;
	box-shadow: 0 0 0 3px rgba(115, 115, 115, 0.08);
}

/* --- Search icon (wrapper span) --- */
.wcps-search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	color: #a3a3a3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 16px;
	line-height: 1;
	transition: color 0.2s;
}

.wcps-search-icon svg {
	width: 18px;
	height: 18px;
}

.wcps-search-icon i {
	font-size: inherit;
}

.wcps-input:focus ~ .wcps-search-icon {
	color: #737373;
}

/* --- Spinner --- */
.wcps-spinner {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid #e5e5e5;
	border-top-color: #737373;
	border-radius: 50%;
	animation: wcps-spin 0.6s linear infinite;
}

@keyframes wcps-spin {
	to { transform: translateY(-50%) rotate(360deg); }
}

/* --- Dropdown --- */
.wcps-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 9999;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	max-height: 380px;
	overflow-y: auto;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wcps-dropdown-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.12s;
	border-bottom: 1px solid #f5f5f5;
}

.wcps-dropdown-item:last-child {
	border-bottom: none;
}

.wcps-dropdown-item:first-child {
	border-radius: 8px 8px 0 0;
}

.wcps-dropdown-item:last-child {
	border-radius: 0 0 8px 8px;
}

.wcps-dropdown-item:only-child {
	border-radius: 8px;
}

.wcps-dropdown-item:hover {
	background-color: #f5f5f5;
}

.wcps-item-thumb {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
	background: #f5f5f5;
}

.wcps-item-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1;
}

.wcps-item-name {
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wcps-item-price {
	font-size: 13px;
	color: #737373;
}

.wcps-no-results {
	padding: 20px 16px;
	text-align: center;
	color: #a3a3a3;
	font-size: 14px;
}

/* --- Filters --- */
.wcps-filters {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 12px;
	flex-shrink: 0;
}

.wcps-filter,
.wcps-category-filter,
.wcps-brand-filter {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.wcps-category-filter,
.wcps-brand-filter {
	flex-shrink: 0;
}

.wcps-filter-label {
	font-size: 13px;
	font-weight: 600;
	color: #525252;
	white-space: nowrap;
	letter-spacing: 0.01em;
}

.wcps-filter-select,
.wcps-category-select,
.wcps-brand-select {
	height: 36px;
	padding: 0 28px 0 10px;
	border: 1px solid #d4d4d4;
	border-radius: 6px;
	font-size: 13px;
	color: #1a1a1a;
	background-color: #fafafa;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23737373' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
}

.wcps-filter-select:hover,
.wcps-category-select:hover,
.wcps-brand-select:hover {
	border-color: #a3a3a3;
	background-color: #fff;
}

.wcps-filter-select:focus,
.wcps-category-select:focus,
.wcps-brand-select:focus {
	outline: none;
	border-color: #737373;
	background-color: #fff;
}

/* --- Separator between search and filters --- */
.wcps-separator {
	width: 1px;
	height: 28px;
	background-color: #e5e5e5;
	flex-shrink: 0;
}

/* --- Button filters --- */
.wcps-filter-buttons {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
}

.wcps-filter-btn {
	height: 32px;
	padding: 0 14px;
	border: 1px solid #d4d4d4;
	border-radius: 16px;
	background: #fafafa;
	font-size: 13px;
	color: #525252;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s;
}

.wcps-filter-btn:hover {
	border-color: #a3a3a3;
	background: #fff;
	color: #1a1a1a;
}

.wcps-filter-btn.active {
	background-color: #262626;
	border-color: #262626;
	color: #fff;
}

/* --- Filters toggle button (hidden by default) --- */
.wcps-filters-toggle {
	display: none;
	align-items: center;
	gap: 6px;
	padding: 0 14px;
	height: 36px;
	border: 1px solid #d4d4d4;
	border-radius: 6px;
	background: #fafafa;
	color: #525252;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.2s, background-color 0.2s;
	flex-shrink: 0;
}

.wcps-filters-toggle:hover {
	border-color: #a3a3a3;
	background: #fff;
	color: #1a1a1a;
}

.wcps-toggle-chevron {
	transition: transform 0.2s;
}

.wcps-expanded .wcps-toggle-chevron {
	transform: rotate(180deg);
}

.wcps-filter-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #262626;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

/* --- Collapsible state --- */
.wcps-collapsible .wcps-filters-toggle {
	display: inline-flex;
}

.wcps-collapsible .wcps-bar {
	flex-wrap: wrap;
}

.wcps-collapsible .wcps-filters {
	display: none;
	flex: 0 0 100%;
	flex-wrap: wrap;
	padding-top: 12px;
}

.wcps-collapsible.wcps-expanded .wcps-filters {
	display: flex;
}

/* --- Reset link --- */
.wcps-reset {
	display: block;
	text-align: right;
	font-size: 12px;
	color: #737373;
	margin-top: 6px;
	text-decoration: none;
	transition: color 0.15s;
}

.wcps-reset:hover {
	color: #1a1a1a;
	text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 767px) {
	.wcps-search-box {
		flex: 1 1 100%;
	}

	.wcps-separator {
		display: none;
	}

	.wcps-filters {
		flex-wrap: wrap;
		width: 100%;
	}

	.wcps-filter-buttons {
		flex-wrap: wrap;
	}

	.wcps-filter-select,
	.wcps-category-select,
	.wcps-brand-select {
		flex: 1;
		min-width: 0;
	}

	/* On mobile, collapsible: search + toggle on same row */
	.wcps-collapsible .wcps-bar {
		flex-wrap: wrap;
	}

	.wcps-collapsible .wcps-search-box {
		flex: 1 1 0%;
		min-width: 0;
	}

	.wcps-collapsible .wcps-toggle-label {
		display: none;
	}

	.wcps-collapsible .wcps-filters-toggle {
		padding: 0 10px;
	}

	.wcps-category-filter,
	.wcps-brand-filter {
		flex: 1 1 100%;
	}
}
