/* ==========================================================================
   BINAWATT — shop filters & results layout
   ========================================================================== */

.bw-shop {
	display: grid;
	grid-template-columns: 288px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}
.bw-shop__main { position: relative; min-width: 0; transition: opacity .2s; }
.bw-shop .woocommerce-products-header { display: none; }

/* Loading: dim results + moving bar */
.bw-shop.is-loading .bw-shop__main { opacity: .45; pointer-events: none; }
.bw-shop.is-loading .bw-filters__panel { pointer-events: none; }
.bw-shop.is-loading .bw-shop__main::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 0;
	z-index: 5;
	width: 30%;
	height: 3px;
	border-radius: 3px;
	background: var(--bw-orange);
	animation: bw-loadbar 1s var(--bw-ease) infinite;
}
@keyframes bw-loadbar { from { left: 0; width: 10%; } 50% { width: 40%; } to { left: 100%; width: 10%; } }

/* Sidebar
   -------------------------------------------------------------------------- */
.bw-filters { position: sticky; top: 160px; }
.bw-filters__overlay { display: none; }
.bw-filters__panel {
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 180px);
	border: 1px solid var(--bw-line);
	border-radius: 18px;
	background: var(--bw-white);
}
.bw-filters__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--bw-line);
}
.bw-filters__title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--bw-ink); font-size: 17px; font-weight: 800; }
.bw-filters__title .bw-icon { color: var(--bw-orange); }
.bw-filters__badge {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--bw-orange);
	color: var(--bw-white);
	font-size: 12px;
	font-weight: 700;
}
.bw-filters__clear { margin-left: auto; color: var(--bw-orange-600); font-size: 14px; font-weight: 600; text-decoration: none; }
.bw-filters__clear:hover { text-decoration: underline; }
.bw-filters__x { display: none; margin-left: auto; color: var(--bw-navy); }
.bw-filters__body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 10px; scrollbar-width: thin; }
.bw-filters__foot { display: none; }

/* Facet (collapsible group) */
.bw-facet { border-bottom: 1px solid var(--bw-line); }
.bw-facet:last-child { border-bottom: 0; }
.bw-facet summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 15px 0;
	color: var(--bw-ink);
	font-size: 15px;
	font-weight: 700;
	list-style: none;
	cursor: pointer;
	user-select: none;
}
.bw-facet summary::-webkit-details-marker { display: none; }
.bw-facet__arrow { width: 18px; height: 18px; margin-left: auto; color: var(--bw-muted); transition: transform .2s; }
.bw-facet[open] .bw-facet__arrow { transform: rotate(180deg); }
.bw-facet__count {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--bw-orange-50);
	color: var(--bw-orange-600);
	font-size: 12px;
}
.bw-facet__content { margin: 0 0 16px; padding: 0; list-style: none; }

/* Category list */
.bw-cat-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	color: var(--bw-navy);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.bw-cat-back .bw-icon { width: 16px; height: 16px; }
.bw-cat-list { margin: 0; padding: 0; list-style: none; }
.bw-cat-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 -10px;
	padding: 8px 10px;
	border-radius: 8px;
	color: var(--bw-ink);
	font-size: 14px;
	text-decoration: none;
	transition: background .12s, color .12s;
}
.bw-cat-list a:hover { background: var(--bw-bg); color: var(--bw-navy); }
.bw-cat-list em,
.bw-opt__count { color: var(--bw-muted); font-size: 12px; font-style: normal; font-weight: 600; }

/* Checkbox options */
.bw-opts li.is-extra { display: none; }
.bw-opts.is-expanded li.is-extra { display: block; }
.bw-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 -10px;
	padding: 7px 10px;
	border-radius: 8px;
	color: var(--bw-ink);
	font-size: 14px;
	text-decoration: none;
	transition: background .12s;
}
.bw-opt:hover { background: var(--bw-bg); }
.bw-opt__name { flex: 1; }
.bw-opt__box {
	position: relative;
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #b8c0cc;
	border-radius: 5px;
	background: var(--bw-white);
	transition: background .15s, border-color .15s;
}
.bw-opt:hover .bw-opt__box { border-color: var(--bw-navy); }
.bw-opt.is-on .bw-opt__box { border-color: var(--bw-orange); background: var(--bw-orange); }
.bw-opt.is-on .bw-opt__box::after {
	content: "";
	position: absolute;
	top: 1px;
	left: 5px;
	width: 5px;
	height: 10px;
	border: solid var(--bw-white);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.bw-opt.is-on .bw-opt__name { font-weight: 600; }
.bw-opt.is-empty { opacity: .4; pointer-events: none; }

/* Chip options (short values like IP65, 3P, 4000 K) */
.bw-opts--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bw-opts--chips .bw-opt {
	gap: 6px;
	margin: 0;
	padding: 7px 12px;
	border: 1.5px solid var(--bw-line);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}
.bw-opts--chips .bw-opt:hover { border-color: var(--bw-navy); background: var(--bw-white); }
.bw-opts--chips .bw-opt.is-on { border-color: var(--bw-orange); background: var(--bw-orange); color: var(--bw-white); }
.bw-opts--chips .bw-opt.is-on .bw-opt__count { color: rgba(255, 255, 255, .8); }

.bw-more {
	margin: -8px 0 14px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--bw-navy);
	font: 600 13px var(--bw-font);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.bw-more:hover { background: none; color: var(--bw-orange-600); }

/* Switches */
.bw-switches { display: grid; gap: 4px; }
.bw-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 7px 0;
	color: var(--bw-ink);
	font-size: 14px;
	text-decoration: none;
}
.bw-switch i {
	position: relative;
	flex: none;
	width: 40px;
	height: 22px;
	border-radius: 999px;
	background: #d3d8e0;
	transition: background .2s, box-shadow .2s;
}
.bw-switch i::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--bw-white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .2s var(--bw-ease);
}
.bw-switch.is-on i { background: var(--bw-orange); }
.bw-switch.is-on i::after { transform: translateX(18px); }
.bw-switch:hover i { box-shadow: 0 0 0 4px var(--bw-orange-50); }

/* Price range: two native sliders stacked on one track */
.bw-range { position: relative; height: 28px; margin: 4px 9px 10px; }
.bw-range::before,
.bw-range::after {
	content: "";
	position: absolute;
	top: 12px;
	height: 4px;
	border-radius: 4px;
}
.bw-range::before { left: -9px; right: -9px; background: var(--bw-line); }
.bw-range::after { left: var(--from); right: calc(100% - var(--to)); background: var(--bw-orange); }
.bw-range input[type="range"] {
	position: absolute;
	top: 0;
	left: -9px;
	z-index: 1;
	width: calc(100% + 18px);
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.bw-range input[type="range"]::-webkit-slider-runnable-track { background: none; }
.bw-range input[type="range"]::-moz-range-track { background: none; }
.bw-range input[type="range"]::-webkit-slider-thumb {
	width: 20px;
	height: 20px;
	border: 3px solid var(--bw-orange);
	border-radius: 50%;
	background: var(--bw-white);
	box-shadow: 0 2px 6px rgba(7, 26, 66, .25);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
}
.bw-range input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 3px solid var(--bw-orange);
	border-radius: 50%;
	background: var(--bw-white);
	cursor: grab;
	pointer-events: auto;
}
.bw-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--bw-orange-50); }

.bw-price__inputs { display: flex; align-items: center; gap: 8px; }
.bw-price__inputs label {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 4px;
	padding: 0 10px;
	border: 1px solid var(--bw-line);
	border-radius: 10px;
	color: var(--bw-muted);
	font-size: 14px;
}
.bw-price__inputs label:focus-within { border-color: var(--bw-navy); }
.bw-price__inputs input[type="number"] {
	width: 100%;
	min-width: 0;
	height: 40px;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	font-weight: 700;
	-moz-appearance: textfield;
}
.bw-price__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; }
.bw-price__inputs input:focus { outline: none; }
.bw-price__dash { color: var(--bw-muted); }
/* JS applies the price automatically; the button is the no-JS fallback. */
.bw-price__apply {
	width: 100%;
	margin-top: 10px;
	padding: 9px;
	border: 1px solid var(--bw-line);
	border-radius: 10px;
	background: var(--bw-white);
	color: var(--bw-navy);
	font: 600 14px var(--bw-font);
}
.bw-js .bw-price__apply { display: none; }

/* Toolbar
   -------------------------------------------------------------------------- */
.bw-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-bottom: 16px;
	padding: 10px 10px 10px 18px;
	border: 1px solid var(--bw-line);
	border-radius: 14px;
	background: var(--bw-white);
}
.bw-toolbar__count { margin: 0 auto 0 0; color: var(--bw-muted); font-size: 14px; }
.bw-toolbar__count strong { color: var(--bw-ink); }
.bw-toolbar__filters {
	display: none;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--bw-navy);
	color: var(--bw-white);
	font: 700 14px var(--bw-font);
}
.bw-toolbar__filters:hover,
.bw-toolbar__filters:focus { background: var(--bw-navy-700); color: var(--bw-white); }

.bw-sort { display: flex; align-items: center; gap: 10px; margin: 0; }
.bw-sort label { color: var(--bw-muted); font-size: 14px; white-space: nowrap; }
.bw-sort__select { position: relative; }
.bw-sort__select select {
	height: 42px;
	padding: 0 38px 0 14px;
	border: 1px solid var(--bw-line);
	border-radius: 999px;
	background: var(--bw-bg);
	color: var(--bw-ink);
	font: 600 14px var(--bw-font);
	appearance: none;
	cursor: pointer;
}
.bw-sort__select .bw-icon {
	position: absolute;
	top: 50%;
	right: 14px;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	color: var(--bw-muted);
	pointer-events: none;
}

.bw-view { display: flex; padding: 3px; border-radius: 999px; background: var(--bw-bg); }
.bw-view__btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bw-muted);
}
.bw-view__btn .bw-icon { width: 18px; height: 18px; }
.bw-view__btn:hover,
.bw-view__btn:focus { background: transparent; color: var(--bw-navy); }
.bw-view__btn.is-active { background: var(--bw-white); color: var(--bw-navy); box-shadow: var(--bw-shadow-sm); }

/* Active filter chips */
.bw-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.bw-active a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px 6px 14px;
	border-radius: 999px;
	background: #eef3fc;
	color: var(--bw-navy);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.bw-active a .bw-icon { width: 14px; height: 14px; }
.bw-active a:hover { background: var(--bw-navy); color: var(--bw-white); }
.bw-active a.bw-active__clear { padding: 6px 4px; background: none; color: var(--bw-orange-600); text-decoration: underline; text-underline-offset: 3px; }
.bw-active a.bw-active__clear:hover { background: none; color: var(--bw-orange-600); }

/* Three product columns next to the sidebar */
.bw-shop ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* No results */
.bw-noresults {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 56px 24px;
	border: 1px dashed var(--bw-line);
	border-radius: 18px;
	text-align: center;
}
.bw-noresults > .bw-icon { width: 48px; height: 48px; margin-bottom: 14px; color: var(--bw-orange); }
.bw-noresults h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.bw-noresults p { max-width: 440px; color: var(--bw-muted); }
.bw-noresults__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.bw-btn--outline { border-color: var(--bw-line); color: var(--bw-navy); }
.bw-btn--outline:hover { border-color: var(--bw-navy); color: var(--bw-navy); }

/* List view
   -------------------------------------------------------------------------- */
.bw-shop.is-list ul.products { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.bw-shop.is-list .bw-card { flex-direction: row; align-items: stretch; }
.bw-shop.is-list .bw-card:hover { transform: translateY(-2px); }
.bw-shop.is-list .bw-card__media { flex: none; width: 180px; margin: 8px; }
.bw-shop.is-list .bw-card__body { justify-content: center; padding: 16px 8px; }
.bw-shop.is-list .bw-card__title { min-height: 0; font-size: 17px; }
.bw-shop.is-list .bw-card__meta { justify-content: flex-start; gap: 14px; margin-top: 4px; }
.bw-shop.is-list .bw-card__foot {
	flex: none;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	width: 210px;
	padding: 16px 20px;
	border-top: 0;
	border-left: 1px dashed var(--bw-line);
}
.bw-shop.is-list .bw-card__price { font-size: 22px; }
.bw-shop.is-list .bw-card .button { justify-content: center; }
.bw-shop.is-list .bw-card .added_to_cart { top: 12px; bottom: auto; }

/* Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
	.bw-shop { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
	.bw-shop ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
	.bw-shop { grid-template-columns: minmax(0, 1fr); }
	.bw-shop ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.bw-toolbar__filters { display: inline-flex; }

	/* Sidebar becomes a slide-in panel */
	.bw-filters { position: fixed; inset: 0; z-index: 1000; visibility: hidden; }
	.bw-filters.is-open { visibility: visible; }
	.bw-filters__overlay {
		display: block;
		position: absolute;
		inset: 0;
		background: rgba(7, 26, 66, .55);
		opacity: 0;
		transition: opacity .25s;
	}
	.bw-filters.is-open .bw-filters__overlay { opacity: 1; }
	.bw-filters__panel {
		position: absolute;
		inset: 0 auto 0 0;
		width: min(380px, 90vw);
		max-height: none;
		border: 0;
		border-radius: 0;
		transform: translateX(-100%);
		transition: transform .3s var(--bw-ease);
	}
	.bw-filters.is-open .bw-filters__panel { transform: none; }
	.bw-filters__x { display: inline-grid; }
	.bw-filters__clear + .bw-filters__x { margin-left: 0; }
	.bw-filters__body { flex: 1; }
	.bw-filters__foot { display: block; padding: 14px 18px; border-top: 1px solid var(--bw-line); }
	.bw-filters__foot .bw-btn { width: 100%; }
}

@media (max-width: 768px) {
	.bw-shop ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bw-toolbar { gap: 10px; padding: 10px; }
	.bw-toolbar__count { order: 5; flex-basis: 100%; margin: 0; padding: 0 4px; font-size: 13px; }
	.bw-sort { margin-left: auto; }
	.bw-sort label { display: none; }
	.bw-view { display: none; }
	.bw-shop.is-list ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bw-shop.is-list .bw-card { flex-direction: column; }
	.bw-shop.is-list .bw-card__media { width: auto; }
	.bw-shop.is-list .bw-card__foot { width: auto; border-top: 1px dashed var(--bw-line); border-left: 0; }
}
