/**
 * Shop / Product Catalog — Köp utbildning.
 *
 * Sidebar filters + product collection; mobile uses WC’s filter drawer.
 */

.ya-shop {
	box-sizing: border-box;
	width: 100%;
	background-color: var(--wp--custom--color--background-base, var(--wp--preset--color--gray-300));
}

.ya-shop,
.ya-shop * {
	box-sizing: border-box;
}

.ya-shop__catalog {
	width: 100%;
	margin-block: 0;
	padding-inline: var(--wp--custom--spacing--padding-inline, clamp(1rem, -1.486rem + 8.304vi, 2.5rem));
	padding-block-end: var(--wp--custom--spacing--padding-block, clamp(3rem, 1.004rem + 4.163vi, 6rem));
}

.ya-shop__catalog-inner {
	width: min(100%, var(--wp--style--global--wide-size, 1440px));
	margin-inline: auto;
}

.ya-shop__results-count {
	margin-block: 0 var(--ya-spacing-24);
}

.ya-shop__results-count .woocommerce-result-count,
.ya-shop-results-count {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--ya-spacing-08);
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--figtree);
	font-size: var(--wp--preset--font-size--body-md, 1rem);
	font-weight: 400;
	line-height: 1.5;
	color: var(--wp--custom--color--text-primary, #000);
}

.ya-shop-results-count__pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	min-height: 1.5rem;
	padding-inline: var(--ya-spacing-12);
	border-radius: 999px;
	background-color: var(--wp--preset--color--gray-white, #fff);
	font-weight: 700;
	line-height: 1;
}

.ya-shop__columns {
	align-items: start;
	gap: var(--ya-spacing-24);
}

.wc-block-product-filters__overlay-content {
	gap: 0;
}

.ya-shop__filters fieldset {
	border: 0;
	padding: 0;
	margin: 0;
}

.ya-shop__filters {
	--wc-product-filter-checkbox-list-option-element: transparent;
	--wc-product-filter-checkbox-list-option-element-border: var(--wp--preset--color--gray-400, #aba8a0);
	--wc-product-filter-checkbox-list-option-element-selected: var(--wp--preset--color--gray-black, #000);
	--wc-product-filter-checkbox-list-label-element: var(--wp--custom--color--text-primary, #000);

	padding: var(--ya-spacing-24);
	border-radius: 16px;
	background-color: var(--wp--preset--color--gray-white, #fff);
}

.ya-shop__filters .wp-block-heading {
	margin-block: var(--ya-spacing-24) var(--ya-spacing-16);
	font-family: var(--wp--preset--font-family--sora);
	font-weight: 800;
	color: var(--wp--custom--color--text-primary);
}

.ya-shop__filters .wp-block-heading:first-child {
	margin-block-start: 0;
}

/* DS: five visible options until “Visa fler” expands the list. */
.ya-shop__filters .ya-shop-filter-checkbox-list:not(.ya-is-expanded) .wc-block-product-filter-checkbox-list__items > .wc-block-product-filter-checkbox-list__item:nth-child(n + 6):not(:has(input:checked)) {
	display: none;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__items {
	display: flex;
	flex-direction: column;
	gap: var(--ya-spacing-12);
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__item {
	margin: 0;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__label {
	display: flex;
	align-items: center;
	gap: var(--ya-spacing-12);
	width: 100%;
	margin: 0;
	cursor: pointer;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__item:has(input:disabled) {
	opacity: 0.45;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__item:has(input:disabled) .wc-block-product-filter-checkbox-list__label {
	cursor: not-allowed;
}

.ya-shop__filters input[type="checkbox"].wc-block-product-filter-checkbox-list__input:disabled {
	border-color: var(--wp--preset--color--gray-400, #aba8a0);
	background-color: transparent;
	cursor: not-allowed;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__input-wrapper::before {
	display: none;
}

.ya-shop__filters input[type="checkbox"].wc-block-product-filter-checkbox-list__input {
	width: 1.25rem;
	height: 1.25rem;
	border-width: 1.5px;
	border-radius: 4px;
	flex-shrink: 0;
}

.ya-shop__filters input[type="checkbox"].wc-block-product-filter-checkbox-list__input:checked {
	background-color: var(--wp--preset--color--gray-black, #000);
	border-color: var(--wp--preset--color--gray-black, #000);
}

.ya-shop__filters svg.wc-block-product-filter-checkbox-list__mark {
	width: 1.25rem;
	height: 1.25rem;
	color: var(--wp--preset--color--gray-white, #fff);
	padding: 0.2rem;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__text-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ya-spacing-12);
	flex: 1 1 auto;
	min-width: 0;
	font-size: var(--wp--preset--font-size--body-md, 1rem);
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__text {
	display: block;
	min-width: 0;
	overflow-wrap: anywhere;
	font-weight: 400;
	color: var(--wp--custom--color--text-primary);
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	min-width: 1.5rem;
	height: 1.25rem;
	padding-inline: var(--ya-spacing-08);
	border-radius: 999px;
	background-color: var(--wp--preset--color--gray-300, #e8e6de);
	color: var(--wp--custom--color--text-primary);
	font-size: 0;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__count span {
	font-size: 0.75rem;
	line-height: 1.5;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__show-more {
	display: inline-flex;
	align-items: center;
	gap: var(--ya-spacing-04);
	margin-block-start: var(--ya-spacing-16);
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--custom--color--link-primary, var(--wp--preset--color--brand-900));
	font-family: var(--wp--preset--font-family--figtree);
	font-size: var(--wp--preset--font-size--body-md, 1rem);
	font-weight: 700;
	line-height: 1.5;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__show-more::after {
	content: "";
	display: inline-block;
	width: 0.5rem;
	height: 0.5rem;
	border-inline-end: 2px solid currentColor;
	border-block-end: 2px solid currentColor;
	transform: rotate(45deg) translateY(-0.1em);
}

.ya-shop__filters .ya-shop-filter-checkbox-list.ya-is-expanded .wc-block-product-filter-checkbox-list__show-more::after {
	transform: rotate(-135deg) translateY(0.15em);
}

.ya-shop__filters .wc-block-product-filter-checkbox-list__show-more:hover {
	color: var(--wp--custom--color--link-primary-hover, var(--wp--preset--color--brand-1000));
	text-decoration-thickness: 2px;
}

.ya-shop__clear {
	margin-block-start: var(--ya-spacing-24);
}

.ya-shop__clear .wp-block-buttons {
	margin: 0;
	width: 100%;
}

.ya-shop__clear .wp-block-button,
.ya-shop__clear .wp-block-button__link,
.ya-shop__clear .ya-shop__clear-filters__button {
	width: 100%;
}

.ya-shop__filters .ya-shop__clear-filters__button.wp-block-button__link,
.ya-shop__filters button.ya-shop__clear-filters__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	border: 1.5px solid var(--wp--preset--color--gray-black, #000);
	border-radius: 999px;
	background-color: transparent;
	color: var(--wp--custom--color--text-primary, #000);
	font-family: var(--wp--preset--font-family--figtree);
	font-size: var(--wp--preset--font-size--body-md, 1rem);
	font-weight: 700;
	line-height: 1.5;
	text-decoration: none;
	cursor: pointer;
}

.ya-shop__filters .ya-shop__clear-filters__button.wp-block-button__link:hover,
.ya-shop__filters button.ya-shop__clear-filters__button:hover:not(:disabled) {
	background-color: var(--wp--preset--color--gray-300, #e8e6de);
	text-decoration: none;
}

.ya-shop__filters .ya-shop__clear-filters__button.wp-block-button__link:disabled,
.ya-shop__filters button.ya-shop__clear-filters__button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.ya-shop__collection {
	width: 100%;
	max-width: 100%;
}

.ya-shop__collection .wc-block-product-template,
.ya-shop__collection ul.wc-block-product-template {
	list-style: none;
	margin: 0;
	padding: 0;
	gap: var(--wp--custom--grid--gutter--tablet, 1rem);
}

.ya-shop__collection .wc-block-product-template > .wc-block-product,
.ya-shop__collection .wc-block-product-template > li {
	margin: 0;
	min-width: 0;
}

.ya-shop__collection .ya-card-media {
	height: 100%;
	max-width: none;
}

.ya-shop__collection .ya-card-media__content {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ya-shop__collection .ya-card-media__info {
	flex: 1 1 auto;
}

/* Shop cards: title / meta / price only (no excerpt). */
.ya-shop__collection .ya-card-media__description {
	display: none;
}

/* —— Mobile / Tablet (<768): Visar + Filter; fullscreen drawer, no animation —— */

@media (max-width: 767px) {
	.ya-shop__catalog-inner {
		position: relative;
	}

	.ya-shop__results-count {
		margin-block: 0 var(--ya-spacing-24);
		padding-inline-end: 7rem;
		min-height: 2.75rem;
		display: flex;
		align-items: center;
	}

	.ya-shop__columns {
		flex-direction: column;
	}

	.ya-shop__sidebar {
		flex-basis: 0 !important;
		width: 0 !important;
		min-height: 0;
		margin: 0;
		padding: 0;
		border: 0;
		overflow: visible;
	}

	.ya-shop__results {
		flex-basis: 100% !important;
		width: 100% !important;
		max-width: 100%;
	}

	.ya-shop__filters {
		padding: 0;
		border-radius: 0;
		background-color: transparent;
	}

	.ya-shop .wc-block-product-filters__open-overlay {
		position: absolute;
		top: 0;
		right: 0;
		z-index: 2;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		min-height: 2.75rem;
		padding: 0.625rem 1.25rem;
		border: 1.5px solid var(--wp--preset--color--gray-black, #000);
		border-radius: 999px;
		background-color: var(--wp--preset--color--gray-white, #fff);
		color: var(--wp--custom--color--text-primary, #000);
		font-family: var(--wp--preset--font-family--figtree);
		font-size: var(--wp--preset--font-size--body-md, 1rem);
		font-weight: 700;
		line-height: 1.5;
		cursor: pointer;
	}

	.ya-shop .wc-block-product-filters__open-overlay svg {
		display: none;
	}

	.ya-shop .wc-block-product-filters__open-overlay span {
		padding: 0;
	}

	/* Closed: fully hidden (avoids WC’s 601px inline layout). */
	.ya-shop .wc-block-product-filters:not(.is-overlay-opened) .wc-block-product-filters__overlay {
		display: none !important;
	}

	/* Open: true fullscreen sheet, no slide transition. */
	.ya-shop .wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay {
		display: block !important;
		position: fixed !important;
		inset: 0 !important;
		width: 100vw !important;
		height: 100vh !important;
		height: 100dvh !important;
		max-height: 100dvh !important;
		margin: 0 !important;
		padding: 0 !important;
		background-color: var(--wp--preset--color--gray-white, #fff) !important;
		pointer-events: auto !important;
		transition: none !important;
		z-index: 100000 !important;
		overflow: hidden;
	}

	.ya-shop .wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay-wrapper {
		display: block !important;
		width: 100% !important;
		height: 100% !important;
		position: relative !important;
		transform: none !important;
	}

	.ya-shop .wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay-dialog {
		display: flex !important;
		flex-direction: column !important;
		position: absolute !important;
		inset: 0 !important;
		width: 100% !important;
		height: 100% !important;
		max-height: none !important;
		transform: none !important;
		transition: none !important;
		background-color: var(--wp--preset--color--gray-white, #fff);
	}

	.ya-shop .wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay-header {
		display: flex !important;
		flex-flow: row nowrap;
		align-items: center;
		justify-content: space-between;
		gap: var(--ya-spacing-16);
		flex-shrink: 0;
		padding: var(--ya-spacing-24) var(--ya-spacing-16) var(--ya-spacing-16);
	}

	.ya-shop .ya-shop__filters-title {
		margin: 0;
		font-family: var(--wp--preset--font-family--sora);
		font-weight: 800;
	}

	.ya-shop .wc-block-product-filters__close-overlay {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 2.75rem;
		height: 2.75rem;
		border: 1.5px solid var(--wp--preset--color--gray-400, #aba8a0);
		border-radius: 999px;
		background-color: var(--wp--preset--color--gray-white, #fff);
	}

	.ya-shop .wc-block-product-filters__close-overlay span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.ya-shop .wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay-content {
		flex: 1 1 auto !important;
		overflow-y: auto !important;
		overflow-x: hidden;
		padding: 0 var(--ya-spacing-16) var(--ya-spacing-24);
		gap: 0;
		-webkit-overflow-scrolling: touch;
	}

	.ya-shop .wc-block-product-filters__overlay-content > .ya-shop__clear:not(.ya-shop__clear--footer) {
		display: none;
	}

	.ya-shop .wc-block-product-filters.is-overlay-opened .wc-block-product-filters__overlay-footer {
		display: flex !important;
		flex-direction: column;
		gap: var(--ya-spacing-12);
		flex-shrink: 0;
		padding: var(--ya-spacing-16);
		padding-bottom: max(var(--ya-spacing-16), env(safe-area-inset-bottom, 0px));
		border-block-start: 1px solid var(--wp--preset--color--gray-300, #e8e6de);
		background-color: var(--wp--preset--color--gray-white, #fff);
		box-shadow: none;
	}

	.ya-shop .wc-block-product-filters__apply {
		width: 100%;
		min-height: 2.75rem;
		border: 0;
		border-radius: 999px;
		background-color: var(--wp--preset--color--gray-black, #000);
		color: var(--wp--preset--color--gray-white, #fff);
		font-weight: 700;
	}

	.ya-shop .ya-shop__clear--footer {
		margin-block-start: 0;
	}

	.ya-shop__collection .wc-block-product-template,
	.ya-shop__collection ul.wc-block-product-template,
	.ya-shop__collection .wc-block-product-template__responsive {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: var(--ya-spacing-16);
	}
}

@media (min-width: 768px) {
	.ya-shop__filters-title,
	.ya-shop__clear--footer {
		display: none;
	}

	/* DS filter panel: sticky beside results (sidebar column; WC filters wrapper won’t stick). */
	.ya-shop .ya-shop__sidebar {
		position: sticky;
		top:  var(--ya-spacing-24);
		align-self: flex-start;
	}

	.ya-shop__collection .wc-block-product-template,
	.ya-shop__collection ul.wc-block-product-template {
		gap: var(--wp--custom--grid--gutter--desktop, 1.5rem);
	}
}

@media (min-width: 1280px) {
	.ya-shop__collection .wc-block-product-template__responsive.columns-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
