/* Premium WooCommerce Filters — frontend styles
   All colors/sizes are driven by CSS variables (see PWF_Frontend::print_style_variables) */

.pwf-sidebar {
	width: var(--pwf-sidebar-width, 280px);
	font-family: var(--pwf-font-family, inherit);
	font-size: var(--pwf-font-size, 14px);
	color: var(--pwf-primary, #111);
	padding-right: var(--pwf-spacing, 16px);
	box-sizing: border-box;
}

.pwf-sidebar--sticky {
	position: sticky;
	top: 24px;
	align-self: flex-start;
}

.pwf-sidebar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.pwf-sidebar__header h3 {
	margin: 0;
	font-size: 1.1em;
	font-weight: 600;
}

.pwf-remove-all {
	background: none;
	border: none;
	color: var(--pwf-secondary, #6b6b6b);
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.9em;
	padding: 0;
}

.pwf-remove-all:hover {
	color: var(--pwf-primary, #111);
}

/* Active filter chips */
.pwf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.pwf-chips:empty {
	display: none;
}

.pwf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--pwf-hover, #f5f5f5);
	border: 1px solid var(--pwf-border, #e2e2e2);
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 0.85em;
}

.pwf-chip button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.1em;
	line-height: 1;
	color: var(--pwf-secondary, #6b6b6b);
	padding: 0;
}

/* Accordion groups */
.pwf-group {
	border-bottom: 1px solid var(--pwf-border, #e2e2e2);
	padding: 12px 0;
}

.pwf-group__header {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: none;
	border: none;
	cursor: pointer;
	font-weight: 600;
	font-size: 1em;
	color: var(--pwf-primary, #111);
	padding: 4px 0;
}

.pwf-chevron {
	transition: transform var(--pwf-anim-speed, 300ms) ease;
}

.pwf-group__header[aria-expanded="true"] .pwf-chevron {
	transform: rotate(180deg);
}

.pwf-group__body {
	margin-top: 10px;
}

.pwf-option-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pwf-option {
	margin-bottom: 8px;
}

.pwf-option label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.pwf-option__count {
	color: var(--pwf-secondary, #6b6b6b);
	font-size: 0.85em;
	margin-left: auto;
}

.pwf-option--overflow[hidden] {
	display: none;
}

.pwf-show-more,
.pwf-search-box {
	width: 100%;
	background: none;
	border: 1px solid var(--pwf-border, #e2e2e2);
	border-radius: var(--pwf-radius, 4px);
	padding: 6px 10px;
	font-size: 0.9em;
	margin-top: 6px;
	cursor: pointer;
}

.pwf-search-box {
	cursor: text;
	margin-bottom: 8px;
}

.pwf-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.pwf-stars {
	color: #d9a441;
	letter-spacing: 1px;
}

/* Price range */
.pwf-price-inputs {
	display: flex;
	gap: 10px;
}

.pwf-price-field {
	display: flex;
	align-items: center;
	border: 1px solid var(--pwf-border, #e2e2e2);
	border-radius: var(--pwf-radius, 4px);
	padding: 4px 8px;
}

.pwf-price-field input {
	border: none;
	width: 70px;
	padding: 4px;
}

.pwf-price-field input:focus {
	outline: none;
}

.pwf-currency {
	color: var(--pwf-secondary, #6b6b6b);
	margin-right: 4px;
}

/* Toolbar (above product grid) */
.pwf-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.pwf-mobile-filter-trigger {
	display: none;
	align-items: center;
	gap: 6px;
	background: none;
	border: 1px solid var(--pwf-border, #e2e2e2);
	border-radius: var(--pwf-radius, 4px);
	padding: 10px 16px;
	cursor: pointer;
	font-weight: 600;
}

.pwf-result-count {
	color: var(--pwf-secondary, #6b6b6b);
	font-size: 0.9em;
}

/* Buttons */
.pwf-btn {
	border-radius: var(--pwf-radius, 4px);
	border: none;
	cursor: pointer;
	font-weight: 600;
	padding: 0 20px;
	height: 48px;
}

.pwf-btn--apply {
	background: var(--pwf-button, #111);
	color: var(--pwf-button-text, #fff);
	height: 56px;
	flex: 1;
}

.pwf-btn--ghost {
	background: none;
	border: 1px solid var(--pwf-border, #e2e2e2);
	color: var(--pwf-primary, #111);
	height: 56px;
}

/* Mobile drawer */
.pwf-drawer-overlay {
	position: fixed;
	inset: 0;
	background: var(--pwf-overlay-color, rgba(0, 0, 0, 0.5));
	z-index: 9998;
	opacity: 0;
	transition: opacity var(--pwf-anim-speed, 300ms) ease;
}

.pwf-drawer-overlay.pwf-visible {
	opacity: 1;
}

.pwf-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: var(--pwf-drawer-width, 90%);
	max-width: 480px;
	background: #fff;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform var(--pwf-anim-speed, 300ms) ease;
	font-family: var(--pwf-font-family, inherit);
}

.pwf-drawer.pwf-open {
	transform: translateX(0);
}

.pwf-drawer__screen {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	transform: translateX(100%);
	transition: transform var(--pwf-anim-speed, 300ms) ease;
}

.pwf-drawer__screen--root {
	position: relative;
	transform: none;
}

.pwf-drawer__screen--sub.pwf-screen-active {
	transform: translateX(0);
}

.pwf-drawer__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid var(--pwf-border, #e2e2e2);
	position: relative;
}

.pwf-drawer__title {
	font-weight: 700;
	letter-spacing: 0.05em;
}

.pwf-drawer__close,
.pwf-drawer__back {
	background: none;
	border: none;
	font-size: 1.4em;
	cursor: pointer;
	line-height: 1;
}

.pwf-drawer__categories {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
}

.pwf-drawer__category-row {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: none;
	border: none;
	border-bottom: 1px solid var(--pwf-border, #e2e2e2);
	padding: 16px;
	font-size: 1em;
	cursor: pointer;
	text-align: left;
}

.pwf-drawer__screen-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}

.pwf-drawer__sticky-actions {
	display: flex;
	gap: 10px;
	padding: 12px 16px;
	border-top: 1px solid var(--pwf-border, #e2e2e2);
}

.pwf-mobile-apply {
	margin: 12px 16px;
	width: calc(100% - 32px);
}

/* ---------------------------------------------------------------------
 * Layout wrapper: sidebar + content, side by side. Wrap your sidebar and
 * product content in a `.pwf-shop-layout` element (see README) so the
 * sidebar keeps a fixed width and never gets compressed.
 * ------------------------------------------------------------------- */
.pwf-shop-layout {
	display: flex;
	align-items: flex-start;
	gap: 40px;
}

.pwf-sidebar {
	flex: 0 0 var(--pwf-sidebar-width, 280px);
	width: var(--pwf-sidebar-width, 280px);
	max-width: var(--pwf-sidebar-width, 280px);
	box-sizing: border-box;
}

.pwf-content {
	flex: 1 1 0%;
	min-width: 0; /* required so grid children can shrink instead of overflowing */
}

/* ---------------------------------------------------------------------
 * Product grid — real CSS Grid (no floats), reflows immediately after
 * AJAX with no leftover empty rows/columns, equal card heights.
 * ------------------------------------------------------------------- */
.pwf-active ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px !important;
	list-style: none;
	margin: 0 !important;
	justify-content: start;
	align-items: start;
	transition: opacity 250ms ease;
}

/* Kill theme float/clearfix leftovers that cause the gap/stacking bugs */
.pwf-active ul.products::before,
.pwf-active ul.products::after {
	display: none !important;
	content: none !important;
}

.pwf-active ul.products li.product {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Equal card heights: image -> title -> price -> button, bottom-aligned button/price */
.pwf-active ul.products li.product > a:first-child,
.pwf-active ul.products li.product .woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.pwf-active ul.products li.product img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.pwf-active ul.products li.product .woocommerce-loop-product__title {
	margin-top: 12px;
	flex: 0 0 auto;
}

.pwf-active ul.products li.product .price {
	margin-top: auto;
	padding-top: 6px;
}

.pwf-active ul.products li.product .button,
.pwf-active ul.products li.product a.button {
	margin-top: 10px;
}

/* ---------------------------------------------------------------------
 * AJAX loading state: keep the container's height so nothing jumps,
 * show a skeleton grid, then fade the new grid in.
 * ------------------------------------------------------------------- */
.pwf-active ul.products.pwf-loading {
	opacity: 0.35;
	pointer-events: none;
}

.pwf-active ul.products.pwf-fade-in {
	animation: pwf-fade-in 250ms ease forwards;
}

/* Same loading/fade behaviour for Elementor Loop Grid mode. Deliberately
 * does NOT touch grid-template-columns/gap/card layout — that stays
 * fully controlled by the Loop Grid widget's own Elementor settings. */
[data-pwf-grid] {
	transition: opacity 250ms ease;
}

[data-pwf-grid].pwf-loading {
	opacity: 0.35;
	pointer-events: none;
}

[data-pwf-grid].pwf-fade-in {
	animation: pwf-fade-in 250ms ease forwards;
}

@keyframes pwf-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.pwf-skeleton-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px;
}

.pwf-skeleton-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pwf-skeleton-card .pwf-skeleton-block {
	background: linear-gradient(90deg, var(--pwf-hover, #f0f0f0) 25%, var(--pwf-border, #e5e5e5) 37%, var(--pwf-hover, #f0f0f0) 63%);
	background-size: 400% 100%;
	animation: pwf-skeleton-shimmer 1.4s ease infinite;
	border-radius: var(--pwf-radius, 4px);
}

.pwf-skeleton-card .pwf-skeleton-image {
	aspect-ratio: 3 / 4;
}

.pwf-skeleton-card .pwf-skeleton-line {
	height: 12px;
	width: 70%;
}

.pwf-skeleton-card .pwf-skeleton-line--short {
	width: 40%;
}

@keyframes pwf-skeleton-shimmer {
	0% { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

/* ---------------------------------------------------------------------
 * Responsive tiers
 * Desktop (>=1025px): permanent sidebar, filter button/drawer never shown
 * Tablet  (768–1024px): sidebar hidden, filter button + drawer, 3 columns
 * Mobile  (<768px): drawer only, filter button, 2 columns (1 on very small)
 * ------------------------------------------------------------------- */
@media (min-width: 1025px) {
	.pwf-mobile-filter-trigger,
	.pwf-drawer,
	.pwf-drawer-overlay {
		display: none !important;
	}

	.pwf-sidebar {
		display: block !important;
	}
}

@media (max-width: 1024px) {
	.pwf-sidebar {
		display: none !important;
	}

	.pwf-mobile-filter-trigger {
		display: inline-flex;
	}

	.pwf-active ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.pwf-active ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 479px) {
	.pwf-active ul.products {
		grid-template-columns: 1fr;
	}
}

.pwf-no-results,
.pwf-empty {
	color: var(--pwf-secondary, #6b6b6b);
}

/* ---------------------------------------------------------------------
 * v1.0.2 — Bebas Neue typography, touch targets, safe areas, focus states
 * Applied only to prominent interface text (headings, titles, button
 * labels) — never to option values, prices, counts, or inputs.
 * ------------------------------------------------------------------- */
.pwf-sidebar__header h3,
.pwf-group__header,
.pwf-drawer__title,
.pwf-drawer__category-row,
.pwf-mobile-filter-trigger,
.pwf-btn {
	font-family: var(--pwf-heading-font, 'Bebas Neue', Arial, sans-serif);
	letter-spacing: 0.04em;
}

.pwf-sidebar__header h3 {
	font-size: 1.35em;
	font-weight: 400; /* Bebas Neue ships a single weight. */
	text-transform: uppercase;
}

.pwf-group__header {
	font-size: 1.15em;
	font-weight: 400;
	text-transform: uppercase;
}

.pwf-drawer__title {
	font-size: 1.3em;
	font-weight: 400;
	text-transform: uppercase;
}

.pwf-drawer__category-row {
	font-size: 1.1em;
	text-transform: uppercase;
}

.pwf-mobile-filter-trigger,
.pwf-btn {
	font-size: 1.05em;
	font-weight: 400;
	text-transform: uppercase;
}

/* Keep counts inside Bebas elements readable in the body font. */
.pwf-mobile-filter-trigger__count,
.pwf-btn__count {
	font-family: var(--pwf-font-family, inherit);
	font-size: 0.85em;
	letter-spacing: 0;
	opacity: 0.85;
}

.pwf-btn__count {
	margin-left: 6px;
}

.pwf-btn__count:empty {
	display: none;
}

/* Comfortable touch targets (min ~44x44px) */
.pwf-mobile-filter-trigger {
	min-height: 44px;
	min-width: 44px;
}

.pwf-drawer__close,
.pwf-drawer__back {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

/* Mobile safe areas (notch devices, iOS home indicator) */
.pwf-drawer__top {
	padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.pwf-drawer__sticky-actions {
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	background: #fff;
}

/* Visible keyboard focus states */
.pwf-mobile-filter-trigger:focus-visible,
.pwf-drawer__close:focus-visible,
.pwf-drawer__back:focus-visible,
.pwf-drawer__category-row:focus-visible,
.pwf-btn:focus-visible,
.pwf-group__header:focus-visible,
.pwf-remove-all:focus-visible,
.pwf-option input:focus-visible,
.pwf-chip button:focus-visible {
	outline: 2px solid var(--pwf-button, #111);
	outline-offset: 2px;
}
