/**
 * Interactive Three Cards — Podo / Elementor
 * Expanding cards con imagen de fondo a pantalla completa.
 */

.pti-three-cards {
	--pti-accent: #1237c5;
	--pti-text: #555555;
	--pti-title: #050505;
	--pti-overlay: rgba(255, 255, 255, 0.74);
	--pti-overlay-active: rgba(255, 255, 255, 0.66);
	--pti-radius: 40px;
	--pti-gap: 24px;
	--pti-card-height: 640px;
	--pti-height-active-mobile: 560px;
	--pti-flex-inactive: 1;
	--pti-flex-active: 1.75;
	--pti-transition: 600ms;
	--pti-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--pti-number-size: 72px;
	--pti-title-size: 40px;
	--pti-description-size: 24px;
	--pti-text-size: 16px;
	--pti-cta-size: 17px;

	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: var(--pti-gap);
	width: 100%;
	box-sizing: border-box;
}

/* --- Tarjeta --- */
.pti-three-card {
	position: relative;
	flex: var(--pti-flex-inactive) 1 0;
	min-width: 0;
	min-height: var(--pti-card-height);
	border-radius: var(--pti-radius);
	overflow: hidden;
	cursor: pointer;
	isolation: isolate;
	transition:
		flex var(--pti-transition) var(--pti-ease),
		box-shadow var(--pti-transition) var(--pti-ease),
		min-height var(--pti-transition) var(--pti-ease);
}

.pti-three-card.is-active {
	flex: var(--pti-flex-active) 1 0;
	box-shadow: 0 28px 70px rgba(20, 35, 90, 0.12);
}

/* Imagen de fondo a pantalla completa */
.pti-three-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: #e4eaf2;
	background-image: var(--pti-bg-image, none);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transform: scale(1);
	filter: saturate(0.88) contrast(0.95);
	transition: transform calc(var(--pti-transition) * 1.1) var(--pti-ease);
	z-index: 0;
}

.pti-three-card.is-active::before {
	transform: scale(1.03);
}

/* Overlay blanco translúcido */
.pti-three-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--pti-overlay);
	backdrop-filter: blur(1px);
	-webkit-backdrop-filter: blur(1px);
	transition: background var(--pti-transition) var(--pti-ease);
	z-index: 1;
	pointer-events: none;
}

.pti-three-card.is-active::after {
	background: var(--pti-overlay-active);
}

/* Botón para activación por teclado; el ratón usa la tarjeta completa */
.pti-three-card__trigger {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	pointer-events: none;
}

.pti-three-card__trigger:focus {
	outline: none;
}

.pti-three-card__trigger:focus-visible {
	outline: 3px solid var(--pti-accent);
	outline-offset: -6px;
	border-radius: calc(var(--pti-radius) - 6px);
}

/* Contenido unificado (sin panel inferior) */
.pti-three-card__content {
	position: relative;
	z-index: 2;
	height: 100%;
	min-height: inherit;
	padding: 72px 56px 48px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	box-sizing: border-box;
	pointer-events: auto;
}

.pti-three-card__number {
	font-size: var(--pti-number-size, 72px);
	line-height: 0.9;
	font-weight: 300;
	color: var(--pti-accent);
	margin: 0 0 48px;
}

.pti-three-card__kicker {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: var(--pti-text-size, 12px);
	line-height: 1;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #222222;
	margin: 0 0 18px;
}

.pti-three-card__kicker::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--pti-accent);
	flex: 0 0 auto;
}

.pti-three-card__title {
	font-size: var(--pti-title-size, 40px);
	line-height: 1.05;
	font-weight: 400;
	color: var(--pti-title);
	margin: 0 0 26px;
}

.pti-three-card__description {
	font-size: var(--pti-description-size, 24px);
	line-height: 1.45;
	font-weight: 500;
	color: #090909;
	max-width: 520px;
	margin: 0 0 36px;
	transition:
		opacity var(--pti-transition) var(--pti-ease),
		max-width var(--pti-transition) var(--pti-ease);
}

.pti-three-card__benefits {
	list-style: none;
	padding: 0;
	margin: 0 0 36px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	transition:
		opacity var(--pti-transition) var(--pti-ease),
		visibility var(--pti-transition) var(--pti-ease),
		transform var(--pti-transition) var(--pti-ease);
}

.pti-three-card__benefits li {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	color: var(--pti-text);
	font-size: var(--pti-text-size, 16px);
	line-height: 1.45;
	margin: 0;
}

.pti-three-card__benefits li::before {
	content: "✓";
	color: var(--pti-accent);
	font-weight: 500;
	flex: 0 0 auto;
}

.pti-three-card__cta {
	margin-top: auto;
	color: var(--pti-accent);
	font-size: var(--pti-cta-size, 17px);
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	pointer-events: auto;
	position: relative;
	z-index: 4;
	transition:
		opacity var(--pti-transition) var(--pti-ease),
		visibility var(--pti-transition) var(--pti-ease);
}

.pti-three-card__cta::after {
	content: "→";
	transition: transform 300ms ease;
}

.pti-three-card__cta:hover,
.pti-three-card__cta:focus-visible {
	text-decoration: underline;
}

.pti-three-card__cta:hover::after,
.pti-three-card__cta:focus-visible::after {
	transform: translateX(4px);
}

.pti-three-card__cta:focus-visible {
	outline: 2px solid var(--pti-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

.pti-three-card__details {
	width: 100%;
}

.pti-three-card__details-inner {
	min-height: 0;
}

/* Tarjetas inactivas: solo layout; tipografía la controla Elementor */
.pti-three-card:not(.is-active) .pti-three-card__description {
	max-width: 320px;
}

.pti-three-card:not(.is-active) .pti-three-card__benefits {
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	max-height: 0;
	margin-bottom: 0;
	overflow: hidden;
}

.pti-three-card:not(.is-active) .pti-three-card__cta {
	opacity: 0.85;
}

.pti-three-card.is-active .pti-three-card__benefits {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	max-height: 500px;
}

/* Editor Elementor: evitar overlay "Previsualizar" al mover el ratón sobre las cards */
.elementor-editor-active .elementor-element.elementor-widget-pti_interactive_three_cards > .elementor-element-overlay {
	pointer-events: none;
}

.elementor-editor-active .elementor-element:has(.pti-three-cards) .elementor-widget-empty {
	display: none !important;
}

.elementor-editor-active .elementor-widget-pti_interactive_three_cards .pti-three-cards,
.elementor-editor-active .elementor-widget-pti_interactive_three_cards .pti-three-card {
	pointer-events: auto;
}

/* Móvil — acordeón vertical */
@media (max-width: 767px) {
	.pti-three-cards,
	.pti-three-cards--accordion-mobile {
		flex-direction: column;
		gap: var(--pti-gap, 18px);
	}

	.pti-three-cards--scroll-active .pti-three-card {
		scroll-margin-top: clamp(72px, 14vh, 120px);
	}

	.pti-three-card,
	.pti-three-card.is-active {
		flex: none;
		width: 100%;
	}

	.pti-three-card {
		min-height: var(--pti-card-height, 240px);
		scroll-margin-top: 24px;
	}

	.pti-three-card.is-active {
		min-height: var(--pti-height-active-mobile, 560px);
	}

	.pti-three-card__details {
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows var(--pti-transition) var(--pti-ease);
	}

	.pti-three-card.is-active .pti-three-card__details {
		grid-template-rows: 1fr;
	}

	.pti-three-card__details-inner {
		overflow: hidden;
	}

	.pti-three-card:not(.is-active) .pti-three-card__description,
	.pti-three-card:not(.is-active) .pti-three-card__benefits,
	.pti-three-card:not(.is-active) .pti-three-card__cta {
		opacity: 0;
		visibility: hidden;
		margin: 0;
	}

	.pti-three-card.is-active .pti-three-card__description,
	.pti-three-card.is-active .pti-three-card__benefits,
	.pti-three-card.is-active .pti-three-card__cta {
		opacity: 1;
		visibility: visible;
	}

	.pti-three-cards.is-scroll-animating .pti-three-card {
		pointer-events: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pti-three-cards,
	.pti-three-card,
	.pti-three-card::before,
	.pti-three-card::after,
	.pti-three-card__description,
	.pti-three-card__benefits,
	.pti-three-card__cta {
		transition-duration: 0.01ms !important;
	}
}
