/*
 * Teducas - Tutor Card Vertical  |  v1.0.0
 * Estilos del widget de tarjeta vertical para cursos TutorLMS.
 * ─────────────────────────────────────────────────────────────
 */

/* ── Cuadrícula (modo "Todos los cursos") ─────────────────────── */
.tcv-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr); /* sobrescrito por Elementor responsive */
	gap: 24px;
	width: 100%;
}

@media (max-width: 1024px) {
	.tcv-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.tcv-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Tarjeta base ─────────────────────────────────────────────── */
.tcv-card {
	position: relative;
	overflow: hidden;
	border-radius: 16px;

	/* Imagen de fondo a resolución completa */
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-color: #1a1a2e; /* color de reserva */

	min-height: 480px;
	display: flex;
	align-items: stretch; /* .tcv-content llena toda la altura */
	justify-content: center;

	transition:
		transform  0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		box-shadow 0.35s ease;
	cursor: pointer;
	text-decoration: none;
}

.tcv-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
}

/* Fondo de reserva cuando el curso no tiene portada */
.tcv-card--no-thumb {
	background: linear-gradient(145deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
}

/* ── Capa oscura sobre la imagen ──────────────────────────────── */
.tcv-overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 6, 18, 0.52);
	z-index: 1;
	transition: background 0.35s ease;
}

.tcv-card:hover .tcv-overlay {
	background: rgba(8, 6, 18, 0.42);
}

/* ── Contenido ────────────────────────────────────────────────── */
.tcv-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between; /* botón siempre al fondo */
	padding: 36px 22px 28px;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

/* Grupo superior: icono + título centrado verticalmente */
.tcv-main {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	flex: 1;
	width: 100%;
	padding-bottom: 20px;
}

/* ── Círculo con icono ────────────────────────────────────────── */
.tcv-icon-wrap {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #e8405a;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-bottom: 4px;
	box-shadow: 0 6px 24px rgba(232, 64, 90, 0.45);
}

/* Icono Font Awesome */
.tcv-icon-wrap i,
.tcv-icon-wrap span > i {
	color: #ffffff !important;
	font-size: 28px;
	line-height: 1;
}

/* Icono SVG */
.tcv-icon-wrap svg {
	width: 28px;
	height: 28px;
	fill: #ffffff;
	stroke: #ffffff;
	display: block;
}

/* ── Título del curso ─────────────────────────────────────────── */
.tcv-title {
	color: #ffffff !important;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 !important;
	padding: 0 !important;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.tcv-title-link {
	color: inherit !important;
	text-decoration: none !important;
	display: block;
}

.tcv-title-link:hover {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

/* ── Botón CTA ────────────────────────────────────────────────── */
.tcv-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;

	background: #e8405a;
	color: #ffffff !important;
	text-decoration: none !important;

	padding: 12px 12px 12px 22px;
	border-radius: 50px;
	border: none;

	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;

	width: 100%;
	box-sizing: border-box;
	margin-top: 0;
	cursor: pointer;

	box-shadow: 0 5px 18px rgba(232, 64, 90, 0.38);
	transition:
		background-color 0.3s ease,
		box-shadow       0.3s ease,
		transform        0.2s ease;
}

.tcv-btn:hover,
.tcv-btn:focus {
	background: #cc2e47;
	box-shadow: 0 8px 24px rgba(232, 64, 90, 0.55);
	color: #ffffff !important;
	text-decoration: none !important;
	transform: translateY(-1px);
	outline: none;
}

/* Texto del botón */
.tcv-btn-text {
	flex: 1;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: inherit;
}

/* Círculo con flecha (derecha del botón) */
.tcv-btn-arrow {
	width: 36px;
	height: 36px;
	min-width: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s ease;
	flex-shrink: 0;
}

.tcv-btn:hover .tcv-btn-arrow,
.tcv-btn:focus .tcv-btn-arrow {
	background: rgba(255, 255, 255, 0.35);
}

/* SVG dentro del círculo de flecha */
.tcv-btn-arrow svg {
	width: 14px;
	height: 14px;
	display: block;
	stroke: #ffffff;
	fill: none;
}

/* ── Aviso en el editor de Elementor ──────────────────────────── */
.tcv-editor-notice {
	background: #f7f7f7;
	border: 2px dashed #b5b5b5;
	padding: 24px 16px;
	text-align: center;
	border-radius: 12px;
	color: #555;
	font-size: 13px;
	line-height: 1.5;
}

/* ── Accesibilidad: focus visible ─────────────────────────────── */
.tcv-btn:focus-visible {
	outline: 3px solid rgba(232, 64, 90, 0.7);
	outline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════════
 * SLIDER / CARRUSEL
 * ═══════════════════════════════════════════════════════════════ */

.tcv-slider-wrapper {
	position: relative;
	width: 100%;
	--tcv-pv:   3;
	--tcv-pv-t: 2;
	--tcv-pv-m: 1;
	--tcv-gap:  20px;
	overflow: visible !important; /* flechas deben poder sobresalir */
}

/* Contenedor que oculta el overflow */
.tcv-slider-overflow {
	overflow: hidden;
	width: 100%;
}

/* Pista de slides */
.tcv-slider-track {
	display: flex;
	gap: var(--tcv-gap, 20px);
	transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

/* Cada slide */
.tcv-slide {
	flex: 0 0 calc(
		(100% - var(--tcv-gap, 20px) * (var(--tcv-pv, 3) - 1))
		/ var(--tcv-pv, 3)
	);
	max-width: calc(
		(100% - var(--tcv-gap, 20px) * (var(--tcv-pv, 3) - 1))
		/ var(--tcv-pv, 3)
	);
	box-sizing: border-box;
}

/* Tablet: usar --tcv-pv-t */
@media (max-width: 1024px) {
	.tcv-slide {
		flex-basis: calc(
			(100% - var(--tcv-gap, 20px) * (var(--tcv-pv-t, 2) - 1))
			/ var(--tcv-pv-t, 2)
		);
		max-width: calc(
			(100% - var(--tcv-gap, 20px) * (var(--tcv-pv-t, 2) - 1))
			/ var(--tcv-pv-t, 2)
		);
	}
}

/* Móvil: 1 por vista */
@media (max-width: 767px) {
	.tcv-slide {
		flex-basis: 100%;
		max-width: 100%;
	}
}

/* ── Contenedor Elementor: no puede recortar las flechas ─────── */
.elementor-widget-teducas_tutor_card_vertical .elementor-widget-container {
	overflow: visible !important;
}

/* ── Botones de navegación (flechas) ─────────────────────────── */
.tcv-slider-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;

	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none !important;
	cursor: pointer;
	padding: 0 !important;

	background: #ffffff !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);

	display: flex !important;
	align-items: center !important;
	justify-content: center !important;

	transition:
		background-color 0.25s ease,
		box-shadow       0.25s ease,
		transform        0.25s ease;
}

.tcv-slider-btn:hover,
.tcv-slider-btn:focus {
	background: #e8405a !important;
	box-shadow: 0 6px 20px rgba(232, 64, 90, 0.4);
	transform: translateY(-50%) scale(1.08);
	outline: none;
}

.tcv-slider-prev {
	left: -22px;
}

.tcv-slider-next {
	right: -22px;
}

/* Ocultar el SVG incrustado — la flecha se dibuja 100% con CSS */
.tcv-slider-btn svg {
	display: none !important;
}

/* Flecha CSS pura con pseudo-elemento (no puede ser bloqueada por el tema) */
.tcv-slider-btn::before {
	content: '' !important;
	display: block !important;
	width: 10px;
	height: 10px;
	border-top: 2.5px solid #333333;
	border-right: 2.5px solid #333333;
	border-bottom: none;
	border-left: none;
	flex-shrink: 0;
	transition: border-color 0.25s ease;
}

/* Chevron ‹ apuntando a la izquierda */
.tcv-slider-prev::before {
	transform: rotate(-135deg);
	margin-left: 3px;
}

/* Chevron › apuntando a la derecha */
.tcv-slider-next::before {
	transform: rotate(45deg);
	margin-right: 3px;
}

.tcv-slider-btn:hover::before,
.tcv-slider-btn:focus::before {
	border-color: #ffffff;
}

/* ── Puntos de paginación ────────────────────────────────────── */
.tcv-slider-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
}

.tcv-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.2);
	cursor: pointer;
	padding: 0;
	transition:
		background-color 0.3s ease,
		width            0.3s ease;
}

.tcv-dot--active {
	background: #e8405a;
	width: 24px;
	border-radius: 4px;
}

/* Ocultar flechas cuando el slider está en el borde */
.tcv-slider-wrapper[data-at-start="1"] .tcv-slider-prev,
.tcv-slider-wrapper[data-at-end="1"]   .tcv-slider-next {
	opacity: 0.3;
	pointer-events: none;
}

/* Accesibilidad: focus en botones de slider */
.tcv-slider-btn:focus-visible,
.tcv-dot:focus-visible {
	outline: 3px solid rgba(232, 64, 90, 0.7);
	outline-offset: 2px;
}
