/**
 * Woo Dynamic Pro Slider — frontend styles.
 *
 * All colours, radius and shadows are driven by CSS custom properties set
 * per-instance inline, so a single stylesheet serves every configuration and
 * stays fully cacheable.
 */

.wdps-slider {
	--wdps-primary: #2563eb;
	--wdps-text: #1f2937;
	--wdps-btn-bg: #2563eb;
	--wdps-btn-text: #ffffff;
	--wdps-radius: 12px;
	--wdps-shadow: 0 6px 24px rgba( 0, 0, 0, 0.08 );
	--wdps-font: inherit;

	position: relative;
	width: 100%;
	font-family: var( --wdps-font );
	color: var( --wdps-text );
}

.wdps-slider .swiper {
	padding: 8px 4px 40px;
}

/* ---------- Card ---------- */
.wdps-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-radius: var( --wdps-radius );
	overflow: hidden;
	box-shadow: var( --wdps-shadow );
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wdps-card:hover {
	transform: translateY( -4px );
}

.wdps-card__media {
	position: relative;
}

.wdps-card__image {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f3f4f6;
}

.wdps-card__image img,
.wdps-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.wdps-card:hover .wdps-card__img {
	transform: scale( 1.05 );
}

.wdps-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var( --wdps-primary );
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 4px 10px;
	border-radius: 999px;
	z-index: 2;
}

.wdps-badge--muted {
	background: #6b7280;
}

.wdps-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	flex: 1 1 auto;
}

.wdps-card__title {
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
	font-weight: 600;
}

.wdps-card__title a {
	color: inherit;
	text-decoration: none;
}

.wdps-card__title a:hover {
	color: var( --wdps-primary );
}

.wdps-card__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}

.wdps-card__rating .star-rating {
	color: var( --wdps-primary );
	margin: 0;
}

.wdps-card__rating-count {
	color: #6b7280;
}

.wdps-card__attributes {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 12px;
	color: #6b7280;
}

.wdps-card__attributes .wdps-attr__name {
	font-weight: 600;
	color: var( --wdps-text );
}

.wdps-card__price {
	font-size: 16px;
	font-weight: 700;
	color: var( --wdps-text );
	margin-top: auto;
}

.wdps-card__price del {
	color: #9ca3af;
	font-weight: 400;
	margin-right: 6px;
}

.wdps-card__price ins {
	text-decoration: none;
	color: var( --wdps-primary );
}

/* ---------- Button ---------- */
.wdps-card__button {
	display: inline-block;
	text-align: center;
	margin-top: 8px;
	padding: 10px 16px;
	background: var( --wdps-btn-bg );
	color: var( --wdps-btn-text );
	border: none;
	border-radius: calc( var( --wdps-radius ) / 2 );
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.2s ease, opacity 0.2s ease;
}

.wdps-card__button:hover {
	filter: brightness( 0.92 );
	color: var( --wdps-btn-text );
}

.wdps-card__button.added {
	opacity: 0.85;
}

/* Woo's "View cart" link that appears after an AJAX add. */
.wdps-card .added_to_cart {
	display: inline-block;
	margin-top: 6px;
	font-size: 13px;
	color: var( --wdps-primary );
}

/* ---------- Swiper UI overrides ---------- */
.wdps-slider .swiper-button-next,
.wdps-slider .swiper-button-prev {
	color: var( --wdps-primary );
	background: #fff;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.12 );
	/* Centre the arrows on the product photo, not on the whole card, so they
	   never cover the product name or price. */
	top: 30%;
}

.wdps-slider .swiper-button-next::after,
.wdps-slider .swiper-button-prev::after {
	font-size: 16px;
	font-weight: 700;
}

.wdps-slider .swiper-pagination-bullet-active {
	background: var( --wdps-primary );
}

.wdps-slider button.swiper-button-next,
.wdps-slider button.swiper-button-prev {
	border: 0;
	padding: 0;
	cursor: pointer;
}

/* Equal-height slides. */
.wdps-slider .swiper-slide {
	height: auto;
}

/* Before Swiper boots: lay the slides out with the final widths so the page
   does not jump (no layout shift). --wdps-spv / --wdps-gap are set inline. */
.wdps-slider:not( .is-ready ) .swiper-wrapper {
	display: flex;
	gap: var( --wdps-gap, 20px );
	overflow: hidden;
}

.wdps-slider:not( .is-ready ) .swiper-slide {
	flex: 0 0 calc( ( 100% - ( var( --wdps-spv, 1 ) - 1 ) * var( --wdps-gap, 20px ) ) / var( --wdps-spv, 1 ) );
}

.wdps-slider:not( .is-ready ) .swiper-button-next,
.wdps-slider:not( .is-ready ) .swiper-button-prev,
.wdps-slider:not( .is-ready ) .swiper-pagination {
	visibility: hidden;
}

/* Visible keyboard focus. */
.wdps-card a:focus-visible,
.wdps-slider .swiper-button-next:focus-visible,
.wdps-slider .swiper-button-prev:focus-visible,
.wdps-slider .swiper-pagination-bullet:focus-visible {
	outline: 2px solid var( --wdps-primary );
	outline-offset: 2px;
}

@media ( prefers-reduced-motion: reduce ) {
	.wdps-card,
	.wdps-card__img {
		transition: none;
	}

	.wdps-card:hover,
	.wdps-card:hover .wdps-card__img {
		transform: none;
	}
}

@media ( max-width: 480px ) {
	.wdps-card__body {
		padding: 12px;
	}
}
