/* =========================================================
 * Taxonomy Filter Multi
 * Custom listbox per filtru — pattern identic cu
 * taxonomyFilterDropdown.css, adaptat pentru repeater de filtre.
 * ========================================================= */

.filter_prod {
    position:relative;
}
.filter_prod, .filter_prod > div, .filter_prod > div > div {
    height:100%;   
}
.tx-tfm {
	width: 100%;
	position: sticky;
    top: 50px;
}

.tx-tfm__list {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 16px;
	width: 100%;
}

.tx-tfm__filter {
	flex: 1 1 200px;
	min-width: 200px;
	display: flex;
	flex-direction: column;
}

.tx-tfm__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: #0b1c3f;
}

/* ---------- Combo wrapper ---------- */
.tx-tfm__combo {
	position: relative;
	width: 100%;
}

/* ---------- Trigger ---------- */
.tx-tfm__select {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: 12px 40px 12px 16px;
	font-size: 16px;       /* prevent iOS zoom */
	font-family: inherit;
	line-height: 1.3;
	color: #0b1c3f;
	background-color: #fff;
	border: 1px solid #0b1c3f;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	-webkit-appearance: none;
	appearance: none;

	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1c3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px 16px;

	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.tx-tfm__select[aria-expanded="true"] {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1c3f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='18 15 12 9 6 15'/></svg>");
}

.tx-tfm__value {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- Menu (UL) ---------- */
.tx-tfm__menu {
	position: absolute;
	left: 0;
	right: 0;
	margin: 4px 0 0;
	padding: 4px 0;
	max-height: 320px;
	overflow-y: auto;
	overflow-x: hidden;
	background-color: #fff;
	border: 1px solid rgba(11, 28, 63, 0.15);
	border-radius: 8px;
	/*box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);*/
	list-style: none;
	z-index: 1000;
	overscroll-behavior: contain;
}

.tx-tfm__menu[hidden] {
	display: none;
}

/* Flip sus */
.tx-tfm__combo.is-up .tx-tfm__menu {
	top: auto;
	bottom: 100%;
	margin: 0 0 4px;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}

/* ---------- Option (LI) ---------- */
.tx-tfm__option {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px;
	font-size: 16px;
	line-height: 1.3;
	color: #0b1c3f;
	cursor: pointer;
	transition: background-color 0.12s ease, opacity 0.12s ease;
	white-space: nowrap;
	overflow: hidden;
}

/* Suprascriem display: flex când [hidden] e setat de JS (unavailableMode = "hidden") */
.tx-tfm__option[hidden] {
	display: none;
}

/* ---------- Indentare ierarhică ----------
   `data-depth` e pus la render de sort_terms_hierarchically() din
   taxonomyFilterMulti.php: 0 = rădăcină, 1 = copil, etc. Indentăm pe LI (nu pe
   label) ca fundalul de hover/selected să rămână pe toată lățimea.
   Depth 0 nu are regulă — moștenește padding-ul de bază de mai sus. */
.tx-tfm__menu {
	--tx-tfm-indent: 18px;
}

.tx-tfm__option[data-depth="1"] {
	padding-left: calc(10px + var(--tx-tfm-indent));
}

.tx-tfm__option[data-depth="2"] {
	padding-left: calc(10px + var(--tx-tfm-indent) * 2);
}

.tx-tfm__option[data-depth="3"] {
	padding-left: calc(10px + var(--tx-tfm-indent) * 3);
}

.tx-tfm__option-label {
	white-space: normal;
	min-width: 0;
}

.tx-tfm__option-count {
	color: #6b7280;
	font-size: 0.9em;
	flex-shrink: 0;
}

.tx-tfm__option:hover:not(.is-disabled),
.tx-tfm__option.is-highlighted:not(.is-disabled) {
	background-color: rgba(11, 28, 63, 0.06);
}

.tx-tfm__option[aria-selected="true"] {
	background-color: rgba(11, 28, 63, 0.1);
	font-weight: 600;
}

.tx-tfm__option[aria-selected="true"]:hover:not(.is-disabled),
.tx-tfm__option[aria-selected="true"].is-highlighted:not(.is-disabled) {
	background-color: rgba(11, 28, 63, 0.15);
}

.tx-tfm__option.is-disabled,
.tx-tfm__option[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
}

.tx-tfm__option.is-disabled .tx-tfm__option-count,
.tx-tfm__option[aria-disabled="true"] .tx-tfm__option-count {
	color: #9ca3af;
}

/* Scrollbar subțire */
.tx-tfm__menu::-webkit-scrollbar { width: 6px; }
.tx-tfm__menu::-webkit-scrollbar-track { background: transparent; }
.tx-tfm__menu::-webkit-scrollbar-thumb {
	background: rgba(11, 28, 63, 0.2);
	border-radius: 3px;
}
.tx-tfm__menu::-webkit-scrollbar-thumb:hover {
	background: rgba(11, 28, 63, 0.4);
}

/* ---------- Reset button ---------- */
.tx-tfm__reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding: 10px 16px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1;
	color: #0b1c3f;
	background-color: transparent;
	border: 1px solid #0b1c3f;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	float:right;
}

.tx-tfm__reset[hidden] {
	display: none;
}

.tx-tfm__reset::before {
	content: '×';
	font-size: 18px;
	line-height: 0.7;
	font-weight: 300;
}

.tx-tfm__reset:hover,
.tx-tfm__reset:focus-visible {
	background-color: #0b1c3f;
	color: #fff;
	outline: none;
}

/* ---------- No-results message ---------- */
.tx-tfm__no-results {
	margin-top: 12px;
	padding: 16px;
	font-size: 15px;
	color: #6b7280;
	background-color: rgba(11, 28, 63, 0.04);
	border: 1px solid rgba(11, 28, 63, 0.1);
	border-radius: 8px;
	text-align: center;
}

.tx-tfm__no-results[hidden] {
	display: none;
}

/* ---------- Reload fade ---------- */
/* JS adaugă .tx-tfm-is-reloading pe <html> înainte de window.location.href.
   Apoi browserul reîncarcă pagina și clasa dispare singură la noul load. */
html.tx-tfm-is-reloading body {
	transition: opacity 0.2s ease;
	opacity: 0.5;
	cursor: progress;
}

html.tx-tfm-is-reloading .tx-tfm {
	pointer-events: none;
}

/* ---------- Editor placeholder ---------- */
.tx-tfm__empty {
	padding: 24px;
	text-align: center;
	color: #6b7280;
	border: 1px dashed rgba(11, 28, 63, 0.3);
	border-radius: 8px;
	background: rgba(11, 28, 63, 0.02);
}

/* ---------- Mobile: filtrele unul sub altul ---------- */
@media (max-width: 767px) {
	.tx-tfm__list {
		flex-direction: column;
	}
	.tx-tfm__filter {
		flex: 1 1 100%;
		min-width: 100%;
	}
}
