/* Ayurveda Product Filters */
.apf {
	--apf-accent: var(--apuk-primary, #2f6b2f);
	--apf-accent-2: var(--apuk-secondary, #a5c055);
	--apf-text: #23312a;
	--apf-muted: #6f7a72;
	--apf-line: #e2e8d8;
	--apf-soft: #f4f8ec;
	color: var(--apf-text);
	font-size: 15px;
}
.apf *, .apf *::before, .apf *::after { box-sizing: border-box; }
.apf .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Bar (mobile): toggle button + chips */
.apf-bar { display: none; }
.apf-toggle {
	display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
	padding: 10px 16px; border: 1.5px solid var(--apf-accent); border-radius: 999px;
	background: #fff; color: var(--apf-accent); font: inherit; font-weight: 700; cursor: pointer;
}
.apf-toggle__icon { width: 18px; height: 14px; background:
	linear-gradient(currentColor, currentColor) 0 1px / 18px 2px no-repeat,
	linear-gradient(currentColor, currentColor) 0 6px / 18px 2px no-repeat,
	linear-gradient(currentColor, currentColor) 0 11px / 18px 2px no-repeat; }
.apf-toggle__n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--apf-accent); color: #fff; font-size: 12.5px; line-height: 22px; text-align: center; }

/* Panel */
.apf-panel__head { display: none; }
.apf-form { margin: 0; }
.apf-body { display: flex; flex-direction: column; }

/* Chips */
.apf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.apf-chip {
	display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
	padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--apf-soft); border: 1px solid #d5e2c2;
	color: var(--apf-text) !important; font-size: 13.5px; font-weight: 600; line-height: 1.2; text-decoration: none !important;
}
.apf-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apf-chip__x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--apf-accent); font-size: 15px; line-height: 1; }
.apf-chip:hover, .apf-chip:focus-visible { border-color: var(--apf-accent); }
.apf-chip--clear { padding: 6px 12px; background: transparent; border-color: transparent; color: var(--apf-accent) !important; text-decoration: underline !important; }

/* Groups */
.apf-group { border-bottom: 1px solid var(--apf-line); }
.apf-group:last-child { border-bottom: 0; }
.apf-group__title {
	display: flex; align-items: center; gap: 8px; padding: 14px 2px; cursor: pointer; list-style: none;
	font-size: 17px; font-weight: 700; color: var(--apf-text); user-select: none;
}
.apf-group__title::-webkit-details-marker { display: none; }
.apf-group__title > span:first-child { flex: 1 1 auto; }
.apf-group__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--apf-accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.apf-group__chev { width: 10px; height: 10px; border-right: 2px solid var(--apf-muted); border-bottom: 2px solid var(--apf-muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.apf-group[open] .apf-group__chev { transform: rotate(-135deg) translate(-2px, -2px); }
.apf-group__body { padding: 0 2px 16px; }

/* Option lists */
.apf-list { list-style: none; margin: 0; padding: 0; }
.apf-opt { margin: 0; padding: 0; }
.apf-opt label { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; line-height: 1.3; }
.apf-opt label:hover { background: var(--apf-soft); }
.apf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.apf-box { flex: 0 0 20px; width: 20px; height: 20px; border: 2px solid #8b968d; border-radius: 5px; background: #fff; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.apf-opt--radio .apf-box { border-radius: 50%; }
.apf-opt input:checked + .apf-box { background: var(--apf-accent); border-color: var(--apf-accent); }
.apf-opt input:checked + .apf-box::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.apf-opt--radio input:checked + .apf-box { background: #fff; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 10px var(--apf-accent); }
.apf-opt--radio input:checked + .apf-box::after { display: none; }
.apf-opt input:focus-visible + .apf-box { outline: 3px solid rgba(47, 107, 47, .35); outline-offset: 2px; }
.apf-opt__name { flex: 1 1 auto; min-width: 0; font-size: 15.5px; color: #2b2d2f; overflow-wrap: anywhere; }
.apf-opt input:checked ~ .apf-opt__name { font-weight: 700; color: var(--apf-text); }
.apf-opt__count { flex: 0 0 auto; min-width: 28px; padding: 1px 7px; border-radius: 10px; background: #f0f2ec; color: var(--apf-muted); font-size: 12.5px; text-align: center; }
.apf-opt.is-zero .apf-opt__name, .apf-opt.is-zero .apf-opt__count { opacity: .5; }
.apf-opt.is-more { display: none; }
.apf-group.is-expanded .apf-opt.is-more, .apf-group.is-searching .apf-opt.is-more { display: block; }
.apf-group.is-searching .apf-opt.is-nomatch { display: none; }
.apf-group.is-searching .apf-more { display: none; }
.apf-more { margin: 6px 0 0 4px; padding: 4px 0; border: 0; background: none; color: var(--apf-accent); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.apf-nomatch { margin: 6px 4px; color: var(--apf-muted); font-size: 14px; }
.apf-stars { color: #e0a100; letter-spacing: 1px; font-size: 16px; }
.apf-stars__off { color: #d6d9d2; }

/* List search */
.apf-search { margin: 0 0 8px; }
.apf-search__input {
	width: 100%; height: 40px; padding: 0 12px 0 36px !important; border: 1px solid #cdd6c1 !important; border-radius: 10px !important;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f7a72' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px 50% no-repeat !important;
	font-size: 15px !important; color: var(--apf-text);
}
.apf-search__input:focus { border-color: var(--apf-accent) !important; outline: none; box-shadow: 0 0 0 3px rgba(47, 107, 47, .15); }

/* Sort */
.apf-select {
	width: 100%; height: 42px; padding: 0 36px 0 12px !important; border: 1px solid #cdd6c1 !important; border-radius: 10px !important;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236f7a72' stroke-width='2' d='m1 1 5 5 5-5'/%3E%3C/svg%3E") right 12px center no-repeat !important;
	-webkit-appearance: none; appearance: none; font-size: 15px !important; color: var(--apf-text); cursor: pointer;
}

/* Price */
.apf-price { padding: 6px 2px 0; }
.apf-range { position: relative; height: 32px; margin: 0 12px 10px; touch-action: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.apf-range__track { position: absolute; left: 0; right: 0; top: 14px; height: 4px; border-radius: 2px; background: #dfe5d6; }
.apf-range__fill { position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: 2px; background: var(--apf-accent); }
.apf-thumb {
	position: absolute; top: 5px; left: 0; z-index: 2; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
	background: #fff; border: 3px solid var(--apf-accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: grab; touch-action: none; outline: none;
	transition: transform .12s, box-shadow .12s;
}
.apf-thumb::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; } /* larger touch target */
.apf-thumb:hover { transform: scale(1.1); }
.apf-thumb:focus-visible { box-shadow: 0 0 0 4px rgba(32, 80, 37, .25), 0 1px 4px rgba(0, 0, 0, .25); }
.apf-range.is-dragging .apf-thumb:focus { transform: scale(1.15); cursor: grabbing; box-shadow: 0 0 0 6px rgba(32, 80, 37, .18), 0 1px 4px rgba(0, 0, 0, .25); }
.apf-price__inputs { display: flex; align-items: flex-end; gap: 8px; }
.apf-price__inputs label { flex: 1 1 0; min-width: 0; margin: 0; }
.apf-price__inputs label > span:first-child { display: block; margin: 0 0 3px; color: var(--apf-muted); font-size: 12.5px; }
.apf-price__field { display: flex; align-items: center; height: 40px; padding: 0 10px; border: 1px solid #cdd6c1; border-radius: 10px; background: #fff; }
.apf-price__field:focus-within { border-color: var(--apf-accent); box-shadow: 0 0 0 3px rgba(47, 107, 47, .15); }
.apf-price__field i { font-style: normal; color: var(--apf-muted); margin-right: 4px; }
.apf-price__field input { width: 100%; min-width: 0; height: 38px; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; font-size: 15px !important; color: var(--apf-text); -moz-appearance: textfield; }
.apf-price__field input::-webkit-outer-spin-button, .apf-price__field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.apf-price__dash { padding-bottom: 10px; color: var(--apf-muted); }

/* Actions */
.apf-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 4px; }
.apf.apf-js .apf-actions:not(.apf-actions--always) { display: none; }
.apf-clear { color: var(--apf-accent) !important; font-weight: 700; text-decoration: underline !important; text-underline-offset: 3px; }
.apf-apply {
	flex: 1 1 auto; max-width: 260px; margin-left: auto; padding: 12px 18px; border: 0; border-radius: 10px;
	background: var(--apf-accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.apf-apply:hover { filter: brightness(1.08); }

/* Loading */
.apf-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }
.apf.is-loading .apf-apply { opacity: .7; }

.apf-scrim[hidden] { display: none !important; }

/* ---------- Mobile drawer ---------- */
@media (max-width: 991px) {
	.apf--drawer .apf-bar { display: flex; align-items: center; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 0 6px; }
	.apf--drawer .apf-bar::-webkit-scrollbar { display: none; }
	.apf--drawer .apf-bar .apf-chips { flex-wrap: nowrap; margin: 0; }
	.apf--drawer .apf-bar .apf-chip { flex: 0 0 auto; }
	.apf--drawer .apf-chips-wrap { display: none; }
	.apf--drawer .apf-panel {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 100001; display: flex; flex-direction: column;
		max-height: 88vh; max-height: 88dvh; border-radius: 18px 18px 0 0; background: #fff;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); transform: translateY(105%); visibility: hidden;
		transition: transform .28s ease, visibility 0s linear .28s;
	}
	.apf--drawer.is-open .apf-panel { transform: none; visibility: visible; transition: transform .28s ease; }
	.apf--drawer .apf-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--apf-line); }
	.apf--drawer .apf-panel__title { font-size: 18px; font-weight: 800; }
	.apf--drawer .apf-close { flex: 0 0 38px; width: 38px; height: 38px; min-width: 0; padding: 0 !important; border: 0; border-radius: 50% !important; display: grid; place-items: center; background: #f1f3ee; color: var(--apf-text); font-size: 24px; line-height: 1; cursor: pointer; }
	.apf--drawer .apf-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
	.apf--drawer .apf-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px; }
	.apf--drawer.apf-js .apf-actions,
	.apf--drawer.apf-js .apf-actions:not(.apf-actions--always) { display: flex; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--apf-line); background: #fff; }
	.apf--drawer .apf-apply { max-width: none; padding: 14px 18px; font-size: 16px; }
	.apf--drawer .apf-scrim { position: fixed; inset: 0; z-index: 100000; background: rgba(15, 25, 15, .45); }
	html.apf-lock, html.apf-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
	.apf-panel, .apf-group__chev { transition: none !important; }
}

/* The panel has its own "Sort by": hide the duplicate WooCommerce dropdown above the grid. */
body:has(.apf .apf-group--sort) .woocommerce-ordering { display: none !important; }
.apf .apf-price__field input[type="number"] { border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0 !important; height: 38px !important; padding: 0 !important; margin: 0 !important; }
