/*
 * Codepun Catalog: neutral fallback of the website (sheets 20, 21, 23, 24).
 * The fallback sits in @layer codepun-catalog, so every rule of the theme wins,
 * also with lower specificity; only the few rules that carry the layout stand
 * behind the layer, at the end of this file. Font and colours are inherited; lines and
 * secondary text are shares of currentColor; the selection uses the accent of
 * the theme. Arrows, "Vollbild" and the full screen view ignore general theme
 * rules (revert-layer, see the end of the file); themes style them through
 * the variables --codepun-catalog-control-* and --codepun-catalog-lightbox-*.
 * Switch it off with
 * add_filter( 'codepun_catalog_load_styles', '__return_false' ).
 */
@layer codepun-catalog {
	.codepun-catalog,
	.codepun-catalog-product {
		--codepun-catalog-card-min: 220px;
		--codepun-catalog-columns-mobile: 2;
		--codepun-catalog-image-ratio: 1 / 1;
		--codepun-catalog-gap: 1.5rem;
		--codepun-catalog-gap-row: 2.5rem;
		--codepun-catalog-radius: 8px;
		--codepun-catalog-selected: var(--wp--preset--color--accent, var(--wp--preset--color--primary, currentColor));
		--codepun-catalog-selected-text: var(--wp--preset--color--base, Canvas);
		--codepun-catalog-line: color-mix(in srgb, currentColor 50%, transparent);
		--codepun-catalog-muted: color-mix(in srgb, currentColor 70%, transparent);
		--codepun-catalog-placeholder: color-mix(in srgb, currentColor 6%, transparent);
		--codepun-catalog-focus: currentColor;
		--codepun-catalog-stage-max: 42rem;
		--codepun-catalog-stage-bg: #f5f5f4;
		--codepun-catalog-control-bg: rgb(255 255 255 / 0.92);
		--codepun-catalog-control-text: #1f2421;
		--codepun-catalog-lightbox-bg: rgb(17 17 17 / 0.96);
		--codepun-catalog-lightbox-text: #fff;
		box-sizing: border-box;
	}

	.codepun-catalog *,
	.codepun-catalog-product * {
		box-sizing: border-box;
	}

	.codepun-catalog {
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
		scroll-margin-top: 2rem;
	}

	.codepun-catalog > * {
		margin-block: 0;
	}

	.codepun-catalog__sr {
		position: absolute !important;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
		border: 0;
	}

	.codepun-catalog :is(a, button, input, select):focus-visible,
	.codepun-catalog-product :is(a, button, summary):focus-visible {
		outline: 2px solid var(--codepun-catalog-focus);
		outline-offset: 2px;
	}

	/* Search and brand: one GET form, button "Suchen" without JavaScript. */
	.codepun-catalog__search {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 8px;
	}

	.codepun-catalog__search-field {
		position: relative;
		flex: 0 1 380px;
		min-width: 0;
	}

	.codepun-catalog__search-icon {
		position: absolute;
		inset-inline-start: 14px;
		top: 50%;
		translate: 0 -50%;
		color: var(--codepun-catalog-muted);
		pointer-events: none;
	}

	.codepun-catalog__search-input,
	.codepun-catalog__brand-select {
		width: 100%;
		min-height: 44px;
		padding: 0 14px;
		border: 1px solid var(--codepun-catalog-line);
		border-radius: var(--codepun-catalog-radius);
		background-color: transparent;
		color: inherit;
		font: inherit;
		font-size: 1rem;
	}

	.codepun-catalog__search-input {
		padding-inline-start: 44px;
	}

	.codepun-catalog__search-input::placeholder {
		color: var(--codepun-catalog-muted);
		opacity: 1;
	}

	.codepun-catalog__brand-select {
		flex: 0 1 220px;
		width: auto;
		min-width: 0;
		font-size: 0.9375rem;
	}

	.codepun-catalog__brand-select option {
		color: initial;
	}

	.codepun-catalog__brand-select--chosen {
		border-color: currentColor;
		box-shadow: inset 0 0 0 1px currentColor;
		font-weight: 700;
	}

	/* Buttons: the theme's wp-element-button wins; without one, filled in the text colour (as Codepun Forms). */
	.codepun-catalog__submit,
	.codepun-catalog-product__inquiry-button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		padding: 0 20px;
		border: 0;
		border-radius: var(--codepun-catalog-radius);
		background: CanvasText;
		color: Canvas;
		font: inherit;
		font-weight: 600;
		text-decoration: none;
		cursor: pointer;
	}

	@supports (color: lch(from red l c h)) {
		.codepun-catalog__submit,
		.codepun-catalog-product__inquiry-button {
			color: lch(from currentColor calc((62 - l) * 100) 0 0);
			background: lch(from currentColor calc((62 - l) * 100) 0 0);
		}
	}

	/* Category filter: rows of links, the chosen one with aria-current. */
	.codepun-catalog__filters {
		display: flex;
		flex-direction: column;
		gap: 12px;
	}

	.codepun-catalog__filter-row {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.codepun-catalog__filter,
	.codepun-catalog__page {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 40px;
		padding: 0 16px;
		border-radius: var(--codepun-catalog-radius);
		color: inherit;
		font-size: 0.9375rem;
		white-space: nowrap;
		text-decoration: none;
	}

	.codepun-catalog__filter {
		box-shadow: inset 0 0 0 1px var(--codepun-catalog-line);
	}

	.codepun-catalog__filter-row--sub .codepun-catalog__filter {
		min-height: 36px;
		padding: 0 14px;
		font-size: 0.875rem;
	}

	.codepun-catalog__filter:hover {
		box-shadow: inset 0 0 0 1px currentColor;
	}

	/* Chosen: a 2 px ring in the accent (currentColor without one) and bold. */
	.codepun-catalog__filter[aria-current],
	.codepun-catalog__page[aria-current] {
		box-shadow: inset 0 0 0 2px var(--codepun-catalog-selected);
		font-weight: 700;
	}

	/* With an accent of the theme also filled. Without one these declarations are invalid and the ring stays. */
	.codepun-catalog__filter[aria-current],
	.codepun-catalog__page[aria-current] {
		background: color-mix(in srgb, var(--codepun-catalog-selected) 100%, var(--wp--preset--color--accent, var(--wp--preset--color--primary)) 0%);
		color: color-mix(in srgb, var(--codepun-catalog-selected-text) 100%, var(--wp--preset--color--accent, var(--wp--preset--color--primary)) 0%);
	}

	.codepun-catalog__count {
		padding-top: 8px;
		color: var(--codepun-catalog-muted);
		font-size: 0.9375rem;
	}

	/* Grid: as many columns as fit; the selection fills the width (auto-fit). */
	.codepun-catalog__grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(min(var(--codepun-catalog-card-min), 100%), 1fr));
		gap: var(--codepun-catalog-gap-row) var(--codepun-catalog-gap);
	}

	/* Loading longer than 300 ms: only the cards turn pale, search and filters stay usable. */
	.codepun-catalog__grid[aria-busy="true"] {
		opacity: 0.5;
	}

	.codepun-catalog--selection .codepun-catalog__grid {
		grid-template-columns: repeat(auto-fit, minmax(min(var(--codepun-catalog-card-min), 100%), 1fr));
	}

	/* Card: no frame, no shadow; the image carries it. One link, one tab stop. */
	.codepun-catalog__card {
		position: relative;
		display: flex;
		flex-direction: column;
		gap: 3px;
		min-width: 0;
		border-radius: var(--codepun-catalog-radius);
	}

	.codepun-catalog__card-link {
		display: flex;
		flex-direction: column;
		gap: 3px;
		color: inherit;
		text-decoration: none;
	}

	.codepun-catalog__card-link::after {
		content: "";
		position: absolute;
		inset: 0;
	}

	.codepun-catalog__card-image,
	.codepun-catalog-product__stage--placeholder,
	.codepun-catalog-product__thumb {
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
		border-radius: var(--codepun-catalog-radius);
		background: var(--codepun-catalog-placeholder);
		color: var(--codepun-catalog-muted);
	}

	.codepun-catalog__card-image {
		aspect-ratio: var(--codepun-catalog-image-ratio);
		margin-bottom: 7px;
	}

	.codepun-catalog__card-image img,
	.codepun-catalog-product__slide img,
	.codepun-catalog-product__thumb img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	.codepun-catalog__card-brand,
	.codepun-catalog__card-availability {
		color: var(--codepun-catalog-muted);
		font-size: 0.875rem;
	}

	.codepun-catalog__card-name {
		display: -webkit-box;
		overflow: hidden;
		font-weight: 600;
		line-height: 1.35;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		text-underline-offset: 3px;
	}

	.codepun-catalog__card-link:hover .codepun-catalog__card-name {
		text-decoration: underline;
	}

	.codepun-catalog__card-price {
		font-size: 0.9375rem;
		font-variant-numeric: tabular-nums;
	}

	@supports selector(:has(*)) {
		.codepun-catalog__card-link:focus-visible {
			outline: none;
		}

		.codepun-catalog__card:has(.codepun-catalog__card-link:focus-visible) {
			outline: 2px solid var(--codepun-catalog-focus);
			outline-offset: 4px;
		}
	}

	/* Page links, 44 × 44. */
	.codepun-catalog__pagination {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px;
		padding-top: 1.5rem;
	}

	.codepun-catalog__page {
		min-width: 44px;
		min-height: 44px;
		padding: 0 12px;
		font-size: 1rem;
		text-decoration: underline;
		text-underline-offset: 3px;
	}

	.codepun-catalog__page[aria-current],
	.codepun-catalog__page--gap {
		text-decoration: none;
	}

	/* Empty states and the inquiry without product. */
	.codepun-catalog__empty {
		display: flex;
		flex-direction: column;
		gap: 6px;
		padding-block: 1rem 0.5rem;
	}

	.codepun-catalog__empty-title {
		font-size: 1.125rem;
		font-weight: 600;
	}

	.codepun-catalog__inquiry {
		max-width: 45rem;
	}

	.codepun-catalog__inquiry {
		padding-top: 1.5rem;
		border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	}

	.codepun-catalog__all-link {
		color: inherit;
		font-weight: 600;
		text-underline-offset: 3px;
	}

	/* Links on their own line: at least 24 px high (WCAG 2.5.8). */
	.codepun-catalog__all-link,
	.codepun-catalog__empty-action a,
	.codepun-catalog__editor-note a,
	.codepun-catalog-product__back a,
	.codepun-catalog-product__gone-links a,
	.codepun-catalog-product__preview-bar a,
	.codepun-catalog-product__fact a {
		display: inline-flex;
		align-items: center;
		min-height: 24px;
	}

	.codepun-catalog__editor-note {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		align-self: flex-start;
		padding: 8px 12px;
		border: 1px solid var(--codepun-catalog-line);
		border-radius: var(--codepun-catalog-radius);
		font-size: 0.875rem;
	}

	/* Product page. */
	.codepun-catalog-template:not(.has-global-padding) {
		padding-inline: 16px;
	}

	.codepun-catalog-product {
		display: flex;
		flex-direction: column;
		gap: 2rem;
	}

	.codepun-catalog-product__preview-bar {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.5rem;
		padding: 10px 20px;
		border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
		background: var(--codepun-catalog-placeholder);
		font-size: 0.875rem;
	}

	.codepun-catalog-product__preview-state,
	.codepun-catalog-product__brand,
	.codepun-catalog-product__price-note,
	.codepun-catalog-product__fact dt {
		color: var(--codepun-catalog-muted);
	}

	.codepun-catalog-product__back,
	.codepun-catalog-product__breadcrumb {
		font-size: 0.9375rem;
	}

	.codepun-catalog-product a:not(.wp-element-button) {
		color: inherit;
		text-underline-offset: 3px;
	}

	.codepun-catalog-product__main {
		display: grid;
		gap: 2rem;
		align-items: start;
	}

	/* Gallery (sheet 24): square stage, the whole image visible, a row that swipes by itself. */
	.codepun-catalog-product__gallery {
		display: flex;
		flex-direction: column;
		gap: 12px;
		min-width: 0;
	}

	.codepun-catalog-product__gallery [hidden] {
		display: none !important;
	}

	.codepun-catalog-product__stage {
		position: relative;
		overflow: hidden;
		flex: none;
		width: min(100%, var(--codepun-catalog-stage-max));
		margin-inline: auto;
		aspect-ratio: 1 / 1;
		border-radius: var(--codepun-catalog-radius);
		background: var(--codepun-catalog-stage-bg);
	}

	.codepun-catalog-product__stage--placeholder {
		background: var(--codepun-catalog-placeholder);
	}

	.codepun-catalog-product__slides {
		display: flex;
		width: 100%;
		height: 100%;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.codepun-catalog-product__slides::-webkit-scrollbar {
		display: none;
	}

	.codepun-catalog-product__slide {
		display: flex;
		flex: 0 0 100%;
		align-items: center;
		justify-content: center;
		height: 100%;
		scroll-snap-align: start;
		scroll-snap-stop: always;
		cursor: zoom-in;
	}

	/* Arrows, counter, "Vollbild": always on the light stage, so their colours are fixed. */
	.codepun-catalog-product__arrow,
	.codepun-catalog-product__counter,
	.codepun-catalog-product__fullscreen {
		position: absolute;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		margin: 0;
		padding: 0 10px;
		border: 0;
		border-radius: 999px;
		background: var(--codepun-catalog-control-bg);
		color: var(--codepun-catalog-control-text);
		font: inherit;
		font-size: 0.8125rem;
		line-height: 1;
		font-variant-numeric: tabular-nums;
		appearance: none;
	}

	.codepun-catalog-product__arrow {
		top: 50%;
		width: 44px;
		height: 44px;
		padding: 0;
		box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
		translate: 0 -50%;
		cursor: pointer;
	}

	.codepun-catalog-product__arrow--prev {
		inset-inline-start: 16px;
	}

	.codepun-catalog-product__arrow--next {
		inset-inline-end: 16px;
	}

	.codepun-catalog-product__counter,
	.codepun-catalog-product__fullscreen {
		bottom: 16px;
		height: 28px;
	}

	.codepun-catalog-product__counter {
		inset-inline-end: 16px;
	}

	.codepun-catalog-product__fullscreen {
		inset-inline-start: 16px;
		cursor: pointer;
	}

	.codepun-catalog-product__fullscreen svg {
		width: 14px;
		height: 14px;
	}

	.codepun-catalog-product__arrow:hover,
	.codepun-catalog-product__fullscreen:hover {
		background: color-mix(in srgb, var(--codepun-catalog-control-bg) 60%, #fff);
	}

	.codepun-catalog-product__stage :is(button, a):focus-visible {
		outline: 2px solid var(--codepun-catalog-control-text);
		outline-offset: -4px;
	}

	.codepun-catalog-product__stage button:focus-visible {
		outline-offset: 2px;
	}

	.codepun-catalog-product__dots {
		display: flex;
		justify-content: center;
		gap: 8px;
	}

	.codepun-catalog-product__dots span {
		width: 8px;
		height: 8px;
		border-radius: 999px;
		background: color-mix(in srgb, currentColor 35%, transparent);
	}

	.codepun-catalog-product__dots [data-current] {
		background: currentColor;
	}

	.codepun-catalog-product__thumbs {
		display: flex;
		flex-direction: column;
		gap: 10px;
		max-height: calc(5.5 * 80px + 5 * 10px + 4px); /* a part of the sixth shows there is more */
		margin: -4px;
		padding: 4px;
		overflow: hidden auto;
		list-style: none;
		scrollbar-width: none;
	}

	.codepun-catalog-product__thumbs > li {
		flex: none;
		margin: 0;
	}

	.codepun-catalog-product__thumb {
		width: 80px;
		height: 80px;
		background: var(--codepun-catalog-stage-bg);
		cursor: pointer;
	}

	/* Full screen view: a dialog of its own, dark, the image as large as the screen allows. */
	.codepun-catalog-lightbox {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		margin: 0;
		padding: 0;
		overflow: hidden;
		border: 0;
		background: var(--codepun-catalog-lightbox-bg);
		color: var(--codepun-catalog-lightbox-text);
		touch-action: pinch-zoom;
	}

	.codepun-catalog-lightbox[open] {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.codepun-catalog-lightbox::backdrop {
		background: transparent;
	}

	.codepun-catalog-lightbox__image {
		display: block;
		width: auto;
		max-width: calc(100% - 176px);
		height: auto;
		max-height: calc(100% - 136px);
		object-fit: contain;
	}

	.codepun-catalog-lightbox button {
		position: absolute;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 999px;
		background: color-mix(in srgb, var(--codepun-catalog-lightbox-text) 12%, transparent);
		color: var(--codepun-catalog-lightbox-text);
		font: inherit;
		appearance: none;
		cursor: pointer;
	}

	.codepun-catalog-lightbox button:hover {
		background: color-mix(in srgb, var(--codepun-catalog-lightbox-text) 24%, transparent);
	}

	.codepun-catalog-lightbox button:focus-visible {
		outline: 2px solid var(--codepun-catalog-lightbox-text);
		outline-offset: 2px;
	}

	.codepun-catalog-lightbox__close {
		top: 24px;
		inset-inline-end: 24px;
	}

	.codepun-catalog-lightbox .codepun-catalog-lightbox__arrow {
		top: 50%;
		width: 56px;
		height: 56px;
		translate: 0 -50%;
	}

	.codepun-catalog-lightbox__arrow svg {
		width: 28px;
		height: 28px;
	}

	.codepun-catalog-lightbox__arrow--prev {
		inset-inline-start: 32px;
	}

	.codepun-catalog-lightbox__arrow--next {
		inset-inline-end: 32px;
	}

	.codepun-catalog-lightbox__caption {
		position: absolute;
		inset-inline: 16px;
		bottom: 24px;
		margin: 0;
		color: color-mix(in srgb, var(--codepun-catalog-lightbox-text) 80%, transparent);
		font-size: 0.875rem;
		text-align: center;
	}

	.codepun-catalog-product__summary {
		display: flex;
		flex-direction: column;
		gap: 1rem;
		min-width: 0;
	}

	.codepun-catalog-product__title {
		line-height: 1.15;
		overflow-wrap: anywhere;
	}

	.codepun-catalog-product__price {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0.5rem;
		font-size: 1.5rem;
		font-variant-numeric: tabular-nums;
	}

	.codepun-catalog-product__price-note {
		font-size: 0.9375rem;
	}

	.codepun-catalog-product__gone {
		font-size: 1.0625rem;
		font-weight: 600;
	}

	.codepun-catalog-product__gone-links {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem 1.25rem;
	}

	/* "Jetzt anfragen" is the summary of the folded inquiry (sheet 24). */
	.codepun-catalog-product__inquiry-fold {
		padding-top: 0.5rem;
	}

	.codepun-catalog-product__inquiry-fold > summary {
		list-style: none;
	}

	.codepun-catalog-product__inquiry-button {
		min-height: 48px;
		padding: 0 28px;
	}

	.codepun-catalog-product__inquiry-link {
		display: inline-flex;
		align-items: center;
		min-height: 24px;
		font-weight: 600;
		text-decoration: underline;
		text-underline-offset: 3px;
		cursor: pointer;
	}

	.codepun-catalog-product__inquiry-arrow {
		display: inline-block;
		width: 0.45em;
		height: 0.45em;
		margin-inline-start: 0.625em;
		border-right: 2px solid;
		border-bottom: 2px solid;
		rotate: 45deg;
		translate: 0 -25%;
	}

	[open] > summary .codepun-catalog-product__inquiry-arrow {
		rotate: -135deg;
		translate: 0 25%;
	}

	.codepun-catalog-product__inquiry-fold[open] > .codepun-catalog-product__inquiry {
		margin-top: 1rem;
	}

	.codepun-catalog-product__description {
		padding-top: 1rem;
		font-size: 1.125rem;
		line-height: 1.6;
	}

	.codepun-catalog-product__description > :first-child {
		margin-top: 0;
	}

	.codepun-catalog-product__description > :last-child {
		margin-bottom: 0;
	}

	.codepun-catalog-product__facts {
		display: grid;
		grid-template-columns: minmax(auto, 140px) minmax(0, 1fr);
		gap: 10px 24px;
		padding-top: 1.25rem;
		border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	}

	.codepun-catalog-product__fact {
		display: contents;
	}

	.codepun-catalog-product__fact dd {
		font-variant-numeric: tabular-nums;
	}

	.codepun-catalog-product__similar {
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
		padding-top: 1.5rem;
	}

	@media (min-width: 800px) {
		.codepun-catalog-product__main {
			grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
			gap: 4rem;
		}

		.codepun-catalog-product__summary {
			padding-top: 8px;
		}

		/* Small images in a column left of the stage. */
		.codepun-catalog-product__gallery--several {
			display: grid;
			grid-template-columns: 80px minmax(0, 1fr);
			gap: 16px;
			align-items: start;
		}

		.codepun-catalog-product__dots {
			display: none;
		}
	}

	/* One column: no small images, dots below the stage. */
	@media (max-width: 799px) {
		.codepun-catalog-product__thumbs {
			display: none;
		}
	}

	/* Phone: two columns, rows swipe sideways, tap targets 44 px. */
	@media (max-width: 599px) {
		.codepun-catalog__grid,
		.codepun-catalog--selection .codepun-catalog__grid {
			grid-template-columns: repeat(var(--codepun-catalog-columns-mobile), minmax(0, 1fr));
			gap: 1.75rem 1rem;
		}

		.codepun-catalog__search-field,
		.codepun-catalog__brand-select {
			flex-basis: 100%;
		}

		.codepun-catalog__filter-row {
			flex-wrap: nowrap;
			overflow-x: auto;
			padding-bottom: 4px;
			scrollbar-width: none;
		}

		/* Inside the value: the scrolling row would cut a ring around it. */
		.codepun-catalog__filter:focus-visible {
			outline-offset: -2px;
		}

		.codepun-catalog__filter,
		.codepun-catalog__filter-row--sub .codepun-catalog__filter {
			flex: none;
			min-height: 44px;
		}

		.codepun-catalog__card-name {
			font-size: 0.9375rem;
		}

		/* Phone: no arrows over the image, swipe; the counter dark as on the sheet. */
		.codepun-catalog-product__arrow,
		.codepun-catalog-product__fullscreen,
		.codepun-catalog-lightbox .codepun-catalog-lightbox__arrow {
			display: none;
		}

		.codepun-catalog-product__counter {
			inset-inline-end: 10px;
			bottom: 10px;
			background: rgb(0 0 0 / 0.55);
			color: #fff;
		}

		.codepun-catalog-lightbox__image {
			max-width: 100%;
		}

		.codepun-catalog-product__back a {
			display: inline-flex;
			align-items: center;
			min-height: 44px;
		}

		.codepun-catalog-product__price {
			font-size: 1.25rem;
		}

		.codepun-catalog-product__inquiry-button {
			width: 100%;
		}
	}
}

/*
 * Outside the layer: the few rules the catalog needs to work at all. A theme
 * rule outside a layer always beats a layered one, so a reset like
 * nav { display: block } or img { height: auto }, margins on every p, or a theme
 * that styles every input or underlines every link would otherwise break rows,
 * cards and images. These rules only hold structure, never colour or look, and
 * carry one or two classes more than such general theme rules; a theme that
 * targets the catalog's own classes with a parent still wins. Card names keep
 * the theme's link style.
 */
.codepun-catalog .codepun-catalog__filter-row,
.codepun-catalog .codepun-catalog__pagination {
	display: flex;
}

/* Spaces come from the gap of the parent, not from margins on p, headings and lists. */
:is(.codepun-catalog, .codepun-catalog-product, .codepun-catalog__card, .codepun-catalog__empty, .codepun-catalog-product__summary, .codepun-catalog-product__similar) > :is(p, h1, h2, dl)[class],
.codepun-catalog-product .codepun-catalog-product__fact dd {
	margin-block: 0;
	margin-inline: 0;
}

:is(.codepun-catalog, .codepun-catalog-product) :is(.codepun-catalog__card-image, .codepun-catalog-product__stage, .codepun-catalog-product__thumb) img {
	height: 100%;
}

/*
 * Arrows, "Vollbild" and the full screen view: theme rules for button, img, p
 * or dialog stand outside any layer and would win over the fallback (a theme
 * that fills every button with its accent turns the arrows into coloured
 * blocks). revert-layer drops every rule outside a layer for these elements,
 * also a theme rule on their own classes unless it is more specific than
 * this one, and hands them back to the layer above. Variables stay: a theme
 * sets --codepun-catalog-control-bg, -control-text, -lightbox-bg and
 * -lightbox-text. Browsers without
 * revert-layer get no arrows and no full screen view (catalog.js).
 */
.codepun-catalog-product .codepun-catalog-product__gallery :is(button, .codepun-catalog-lightbox, .codepun-catalog-lightbox__image, .codepun-catalog-lightbox__caption) {
	all: revert-layer;
}

.codepun-catalog-product .codepun-catalog-product__inquiry-fold > summary {
	box-sizing: border-box;
	list-style: none;
}

.codepun-catalog-product .codepun-catalog-product__inquiry-fold > summary::-webkit-details-marker {
	display: none;
}

html:has(.codepun-catalog-lightbox[open]) {
	overflow: hidden;
}

/* Images are links, and resets clear the background of links. The mark of the chosen small image must not depend on the theme. */
.codepun-catalog-product :is(.codepun-catalog-product__stage, .codepun-catalog-product__thumb) {
	background: var(--codepun-catalog-stage-bg);
}

.codepun-catalog-product .codepun-catalog-product__stage--placeholder {
	background: var(--codepun-catalog-placeholder);
}

.codepun-catalog-product .codepun-catalog-product__thumb[aria-current] {
	box-shadow: 0 0 0 2px currentColor;
}

.codepun-catalog .codepun-catalog__search-input {
	padding-inline-start: 44px;
}

.codepun-catalog .codepun-catalog__filters .codepun-catalog__filter,
.codepun-catalog .codepun-catalog__card-link,
.codepun-catalog-product .codepun-catalog__card-link,
.codepun-catalog-product .codepun-catalog-product__inquiry-button {
	text-decoration: none;
}

.codepun-catalog .codepun-catalog__card-link:hover .codepun-catalog__card-name,
.codepun-catalog-product .codepun-catalog__card-link:hover .codepun-catalog__card-name {
	text-decoration: underline;
}

.codepun-catalog ul.codepun-catalog__grid,
.codepun-catalog-product ul.codepun-catalog__grid {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 4 px around the small images, so the scrolling row does not cut the selection and the focus ring. */
.codepun-catalog-product ul.codepun-catalog-product__thumbs {
	margin: -4px;
	padding: 4px;
	list-style: none;
}

.codepun-catalog ul.codepun-catalog__grid > li,
.codepun-catalog-product ul.codepun-catalog__grid > li,
.codepun-catalog-product ul.codepun-catalog-product__thumbs > li {
	margin: 0;
}

