/* Khejuri Product Archive */
.kpa-wrap {
	--kpa-accent: #F48721;
	--kpa-bg: #F1F3F8;
	--kpa-text: #222;
	--kpa-muted: #666;
	--kpa-line: #e6e6e6;
	--kpa-cols: 4;
	--kpa-cols-t: 3;
	--kpa-cols-m: 2;
	font-family: 'DM Sans', sans-serif;
	color: var(--kpa-text);
	background: var(--kpa-bg);
	padding: 20px;
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
	box-sizing: border-box;
}
.kpa-wrap *,
.kpa-wrap *::before,
.kpa-wrap *::after { box-sizing: border-box; }
.kpa-wrap button,
.kpa-wrap input,
.kpa-wrap select,
.kpa-wrap a,
.kpa-wrap h3,
.kpa-wrap h4,
.kpa-wrap label { font-family: 'DM Sans', sans-serif; }
.kpa-wrap.kpa-no-sidebar { grid-template-columns: minmax(0, 1fr); }

/* ---------- Sidebar ---------- */
.kpa-filter-toggle { display: none; }
.kpa-sidebar {
	position: sticky;
	top: var(--kpa-sticky-top, 20px);
	z-index: 1;
	align-self: start;
	max-height: calc(100vh - var(--kpa-sticky-top, 20px) - 20px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.kpa-box {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(20, 30, 60, .07);
	padding: 14px 15px 16px;
	margin-bottom: 10px;
}
.kpa-box-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	border-bottom: 1px solid var(--kpa-line);
	margin-bottom: 14px;
}
.kpa-box-title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: #333 !important;
	line-height: 1.2 !important;
}
.kpa-box-title span {
	display: inline-block;
	padding: 10px 0 11px;
	border-bottom: 2px solid var(--kpa-accent);
	margin-bottom: -1px;
}
.kpa-toggle {
	background: none !important;
	border: 0 !important;
	padding: 6px !important;
	margin: 0 0 6px;
	width: 28px;
	height: 28px;
	cursor: pointer;
	position: relative;
	box-shadow: none !important;
}
.kpa-toggle::before,
.kpa-toggle::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 12px;
	height: 2px;
	background: #333;
	transform: translate(-50%, -50%);
	transition: transform .2s;
}
.kpa-toggle::after { transform: translate(-50%, -50%) rotate(90deg) scaleX(0); }
.kpa-box.kpa-closed .kpa-toggle::after { transform: translate(-50%, -50%) rotate(90deg) scaleX(1); }
.kpa-box.kpa-closed .kpa-box-body { display: none; }
.kpa-box.kpa-closed .kpa-box-head { margin-bottom: 0; border-bottom-color: transparent; }

.kpa-check {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 6px 0;
	margin: 0;
	cursor: pointer;
	font-size: 15px;
	color: #555;
	line-height: 1.3;
}
.kpa-check input { position: absolute; opacity: 0; pointer-events: none; }
.kpa-box-ui {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 1px solid #b9b9b9;
	border-radius: 3px;
	background: #fff;
	position: relative;
	transition: background .15s, border-color .15s;
}
.kpa-check input:checked + .kpa-box-ui { background: var(--kpa-accent); border-color: var(--kpa-accent); }
.kpa-check input:checked + .kpa-box-ui::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.kpa-check input:focus-visible + .kpa-box-ui { outline: 2px solid var(--kpa-accent); outline-offset: 2px; }
.kpa-check:hover .kpa-check-text { color: #000; }

/* Price range */
.kpa-price-labels {
	display: flex;
	justify-content: space-between;
	font-size: 15px;
	color: #444;
	margin-bottom: 14px;
}
.kpa-price-labels b { font-weight: 500; }
.kpa-range { position: relative; height: 26px; margin: 0 6px; }
.kpa-range-track {
	position: absolute;
	left: 0; right: 0; top: 50%;
	height: 6px;
	margin-top: -3px;
	border-radius: 3px;
	background: #e3e3e3;
}
.kpa-range-fill {
	position: absolute;
	top: 0; bottom: 0;
	background: var(--kpa-accent);
	border-radius: 3px;
}
.kpa-range input[type=range] {
	position: absolute;
	left: -6px;
	width: calc(100% + 12px);
	top: 0;
	height: 26px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.kpa-range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.kpa-range input[type=range]::-moz-range-track { background: transparent; height: 26px; }
.kpa-range input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 20px; height: 20px;
	margin-top: 3px;
	border-radius: 50%;
	background: var(--kpa-accent);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
	cursor: grab;
}
.kpa-range input[type=range]::-moz-range-thumb {
	pointer-events: auto;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--kpa-accent);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
	cursor: grab;
}
.kpa-range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid #333; outline-offset: 2px; }

/* ---------- Sort bar ---------- */
.kpa-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(20, 30, 60, .07);
	padding: 12px 13px;
	margin-bottom: 26px;
}
.kpa-bar-left { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.kpa-wrap .kpa-bar .kpa-bar-label { font-weight: 600; font-size: 15px; color: #333; margin: 0; padding: 0; white-space: nowrap !important; word-break: keep-all; flex: 0 0 auto !important; width: auto !important; min-width: max-content; line-height: 1; display: inline-block; }
.kpa-select {
	height: 42px;
	padding: 0 34px 0 11px;
	font-size: 14px;
	color: #333;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23333' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	min-width: 150px;
	width: auto !important;
	max-width: 100%;
	flex: 0 0 auto;
	margin: 0;
}
.kpa-select-accent {
	min-width: 103px;
	color: var(--kpa-accent);
	border-color: #f5d3b2;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23F48721' stroke-width='1.6'/%3E%3C/svg%3E");
}
.kpa-select:focus-visible { outline: 2px solid var(--kpa-accent); outline-offset: 1px; }

/* ---------- Products ---------- */
.kpa-results { position: relative; transition: opacity .2s; }
.kpa-results.is-loading { opacity: .45; pointer-events: none; }
.kpa-results.is-loading::after {
	content: '';
	position: absolute;
	left: 50%; top: 120px;
	width: 34px; height: 34px;
	margin-left: -17px;
	border: 3px solid #fff;
	border-top-color: var(--kpa-accent);
	border-radius: 50%;
	animation: kpa-spin .7s linear infinite;
}
@keyframes kpa-spin { to { transform: rotate(360deg); } }

.kpa-grid {
	display: grid;
	grid-template-columns: repeat(var(--kpa-cols), minmax(0, 1fr));
	gap: 20px;
	align-items: start;
}
.kpa-card {
	position: relative;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 4px;
	padding: 8px 9px 9px;
	display: flex;
	flex-direction: column;
}
.kpa-badge {
	position: absolute;
	top: 16px;
	right: 14px;
	z-index: 2;
	background: var(--kpa-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	padding: 5px 7px;
	border-radius: 3px;
}
.kpa-img {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 250px;
	margin-bottom: 8px;
	overflow: hidden;
}
.kpa-img img {
	max-width: 100%;
	max-height: 100%;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
	display: block;
}
.kpa-title {
	margin: 0 0 6px !important;
	padding: 0 !important;
	font-size: 18px !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	letter-spacing: 0;
	text-transform: none;
}
.kpa-title a { color: var(--kpa-text) !important; text-decoration: none !important; }
.kpa-title a:hover { color: var(--kpa-accent) !important; }
.kpa-price { display: flex; align-items: baseline; gap: 12px; min-height: 28px; margin-bottom: 8px; }
.kpa-price-now { font-size: 18px; font-weight: 700; color: var(--kpa-accent); }
.kpa-price-old { font-size: 16px; font-weight: 600; color: #9b9b9b; text-decoration: line-through; }

.kpa-add {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 44px;
	margin-top: auto;
	padding: 0 12px;
	background: #fff !important;
	color: var(--kpa-accent) !important;
	border: 1px solid var(--kpa-accent) !important;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	cursor: pointer;
	transition: background .15s, color .15s;
	box-shadow: none;
}
.kpa-add:hover,
.kpa-add:focus-visible,
.kpa-add.is-added { background: var(--kpa-accent) !important; color: #fff !important; }
.kpa-add.is-busy { opacity: .7; cursor: wait; }

.kpa-empty {
	grid-column: 1 / -1;
	background: #fff;
	border-radius: 4px;
	padding: 40px 20px;
	text-align: center;
	color: var(--kpa-muted);
	font-size: 16px;
}

/* ---------- Pagination ---------- */
.kpa-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.kpa-pagination:empty { display: none; }
.kpa-page {
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	background: #fff !important;
	color: #333 !important;
	border: 1px solid #dcdcdc !important;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}
.kpa-page:hover { border-color: var(--kpa-accent) !important; color: var(--kpa-accent) !important; }
.kpa-page.is-current { background: var(--kpa-accent) !important; border-color: var(--kpa-accent) !important; color: #fff !important; }
.kpa-dots { align-self: center; padding: 0 4px; color: #888; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.kpa-wrap { grid-template-columns: 250px minmax(0, 1fr); gap: 16px; padding: 14px; }
	.kpa-grid { grid-template-columns: repeat(var(--kpa-cols-t), minmax(0, 1fr)); gap: 14px; }
	.kpa-img { height: 200px; }
}
@media (max-width: 767px) {
	.kpa-wrap { grid-template-columns: minmax(0, 1fr); padding: 10px; }
	.kpa-filter-toggle {
		display: block;
		width: 100%;
		height: 44px;
		background: #fff !important;
		color: var(--kpa-accent) !important;
		border: 1px solid var(--kpa-accent) !important;
		border-radius: 4px;
		font-size: 15px;
		font-weight: 600;
		cursor: pointer;
	}
	.kpa-sidebar { display: none; position: static; max-height: none; overflow: visible; }
	.kpa-wrap.kpa-filters-open .kpa-sidebar { display: block; }
	.kpa-grid { grid-template-columns: repeat(var(--kpa-cols-m), minmax(0, 1fr)); gap: 10px; }
	.kpa-img { height: 160px; }
	.kpa-title { font-size: 15px !important; }
	.kpa-price-now { font-size: 16px; }
	.kpa-price-old { font-size: 14px; }
	.kpa-price { gap: 8px; flex-wrap: wrap; }
	.kpa-add { font-size: 14px; height: 40px; }
	.kpa-bar { flex-wrap: wrap; }
	.kpa-select { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.kpa-results.is-loading::after { animation: none; }
	.kpa-toggle::before, .kpa-toggle::after { transition: none; }
}
