/*
 * Neueste Produkte Slider für WooCommerce
 * Erbt Schriften, Textfarbe und Buttons vom Theme. Farben von Block-Themes
 * (theme.json) werden automatisch übernommen, sofern im Admin nichts gesetzt ist.
 */

.wcnps {
	--wcnps-a: var(--wcnps-accent, var(--wp--preset--color--primary, var(--wp--preset--color--contrast, #1e1e1e)));
	--wcnps-ac: var(--wcnps-accent-contrast, var(--wp--preset--color--base, #fff));
	--wcnps-line: rgba(128, 128, 128, 0.22);
	position: relative;
	margin: 0 0 2.5em;
	color: var(--wcnps-text, inherit);
}

.wcnps *,
.wcnps *::before,
.wcnps *::after {
	box-sizing: border-box;
}

/* ---------- Kopfzeile ---------- */

.wcnps .wcnps__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5em 1.5em;
	margin: 0 0 1em;
}

.wcnps--heading-center .wcnps__header {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.wcnps .wcnps__heading {
	margin: 0;
}

.wcnps .wcnps__all {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	white-space: nowrap;
}

.wcnps .wcnps__all:hover {
	color: var(--wcnps-a);
}

/* ---------- Spur & Folien ---------- */

.wcnps .wcnps__viewport {
	position: relative;
}

.wcnps .wcnps__track {
	display: flex;
	gap: var(--wcnps-gap, 20px);
	margin: 0;
	padding: 0 0 6px;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.wcnps .wcnps__track::-webkit-scrollbar {
	display: none;
}

.wcnps .wcnps__track:focus-visible {
	outline: 2px solid var(--wcnps-a);
	outline-offset: 4px;
}

.wcnps .wcnps__slide {
	display: flex;
	flex: 0 0 calc((100% - (var(--wcnps-pv, 1) - 1) * var(--wcnps-gap, 20px)) / var(--wcnps-pv, 1));
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.wcnps .wcnps__slide::before,
.wcnps .wcnps__slide::marker {
	content: none;
	display: none;
}

/* ---------- Karte ---------- */

.wcnps .wcnps__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0;
	border-radius: var(--wcnps-radius, 8px);
}

.wcnps--card .wcnps__card {
	overflow: hidden;
	background: var(--wcnps-card-bg, var(--wp--preset--color--base, #fff));
}

.wcnps--card.wcnps--border .wcnps__card {
	border: 1px solid var(--wcnps-line);
}

.wcnps--card.wcnps--shadow .wcnps__card {
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px -8px rgba(0, 0, 0, 0.14);
}

/* ---------- Bild ---------- */

.wcnps .wcnps__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--wcnps-ratio, auto);
	border-radius: var(--wcnps-radius, 8px);
	background: rgba(128, 128, 128, 0.08);
}

.wcnps--card .wcnps__media {
	border-radius: 0;
}

.wcnps .wcnps__img-link {
	display: block;
	height: 100%;
}

.wcnps .wcnps__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: var(--wcnps-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.wcnps--hover .wcnps__media img {
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
	.wcnps--hover .wcnps__card:hover .wcnps__media img {
		transform: scale(1.04);
	}
}

/* ---------- Kennzeichnungen ---------- */

.wcnps .wcnps__badges {
	position: absolute;
	top: 0.65em;
	inset-inline-start: 0.65em;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35em;
	pointer-events: none;
}

.wcnps .wcnps__badge {
	display: inline-block;
	padding: 0.3em 0.65em;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.2;
	border-radius: 999px;
	white-space: nowrap;
}

.wcnps .wcnps__badge--sale {
	background: var(--wcnps-a);
	color: var(--wcnps-ac);
}

.wcnps .wcnps__badge--new {
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #1e1e1e);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---------- Text ---------- */

.wcnps .wcnps__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35em;
	padding: 0.85em 0 0;
}

.wcnps--card .wcnps__body {
	padding: 1em 1.1em 1.15em;
}

.wcnps--content-center .wcnps__body {
	align-items: center;
	text-align: center;
}

.wcnps .wcnps__title {
	display: -webkit-box;
	margin: 0;
	padding: 0;
	overflow: hidden;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.35;
	-webkit-line-clamp: var(--wcnps-lines, 2);
	line-clamp: var(--wcnps-lines, 2);
	-webkit-box-orient: vertical;
}

.wcnps .wcnps__title a {
	color: inherit;
	text-decoration: none;
}

.wcnps .wcnps__title a:hover,
.wcnps .wcnps__title a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.wcnps .wcnps__rating .star-rating {
	float: none;
	margin: 0;
	font-size: 0.85em;
}

.wcnps--content-center .wcnps__rating .star-rating {
	margin: 0 auto;
}

.wcnps .wcnps__price {
	display: block;
	margin: 0;
	font-size: 0.95em;
}

.wcnps .wcnps__price del {
	opacity: 0.6;
}

.wcnps .wcnps__price ins {
	text-decoration: none;
	font-weight: 700;
}

.wcnps .wcnps__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin-top: auto;
	padding-top: 0.6em;
}

.wcnps--content-center .wcnps__actions {
	justify-content: center;
}

.wcnps .wcnps__actions .button {
	margin: 0;
}

.wcnps .wcnps__actions .added_to_cart {
	font-size: 0.875em;
}

/* ---------- Pfeile ---------- */

.wcnps .wcnps__arrow {
	position: absolute;
	top: var(--wcnps-arrow-top, 40%);
	z-index: 3;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	color: #1e1e1e;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
	cursor: pointer;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	transform: translateY(-50%);
	transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.wcnps .wcnps__arrow--prev {
	inset-inline-start: 10px;
}

.wcnps .wcnps__arrow--next {
	inset-inline-end: 10px;
}

.wcnps .wcnps__arrow svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

[dir="rtl"] .wcnps .wcnps__arrow svg {
	transform: scaleX(-1);
}

.wcnps .wcnps__arrow:hover {
	background: var(--wcnps-a);
	color: var(--wcnps-ac);
}

.wcnps .wcnps__arrow:focus-visible,
.wcnps .wcnps__toggle:focus-visible,
.wcnps .wcnps__dot:focus-visible {
	outline: 2px solid var(--wcnps-a);
	outline-offset: 2px;
}

.wcnps .wcnps__arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}

/* ---------- Punkte & Pause ---------- */

.wcnps .wcnps__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	margin-top: 1.1em;
}

.wcnps .wcnps__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.wcnps .wcnps__dot,
.wcnps .wcnps__toggle {
	display: inline-grid;
	place-items: center;
	min-width: 28px;
	height: 28px;
	min-height: 0;
	margin: 0;
	padding: 0 4px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	box-shadow: none;
	cursor: pointer;
	line-height: 1;
}

.wcnps .wcnps__dot::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.28;
	transition: width 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
}

.wcnps .wcnps__dot:hover::before {
	opacity: 0.55;
}

.wcnps .wcnps__dot[aria-current="true"]::before {
	width: 22px;
	opacity: 1;
	background: var(--wcnps-a);
}

.wcnps .wcnps__toggle svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wcnps .wcnps__icon-play {
	display: none;
}

.wcnps .wcnps__toggle.is-paused .wcnps__icon-pause {
	display: none;
}

.wcnps .wcnps__toggle.is-paused .wcnps__icon-play {
	display: block;
}

/* Ohne JavaScript: normale Wisch-/Scroll-Liste ohne Bedienelemente. */
.wcnps:not(.is-ready) .wcnps__arrow,
.wcnps:not(.is-ready) .wcnps__controls,
.wcnps.is-static .wcnps__arrow,
.wcnps.is-static .wcnps__controls,
.wcnps .wcnps__toggle[hidden] {
	display: none;
}

/* Bewegung reduzieren (Betriebssystem-Einstellung) respektieren. */
@media (prefers-reduced-motion: reduce) {
	.wcnps .wcnps__track {
		scroll-behavior: auto;
	}

	.wcnps .wcnps__media img,
	.wcnps .wcnps__arrow,
	.wcnps .wcnps__dot::before {
		transition: none;
	}

	.wcnps--hover .wcnps__card:hover .wcnps__media img {
		transform: none;
	}
}
