/**
 * Internal Group Product Filter — Frontend Styles v1.2
 *
 * Minimal neutral defaults. Most colors overridable via Elementor Style controls.
 */

/* ===== FILTER WIDGET ===== */
.igpf-filter {
	font-family: inherit;
	box-sizing: border-box;
}

.igpf-filter * {
	box-sizing: border-box;
}

.igpf-filter__title {
	font-size: 1.25em;
	font-weight: 700;
	margin: 0 0 8px;
	padding-bottom: 0;
}

.igpf-filter__group:first-of-type {
	padding-top: 8px;
}

.igpf-filter__group {
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	padding: 16px 0;
}

.igpf-filter__group:last-of-type {
	border-bottom: none;
}

.igpf-filter__group-title {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: default;
	user-select: none;
}

.igpf-filter__group--collapsible .igpf-filter__group-title[data-toggle] {
	cursor: pointer;
}

.igpf-filter__toggle {
	font-size: 1.2em;
	font-weight: 400;
	color: #999;
	line-height: 1;
	transition: transform 0.2s ease;
}

.igpf-filter__group-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.igpf-filter--scrollable .igpf-filter__group-body {
	max-height: 280px;
	overflow-y: auto;
}

.igpf-filter--scrollable .igpf-filter__group-body::-webkit-scrollbar {
	width: 4px;
}
.igpf-filter--scrollable .igpf-filter__group-body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.04);
}
.igpf-filter--scrollable .igpf-filter__group-body::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 2px;
}

.igpf-filter__item {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding: 4px 0;
	font-size: 0.95em;
	line-height: 1.4;
}

.igpf-filter__check {
	width: 16px;
	height: 16px;
	margin: 0;
	cursor: pointer;
	flex-shrink: 0;
}

.igpf-filter__label {
	flex: 1;
}

.igpf-filter__count {
	color: #999;
	font-size: 0.85em;
	font-weight: 400;
}

/* Subtle fade animation when filter items show/hide during cascading */
.igpf-filter__item {
	transition: opacity 0.15s ease;
}

/* Visual indicator for items kept visible only because they're checked but have 0 count */
.igpf-filter__item.igpf-filter__item--zero-count {
	opacity: 0.6;
}

/* ===== PRICE SLIDER ===== */
.igpf-price-slider {
	padding: 4px 0 8px;
}

.igpf-price-slider__track {
	position: relative;
	height: 4px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 2px;
	margin: 10px 9px 18px;
}

.igpf-price-slider__range {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: #d32f2f;
	border-radius: 2px;
	pointer-events: none;
}

.igpf-price-slider__min,
.igpf-price-slider__max {
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 18px;
	transform: translateY(-50%);
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: transparent;
	pointer-events: none;
	margin: 0;
}

.igpf-price-slider__min::-webkit-slider-runnable-track,
.igpf-price-slider__max::-webkit-slider-runnable-track {
	-webkit-appearance: none;
	height: 18px;
	background: transparent;
	border: none;
}

.igpf-price-slider__min::-webkit-slider-thumb,
.igpf-price-slider__max::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	margin-top: 0;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #d32f2f;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 0.1s ease;
}

.igpf-price-slider__min::-webkit-slider-thumb:active,
.igpf-price-slider__max::-webkit-slider-thumb:active {
	transform: scale(1.12);
}

.igpf-price-slider__min::-moz-range-thumb,
.igpf-price-slider__max::-moz-range-thumb {
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #d32f2f;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.igpf-price-slider__min::-moz-range-track,
.igpf-price-slider__max::-moz-range-track {
	height: 18px;
	background: transparent;
	border: none;
}

.igpf-price-slider__inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.igpf-price-sep {
	color: #999;
	flex-shrink: 0;
	font-size: 0.9em;
	line-height: 1;
}

.igpf-price-input-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.igpf-price-input-wrap:focus-within {
	border-color: #d32f2f;
	box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.12);
}

.igpf-price-currency {
	display: inline-block;
	padding: 0 0 0 10px;
	color: #999;
	font-size: 0.82em;
	font-weight: 500;
	user-select: none;
	flex-shrink: 0;
}

.igpf-price-slider__inputs input {
	flex: 1;
	width: 100%;
	min-width: 0;
	padding: 8px 10px;
	border: none;
	background: transparent;
	font-size: 0.9em;
	font-family: inherit;
	text-align: left;
	-moz-appearance: textfield;
	appearance: textfield;
	outline: none;
}

.igpf-price-slider__inputs input::-webkit-outer-spin-button,
.igpf-price-slider__inputs input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.igpf-price-slider__hint {
	display: none;
}

/* ===== SORT BAR ===== */
.igpf-sort-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 12px;
}

.igpf-count {
	font-size: 0.95em;
	color: #666;
}

.igpf-sort-control {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.igpf-sort-label {
	font-size: 0.95em;
	font-weight: 500;
}

.igpf-sort-select {
	padding: 8px 30px 8px 12px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	font-family: inherit;
	font-size: 0.9em;
	background: #fff;
	cursor: pointer;
	min-width: 160px;
}

.igpf-sort-select:focus {
	outline: none;
	border-color: rgba(0, 0, 0, 0.4);
}

/* ===== GRID ===== */
.igpf-grid-wrapper {
	position: relative;
}

.igpf-grid {
	min-height: 200px;
	transition: opacity 0.2s ease;
	position: relative;
}

.igpf-grid.igpf-loading {
	opacity: 0.5;
	pointer-events: none;
}

.igpf-grid-inner {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 40px 20px;
}

.igpf-grid-item {
	min-width: 0;
}

.igpf-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	font-size: 1.1em;
	color: #666;
}

.igpf-error {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	color: #c00;
}

/* Loading progress indicator (with %) */
.igpf-progress {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding-top: 48px;
	gap: 12px;
	z-index: 10;
	pointer-events: none;
}

.igpf-progress.is-active {
	display: flex;
}

.igpf-progress__spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid rgba(0, 0, 0, 0.1);
	border-top-color: #d32f2f;
	animation: igpf-spin 0.8s linear infinite;
}

.igpf-progress__pct {
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	color: #d32f2f;
	min-width: 42px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.igpf-progress__bar {
	width: 160px;
	max-width: 60%;
	height: 4px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 2px;
	overflow: hidden;
}

.igpf-progress__bar > span {
	display: block;
	height: 100%;
	width: 0;
	background: #d32f2f;
	border-radius: 2px;
	transition: width 0.12s ease;
}

@keyframes igpf-spin {
	to { transform: rotate(360deg); }
}

/* Fallback card */
.igpf-fallback-card {
	display: flex;
	flex-direction: column;
}

.igpf-card-thumb img {
	width: 100%;
	height: auto;
	display: block;
}

.igpf-card-title {
	font-size: 1em;
	margin: 12px 0 8px;
}

.igpf-card-title a {
	color: inherit;
	text-decoration: none;
}

.igpf-card-price {
	font-weight: 600;
	color: #333;
}

/* ===== PAGINATION ===== */
.igpf-pagination {
	margin-top: 40px;
}

.igpf-pagination:empty {
	display: none;
}

.igpf-page-numbers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.igpf-page-numbers li {
	margin: 0;
}

.igpf-page-numbers a,
.igpf-page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	text-decoration: none;
	font-size: 0.95em;
	transition: all 0.15s ease;
}

.igpf-page-numbers a:hover {
	background: rgba(0, 0, 0, 0.05);
}

.igpf-page-numbers .current {
	background: #d32f2f;
	color: #fff;
	border-color: #d32f2f;
}

.igpf-page-numbers .dots {
	border: none;
	background: transparent;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
	.igpf-grid-inner {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.igpf-grid-inner {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px 12px;
	}

	.igpf-sort-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.igpf-sort-control {
		margin-left: 0;
	}

	.igpf-sort-select {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.igpf-grid-inner {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px 8px;
	}
}

/* ===== LOOP ITEM FILL FIX — MOBILE ONLY ===== */
@media (max-width: 768px) {
	.igpf-grid-inner { width: 100%; justify-content: center; justify-items: stretch; }

	.igpf-grid-item { min-width: 0; width: 100%; }

	.igpf-grid-item > .elementor,
	.igpf-grid-item > .elementor > div,
	.igpf-grid-item .e-loop-item,
	.igpf-grid-item .e-con,
	.igpf-grid-item .e-con > .e-con-inner {
		width: 100% !important; max-width: 100% !important;
		margin-left: 0 !important; margin-right: 0 !important;
	}
}
