/* Shop + category left sidebar */

.pb-shop {
	padding-top: 0.35rem;
}

.pb-shop__toolbar {
	display: none;
}

.pb-shop__grid {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 1.5rem;
	align-items: start;
}

.admin-bar .pb-shop-sidebar {
	top: calc(var(--pb-header-h, 70px) + 44px);
}

.pb-shop-sidebar {
	position: sticky;
	top: calc(var(--pb-header-h, 70px) + 12px);
	z-index: 6;
	background: #fff;
	border: 1px solid var(--pb-border);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
	padding: 1.05rem 1.05rem 1.15rem;
}

.pb-shop-sidebar__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.85rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--pb-border);
}

.pb-shop-sidebar__title {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-family: var(--pb-font-display);
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}
.pb-shop-sidebar__title .pb-icon {
	width: 1.1rem;
	height: 1.1rem;
	color: var(--pb-action-blue);
}

.pb-shop-sidebar__close {
	display: none;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: #f3f4f6;
	color: var(--pb-text);
	cursor: pointer;
	place-items: center;
}

.pb-shop-sidebar__close .pb-icon {
	width: 1.05rem;
	height: 1.05rem;
}

.pb-shop-widget--search {
	margin: 0 0 0.35rem;
}

.pb-filter-list {
	margin-top: 0.35rem;
	border-top: 1px solid var(--pb-border);
}

.pb-filter-acc {
	border-bottom: 1px solid var(--pb-border);
}

.pb-filter-acc__btn {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.85rem 0.1rem;
	border: 0;
	background: transparent;
	color: var(--pb-text);
	font: inherit;
	font-weight: 700;
	font-size: 0.92rem;
	text-align: left;
	cursor: pointer;
}

.pb-filter-acc__btn:hover { color: var(--pb-action-blue); }

.pb-filter-acc__label { flex: 0 0 auto; }

.pb-filter-acc__sum {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: right;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--pb-text-secondary);
}

.pb-filter-acc__chev {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	color: #94a3b8;
	transition: transform 0.18s ease;
}
.pb-filter-acc__chev .pb-icon {
	width: 0.95rem;
	height: 0.95rem;
}
.pb-filter-acc.is-open .pb-filter-acc__chev {
	transform: rotate(180deg);
	color: var(--pb-action-blue);
}

.pb-filter-acc__panel {
	padding: 0 0 0.95rem;
}

.pb-filter-opts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	max-height: 220px;
	overflow: auto;
}

.pb-filter-opt {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.38rem 0.2rem;
	color: var(--pb-text);
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	border-radius: 8px;
}
.pb-filter-opt:hover { background: #f8fafc; }

.pb-filter-opt__box {
	width: 16px;
	height: 16px;
	border: 1.5px solid #cbd5e1;
	border-radius: 4px;
	background: #fff;
	flex-shrink: 0;
}
.pb-filter-opt.is-on .pb-filter-opt__box {
	border-color: var(--pb-action-blue);
	background: var(--pb-action-blue);
	box-shadow: inset 0 0 0 2px #fff;
}

.pb-filter-opt__name { flex: 1 1 auto; min-width: 0; }
.pb-filter-opt__count {
	color: var(--pb-text-secondary);
	font-size: 0.72rem;
	font-weight: 700;
}

.pb-shop-widget__title {
	margin: 0 0 0.7rem;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pb-text-secondary);
}

/* Compact AJAX search */
.pb-shop-search {
	position: relative;
	max-width: none;
}

.pb-search--shop {
	padding: 0 0 0 0.7rem;
	border-radius: 12px;
	background: #f8fafc;
	border-color: #e5e7eb;
	gap: 0;
}

.pb-search--shop .pb-shop-search__icon {
	display: grid;
	place-items: center;
	color: var(--pb-text-secondary);
}

.pb-search--shop .pb-shop-search__icon .pb-icon {
	width: 1rem;
	height: 1rem;
}

.pb-search--shop .pb-search__input {
	padding: 0.65rem 0.5rem;
	font-size: 0.86rem;
}

.pb-search--shop .pb-search__btn {
	width: 42px;
	min-width: 42px;
	min-height: 42px;
	border-radius: 0 11px 11px 0;
	padding: 0;
}

.pb-shop-search .pb-search__results {
	z-index: 40;
	width: min(340px, 82vw);
}

/* Price slider */
.pb-shop-price {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.pb-price-slider {
	position: relative;
	height: 28px;
	display: grid;
	align-items: center;
}

.pb-price-slider__rail {
	position: absolute;
	left: 0;
	right: 0;
	height: 6px;
	border-radius: 999px;
	background: #e5e7eb;
	pointer-events: none;
}

.pb-price-slider__range {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(90deg, var(--pb-action-blue), #1f5fff);
	border-radius: inherit;
}

.pb-price-slider__input {
	position: absolute;
	left: 0;
	width: 100%;
	margin: 0;
	appearance: none;
	background: none;
	pointer-events: none;
	height: 28px;
}

.pb-price-slider__input::-webkit-slider-thumb {
	appearance: none;
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: var(--pb-action-blue);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
	cursor: pointer;
}

.pb-price-slider__input::-moz-range-thumb {
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: var(--pb-action-blue);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
	cursor: pointer;
}

.pb-shop-price__values {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.4rem;
	font-size: 0.88rem;
	font-weight: 750;
	color: var(--pb-text);
}

.pb-shop-price__sep {
	color: var(--pb-text-secondary);
	font-weight: 600;
}

.pb-shop-price__apply {
	min-height: 42px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--pb-action-blue) 0%, #1f5fff 55%, #1749d6 100%);
	color: #fff;
	font-weight: 750;
	font-family: var(--pb-font-display);
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(36, 107, 253, 0.24);
}

.pb-shop-price__apply:hover {
	filter: brightness(1.05);
}

/* Categories */
.pb-shop-cats {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pb-shop-cats--child {
	margin-top: 0.15rem;
}

.pb-shop-cats__item > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.48rem 0.6rem;
	padding-left: calc(0.6rem + (var(--pb-cat-depth, 0) * 0.85rem));
	border-radius: 10px;
	color: var(--pb-text);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
}

.pb-shop-cats__item > a:hover {
	background: #f3f6ff;
	color: var(--pb-action-blue);
}

.pb-shop-cats__item.is-active > a {
	background: #eef3ff;
	color: var(--pb-action-blue);
	box-shadow: inset 3px 0 0 var(--pb-action-blue);
}

.pb-shop-cats__name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pb-shop-cats__count {
	flex-shrink: 0;
	min-width: 1.55rem;
	padding: 0.08rem 0.4rem;
	border-radius: 999px;
	background: #f3f4f6;
	color: var(--pb-text-secondary);
	font-size: 0.7rem;
	font-weight: 750;
	text-align: center;
}

.pb-shop-cats__item.is-active .pb-shop-cats__count {
	background: #dbe7ff;
	color: var(--pb-action-blue);
}

.pb-shop-sidebar__clear {
	display: block;
	margin-top: 1.1rem;
	padding-top: 0.95rem;
	border-top: 1px dashed var(--pb-border);
	text-align: center;
	font-size: 0.84rem;
	font-weight: 750;
	color: var(--pb-action-blue);
	text-decoration: none;
}

.pb-shop-sidebar__clear:hover {
	text-decoration: underline;
}

/* Main column */
.pb-shop__main > .page-title,
.pb-shop__main .woocommerce-products-header__title {
	margin: 0 0 0.75rem;
	font-family: var(--pb-font-display);
	font-size: 1.55rem;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.pb-shop,
.pb-shop-layout,
.pb-shop__grid,
.pb-main--shop {
	overflow: visible;
}

@media (min-width: 901px) {
	.pb-shop-sidebar {
		position: sticky;
		top: calc(var(--pb-header-h, 70px) + 16px);
		max-height: calc(100dvh - var(--pb-header-h, 70px) - 32px);
		overflow: visible;
		align-self: start;
	}

	.admin-bar .pb-shop-sidebar {
		top: calc(var(--pb-header-h, 70px) + 48px);
		max-height: calc(100dvh - var(--pb-header-h, 70px) - 64px);
	}
}

.pb-shop-layout ul.products {
	grid-template-columns: repeat(var(--pb-shop-cols, 3), minmax(0, 1fr)) !important;
}
body.tax-product_cat .pb-shop-layout ul.products {
	grid-template-columns: repeat(var(--pb-cat-cols, 3), minmax(0, 1fr)) !important;
}

.pb-shop-filter-scrim {
	display: none;
}

@media (max-width: 1100px) {
	.pb-shop__grid {
		grid-template-columns: 240px minmax(0, 1fr);
		gap: 1.15rem;
	}
	body.post-type-archive-product .pb-shop-layout ul.products {
		grid-template-columns: repeat(min(2, var(--pb-shop-cols, 3)), minmax(0, 1fr)) !important;
	}
	body.tax-product_cat .pb-shop-layout ul.products {
		grid-template-columns: repeat(min(2, var(--pb-cat-cols, 3)), minmax(0, 1fr)) !important;
	}
}

@media (max-width: 900px) {
	.pb-shop__toolbar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 0.85rem;
	}

	.pb-shop__filter-toggle {
		display: inline-flex;
		align-items: center;
		gap: 0.45rem;
		min-height: 42px;
		padding: 0 0.95rem;
		border: 1px solid var(--pb-border);
		border-radius: 999px;
		background: #fff;
		color: var(--pb-text);
		font-weight: 750;
		cursor: pointer;
		box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
	}

	.pb-shop__filter-toggle .pb-icon {
		width: 1.05rem;
		height: 1.05rem;
		color: var(--pb-action-blue);
	}

	.pb-shop__grid {
		display: block;
	}

	.pb-shop-filter-scrim {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 156;
		background: rgba(15, 23, 42, 0.42);
		opacity: 0;
		pointer-events: none;
		transition: opacity 220ms ease;
	}

	body.is-shop-filter-open .pb-shop-filter-scrim {
		opacity: 1;
		pointer-events: auto;
	}

	.pb-shop-sidebar,
	.admin-bar .pb-shop-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 157;
		width: min(340px, 88vw);
		max-height: none;
		margin: 0;
		border-radius: 0 16px 16px 0;
		overflow-y: auto;
		transform: translateX(-104%);
		transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
		padding-bottom: calc(1.2rem + var(--pb-bottom-nav-h, 64px) + env(safe-area-inset-bottom));
	}

	body.is-shop-filter-open .pb-shop-sidebar {
		transform: translateX(0);
	}

	.pb-shop-sidebar__close {
		display: grid;
	}

	.pb-shop-search .pb-search__results {
		width: 100%;
	}

	body.is-shop-filter-open {
		overflow: hidden;
	}
}
