/* Bimek Filtry – panel filtrów jak na Allegro */
.bf, .bf-bar {
	--bf-accent: var(--theme-palette-color-2, #33cc33);
	--bf-accent-dark: #22a322;
	--bf-text: #1d1d1f;
	--bf-muted: #6b6b70;
	--bf-line: #e6e6e8;
	--bf-border: #cfcfd4;
	--bf-soft: #f5f5f6;
	--bf-radius: 8px;
	font-family: inherit;
	color: var(--bf-text);
}
.bf *, .bf-bar * { box-sizing: border-box; }
.bf .screen-reader-text, .bf-bar .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* ---------- Panel (komputer: w panelu bocznym) ---------- */
.bf { font-size: 14px; line-height: 1.35; }
.bf__head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 10px; border-bottom: 1px solid var(--bf-border); margin-bottom: 4px; }
.bf__title { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.bf__close { display: none; }
.bf__foot { display: none; }

.bf__active { padding: 12px 0; border-bottom: 1px solid var(--bf-line); }
.bf__active-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 13px; }
.bf__clear-link { color: var(--bf-muted); text-decoration: underline; font-size: 13px; }
.bf__clear-link:hover { color: var(--bf-text); }

.bf-f { border-bottom: 1px solid var(--bf-line); }
.bf-f__head {
	display: flex; align-items: center; gap: 8px; width: 100%;
	padding: 14px 0; margin: 0; border: 0; background: none; cursor: pointer;
	font: inherit; font-size: 15px; font-weight: 700; color: var(--bf-text); text-align: left;
}
.bf-f__head:hover { color: #000; }
.bf-f__head:focus-visible { outline: 2px solid var(--bf-accent); outline-offset: 2px; border-radius: 4px; }
.bf-f__label { flex: 1; }
.bf-f__sel { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bf-accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center; font-weight: 700; }
.bf-f__chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; opacity: .7; }
.bf-f__head[aria-expanded="true"] .bf-f__chev { transform: rotate(-135deg) translate(-2px, -2px); }
.bf-f__body { padding: 0 0 14px; }
.bf-f__body[hidden] { display: none; }

.bf-f__search {
	width: 100%; margin: 0 0 8px; padding: 8px 10px; font: inherit; font-size: 13px;
	border: 1px solid var(--bf-line); border-radius: 6px; background: #fff;
}
.bf-f__search:focus { outline: none; border-color: var(--bf-accent); box-shadow: 0 0 0 3px rgba(51, 204, 51, .15); }

.bf-opts, .bf-cats, .bf-chips { list-style: none; margin: 0; padding: 0; }
.bf-opt { margin: 0; }
.bf-opt label {
	display: flex; align-items: center; gap: 10px; padding: 6px 4px; margin: 0 -4px;
	border-radius: 6px; cursor: pointer; user-select: none;
}
.bf-opt label:hover { background: var(--bf-soft); }
.bf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bf-opt__box {
	flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid #b9b9be; border-radius: 4px; background: #fff;
	display: grid; place-items: center; transition: background .1s, border-color .1s;
}
.bf-opt input:checked + .bf-opt__box { background: var(--bf-accent); border-color: var(--bf-accent); }
.bf-opt input:checked + .bf-opt__box::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.bf-opt input:focus-visible + .bf-opt__box { outline: 2px solid var(--bf-accent); outline-offset: 2px; }
.bf-opt__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bf-opt input:checked ~ .bf-opt__name { font-weight: 600; }
.bf-opt__count { color: var(--bf-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bf-opt.is-empty { opacity: .45; }
.bf-opt.is-empty label { cursor: default; }
.bf-opt.is-extra, .bf-opt.is-hidden { display: none; }
.bf-f.is-expanded .bf-opt.is-extra { display: block; }
.bf-f.is-searching .bf-opt.is-extra { display: block; }
.bf-f.is-searching .bf-opt.is-hidden { display: none; }

.bf-more { margin-top: 6px; padding: 4px 0; border: 0; background: none; color: var(--bf-accent-dark); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bf-more:hover { text-decoration: underline; }

.bf-cat a { display: flex; align-items: center; gap: 8px; padding: 6px 4px; margin: 0 -4px; border-radius: 6px; color: var(--bf-text); text-decoration: none; }
.bf-cat a:hover { background: var(--bf-soft); }
.bf-cat.is-current a { font-weight: 700; color: var(--bf-accent-dark); }
.bf-cat--up a { color: var(--bf-muted); font-size: 13px; }

.bf-price { display: flex; align-items: center; gap: 6px; }
.bf-price label { flex: 1; min-width: 0; }
.bf-price input {
	width: 100%; padding: 8px 8px; font: inherit; font-size: 14px; border: 1px solid #cfcfd4; border-radius: 6px; background: #fff;
	-moz-appearance: textfield;
}
.bf-price input::-webkit-outer-spin-button, .bf-price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bf-price input:focus { outline: none; border-color: var(--bf-accent); box-shadow: 0 0 0 3px rgba(51, 204, 51, .15); }
.bf-price__sep, .bf-price__cur { color: var(--bf-muted); }

.bf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 36px; padding: 0 14px; border: 1px solid #cfcfd4; border-radius: 6px; background: #fff;
	font: inherit; font-size: 14px; font-weight: 600; color: var(--bf-text); cursor: pointer; text-decoration: none;
}
.bf-btn:hover { border-color: var(--bf-text); }
.bf-btn--primary { background: var(--bf-accent); border-color: var(--bf-accent); color: #fff; }
.bf-btn--primary:hover { background: var(--bf-accent-dark); border-color: var(--bf-accent-dark); color: #fff; }
.bf-btn--primary[disabled] { background: #c9c9cd; border-color: #c9c9cd; cursor: not-allowed; }
.bf-btn--ghost { border-color: transparent; background: none; text-decoration: underline; font-weight: 500; }
.bf-price__ok { min-height: 36px; padding: 0 12px; }

/* ---------- Pasek nad produktami ---------- */
.bf-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.bf-bar:not(.has-chips) { margin: 0; }
.bf-open {
	display: none; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
	border: 1px solid var(--bf-border); border-radius: 999px; background: #fff; color: var(--bf-text);
	font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.bf-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bf-accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.bf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
	background: #ecfbec; border: 1px solid #bfeabf; color: var(--bf-text); font-size: 13px; text-decoration: none; white-space: nowrap;
}
.bf-chip span[aria-hidden] { font-size: 15px; line-height: 1; color: var(--bf-muted); }
.bf-chip:hover { border-color: var(--bf-accent); }
.bf-chip--clear { background: none; border-color: transparent; text-decoration: underline; color: var(--bf-muted); }

/* Ładowanie po kliknięciu filtra */
.bf-loading ul.products, .bf-loading .woocommerce-pagination { opacity: .45; pointer-events: none; transition: opacity .15s; }

/* ---------- Telefon i tablet: przycisk + panel na cały ekran ---------- */
@media (max-width: 999.98px) {
	.bf-js .ct-sidebar:has(#bf-anchor), .bf-js aside:has(#bf-anchor) { display: none !important; }
	.bf-js .bf-open { display: inline-flex; }
	.bf-bar { position: sticky; top: var(--bf-sticky-top, 0px); z-index: 30; padding: 8px 0; background: var(--bf-bar-bg, #f4f4f4); flex-wrap: nowrap; }
	.bf-bar:not(.has-chips) { margin: 0 0 12px; }
	.bf-bar .bf-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
	.bf-bar .bf-chips::-webkit-scrollbar { display: none; }

	.bf-drawer { position: fixed; inset: 0; z-index: 100000; visibility: hidden; }
	.bf-drawer__shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
	.bf-drawer .bf {
		position: absolute; inset: 0 0 0 auto; width: min(100%, 440px); display: flex; flex-direction: column;
		background: #fff; transform: translateX(100%); transition: transform .22s ease-out; box-shadow: -8px 0 24px rgba(0, 0, 0, .15);
	}
	html.bf-is-open .bf-drawer { visibility: visible; }
	html.bf-is-open .bf-drawer__shade { opacity: 1; }
	html.bf-is-open .bf-drawer .bf { transform: none; }
	html.bf-is-open, html.bf-is-open body { overflow: hidden; }

	.bf-drawer .bf__head { padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--bf-line); }
	.bf-drawer .bf__close { display: grid; place-items: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--bf-text); cursor: pointer; }
	.bf-drawer .bf__form { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px; overscroll-behavior: contain; }
	.bf-drawer .bf__foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--bf-line); background: #fff; }
	.bf-drawer .bf__apply { flex: 1; min-height: 48px; font-size: 16px; border-radius: 8px; }
	.bf-drawer .bf__reset { min-height: 48px; }
	.bf-drawer .bf-opt label, .bf-drawer .bf-cat a { padding: 10px 4px; font-size: 15px; }
	.bf-drawer .bf-f__head { padding: 16px 0; font-size: 16px; }
	.bf-drawer .bf-price input { font-size: 16px; min-height: 44px; } /* 16px = brak powiększania na iPhone */
	.bf-drawer .bf-f__search { font-size: 16px; min-height: 42px; }
	.bf-drawer .bf.is-busy .bf__apply { opacity: .7; }
}

@media (min-width: 1000px) {
	.bf-bar:not(.has-chips) { display: none; }
	.bf-anchor--footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.bf-drawer .bf, .bf-drawer__shade, .bf-f__chev { transition: none; }
}

/* Motyw nie może zmieniać wyglądu przycisków i nagłówków panelu */
.bf button, .bf-bar button, .bf .bf-btn, .bf-bar .bf-chip {
	text-transform: none; letter-spacing: normal; box-shadow: none; text-shadow: none; line-height: 1.2;
}
.bf .bf-f__head, .bf .bf__close, .bf .bf-more { background: none; border-radius: 0; min-height: 0; }
.bf .bf__close:focus-visible, .bf-open:focus-visible, .bf .bf-btn:focus-visible { outline: 2px solid var(--bf-accent); outline-offset: 2px; }
.bf input[type="checkbox"] { margin: 0; }
.bf a, .bf-bar a { box-shadow: none; }
.bf ul.bf-opts, .bf ul.bf-cats, .bf ul.bf-chips, .bf-bar ul.bf-chips { margin: 0; padding: 0; list-style: none; }
.bf li { margin: 0; }
.bf .bf-price input, .bf .bf-f__search { background: #fff; color: var(--bf-text); }

/* 1.0.1: motyw nadpisywał padding pól ceny; wąski panel boczny */
.bf .bf-price input { padding: 8px 8px; min-height: 38px; height: auto; }
.bf .bf-price { flex-wrap: wrap; row-gap: 8px; }
.bf .bf-price label { flex: 1 1 56px; }
.bf-panel-wrap, #bf-anchor { container-type: inline-size; }
@container (max-width: 250px) {
	.bf .bf-price__cur { display: none; }
	.bf .bf-price__ok { flex: 1 0 100%; }
}
/* Szerszy panel boczny na listach z filtrami (motyw: 16%) */
@media (min-width: 1000px) {
	.ct-container[data-sidebar]:has(#bf-anchor) { --sidebar-width: 21%; }
}

/* 1.0.1: globalne style przycisków i pól z Elementora/Blocksy (wysoka specyficzność) – tylko wygląd */
.bf button.bf-btn, .bf-bar button.bf-open, .bf-bar .bf-chip, .bf button.bf-btn:hover, .bf-bar button.bf-open:hover {
	background: #fff !important; color: var(--bf-text) !important; border: 1px solid #cfcfd4 !important; border-radius: 6px !important;
	text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important;
}
.bf-bar button.bf-open, .bf-bar button.bf-open:hover { border-color: var(--bf-border) !important; border-radius: 999px !important; }
.bf-bar button.bf-open:hover { border-color: var(--bf-accent) !important; }
.bf-bar .bf-chip { border-radius: 999px !important; }
.bf .bf-chip, .bf .bf-chip:hover { background: #fff !important; border-radius: 999px !important; }
.bf-bar .bf-chip:hover, .bf .bf-chip:hover, .bf button.bf-btn:hover { border-color: var(--bf-accent) !important; }
.bf button.bf-btn--primary, .bf button.bf-btn--primary:hover, .bf button.bf-btn--primary:focus {
	background: var(--bf-accent) !important; border-color: var(--bf-accent) !important; color: #fff !important;
}
.bf button.bf-btn--primary:hover { background: var(--bf-accent-dark) !important; border-color: var(--bf-accent-dark) !important; }
.bf button.bf-btn--primary[disabled] { background: #c9c9cd !important; border-color: #c9c9cd !important; }
.bf button.bf-btn--ghost, .bf button.bf-btn--ghost:hover { background: none !important; border-color: transparent !important; }
.bf-bar .bf-chip--clear, .bf-bar .bf-chip--clear:hover { background: none !important; border-color: transparent !important; color: var(--bf-muted) !important; }
.bf .bf-price input, .bf input.bf-f__search {
	border: 1px solid #cfcfd4 !important; border-radius: 6px !important; background: #fff !important; padding: 8px 10px !important; box-shadow: none !important;
}
.bf .bf-price input:focus, .bf input.bf-f__search:focus { border-color: var(--bf-accent) !important; box-shadow: 0 0 0 3px rgba(51, 204, 51, .15) !important; }
.bf button.bf__close, .bf button.bf__close:hover, .bf button.bf__close:focus,
.bf button.bf-f__head, .bf button.bf-f__head:hover, .bf button.bf-f__head:focus,
.bf button.bf-more, .bf button.bf-more:hover, .bf button.bf-more:focus {
	background: none !important; border: 0 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: 0 !important;
}
.bf button.bf__close, .bf button.bf-f__head { color: var(--bf-text) !important; }
.bf button.bf-more { color: var(--bf-accent-dark) !important; }

/* 1.0.4: równa wysokość pól ceny i przycisku OK */
.bf .bf-price { align-items: center; }
.bf .bf-price input { height: 40px !important; min-height: 40px !important; margin: 0 !important; line-height: 1.2 !important; }
.bf button.bf-price__ok { height: 40px !important; min-height: 40px !important; margin: 0 !important; padding: 0 14px !important; line-height: 1 !important; align-self: center; }
.bf .bf-price__sep, .bf .bf-price__cur { line-height: 40px; }
.bf-drawer .bf .bf-price input, .bf-drawer .bf button.bf-price__ok { height: 44px !important; min-height: 44px !important; }
.bf .bf-price label { margin: 0 !important; padding: 0 !important; display: block; line-height: 0; }
.bf .bf-price input { display: block; }

/* 1.1.0: „Filtruj” na komputerze – przyklejona stopka panelu, widoczna po zmianie filtrów */
.bf__found, .bf__cancel { display: none; }
@media (min-width: 1000px) {
	.bf[data-desktop="button"].is-dirty .bf__foot {
		display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
		position: sticky; bottom: 0; z-index: 5;
		margin: 8px -12px 0; padding: 12px;
		background: #fff; border-top: 1px solid var(--bf-border);
		box-shadow: 0 -8px 20px rgba(0, 0, 0, .06);
		animation: bf-foot-in .18s ease-out;
	}
	.bf[data-desktop="button"] .bf__found { display: block; flex: 1 0 100%; font-size: 13px; color: var(--bf-muted); min-height: 18px; }
	.bf[data-desktop="button"] .bf__found:empty { display: none; }
	.bf[data-desktop="button"] .bf__cancel { display: inline-flex; }
	.bf[data-desktop="button"] .bf__reset { display: none; }
	.bf[data-desktop="button"] .bf button.bf__apply, .bf[data-desktop="button"] button.bf__apply { flex: 1; height: 44px !important; min-height: 44px !important; font-size: 15px; }
	.bf[data-desktop="button"] button.bf__cancel { height: 44px !important; min-height: 44px !important; padding: 0 10px !important; }
	.bf[data-desktop="button"].is-busy .bf__apply, .bf[data-desktop="button"].is-busy .bf__found { opacity: .6; }
	.bf[data-desktop="button"].is-dirty .bf-opt input:checked + .bf-opt__box { box-shadow: 0 0 0 3px rgba(51, 204, 51, .18); }
}
@keyframes bf-foot-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bf__foot { animation: none !important; } }
/* Pasek darmowej dostawy (lewy dolny róg) nie zasłania stopki „Filtruj” */
@media (min-width: 1000px) {
	#bimek-fsb { transition: bottom .2s ease; }
	html:has(.bf[data-desktop="button"].is-dirty) #bimek-fsb { bottom: 140px !important; }
}

/* 1.2.0: kategorie – rozwijane drzewko z polami wyboru */
.bf .bf-tree { margin: 0; padding: 0; list-style: none; }
.bf .bf-node { display: block; padding: 0; }
.bf .bf-node__row { display: flex; align-items: center; gap: 4px; }
.bf .bf-node__row label { flex: 1; min-width: 0; }
.bf button.bf-node__tog, .bf button.bf-node__tog:hover, .bf button.bf-node__tog:focus {
	flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; padding: 0 !important; margin: 0 -6px 0 0 !important;
	display: grid; place-items: center; border: 0 !important; border-radius: 6px !important; background: none !important;
	color: var(--bf-muted) !important; cursor: pointer; box-shadow: none !important;
}
.bf button.bf-node__tog:hover { background: var(--bf-soft) !important; color: var(--bf-text) !important; }
.bf .bf-node__tog .bf-f__chev { transform: rotate(-45deg); margin: 0 2px 0 0; }
.bf .bf-node__tog[aria-expanded="true"] .bf-f__chev { transform: rotate(45deg); margin-top: -3px; }
.bf ul.bf-node__kids { margin: 0 0 4px 13px !important; padding: 0 0 0 12px !important; border-left: 1px solid var(--bf-line); list-style: none; }
.bf .bf-tree > .bf-node > .bf-node__row .bf-opt__name { font-weight: 600; }
.bf .bf-node.has-kids > .bf-node__row .bf-opt__count { margin-right: 2px; }
