.rf-finder,
.rf-cart-modal {
	--rf-border: #e4e1d8;
	--rf-text: #2c2c2a;
	--rf-text-muted: #6b6a63;
	--rf-accent: #0f6e56;
	--rf-accent-bg: #e1f5ee;
	--rf-radius: 10px;
}

/* Defensive resets: themes frequently apply global styles to bare
   input/select/button/table elements which fight with WooCommerce's
   own templates. Scope everything back to a known baseline so this
   widget looks the same regardless of the active theme. */
.rf-finder *,
.rf-cart-modal * {
	box-sizing: border-box;
}

.rf-finder button,
.rf-cart-modal button {
	font-family: inherit;
	line-height: normal;
	appearance: none;
	-webkit-appearance: none;
}

.rf-finder input[type="number"],
.rf-finder input[type="text"],
.rf-finder select {
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
}

.rf-finder table {
	border-collapse: collapse;
	margin: 0;
}

.rf-finder {
	max-width: 1180px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--rf-text);
}

.rf-topbar {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}

.rf-searchbar {
	position: relative;
	flex: 1;
}

.rf-cart-toggle {
	position: relative;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	background: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: var(--rf-text);
}

.rf-cart-toggle:hover {
	border-color: var(--rf-accent);
	color: var(--rf-accent);
}

.rf-cart-toggle svg {
	display: block;
	width: 20px;
	height: 20px;
}

.rf-cart-count {
	position: absolute;
	top: -6px;
	right: -6px;
	background: var(--rf-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

.rf-count {
	color: var(--rf-text-muted);
	font-weight: 400;
}

.rf-search-input {
	width: 100%;
	padding: 16px 20px 16px 48px !important;
	font-size: 16px;
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	box-sizing: border-box;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.rf-search-input:focus {
	border-color: var(--rf-accent);
	box-shadow: 0 0 0 3px var(--rf-accent-bg);
}

.rf-icon-search {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--rf-text-muted);
	pointer-events: none;
}

.rf-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 32px;
	align-items: start;
}

.rf-filters {
	position: sticky;
	top: 20px;
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	padding: 20px;
}

.rf-filter-group {
	margin-bottom: 20px;
}

.rf-filter-group:last-of-type {
	margin-bottom: 12px;
}

.rf-filter-group h3 {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--rf-text-muted);
	margin: 0 0 10px;
	font-weight: 600;
}

.rf-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	padding: 5px 0;
	cursor: pointer;
}

.rf-scroll {
	max-height: 220px;
	overflow-y: auto;
	padding-right: 4px;
}

.rf-select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}

.rf-clear {
	width: 100%;
	padding: 9px;
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	background: transparent;
	font-size: 13px;
	color: var(--rf-text-muted);
	cursor: pointer;
}

.rf-clear:hover {
	border-color: var(--rf-text-muted);
	color: var(--rf-text);
}

.rf-results__meta {
	font-size: 13px;
	color: var(--rf-text-muted);
	margin-bottom: 14px;
	min-height: 18px;
}

.rf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

.rf-card {
	border: 1px solid var(--rf-border);
	border-radius: var(--rf-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s ease, transform .15s ease;
}

.rf-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
	transform: translateY(-2px);
}

.rf-card__image {
	display: block;
	background: #f7f6f2;
}

.rf-card__image img {
	width: 100%;
	height: 170px;
	object-fit: contain;
	padding: 12px;
	box-sizing: border-box;
}

.rf-card__body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.rf-card__type {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--rf-accent);
	font-weight: 600;
}

.rf-card__title {
	font-size: 15px;
	font-weight: 600;
	color: var(--rf-text);
	text-decoration: none;
	line-height: 1.3;
}

.rf-card__symptoms {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 2px 0;
}

.rf-pill {
	font-size: 11px;
	background: var(--rf-accent-bg);
	color: var(--rf-accent);
	padding: 3px 8px;
	border-radius: 999px;
}

.rf-card__price {
	font-size: 14px;
	font-weight: 600;
	margin-top: auto;
}

.rf-card__cta form.cart {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rf-card__cta table.variations,
.rf-card__cta table.variations tbody,
.rf-card__cta table.variations tr,
.rf-card__cta table.variations td {
	display: block;
	width: 100%;
	border: none;
	padding: 0;
}

.rf-card__cta table.variations {
	background: #f7f6f2;
	border-radius: 8px;
	padding: 10px 12px;
	margin: 0 0 2px;
}

.rf-card__cta table.variations tr + tr {
	margin-top: 8px;
}

.rf-card__cta table.variations label {
	font-size: 11px;
	color: var(--rf-text-muted);
	text-transform: uppercase;
	letter-spacing: .03em;
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.rf-card__cta table.variations select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--rf-border);
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
	color: var(--rf-text);
}

.rf-card__cta .reset_variations {
	font-size: 11px;
	color: var(--rf-text-muted);
	display: inline-block;
	margin-top: 6px;
	text-decoration: underline;
}

.rf-card__cta .woocommerce-variation-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--rf-text);
	padding: 0 2px;
}

.rf-card__cta .woocommerce-variation-availability {
	font-size: 12px;
	color: var(--rf-text-muted);
	padding: 0 2px;
}

.rf-card__cta .quantity {
	display: block;
}

.rf-card__cta form.cart > .quantity {
	width: 100%;
}

.rf-card__cta .quantity .qty {
	width: 100%;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	font-size: 14px;
	text-align: center;
	background: #fff;
}

.rf-card__cta .woocommerce-variation-add-to-cart,
.rf-card__cta > .quantity + button,
.rf-card__cta .cart {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.rf-card__cta .quantity {
	width: 60px;
	flex-shrink: 0;
}

button.single_add_to_cart_button,
.rf-card__cta a.button {
	flex: 1;
	text-align: center;
	padding: 0 12px;
	height: 40px;
	border: none;
	border-radius: 8px;
	background: var(--rf-accent);
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity .15s ease;
}

button.single_add_to_cart_button:hover,
.rf-card__cta a.button:hover {
	opacity: .9;
}

button.single_add_to_cart_button:disabled {
	background: var(--rf-border);
	color: var(--rf-text-muted);
	cursor: not-allowed;
	opacity: 1;
}

.rf-unavailable {
	font-size: 13px;
	color: var(--rf-text-muted);
	margin: 0;
	padding: 10px 0 2px;
}

.rf-form-msg {
	position: absolute;
	top: -8px;
	left: 50%;
	transform: translate(-50%, -100%);
	font-size: 12px;
	white-space: nowrap;
	background: var(--rf-text);
	color: #fff;
	padding: 5px 12px;
	border-radius: 6px;
	z-index: 2;
}

.rf-form-msg--error {
	background: #b3261e;
}

.rf-cart-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.rf-cart-modal[hidden] {
	display: none;
}

.rf-cart-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 18, .5);
}

.rf-cart-modal__panel {
	position: relative;
	width: 100%;
	max-width: 760px;
	max-height: calc(100vh - 64px);
	background: #fff;
	border: 1px solid var(--rf-border);
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.rf-cart-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--rf-border);
	flex-shrink: 0;
}

.rf-cart-modal__header h3 {
	margin: 0;
	font-size: 18px;
}

.rf-cart-modal__close {
	border: none;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--rf-text-muted);
	padding: 0;
}

.rf-cart-modal__search {
	position: relative;
	padding: 14px 24px;
	border-bottom: 1px solid var(--rf-border);
	flex-shrink: 0;
}

.rf-cart-modal__search input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	font-size: 13px;
}

.rf-cart-search-results {
	position: absolute;
	left: 24px;
	right: 24px;
	top: calc(100% - 4px);
	background: #fff;
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .1);
	max-height: 260px;
	overflow-y: auto;
	z-index: 5;
}

.rf-cart-search-results[hidden] {
	display: none;
}

.rf-quick-result {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--rf-border);
}

.rf-quick-result:last-child {
	border-bottom: none;
}

.rf-quick-result img,
.rf-quick-noimg {
	width: 36px;
	height: 36px;
	object-fit: contain;
	background: #f7f6f2;
	border-radius: 6px;
	flex-shrink: 0;
}

.rf-quick-info {
	flex: 1;
	min-width: 0;
}

.rf-quick-title {
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rf-quick-price {
	font-size: 12px;
	color: var(--rf-text-muted);
}

.rf-quick-add {
	flex-shrink: 0;
	border: 1px solid var(--rf-accent);
	background: #fff;
	color: var(--rf-accent);
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
}

.rf-quick-add:hover {
	background: var(--rf-accent);
	color: #fff;
}

.rf-quick-empty {
	font-size: 13px;
	color: var(--rf-text-muted);
	padding: 10px 12px;
	margin: 0;
}

.rf-cart-modal__items {
	flex: 1;
	overflow-y: auto;
	padding: 8px 24px;
	min-height: 120px;
}

.rf-cart-modal__footer {
	flex-shrink: 0;
	padding: 16px 24px 20px;
	border-top: 1px solid var(--rf-border);
}

.rf-cart-empty {
	padding: 40px 0;
	text-align: center;
	color: var(--rf-text-muted);
}

.rf-cart-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--rf-border);
}

.rf-cart-item:last-child {
	border-bottom: none;
}

.rf-cart-item__img img {
	width: 56px;
	height: 56px;
	object-fit: contain;
	background: #f7f6f2;
	border-radius: 8px;
	display: block;
}

.rf-cart-item__info {
	flex: 1;
	min-width: 0;
}

.rf-cart-item__title {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--rf-text);
	text-decoration: none;
	margin-bottom: 2px;
}

.rf-cart-item__meta {
	font-size: 12px;
	color: var(--rf-text-muted);
}

.rf-cart-item__meta table,
.rf-cart-item__meta tbody,
.rf-cart-item__meta tr {
	display: inline;
}

.rf-cart-item__unit {
	font-size: 12px;
	color: var(--rf-text-muted);
}

.rf-cart-item__qty {
	display: flex;
	align-items: center;
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	flex-shrink: 0;
}

.rf-qty-btn {
	width: 28px;
	height: 32px;
	border: none !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	font-size: 16px;
	line-height: 1;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: var(--rf-text);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.rf-qty-btn:hover {
	background: #f7f6f2 !important;
}

.rf-cart-item__qty input {
	width: 34px;
	height: 32px;
	line-height: 32px;
	border: none;
	border-left: 1px solid var(--rf-border);
	border-right: 1px solid var(--rf-border);
	text-align: center;
	font-size: 13px;
	padding: 0;
	flex-shrink: 0;
}

.rf-cart-item__subtotal {
	width: 80px;
	flex-shrink: 0;
	text-align: right;
	font-size: 14px;
	font-weight: 600;
}

.rf-cart-item__remove {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border: none !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--rf-text-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.rf-cart-item__remove:hover,
.rf-cart-item__remove:focus,
.rf-cart-item__remove:active {
	border: none !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #b3261e;
}

.rf-cart-subtotal {
	font-size: 15px;
	margin-bottom: 12px;
}

.rf-cart-footer__buttons {
	display: flex;
	gap: 10px;
}

.rf-cart-btn {
	flex: 1;
	text-align: center;
	padding: 12px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.rf-cart-btn--outline {
	border: 1px solid var(--rf-border);
	color: var(--rf-text);
}

.rf-cart-btn--solid {
	background: var(--rf-accent);
	color: #fff;
}

@media (max-width: 640px) {
	.rf-cart-modal {
		padding: 0;
	}
	.rf-cart-modal__panel {
		max-width: none;
		max-height: none;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
	/* WordPress's admin toolbar renders above our modal's default
	   stacking context on mobile (it's 46px tall and fixed to the
	   viewport) - push the panel down so the header/close button
	   isn't hidden underneath it for logged-in users testing the page. */
	.admin-bar .rf-cart-modal__panel {
		margin-top: 46px;
		height: calc(100% - 46px);
	}
}

.rf-cart-modal__body .woocommerce-mini-cart {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rf-cart-modal__body .woocommerce-mini-cart-item {
	display: flex;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rf-border);
	position: relative;
}

.rf-cart-modal__body .woocommerce-mini-cart-item img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	background: #f7f6f2;
	border-radius: 6px;
}

.rf-cart-modal__body .woocommerce-mini-cart__total {
	font-weight: 600;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--rf-border);
}

.rf-cart-modal__body .woocommerce-mini-cart__buttons a {
	display: block;
	text-align: center;
	padding: 10px;
	border-radius: 8px;
	margin-top: 8px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.rf-cart-modal__body .woocommerce-mini-cart__buttons a.wc-forward {
	border: 1px solid var(--rf-border);
	color: var(--rf-text);
}

.rf-cart-modal__body .woocommerce-mini-cart__buttons a.checkout {
	background: var(--rf-accent);
	color: #fff;
}

.rf-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--rf-text-muted);
}

.rf-empty p {
	margin: 4px 0;
}

.rf-empty__hint {
	font-size: 13px;
}

.rf-loading {
	text-align: center;
	padding: 40px;
	color: var(--rf-text-muted);
	font-size: 14px;
}

@media (max-width: 780px) {
	.rf-layout {
		grid-template-columns: 1fr;
	}
	.rf-filters {
		position: static;
	}
}

.rf-readmore {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: 1px solid var(--rf-border);
	background: #fff;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: var(--rf-accent);
	text-decoration: none;
	cursor: pointer;
	margin: 2px 0 4px;
	transition: background .15s ease, border-color .15s ease;
}

.rf-readmore::after {
	content: "\2192";
	font-size: 13px;
	line-height: 1;
}

.rf-readmore:hover {
	background: var(--rf-accent-bg);
	border-color: var(--rf-accent);
}

.rf-desc-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.rf-desc-modal[hidden] {
	display: none;
}

.rf-desc-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 20, 18, .5);
}

.rf-desc-modal__panel {
	position: relative;
	width: 100%;
	max-width: 600px;
	max-height: calc(100vh - 64px);
	background: #fff;
	border: 1px solid var(--rf-border);
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.rf-desc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid var(--rf-border);
	flex-shrink: 0;
}

.rf-desc-modal__header h3 {
	margin: 0;
	font-size: 17px;
}

.rf-desc-modal__close {
	border: none;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--rf-text-muted);
	padding: 0;
	flex-shrink: 0;
}

.rf-desc-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: 20px 24px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--rf-text);
}

.rf-desc-modal__body p {
	margin: 0 0 12px;
}

@media (max-width: 640px) {
	.rf-desc-modal {
		padding: 0;
	}
	.rf-desc-modal__panel {
		max-width: none;
		max-height: none;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
}