/* =========================================================
   ServiTotal — Bloque carrusel (servitotal/carousel).
   El motor (assets/js/carousel.js) mueve la pista; aquí sólo
   la presentación. Variables que fija el bloque/JS:
     --st-carousel-gap  (separación entre slides, desde PHP)
     --st-per           (slides por vista, desde JS)
   ========================================================= */

.st-carousel {
	position: relative;
}

.st-carousel__viewport {
	position: relative;
	overflow: hidden;
	touch-action: pan-y;
}

.st-carousel__track {
	display: flex;
	gap: var(--st-carousel-gap, 16px);
	transition: transform .45s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.st-carousel__slide {
	flex: 0 0 calc((100% - (var(--st-per, 1) - 1) * var(--st-carousel-gap, 16px)) / var(--st-per, 1));
	min-width: 0;
}

.st-carousel__slide > figure,
.st-carousel__slide > .wp-block-image {
	margin: 0;
}

.st-carousel__slide img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

/* ---------- Efecto fade ---------- */
.st-carousel--fade .st-carousel__track {
	display: block;
	transition: none;
}

.st-carousel--fade .st-carousel__slide {
	position: absolute;
	inset: 0;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity .5s ease;
}

.st-carousel--fade .st-carousel__slide.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

/* ---------- Flechas ---------- */
.st-carousel__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: var(--wp--preset--color--navy, #081534);
	box-shadow: 0 4px 14px rgba(8, 21, 52, .18);
	cursor: pointer;
	transition: background .15s ease, color .15s ease, transform .15s ease;
}

.st-carousel__arrow:hover {
	background: var(--wp--preset--color--primary, #EA2B27);
	color: #fff;
}

.st-carousel__arrow:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #EA2B27);
	outline-offset: 2px;
}

.st-carousel__arrow--prev {
	left: 12px;
}

.st-carousel__arrow--next {
	right: 12px;
}

/* ---------- Puntos ---------- */
.st-carousel__dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}

.st-carousel__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #c9ced8;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease, width .15s ease;
}

.st-carousel__dot:hover {
	background: #9aa2b1;
}

.st-carousel__dot.is-active {
	width: 22px;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #EA2B27);
}

.st-carousel__dot:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #EA2B27);
	outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
	.st-carousel__arrow {
		width: 38px;
		height: 38px;
	}
	.st-carousel__arrow--prev {
		left: 6px;
	}
	.st-carousel__arrow--next {
		right: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.st-carousel__track,
	.st-carousel--fade .st-carousel__slide {
		transition: none;
	}
}
