/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

.ahn-shop-filters {
	margin-bottom: 1.5em;
	--ahn-check-accent: var(--theme-palette-color-1, #2563eb);
	--ahn-check-border: color-mix(in srgb, currentColor 28%, transparent);
	--ahn-check-hover: color-mix(in srgb, currentColor 42%, transparent);
}

.ahn-shop-filters__heading {
	font-weight: 600;
	margin: 0 0 0.85em;
}

.ahn-shop-filters__form {
	margin: 0;
}

.ahn-shop-filters__section {
	margin-bottom: 1.1em;
}

.ahn-shop-filters__section--categories {
	padding-top: 0.25em;
	border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.ahn-shop-filters__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.ahn-shop-filters__item {
	margin: 0;
}

.ahn-shop-filters__check {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	cursor: pointer;
	padding: 0.4rem 0.5rem;
	margin: 0 -0.5rem;
	border-radius: 8px;
	transition: background-color 0.15s ease;
	position: relative;
}

.ahn-shop-filters__check:hover {
	background-color: color-mix(in srgb, currentColor 6%, transparent);
}

.ahn-shop-filters__checkbox {
	position: absolute;
	opacity: 0;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	cursor: pointer;
	left: 0.5rem;
	top: 0.55rem;
}

.ahn-shop-filters__check-box {
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.1rem;
	border: 2px solid var(--ahn-check-border);
	border-radius: 6px;
	background: var(--theme-palette-color-8, #fff);
	box-shadow: 0 1px 2px color-mix(in srgb, currentColor 8%, transparent);
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ahn-shop-filters__check:hover .ahn-shop-filters__check-box {
	border-color: var(--ahn-check-hover);
}

.ahn-shop-filters__checkbox:checked + .ahn-shop-filters__check-box {
	background-color: var(--ahn-check-accent);
	border-color: var(--ahn-check-accent);
	box-shadow: none;
}

.ahn-shop-filters__checkbox:checked + .ahn-shop-filters__check-box::after {
	content: "";
	display: block;
	width: 0.3rem;
	height: 0.55rem;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	margin-top: -2px;
}

.ahn-shop-filters__checkbox:focus-visible + .ahn-shop-filters__check-box {
	outline: 2px solid var(--ahn-check-accent);
	outline-offset: 2px;
}

.ahn-shop-filters__check-label {
	line-height: 1.45;
	flex: 1;
}

.ahn-shop-filters__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	margin-left: 0.35rem;
	padding: 0.1rem 0.45rem;
	font-size: 0.75rem;
	font-weight: 500;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 10%, transparent);
	opacity: 0.85;
	vertical-align: middle;
}

.ahn-shop-filters__search {
	margin-bottom: 1.1em;
	width: 100%;
}

.ahn-shop-filters__search--top {
	padding-bottom: 0;
}

.ahn-shop-filters__search-field {
	display: grid;
	align-items: center;
	width: 100%;
	min-width: 0;
}

.ahn-shop-filters__search-field > .ahn-shop-filters__search-input,
.ahn-shop-filters__search-field > .ahn-shop-filters__submit {
	grid-area: 1 / 1;
}

.ahn-shop-filters__search-input {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	padding: 0.65em 5.5em 0.65em 0.85em;
	border-radius: 8px;
	border: 1px solid var(--ahn-check-border);
	background: color-mix(in srgb, currentColor 4%, transparent);
	color: inherit;
}

.ahn-shop-filters__search-input:focus {
	outline: 2px solid color-mix(in srgb, var(--ahn-check-accent, var(--theme-palette-color-1, #2563eb)) 55%, transparent);
	outline-offset: 1px;
}

.ahn-shop-filters__search-field .ahn-shop-filters__submit {
	justify-self: end;
	align-self: center;
	z-index: 2;
	width: auto;
	min-width: 0;
	max-width: 45%;
	margin: 0 0.55rem 0 0;
	padding: 0.2em 0.35em;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--theme-link-color, var(--theme-palette-color-1, #2563eb));
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.2;
	text-align: right;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ahn-shop-filters__search-field .ahn-shop-filters__submit:hover,
.ahn-shop-filters__search-field .ahn-shop-filters__submit:focus,
.ahn-shop-filters__search-field .ahn-shop-filters__submit:active {
	background: transparent;
	box-shadow: none;
	border: none;
	color: #111827;
	text-decoration: underline;
	opacity: 1;
}

/* Override WooCommerce / Blocksy button styles inside the search field */
.ahn-shop-filters button.ahn-shop-filters__submit[type="submit"],
.woocommerce .ahn-shop-filters button.ahn-shop-filters__submit,
.ahn-shop-filters__form .ahn-shop-filters__search-field .ahn-shop-filters__submit {
	float: none;
	display: inline;
	width: auto;
	height: auto;
	min-height: 0;
	padding: 0.2em 0.35em;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border: none !important;
	border-radius: 0 !important;
}

.ahn-shop-filters__clear {
	margin: 0.75em 0 0;
	font-size: 0.9em;
}

.ahn-shop-filters__clear a {
	text-decoration: none;
	opacity: 0.85;
}

.ahn-shop-filters__clear a:hover {
	text-decoration: underline;
	opacity: 1;
}

/* —— Mobile: floating button + bottom sheet —— */
.ahn-shop-filters__fab,
.ahn-shop-filters__panel-header,
.ahn-shop-filters__backdrop {
	display: none;
}

@media (max-width: 689.98px) {
	.ahn-shop-filters {
		margin: 0;
		padding: 0;
		height: 0;
		overflow: visible;
	}

	.ahn-shop-filters__fab {
		--ahn-fab-bg: var(--theme-palette-color-1, #2563eb);
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 0.5rem;
		position: fixed;
		z-index: 9999998;
		left: 50%;
		bottom: max(1rem, env(safe-area-inset-bottom, 0px));
		transform: translateX(-50%);
		margin: 0;
		padding: 0.85rem 1.35rem;
		min-height: 3rem;
		border: none;
		border-radius: 999px;
		appearance: none;
		-webkit-appearance: none;
		background-color: var(--ahn-fab-bg);
		color: #ffffff;
		font-family: inherit;
		font-weight: 600;
		font-size: 0.95rem;
		line-height: 1.2;
		letter-spacing: 0.01em;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
		cursor: pointer;
		transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	}

	.ahn-shop-filters__fab:hover,
	.ahn-shop-filters__fab:focus {
		color: #ffffff;
		background-color: var(--ahn-fab-bg);
		box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
	}

	.ahn-shop-filters__fab-label {
		color: #ffffff;
	}

	.ahn-shop-filters__fab:active {
		transform: translateX(-50%) scale(0.98);
	}

	.ahn-shop-filters__fab-badge {
		width: 0.5rem;
		height: 0.5rem;
		border-radius: 50%;
		background: #fff;
		box-shadow: 0 0 0 2px var(--ahn-fab-bg, #2563eb);
	}

	.ahn-shop-filters__sheet {
		--ahn-check-accent: var(--theme-palette-color-1, #2563eb);
		--ahn-check-border: color-mix(in srgb, currentColor 28%, transparent);
		position: fixed;
		inset: 0;
		z-index: 9999999;
		pointer-events: none;
		visibility: hidden;
	}

	.ahn-shop-filters.is-open .ahn-shop-filters__sheet,
	.ahn-shop-filters__sheet.is-open {
		pointer-events: auto;
		visibility: visible;
	}

	.ahn-shop-filters__backdrop {
		display: block;
		position: absolute;
		inset: 0;
		margin: 0;
		padding: 0;
		border: 0;
		background: rgba(12, 18, 28, 0.48);
		opacity: 0;
		transition: opacity 0.25s ease;
		cursor: pointer;
	}

	.ahn-shop-filters.is-open .ahn-shop-filters__backdrop,
	.ahn-shop-filters__sheet.is-open .ahn-shop-filters__backdrop {
		opacity: 1;
	}

	.ahn-shop-filters__panel {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		flex-direction: column;
		max-height: min(88vh, 640px);
		background: var(--theme-palette-color-8, #fff);
		color: var(--theme-text-color, inherit);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
		transform: translateY(calc(100% + 1rem));
		transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
	}

	.ahn-shop-filters.is-open .ahn-shop-filters__panel,
	.ahn-shop-filters__sheet.is-open .ahn-shop-filters__panel {
		transform: translateY(0);
	}

	.ahn-shop-filters__panel-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-shrink: 0;
		padding: 1rem 1.15rem 0.85rem;
		border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	}

	.ahn-shop-filters__panel-title {
		margin: 0;
		font-weight: 600;
		font-size: 1.05rem;
	}

	.ahn-shop-filters__panel-close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 2.25rem;
		height: 2.25rem;
		margin: 0;
		padding: 0;
		border: none;
		border-radius: 8px;
		background: color-mix(in srgb, currentColor 8%, transparent);
		color: inherit;
		font-size: 1.35rem;
		line-height: 1;
		cursor: pointer;
	}

	.ahn-shop-filters__panel-body {
		overflow-y: auto;
		padding: 1rem 1.15rem max(1.25rem, env(safe-area-inset-bottom, 0px));
		-webkit-overflow-scrolling: touch;
	}

	html.ahn-shop-filters-open {
		overflow: hidden;
	}
}

/* —— Desktop: sidebar layout (unchanged) —— */
@media (min-width: 690px) {
	.ahn-shop-filters__fab,
	.ahn-shop-filters__backdrop,
	.ahn-shop-filters__panel-header {
		display: none !important;
	}

	.ahn-shop-filters__sheet {
		position: static;
		visibility: visible;
		pointer-events: auto;
	}

	.ahn-shop-filters__panel {
		position: static;
		max-height: none;
		transform: none;
		background: transparent;
		box-shadow: none;
		border-radius: 0;
	}

	.ahn-shop-filters__panel-body {
		padding: 0;
		overflow: visible;
	}
}