/* =============================================================
   Product Search & Filter - Styles
   ============================================================= */

:root {
	--psx-border: #e2e4e8;
	--psx-bg-muted: #f5f6f8;
	--psx-text: #1f2328;
	--psx-text-muted: #ffffffbd;
	--psx-accent: #1a73e8;
	--psx-radius: 8px;
}

.psx-search-form,
.psx-results-page,
.psx-live-results,
.psx-sidebar,
.psx-product-card {
	box-sizing: border-box;
}

.psx-search-form *,
.psx-results-page * {
	box-sizing: border-box;
}

/* -------------------------------------------------------------
   Search Bar
   ------------------------------------------------------------- */

.psx-search-form {
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 720px;
	border: none;
	overflow: visible;
	background: #333333!important;
	position: relative;
	border-radius: 50px;
}

.psx-search-input-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.psx-search-input {
	width: 100%;
	height: 44px;
	border: none;
	font-size: 15px;
	color: #dddfe2;
	outline: none;
}
input[type=text]#psx-search-input{
	border: none;
    	border-radius: 50px 0 0 50px;
    	padding: 5px 15px;
background:transparent;
}
.psx-search-input::placeholder {
	color: var(--psx-text-muted);
}
.psx-search-category:focus,
#psx-search-category:focus,
.psx-search-category:focus-visible,
#psx-search-category:focus-visible,
.psx-search-category:active,
#pch-search-input:active {
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
}
.psx-search-select-wrap {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.psx-search-category {
	height: 44px;
	border: none;
	background: transparent;
	padding: 0 32px 0 14px;
	font-size: 15px;
	color: var(--psx-text);
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%236b7280'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	cursor: pointer;
	max-width: 180px;
}

.psx-search-submit {
	flex: 0 0 auto;
	width: 56px;
	border: none !important;
	background: #787575 !important;
    border-radius: 0 50px 50px 0 !important;
	color: var(--psx-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.psx-search-submit:hover {
	background: var(--psx-bg-muted);
	border-radius: 0 50px 50px 0 !important;
}

/* Live typeahead dropdown */
.psx-live-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--psx-border);
	border-radius: var(--psx-radius);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 360px;
	overflow-y: auto;
	z-index: 999;
}

.psx-live-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: var(--psx-text);
	border-bottom: 1px solid var(--psx-border);
}

.psx-live-item:last-child {
	border-bottom: none;
}

.psx-live-item:hover {
	background: var(--psx-bg-muted);
}

.psx-live-item img,
.psx-live-noimg {
	width: 40px;
	height: 40px;
	border-radius: 6px;
	object-fit: cover;
	background: var(--psx-bg-muted);
	flex: 0 0 auto;
}

.psx-live-item span {
	font-size: 14px;
	line-height: 1.3;
}

.psx-live-empty {
	padding: 14px;
	font-size: 14px;
	color: var(--psx-text-muted);
	text-align: center;
}

/* -------------------------------------------------------------
   Search Results Page
   ------------------------------------------------------------- */
.psx-results-page {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 20px 60px;
}

.psx-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.psx-results-title {
	font-size: 22px;
	font-weight: 600;
	color: var(--psx-text);
	margin: 0;
}

.psx-mobile-filter-toggle {
	display: none;
	border: 1px solid var(--psx-border);
	background: #fff;
	border-radius: var(--psx-radius);
	padding: 8px 16px;
	font-size: 14px;
	cursor: pointer;
}

.psx-results-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 28px;
	align-items: start;
}

/* Sidebar */
.psx-sidebar {
	background: #fff;
	border: 1px solid var(--psx-border);
	border-radius: var(--psx-radius);
	padding: 18px;
	position: sticky;
	top: 20px;
}

.psx-sidebar-header {
	display: none;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.psx-sidebar-header h3 {
	margin: 0;
	font-size: 16px;
}

.psx-close-sidebar {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--psx-text-muted);
}

.psx-category-list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	max-height: 340px;
	overflow-y: auto;
}

.psx-category-list li {
	margin-bottom: 10px;
}

.psx-category-list label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--psx-text);
	cursor: pointer;
}

.psx-category-list input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--psx-accent);
	cursor: pointer;
}

.psx-clear-filters {
	width: 100%;
	padding: 10px 14px;
	background: #111827;
	color: #fff;
	border: none;
	border-radius: var(--psx-radius);
	font-size: 14px;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.psx-clear-filters:hover {
	opacity: 0.85;
}

.psx-sidebar-overlay {
	display: none;
}

/* Content / toolbar */
.psx-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
	flex-wrap: wrap;
	gap: 10px;
}

.psx-results-count {
	font-size: 14px;
	color: var(--psx-text-muted);
}

.psx-sort-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.psx-sort-wrap label {
	font-size: 14px;
	color: var(--psx-text);
}

.psx-sort {
	height: 40px;
	border: 1px solid var(--psx-border);
	border-radius: 6px;
	padding: 0 12px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
	min-width: 160px;
}

/* Product grid */
.psx-product-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	transition: opacity 0.2s ease;
}

.psx-product-grid.is-loading {
	opacity: 0.4;
	pointer-events: none;
}

.psx-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: var(--psx-text-muted);
	font-size: 15px;
}

.psx-product-card {
	background: #fff;
	border: 1px solid var(--psx-border);
	border-radius: var(--psx-radius);
	overflow: hidden;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.psx-product-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.psx-product-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.psx-product-card-image {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: var(--psx-bg-muted);
	overflow: hidden;
}

.psx-product-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.psx-product-card-noimage {
	width: 100%;
	height: 100%;
	background: var(--psx-bg-muted);
}

.psx-product-card-title {
	font-size: 14px;
	font-weight: 500;
	color: var(--psx-text);
	margin: 0;
	padding: 12px 14px 4px;
	line-height: 1.4;
}

.psx-product-swatches {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 14px 14px;
	flex-wrap: wrap;
}

.psx-swatch {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	overflow: hidden;
	border: 1px solid var(--psx-border);
	flex: 0 0 auto;
	display: block;
}

.psx-swatch img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.psx-swatch-more {
	font-size: 12px;
	color: var(--psx-text-muted);
}

/* Pagination */
.psx-pagination-wrap {
	margin-top: 32px;
}

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

.psx-page-btn {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--psx-border);
	background: #fff;
	color: var(--psx-text);
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.psx-page-btn:hover {
	background: var(--psx-bg-muted);
}

.psx-page-btn.is-active {
	background: #111827;
	color: #fff;
	border-color: #111827;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

/* Tablet */
@media (max-width: 1024px) {
	.psx-product-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.psx-results-layout {
		grid-template-columns: 200px 1fr;
		gap: 20px;
	}
}

/* Small tablet / large phone */
@media (max-width: 768px) {
	.psx-search-form {
		flex-wrap: wrap;
		max-width: 100%;
	}

	.psx-search-input-wrap {
		flex: 1 1 100%;
	}

	.psx-search-select-wrap {
		flex: 1 1 auto;
		border-left: none;
	}

	.psx-search-submit {
		flex: 0 0 56px;
	}

	.psx-mobile-filter-toggle {
		display: inline-flex;
	}

	.psx-results-layout {
		grid-template-columns: 1fr;
	}

	.psx-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 280px;
		max-width: 84vw;
		border-radius: 0;
		z-index: 1001;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		overflow-y: auto;
	}

	.psx-sidebar.is-open {
		transform: translateX(0);
	}

	.psx-sidebar-header {
		display: flex;
	}

	.psx-sidebar-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 1000;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}

	.psx-sidebar-overlay.is-visible {
		opacity: 1;
		pointer-events: auto;
	}

	.psx-product-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	.psx-results-title {
		font-size: 18px;
	}
}

/* Phone */
@media (max-width: 480px) {
	.psx-product-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.psx-product-card-title {
		font-size: 13px;
		padding: 10px 10px 2px;
	}

	.psx-product-swatches {
		padding: 4px 10px 10px;
	}

	.psx-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.psx-sort {
		width: 100%;
	}

	.psx-results-page {
		padding: 16px 14px 40px;
	}
}