/*
 * PGE-Tema – vinfilteret: række af rullemenuer, "Alle filtre"-skuffe,
 * mærker med valgte filtre og linjen med antal og sortering.
 */

.pge-filter { position: relative; margin: 0 0 24px; font-size: 15px; line-height: 1.4; }
.pge-filter__form { margin: 0; }
.pge-filter button, .pge-filter select, .pge-filter input { margin: 0; }

/* ---------- Række med rullemenuer ---------- */

.pge-filter__row { display: flex; align-items: flex-start; gap: 10px; }
.pge-filter__pills { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 10px; min-width: 0; }

.pge-dd { position: relative; }
.pge-dd > summary { list-style: none; }
.pge-dd > summary::-webkit-details-marker { display: none; }
.pge-dd__btn,
.pge-filter__all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	min-height: 0;
	padding: 0 14px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	color: #2d2d2d;
	background-color: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	user-select: none;
	transition: border-color .15s, background-color .15s, color .15s;
}
.pge-dd__btn:hover, .pge-dd[open] > .pge-dd__btn { border-color: #9a762c; box-shadow: none; }
.pge-dd__btn:focus-visible, .pge-filter__all:focus-visible { outline: 2px solid #9a762c; outline-offset: 2px; }
.pge-dd__btn i { top: 0; font-size: 14px; opacity: .7; transition: transform .15s; }
.pge-dd[open] > .pge-dd__btn i { transform: rotate(180deg); }
.pge-dd__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background-color: #9a762c;
	border-radius: 10px;
}
.pge-dd__badge[hidden] { display: none; }

.pge-filter__all { flex: 0 0 auto; color: #fff; background-color: #191919; border-color: #191919; }
.pge-filter__all:hover { color: #fff; background-color: #9a762c; border-color: #9a762c; box-shadow: none; }
.pge-filter__all i { top: 0; font-size: 16px; }
.pge-filter__all .pge-dd__badge { color: #191919; background-color: #fff; }

/* Panel under knappen */
.pge-filter__pills .pge-dd__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 40;
	width: 300px;
	max-width: calc(100vw - 30px);
	padding: 14px;
	background-color: #fff;
	border: 1px solid #ddd;
	box-shadow: 1px 1px 15px rgba(0, 0, 0, .15);
}
.pge-filter__pills .pge-dd:nth-last-child(-n+2) .pge-dd__panel { left: auto; right: 0; }
.pge-filter__pills .pge-dd:first-child .pge-dd__panel { left: 0; right: auto; }
.pge-dd__list { max-height: 300px; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.pge-dd__list li { margin: 0; padding: 0; list-style: none; }
.pge-opt label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 4px; font-size: 15px; font-weight: 400; line-height: 1.3; color: #2d2d2d; cursor: pointer; }
.pge-opt label:hover { background-color: #f7f4ee; }
.pge-opt input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: #9a762c; cursor: pointer; }
.pge-opt__label { flex: 1 1 auto; min-width: 0; }
.pge-opt__count { flex: 0 0 auto; font-size: 13px; color: #8a8a8a; }
.pge-opt.is-empty label { color: #b9b9b9; cursor: default; }
.pge-opt.is-empty label:hover { background-color: transparent; }
.pge-opt.is-empty .pge-opt__count { color: #c9c9c9; }
.pge-opt[hidden] { display: none; }
/* I lange lister (producenter) skjules valg uden vine helt. */
.pge-dd--long .pge-opt.is-empty { display: none; }
.pge-dd__search { margin: 0 0 10px; }
.pge-dd__search input { width: 100%; height: 38px; margin: 0; font-size: 15px; }
.pge-dd__none { margin: 6px 4px; font-size: 14px; color: #777; }
.pge-dd__hint { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: #777; }
.pge-dd__list + .pge-dd__hint { margin: 8px 0 0; }
.pge-dd__foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid #ececec; }
.pge-dd__foot .button { display: block; width: 100%; margin: 0; }

.pge-range { display: flex; align-items: flex-end; gap: 8px; }
.pge-range label { flex: 1 1 0; min-width: 0; margin: 0; font-size: 13px; font-weight: 400; color: #666; }
.pge-range label span { display: block; margin-bottom: 4px; }
.pge-range input, .pge-range select { width: 100%; height: 40px; margin: 0; font-size: 15px; }
.pge-range__sep, .pge-range__unit { flex: 0 0 auto; padding-bottom: 10px; color: #666; }

/* ---------- Valgte filtre ---------- */

.pge-filter__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pge-filter__chips:empty { display: none; }
.pge-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 14px; line-height: 1.2; color: #2d2d2d; background-color: #f6efe1; border: 1px solid #e6d9bd; transition: border-color .15s, background-color .15s; }
.pge-chip:hover { color: #111; background-color: #efe3c9; border-color: #9a762c; }
.pge-chip i { top: 0; font-size: 11px; opacity: .7; }
.pge-filter__reset { margin-left: 4px; font-size: 14px; color: #2d2d2d; text-decoration: underline; text-underline-offset: 3px; }
.pge-filter__reset:hover { color: #9a762c; }

/* ---------- Antal og sortering ---------- */

.pge-filter__meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #ececec; color: #4a4a4a; }
.pge-filter__meta label { display: inline; margin: 0; font-size: 15px; font-weight: 400; color: inherit; }
.pge-filter__meta select { display: inline-block; width: auto; height: 36px; margin: 0 2px; padding-right: 2em; font-size: 15px; vertical-align: middle; }
.pge-filter__count strong { color: #2d2d2d; }
.pge-filter__sort { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pge-filter__sort .button { margin: 0; }

/* ---------- Resultater ---------- */

.pge-results { transition: opacity .15s; }
.pge-filter.is-loading ~ .pge-results, .pge-results[aria-busy="true"] { opacity: .45; pointer-events: none; }
.pge-no-results { padding: 60px 0 80px; }
.pge-no-results .lead { font-size: 1.15em; }

/* ---------- Skuffen "Alle filtre" ---------- */

.pge-drawer.pge-filter-drawer { width: 400px; background-color: #fff; overflow: hidden; }
.pge-filter-drawer:not([hidden]) { display: flex; flex-direction: column; }
.pge-filter-drawer__head { flex: 0 0 auto; padding: 26px 24px 0; text-align: center; font-size: 1.1em; }
.pge-filter-drawer__head .is-divider { margin: 12px auto 0; }
.pge-filter-drawer__body { flex: 1 1 auto; min-height: 0; padding: 8px 24px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pge-filter-drawer__foot { display: flex; flex: 0 0 auto; align-items: center; gap: 16px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); background-color: #fff; border-top: 1px solid #ececec; }
.pge-filter-drawer__foot .button { flex: 1 1 auto; margin: 0; }
.pge-filter-drawer__foot .pge-filter__reset { flex: 0 0 auto; margin: 0; }

.pge-filter-drawer .pge-dd { border-bottom: 1px solid #ececec; }
.pge-filter-drawer .pge-dd__btn { display: flex; width: 100%; height: 52px; padding: 0; font-size: 16px; border: 0; }
.pge-filter-drawer .pge-dd__label { flex: 1 1 auto; text-align: left; }
.pge-filter-drawer .pge-dd__panel { padding: 0 0 16px; }
.pge-filter-drawer .pge-dd__list { max-height: 260px; }
.pge-filter-drawer .pge-dd__foot { display: none; }

@media (max-width: 440px) {
	.pge-drawer.pge-filter-drawer { width: 100vw; }
}

/* ---------- Tablet og mobil: "Alle filtre" er indgangen ---------- */

@media (max-width: 849px) {
	.js .pge-filter__pills { display: none; }
	.pge-filter__row { justify-content: flex-start; }
	.js .pge-filter__all { flex: 1 1 auto; justify-content: center; }
	.pge-filter__meta { flex-wrap: wrap; gap: 10px 16px; }
}
@media (max-width: 549px) {
	.pge-filter { margin-bottom: 16px; font-size: 14px; }
	.pge-filter__meta label, .pge-filter__meta select { font-size: 14px; }
	.pge-filter__sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
	.pge-filter__sort select { max-width: 46vw; }
}

/* ---------- Uden JavaScript: alt vises på siden, og formularen sendes almindeligt ---------- */

.no-js .pge-filter__all { display: none; }
.no-js .pge-filter-drawer[hidden] { display: block; position: static; width: auto; margin-top: 12px; transform: none; box-shadow: none; overflow: visible; }
.no-js .pge-drawer__close,
.no-js .pge-filter-drawer__head { display: none; }
.no-js .pge-filter-drawer__body { display: flex; flex-wrap: wrap; gap: 0 30px; padding: 0; overflow: visible; }
.no-js .pge-filter-drawer__foot { padding: 12px 0 0; border: 0; }
.no-js .pge-filter-drawer__foot .button { flex: 0 0 auto; }
