/**
 * GK Product Filters – sidebar widget styles (GK Home Foods brand).
 * Everything is scoped to .gk-filter, so nothing else on the site changes.
 */

.gk-filter {
	--gkf-maroon: #800E20;
	--gkf-maroon-dark: #650B19;
	--gkf-mustard: #E9A817;
	--gkf-cream: #FFF5E5;
	--gkf-text: #30221C;
	--gkf-text-soft: #6B5A52;
	--gkf-line: #E6D3B8;
	--gkf-white: #FFFFFF;
	--gkf-focus: 0 0 0 3px rgba(233, 168, 23, 0.4);
	--gkf-heading: "Lora", Georgia, "Times New Roman", serif;

	color: var(--gkf-text);
	font-size: 15px;
	line-height: 1.45;
	transition: opacity 0.2s ease;
}

.gk-filter *,
.gk-filter *::before,
.gk-filter *::after {
	box-sizing: border-box;
}

/* Sections
   ------------------------------------------------------------------ */
.gk-filter__section {
	min-width: 0;
	margin: 0 0 20px;
	padding: 0 0 20px;
	border: 0;
	border-bottom: 1px solid var(--gkf-line);
}

.gk-filter__section:last-of-type {
	margin-bottom: 12px;
	padding-bottom: 0;
	border-bottom: 0;
}

.gk-filter__heading {
	float: left; /* lets the legend sit inside the section like a heading */
	width: 100%;
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	font-family: var(--gkf-heading);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gkf-maroon);
}

.gk-filter__heading + * {
	clear: both;
}

/* Category checkboxes
   ------------------------------------------------------------------ */
.gk-filter__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gk-filter__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gk-filter__list--child {
	padding-left: 28px;
}

.gk-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 7px 0;
	font-weight: 500;
	cursor: pointer;
}

.gk-check__input,
.gk-chip__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.gk-check__box {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border: 1.5px solid var(--gkf-line);
	border-radius: 6px;
	background-color: var(--gkf-white);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gk-check:hover .gk-check__box {
	border-color: var(--gkf-mustard);
}

.gk-check__input:checked + .gk-check__box {
	border-color: var(--gkf-maroon);
	background-color: var(--gkf-maroon);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFF5E5' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px 12px;
}

.gk-check__input:focus-visible + .gk-check__box {
	box-shadow: var(--gkf-focus);
}

.gk-check__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.gk-check__input:checked ~ .gk-check__label {
	color: var(--gkf-maroon);
	font-weight: 600;
}

.gk-check__count {
	flex: 0 0 auto;
	min-width: 28px;
	padding: 1px 8px;
	border-radius: 999px;
	background-color: rgba(233, 168, 23, 0.18);
	color: var(--gkf-text-soft);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

/* Pack size chips
   ------------------------------------------------------------------ */
.gk-filter__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gk-filter__chips li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gk-chip {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}

.gk-chip__label {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1.5px solid var(--gkf-line);
	border-radius: 999px;
	background-color: var(--gkf-cream);
	color: var(--gkf-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gk-chip:hover .gk-chip__label {
	border-color: var(--gkf-mustard);
}

.gk-chip__input:checked + .gk-chip__label {
	border-color: var(--gkf-maroon);
	background-color: var(--gkf-maroon);
	color: var(--gkf-cream);
}

.gk-chip__input:focus-visible + .gk-chip__label {
	box-shadow: var(--gkf-focus);
}

/* Price range slider
   ------------------------------------------------------------------ */
.gk-price__slider {
	position: relative;
	height: 28px;
	margin: 4px 10px 6px;
}

.gk-price__track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	border-radius: 4px;
	background-color: var(--gkf-line);
	transform: translateY(-50%);
}

.gk-price__range {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	border-radius: 4px;
	background-color: var(--gkf-maroon);
}

.gk-price__input {
	position: absolute;
	top: 0;
	left: -10px;
	width: calc(100% + 20px);
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.gk-price__input:focus {
	outline: 0;
}

.gk-price__input::-webkit-slider-runnable-track {
	height: 28px;
	background: transparent;
	border: 0;
}

.gk-price__input::-moz-range-track {
	height: 28px;
	background: transparent;
	border: 0;
}

.gk-price__input::-webkit-slider-thumb {
	width: 22px;
	height: 22px;
	margin-top: 3px;
	border: 2px solid var(--gkf-maroon);
	border-radius: 50%;
	background-color: var(--gkf-white);
	box-shadow: 0 2px 6px rgba(48, 34, 28, 0.18);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}

.gk-price__input::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border: 2px solid var(--gkf-maroon);
	border-radius: 50%;
	background-color: var(--gkf-white);
	box-shadow: 0 2px 6px rgba(48, 34, 28, 0.18);
	cursor: grab;
	pointer-events: auto;
}

.gk-price__input:active::-webkit-slider-thumb {
	cursor: grabbing;
}

.gk-price__input:focus-visible::-webkit-slider-thumb {
	box-shadow: var(--gkf-focus);
}

.gk-price__input:focus-visible::-moz-range-thumb {
	box-shadow: var(--gkf-focus);
}

.gk-price__values {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 6px 0 0;
	font-weight: 700;
	color: var(--gkf-maroon);
}

.gk-price__values span {
	padding: 4px 12px;
	border: 1px solid var(--gkf-line);
	border-radius: 8px;
	background-color: var(--gkf-white);
}

.gk-price__values .gk-price__sep {
	padding: 0;
	border: 0;
	background: none;
	color: var(--gkf-text-soft);
	font-weight: 400;
}

/* Clear all
   ------------------------------------------------------------------ */
.gk-filter__clear {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	color: var(--gkf-maroon);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gk-filter__clear::before {
	content: "×";
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
}

.gk-filter__clear:hover,
.gk-filter__clear:focus-visible {
	color: var(--gkf-maroon-dark);
}

/* Loading state while results update
   ------------------------------------------------------------------ */
.gk-pf-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Screen-reader-only live region */
.gk-filter-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.gk-filter,
	.gk-filter *,
	.gk-pf-loading {
		transition: none !important;
	}
}
