/* Filter Drawer widget — structural styles. Colors/typography/spacing come
   from the widget's style controls (compiled per-instance via {{WRAPPER}}
   selectors targeting the classes below). Ported from Tiger Elements'
   tiger-filter-drawer.css structural rules; class names kept short (tfd-*)
   to match the PHP render() output in widgets/filter-drawer.php. */

.tiger-filter-drawer {
	position: relative;
}

.tfd-toggle-wrap {
	display: flex;
}

.tfd-toggle-wrap.tfd-is-inactive {
	display: none !important;
}

.tfd-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	border: 0;
	cursor: pointer;
	background: #1e1e2e;
	color: #fff;
	padding: 12px 20px;
	font: inherit;
	line-height: 1;
}

.tfd-toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.tfd-toggle-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.tfd-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 50%;
	background: #e5484d;
	color: #fff;
	font-size: 11px;
	line-height: 1;
}

.tfd-badge[hidden] {
	display: none;
}

/* ---- Off-canvas root / backdrop / panel --------------------------------- */

.tfd-root {
	--tfd-panel-width: 340px;
	--tfd-panel-height: 85vh;
	position: fixed;
	inset: 0;
	z-index: 100000;
	visibility: hidden;
	pointer-events: none;
}

.tfd-root.tfd-is-open {
	visibility: visible;
	pointer-events: auto;
}

.tfd-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.tfd-root.tfd-is-open .tfd-backdrop {
	opacity: 1;
}

.tfd-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: var(--tfd-panel-width);
	max-width: 92vw;
	background: #ffffff;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
	overflow-y: auto;
	transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Side: left */
.tfd-root[data-tfd-side="left"] .tfd-panel {
	left: 0;
	transform: translateX(-100%);
}

/* Side: right */
.tfd-root[data-tfd-side="right"] .tfd-panel {
	right: 0;
	transform: translateX(100%);
}

/* Side: bottom (sheet) */
.tfd-root[data-tfd-side="bottom"] .tfd-panel {
	left: 0;
	right: 0;
	top: auto;
	bottom: 0;
	width: 100%;
	max-width: 100%;
	height: var(--tfd-panel-height);
	max-height: 92vh;
	transform: translateY(100%);
}

.tfd-root.tfd-is-open[data-tfd-side="left"] .tfd-panel,
.tfd-root.tfd-is-open[data-tfd-side="right"] .tfd-panel {
	transform: translateX(0);
}

.tfd-root.tfd-is-open[data-tfd-side="bottom"] .tfd-panel {
	transform: translateY(0);
}

/* Fade animation variant swaps the slide transform for an opacity fade. */
.tfd-root[data-tfd-anim="fade"] .tfd-panel {
	transform: none;
	opacity: 0;
}

.tfd-root.tfd-is-open[data-tfd-anim="fade"] .tfd-panel {
	opacity: 1;
}

.tfd-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	flex: 0 0 auto;
}

.tfd-title {
	font-weight: 600;
	color: #1e1e2e;
}

.tfd-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: #333;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
}

.tfd-close svg {
	width: 20px;
	height: 20px;
	display: block;
}

.tfd-body {
	flex: 1 1 auto;
	padding: 20px;
	overflow-y: auto;
}

.tfd-body:empty::before {
	content: "Add a CSS Selector or Sync ID above pointing at your facet widgets — the Filter Drawer relocates them here on mobile.";
	display: block;
	font-size: 12px;
	color: #94a3b8;
	font-style: italic;
}

.tfd-footer {
	display: flex;
	gap: 10px;
	padding: 16px 20px;
	flex: 0 0 auto;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tfd-clear,
.tfd-apply {
	flex: 1 1 auto;
	border: 0;
	cursor: pointer;
	font: inherit;
	padding: 12px 18px;
	border-radius: 6px;
	text-align: center;
}

.tfd-clear {
	background: transparent;
	color: #1e1e2e;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.tfd-apply {
	background: #1e1e2e;
	color: #fff;
}

/* Body scroll-lock helper toggled by ractro-filter-drawer.js while a drawer is open. */
body.ractro-tfd-lock {
	overflow: hidden;
}
