/**
 * Carrusel Licitaciones - estilos estructurales.
 *
 * Idea clave: el widget vive en un contenedor de 100 % del ancho de pantalla.
 * El encabezado y la primera tarjeta se alinean al "ancho del contenido"
 * (variable --cl-content-width) y el resto de tarjetas sobresale cortado por el
 * borde derecho de la pantalla (efecto peek).
 */

/* Asegura que el widget use todo el ancho disponible en contenedores flex. */
.elementor-widget-carrusel_licitaciones,
.elementor-widget-carrusel_licitaciones > .elementor-widget-container {
	width: 100%;
	max-width: 100%;
}

.cl-wrapper {
	--cl-content-width: 1140px;
	--cl-gutter: 20px;
	/* Distancia del borde de pantalla al inicio del contenido. */
	/* --cl-vw lo publica el JS en píxeles (ancho real del wrapper); 100 % es el respaldo. */
	--cl-edge: max(var(--cl-gutter), calc((var(--cl-vw, 100%) - var(--cl-content-width)) / 2));

	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	overflow-x: hidden; /* Respaldo para navegadores sin overflow: clip. */
}

@supports (overflow: clip) {
	.cl-wrapper {
		overflow-x: clip;
		overflow-y: visible;
	}
}

/* Respaldo en CSS; el JS lo afina con el ancho exacto sin la barra de scroll. */
.cl-wrapper.cl-fullbleed {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

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

/* ---------------------------------------------------------------
 * Encabezado
 * ------------------------------------------------------------- */
.cl-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	padding-left: var(--cl-edge);
	padding-right: var(--cl-edge);
	margin-bottom: 32px;
}

.cl-header--nav-only {
	justify-content: flex-end;
}

.cl-header__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

.cl-section-title {
	margin: 0 0 12px;
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-weight: 700;
	line-height: 1.1;
	color: inherit;
}

.cl-section-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	font-size: 1.125rem;
	font-weight: 500;
	text-decoration: none;
	color: inherit;
	transition: color 0.25s ease, opacity 0.25s ease;
}

a.cl-section-link:hover,
a.cl-section-link:focus-visible {
	opacity: 0.75;
}

/* ---------------------------------------------------------------
 * Flechas
 * ------------------------------------------------------------- */
.cl-nav {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 8px;
}

.cl-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	font-size: 16px;
	line-height: 1;
	color: #fff;
	background-color: transparent;
	border: 1px solid currentColor;
	border-radius: 50%;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.cl-arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.cl-arrow i {
	line-height: 1;
}

.cl-arrow img {
	width: 1em;
	height: 1em;
	object-fit: contain;
}

.cl-arrow:hover {
	transform: scale(1.05);
}

.cl-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.cl-arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* ---------------------------------------------------------------
 * Slider (efecto peek)
 * ------------------------------------------------------------- */
.cl-slider {
	/* El contenedor Swiper mide exactamente el ancho del contenido. */
	padding-left: var(--cl-edge);
	padding-right: var(--cl-edge);
}

/* overflow: visible para que las tarjetas sobresalgan por ambos lados del
 * contenido; el borde de la pantalla las recorta (wrapper con overflow-x: clip).
 * Al partir, el clip-path mantiene vacío el margen izquierdo; al primer
 * movimiento el JS agrega .cl-moved y ese margen se libera. */
.cl-wrapper .cl-swiper.swiper,
.cl-wrapper .cl-swiper.swiper-container {
	overflow: visible;
	clip-path: inset(-80px -100vw -80px 0);
	-webkit-user-select: none;
	user-select: none;
}

.cl-wrapper.cl-moved .cl-swiper.swiper,
.cl-wrapper.cl-moved .cl-swiper.swiper-container {
	clip-path: none;
}

.cl-swiper .swiper-wrapper {
	align-items: stretch;
}

.cl-swiper .swiper-slide {
	display: flex;
	height: auto;
	transition-property: opacity, transform;
	transition-duration: 0.5s;
	transition-timing-function: ease;
}

/* Tarjetas fuera de las centrales (asoman cortadas a los lados). */
.cl-swiper .swiper-slide.cl-faded {
	opacity: 0.35;
}

/* ---------------------------------------------------------------
 * Tarjeta
 * ------------------------------------------------------------- */
.cl-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	background-color: transparent;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cl-image {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	margin-bottom: 20px;
	overflow: hidden;
	border-radius: 16px;
	text-decoration: none;
}

.cl-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cl-card:hover .cl-image img {
	transform: scale(1.05);
}

.cl-image--placeholder {
	background-color: rgba(128, 128, 128, 0.25);
}

.cl-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 0.5em;
	margin-bottom: 8px;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.cl-category + .cl-date::before {
	content: "\00B7";
	margin-right: 0.5em;
}

.cl-title {
	margin: 0 0 14px;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.25;
}

.cl-title a {
	position: relative;
	z-index: 2;
	color: inherit;
	text-decoration: none;
	transition: color 0.25s ease, opacity 0.25s ease;
}

.cl-card:hover .cl-title a,
.cl-title a:focus-visible {
	opacity: 0.8;
}

.cl-excerpt {
	margin: 0 0 16px;
	font-size: 1rem;
	line-height: 1.6;
}

.cl-button-wrap {
	position: relative;
	z-index: 2;
	margin-top: auto;
}

/* Toda la tarjeta es clicable: un enlace transparente la cubre por completo. */
.cl-card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
}

.cl-card a,
.cl-card img {
	-webkit-user-drag: none;
}

.cl-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-weight: 600;
	line-height: 1.4;
	color: inherit;
	text-decoration: none;
	background-color: transparent;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.cl-button:hover,
.cl-button:focus-visible {
	opacity: 0.85;
}

/* ---------------------------------------------------------------
 * Distintivo de estado (Publicada = verde, Adjudicada = rojo)
 * ------------------------------------------------------------- */
.cl-badge {
	--cl-badge-off: 12px;
	position: absolute;
	top: var(--cl-badge-off);
	left: var(--cl-badge-off);
	z-index: 2;
	display: inline-block;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

.cl-badge--right {
	left: auto;
	right: var(--cl-badge-off);
}

.cl-badge--publicada {
	background-color: #1e9e4a;
}

.cl-badge--adjudicada {
	background-color: #d63638;
}

/* Sin imagen: el distintivo va dentro del flujo de la tarjeta. */
.cl-badge--inline {
	position: static;
	align-self: flex-start;
	margin-bottom: 12px;
	box-shadow: none;
}

/* ---------------------------------------------------------------
 * ID de la licitación
 * ------------------------------------------------------------- */
.cl-id {
	display: flex;
	flex-direction: column;
	align-self: flex-start;
	gap: 2px;
	margin-bottom: 12px;
	padding: 8px 12px;
	background-color: rgba(128, 128, 128, 0.14);
	border-radius: 8px;
}

.cl-id__label {
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
}

.cl-id__value {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	word-break: break-word;
}

/* Monto, cierre y financiamiento */
.cl-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	line-height: 1.45;
}

.cl-detail__label {
	font-weight: 600;
	opacity: 0.75;
}

/* Mensaje de ayuda en el editor cuando la query no devuelve entradas. */
.cl-empty {
	padding: 24px;
	text-align: center;
	border: 1px dashed currentColor;
	opacity: 0.7;
}

/* Texto solo para lectores de pantalla (por si el tema no lo define). */
.cl-wrapper .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.cl-wrapper *,
	.cl-wrapper *::before,
	.cl-wrapper *::after {
		transition-duration: 0.01ms !important;
	}
}
