/* Bottom section of category and brand archives: long text behind "Läs mer", FAQ, related links.
   Loaded in the head so the long text is collapsed at first paint and nothing moves afterwards. */

.kpco-catbottom {
	--kpco-catbottom-bg: #fff;
	--kpco-catbottom-line: rgba(0, 0, 0, .14);
	--kpco-catbottom-height: 22rem;
	border-top: 1px solid var(--kpco-catbottom-line);
	clear: both;
	margin: 2.5rem 0 1.5rem;
	padding-top: 2rem;
	/* Leaves room for the sticky header when a link jumps to the section. */
	scroll-margin-top: 6rem;
}

.kpco-catbottom__title {
	margin: 0 0 1rem;
}

.kpco-catbottom__subtitle {
	margin: 0 0 .75rem;
}

/* The theme sets its body font on paragraphs only; lists and links in this section should match them. */
.kpco-catbottom__text li,
.kpco-catbottom__a li,
.kpco-catbottom__links a,
.kpco-catempty a:not(.button) {
	font-family: var(--body-font-family, inherit);
}

.kpco-catbottom__text > :first-child {
	margin-top: 0;
}

.kpco-catbottom__text > :last-child {
	margin-bottom: 0;
}

.kpco-catbottom__text img,
.kpco-catbottom__text table {
	break-inside: avoid;
	height: auto;
	max-width: 100%;
}

.kpco-catbottom__text h2,
.kpco-catbottom__text h3,
.kpco-catbottom__text h4 {
	break-after: avoid;
}

/* Collapsed state. The class is printed by the server; the script only swaps it. */
.kpco-catbottom__more.is-collapsed {
	max-height: var(--kpco-catbottom-height);
	overflow: hidden;
	position: relative;
}

.kpco-catbottom__more.is-collapsed::after {
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--kpco-catbottom-bg));
	bottom: 0;
	content: "";
	height: 5rem;
	left: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
}

.kpco-catbottom__toggle.button {
	margin: 1rem 0 0;
	min-height: 44px;
}

@media (min-width: 850px) {
	.kpco-catbottom__more--cols > .kpco-catbottom__text {
		column-gap: 2.5rem;
		columns: 2;
	}

	/* A fixed height with column-fill:auto fills the left column first and continues at the top of the right one,
	   so the visible part reads in order; the rest overflows sideways and is clipped until the text is opened. */
	.kpco-catbottom__more--cols.is-collapsed > .kpco-catbottom__text {
		column-fill: auto;
		height: var(--kpco-catbottom-height);
	}

	/* List markers sit outside the item and were clipped by the collapsed wrapper, leaving only the dot of the
	   number visible. Give the lists room inside the column and keep each item in one column. */
	.kpco-catbottom__more--cols > .kpco-catbottom__text ol,
	.kpco-catbottom__more--cols > .kpco-catbottom__text ul {
		margin-left: 0;
		padding-left: 1.75em;
	}

	.kpco-catbottom__more--cols > .kpco-catbottom__text li {
		break-inside: avoid;
	}

	/* The text is cut at the foot of the right column only. */
	.kpco-catbottom__more--cols.is-collapsed::after {
		left: 50%;
	}
}

/* FAQ: native details/summary, no script. */
.kpco-catbottom__faq,
.kpco-catbottom__links {
	margin-top: 2.5rem;
	max-width: 52rem;
}

.kpco-catbottom__item {
	border-bottom: 1px solid var(--kpco-catbottom-line);
}

.kpco-catbottom__item:first-of-type {
	border-top: 1px solid var(--kpco-catbottom-line);
}

.kpco-catbottom__q {
	align-items: center;
	cursor: pointer;
	display: flex;
	font-family: var(--bold-font-family, inherit);
	gap: 1rem;
	justify-content: space-between;
	list-style: none;
	min-height: 44px;
	padding: .75rem 0;
}

.kpco-catbottom__q::-webkit-details-marker {
	display: none;
}

/* Plus that turns into a minus when the answer is open. */
.kpco-catbottom__q::after {
	background:
		linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
		linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
	content: "";
	flex: 0 0 auto;
	height: .875rem;
	width: .875rem;
}

.kpco-catbottom__item[open] > .kpco-catbottom__q::after {
	background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

.kpco-catbottom__q:hover {
	color: var(--fs-color-primary, inherit);
}

.kpco-catbottom__q:focus-visible,
.kpco-catbottom__toggle:focus-visible,
.kpco-catbottom__links a:focus-visible,
.kpco-catempty a:focus-visible {
	outline: 2px solid var(--fs-color-primary, currentColor);
	outline-offset: 2px;
}

.kpco-catbottom__a {
	padding: 0 2rem 1rem 0;
}

.kpco-catbottom__a > :last-child {
	margin-bottom: 0;
}

/* Related links. */
.kpco-catbottom__links ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The theme's stylesheets load after this one and indent every list item inside a column (.col-inner ul li),
   so this rule needs the extra class to hold. */
.kpco-catbottom .kpco-catbottom__links li {
	margin: 0;
}

.kpco-catbottom__links a {
	align-items: center;
	display: inline-flex;
	min-height: 44px;
	text-decoration: underline;
}

.kpco-catbottom__updated {
	font-size: .875em;
	margin: 1.5rem 0 0;
	opacity: .75;
}

/* Category without products. */
.kpco-catempty {
	margin: 1.5rem 0 2.5rem;
	max-width: 40rem;
}

.kpco-catempty__actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1.5rem;
}

.kpco-catempty__actions .button {
	margin: 0;
	min-height: 44px;
}

.kpco-catempty__tel,
.kpco-catempty__back a {
	align-items: center;
	display: inline-flex;
	min-height: 44px;
	text-decoration: underline;
}

@media print {
	.kpco-catbottom__more.is-collapsed {
		max-height: none;
	}

	.kpco-catbottom__more.is-collapsed > .kpco-catbottom__text {
		column-fill: balance;
		height: auto;
	}

	/* .button is repeated because the theme's own .button rule comes later in the page. */
	.kpco-catbottom__more.is-collapsed::after,
	.kpco-catbottom__toggle.button {
		display: none;
	}
}
