/* GSV Cascading Filter Panel — themed with CSS custom properties */

:root {
	--sidebar-bg: #f8fafc;
	--heading-bg: #f1f5f9;
	--heading-text: #1e293b;
	--heading-count: #94a3b8;
	--item-text: #334155;
	--item-text-disabled: #cbd5e1;
	--count-text: #94a3b8;
	--checkbox-border: #cbd5e1;
	--checkbox-checked-bg: #475569;
	--divider: #e2e8f0;
	--btn-bg: #475569;
	--btn-text: #ffffff;
	--btn-hover: #334155;
	--collapse-icon: #475569;
}

/* Overlay */
.gsvfp-overlay {
	display:none;
	position:fixed;
	top:0;left:0;right:0;bottom:0;
	background:rgba(0,0,0,0.4);
	z-index:9998;
}
.gsvfp-overlay.gsvfp-open { display:block; }

/* Panel — slides from left */
.gsvfp-panel {
	position:fixed;
	top:0;
	left:-90%;
	width:90%;
	height:100%;
	background:var(--sidebar-bg);
	z-index:9999;
	overflow-y:auto;
	transition:left 0.25s ease-in-out;
	display:flex;
	flex-direction:column;
	-webkit-overflow-scrolling:touch;
}
.gsvfp-panel.gsvfp-open { left:0; }

/* Header */
.gsvfp-header {
	display:flex;
	justify-content:space-between;
	align-items:center;
	padding:10px 16px;
	border-bottom:1px solid var(--divider);
	flex-shrink:0;
	background:var(--sidebar-bg);
}
.gsvfp-header-title {
	font-size:2.5rem;
	font-weight:400;
	color:var(--heading-text);
	font-family:"Source Sans Pro", Arial, sans-serif;
}
.gsvfp-close {
	background:none;
	border:none;
	font-size:2.5rem;
	cursor:pointer;
	color:var(--heading-count);
	padding:3px;
	line-height:1;
	font-family:"Source Sans Pro", Arial, sans-serif;
}
.gsvfp-close:hover { color:var(--heading-text); }

/* Applied filters */
.gsvfp-applied {
	background-color:var(--heading-bg);
	border:none;
	border-left:4px solid var(--btn-bg);
	border-radius:3px;
	margin:0.8rem 8px 0 8px;
	padding:10px 10px 12px 12px;
	flex-shrink:0;
	box-shadow:0 1px 3px rgba(0,0,0,0.08);
}
.gsvfp-applied-header {
	display:flex;
	justify-content:space-between;
	align-items:center;
	margin-bottom:8px;
	padding-bottom:6px;
	border-bottom:1px solid var(--divider);
}
.gsvfp-applied-label {
	font-size:1.5rem;
	font-weight:700;
	color:var(--heading-text);
	font-family:"Source Sans Pro", Arial, sans-serif;
}
.gsvfp-clear-all {
	font-size:1.3rem;
	color:var(--btn-bg) !important;
	font-weight:700;
	text-decoration:underline;
	cursor:pointer;
	background:none;
	border:none;
	padding:0;
}
.gsvfp-clear-all:hover { color:var(--btn-hover) !important; }

/* Applied filter tags */
.gsvfp-tags {
	display:flex;
	flex-direction:column;
	gap:4px;
}
.gsvfp-tag {
	display:flex;
	flex-direction:row;
	align-items:center;
	background:var(--sidebar-bg);
	border:1px solid var(--divider);
	border-radius:4px;
	padding:6px 10px;
	margin:0;
	font-size:1.4rem;
	color:var(--item-text);
	line-height:1.3;
	font-family:"Source Sans Pro", Arial, sans-serif;
}
.gsvfp-tag-group {
	font-weight:700;
	color:#000;
	white-space:nowrap;
	margin-right:4px;
}
.gsvfp-tag-name {
	color:#000;
	font-weight:400;
	flex:1;
}
.gsvfp-tag-remove {
	display:flex;
	align-items:center;
	justify-content:center;
	width:20px;
	height:20px;
	background:#396eed;
	color:#fff !important;
	font-weight:bold;
	font-size:1.3rem;
	text-decoration:none !important;
	margin-left:auto;
	padding:0;
	flex-shrink:0;
	cursor:pointer;
	line-height:1;
	border-radius:50%;
}
.gsvfp-tag-remove:hover { background:#2a5bcc; }

/* Filter body (scrollable) */
.gsvfp-body {
	flex:1;
	overflow-y:auto;
	padding:0 8px;
	-webkit-overflow-scrolling:touch;
}

/* Filter group */
.gsvfp-group {
	background-color:var(--sidebar-bg);
	border:1px solid var(--divider);
	border-radius:3px;
	margin-top:0.8rem;
	padding:0 8px 12px 8px;
	border-top:none;
}
.gsvfp-group.gsvfp-collapsed {
	border-bottom:none;
	padding-bottom:0;
}

/* Group title */
.gsvfp-group-title {
	display:flex;
	justify-content:space-between;
	align-items:center;
	font-size:20px;
	line-height:1.2;
	font-family:"Source Sans Pro", Arial, sans-serif;
	font-weight:700;
	text-align:left;
	padding:6px 8px;
	margin:0 -8px 8px -8px;
	background-color:var(--heading-bg);
	border-bottom:none;
	color:var(--heading-text);
	text-transform:none;
	overflow:visible;
	cursor:pointer;
	user-select:none;
	-webkit-user-select:none;
}

/* Collapse toggle */
.gsvfp-group-toggle {
	float:right;
	font-size:1.4em;
	font-weight:bold;
	line-height:1.2;
	color:var(--collapse-icon);
	padding:0 2px;
	user-select:none;
	-webkit-user-select:none;
}
.gsvfp-group-toggle:hover { color:var(--heading-text); }
.gsvfp-group.gsvfp-collapsed .gsvfp-group-toggle {
	/* plus sign shown via JS */
}

/* Selected count in title */
.gsvfp-group-count {
	font-size:1.35rem;
	color:var(--heading-count);
	font-weight:400;
	margin-left:6px;
}

/* Clear link in group title */
.gsvfp-group-clear {
	float:right;
	font-size:1.3rem;
	color:var(--btn-bg) !important;
	font-weight:700;
	text-decoration:underline;
	cursor:pointer;
	margin-left:auto;
	padding-right:8px;
}
.gsvfp-group-clear:hover { color:var(--btn-hover) !important; }

/* Filter options list */
.gsvfp-options {
	padding:0;
}
.gsvfp-group.gsvfp-collapsed .gsvfp-options { display:none; }

/* Individual option */
.gsvfp-option {
	display:flex;
	flex-direction:row;
	align-items:flex-start;
	gap:8px;
	padding:4px 0;
	cursor:pointer;
	font-size:1.7rem;
	font-weight:400;
	color:var(--item-text);
	font-family:"Source Sans Pro", Arial, sans-serif;
	line-height:20px;
}
.gsvfp-option:hover { color:var(--heading-text); }
.gsvfp-option.gsvfp-disabled {
	color:var(--item-text-disabled);
	cursor:default;
}
.gsvfp-option.gsvfp-selected {
	color:var(--item-text);
}

/* Checkbox */
.gsvfp-checkbox {
	background:var(--sidebar-bg) !important;
	border:2px solid var(--checkbox-border) !important;
	border-radius:3px !important;
	cursor:pointer;
	height:20px !important;
	width:20px !important;
	min-width:20px !important;
	margin:0;
	outline:none !important;
	box-shadow:none !important;
	display:flex;
	align-items:center;
	justify-content:center;
	flex-shrink:0;
	position:relative;
	box-sizing:border-box;
}
.gsvfp-option.gsvfp-selected .gsvfp-checkbox {
	background:var(--checkbox-checked-bg) !important;
	border-color:var(--checkbox-checked-bg) !important;
}
.gsvfp-option.gsvfp-selected .gsvfp-checkbox::after {
	content:'\2713';
	color:var(--btn-text);
	font-size:14px;
	position:absolute;
	top:1px;
	left:4px;
}
.gsvfp-option.gsvfp-disabled .gsvfp-checkbox {
	border-color:var(--divider) !important;
	background:var(--heading-bg) !important;
}

/* Option name and count */
.gsvfp-option-name {
	font-size:1.7rem;
	color:inherit;
}
.gsvfp-option-count {
	font-size:1.35rem;
	color:var(--count-text);
	margin-left:0.35em;
	display:inline;
	line-height:20px;
}

/* More/Less toggle for overflow items */
.gsvfp-overflow {
	display:none;
}
.gsvfp-more-toggle {
	display:flex;
	align-items:center;
	justify-content:center;
	gap:6px;
	width:85%;
	margin:6px auto 0 auto;
	padding:8px 0;
	cursor:pointer;
	user-select:none;
	-webkit-user-select:none;
	background:var(--btn-bg);
	border:none;
	border-radius:3px;
	transition:background 0.15s ease;
}
.gsvfp-more-toggle:hover {
	background:var(--btn-hover);
}
.gsvfp-more-toggle:active {
	background:var(--heading-text);
}
.gsvfp-more-text {
	font-size:1.45rem;
	font-weight:600;
	color:var(--btn-text);
	font-family:"Source Sans Pro", Arial, sans-serif;
}

/* Price range */
.gsvfp-price {
	padding:4px 0;
}
.gsvfp-price-inputs {
	display:table;
	margin-top:4px;
	width:100%;
}
.gsvfp-price-field {
	width:50%;
	text-align:center;
	display:table-cell;
}
.gsvfp-price-field label {
	display:block;
	font-size:1.3rem;
	color:var(--count-text);
	margin-bottom:3px;
}
.gsvfp-price-field input {
	border:1px solid var(--checkbox-border);
	outline:none;
	padding:4px;
	border-radius:3px;
	width:70px;
	text-align:right;
	box-sizing:border-box;
	font-size:1.4rem;
}
.gsvfp-price-sep {
	display:none;
}

/* Footer (apply button) */
.gsvfp-footer {
	padding:10px 15px;
	border-top:1px solid var(--divider);
	flex-shrink:0;
	background:var(--sidebar-bg);
	box-shadow:0 -2px 8px rgba(0,0,0,0.15);
}
.gsvfp-apply {
	width:100%;
	padding:14px;
	font-size:20px;
	font-weight:600;
	color:var(--btn-text);
	background-color:var(--btn-bg);
	border:none;
	border-radius:4px;
	cursor:pointer;
}
.gsvfp-apply:hover { background-color:var(--btn-hover); }
.gsvfp-apply:disabled {
	background:var(--item-text-disabled);
	cursor:default;
}

/* Loading spinner */
.gsvfp-loading {
	text-align:center;
	padding:30px;
	color:var(--count-text);
	font-size:1.5rem;
	font-family:"Source Sans Pro", Arial, sans-serif;
}
.gsvfp-spinner {
	display:inline-block;
	width:24px;
	height:24px;
	border:3px solid var(--divider);
	border-top-color:var(--btn-bg);
	border-radius:50%;
	animation:gsvfp-spin 0.6s linear infinite;
}
@keyframes gsvfp-spin { to { transform:rotate(360deg); } }

/* Trigger bar */
.gsvfp-triggerbar {
	display:flex;
	width:100%;
	font-family:"Source Sans Pro", sans-serif;
	height:55px;
	align-items:stretch;
}
.gsvfp-trigger-btn {
	display:flex;
	width:49%;
	border:1px solid var(--divider);
	background-color:var(--sidebar-bg);
	height:55px;
	font-size:1.55rem;
	padding-left:1rem;
	align-items:center;
	cursor:pointer;
	color:var(--item-text);
	gap:8px;
	font-family:"Source Sans Pro", sans-serif;
}
.gsvfp-trigger-btn:hover { background-color:var(--heading-bg); }
.gsvfp-trigger-count {
	background:var(--btn-bg);
	color:var(--btn-text);
	padding:1px 7px;
	border-radius:10px;
	font-size:1.2rem;
}
.gsvfp-sort {
	width:49%;
	margin-left:5px;
}
.gsvfp-sort select {
	width:100%;
	border:1px solid var(--divider);
	background-color:var(--sidebar-bg);
	height:55px;
	font-size:1.55rem;
	padding-left:1rem;
	border-radius:0px;
	font-family:"Source Sans Pro", sans-serif;
}

/* Hide panel trigger on desktop — desktop uses sidebar */
@media only screen and (min-width: 941px) {
	.gsvfp-triggerbar { display:none; }
	.gsvfp-overlay { display:none !important; }
	.gsvfp-panel { display:none !important; }
}
