/**
 * Pricing tables — tabs + plan cards.
 * Intro copy is core Heading / Paragraph above this block.
 * Outer vertical spacing via Spacer blocks.
 */

.pricing-tables {
	width: 100%;
}

/*
 * Flex gaps own the rhythm. Prose p+p / p+ul rules are highly specific
 * (nested :is/:not) — force-reset inside pricing cards only.
 */
body.legalion-gutenberg .pricing-tables :is(p, ul, ol),
.editor-styles-wrapper .pricing-tables :is(p, ul, ol) {
	margin-block: 0 !important;
}

.pricing-tables__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4rem;
	width: 100%;
	max-width: 81.25rem;
	margin-inline: auto;
	padding-inline: 1.5rem;
	box-sizing: border-box;
}

/* Tabs */
.pricing-tables__tabs {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.375rem;
	border: 1px solid #e5e5e5;
	border-radius: 0.75rem;
	background: #fafafa;
	box-sizing: border-box;
}

.pricing-tables__tab {
	appearance: none;
	margin: 0;
	border: 0;
	background: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.5rem 0.625rem;
	border-radius: 0.375rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	color: #737373;
	cursor: pointer;
	white-space: nowrap;
}

.pricing-tables__tab.is-active {
	background: #d5c4ee;
	color: #513370;
	box-shadow:
		0 0 0 2px #fff,
		0 0 0 4px #a178d4;
}

.pricing-tables__tab:focus-visible {
	outline: 2px solid #a178d4;
	outline-offset: 2px;
}

/* Panels / cards */
.pricing-tables__panels {
	width: 100%;
	max-width: 67.5rem;
}

.pricing-tables__panel {
	width: 100%;
}

.pricing-tables__panel[hidden] {
	display: none;
}

.pricing-tables__cards {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 2rem;
	width: 100%;
	/* Allow "Odporúčané" badge to sit above the card edge. */
	overflow: visible;
	padding-top: 0.9375rem;
}

.pricing-tables__cards--single {
	justify-content: center;
}

.pricing-tables__card {
	--pricing-card-radius: 1rem;
	/* Inner fills sit inside the 1px border; match curve so corners aren’t square. */
	--pricing-card-inner-radius: calc(var(--pricing-card-radius) - 1px);
	position: relative;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--pricing-card-radius);
	background: #fafafa;
	box-sizing: border-box;
}

.pricing-tables__card--single {
	flex: 0 1 32.75rem;
	max-width: 32.75rem;
}

.pricing-tables__card--featured {
	/* Badge sits above the card edge — children must carry their own radii. */
	overflow: visible;
	border-color: #8a5ac3;
}

.pricing-tables__badge {
	position: absolute;
	top: -0.9375rem;
	left: 50%;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	background: #d5c4ee;
	color: #3f205f;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25rem;
	white-space: nowrap;
	transform: translateX(-50%);
}

/*
 * Card header — Figma 17257:2314
 * padding 40 / 32 / 32 · gap 32 between heading stack and actions
 */
.pricing-tables__card-header {
	display: flex;
	flex-direction: column;
	gap: 2rem; /* 32px */
	padding: 2.5rem 2rem 2rem; /* 40px 32px 32px */
	box-sizing: border-box;
}

.pricing-tables__card--featured .pricing-tables__card-header {
	background: #3f205f;
	border-radius: var(--pricing-card-inner-radius) var(--pricing-card-inner-radius) 0 0;
}

/* Title → price block: 32px */
.pricing-tables__card-heading {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	width: 100%;
}

.pricing-tables__plan-heading {
	display: flex;
	flex-direction: column;
	gap: 0.25rem; /* 4px — title to tagline */
	width: 100%;
}

.pricing-tables__plan-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 2rem;
	color: #7447a9;
}

.pricing-tables__card--featured .pricing-tables__plan-title {
	color: #e7def6;
}

.pricing-tables__plan-tagline {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25rem;
	color: #7447a9;
}

.pricing-tables__card--featured .pricing-tables__plan-tagline {
	color: #bb9ee2;
}

/* Price block → note: 20px */
.pricing-tables__price {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
}

/* Amount ↔ period (or custom ↔ subtitle): 4px */
.pricing-tables__price-main {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	width: 100%;
}

.pricing-tables__price-amount {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem;
	margin: 0;
	font-size: 3rem;
	font-weight: 600;
	line-height: 3.75rem; /* 60px — Figma display-lg */
	letter-spacing: -0.06rem;
	color: #513370;
}

.pricing-tables__price-amount--from {
	font-size: 0;
	line-height: 0;
	letter-spacing: 0;
}

.pricing-tables__price-prefix {
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 2rem;
	letter-spacing: -0.03rem;
	color: inherit;
}

.pricing-tables__price-amount--from .pricing-tables__price-value {
	font-size: 3rem;
	font-weight: 600;
	line-height: 3.75rem;
	letter-spacing: -0.06rem;
}

.pricing-tables__card--featured .pricing-tables__price-amount {
	color: #fff;
}

.pricing-tables__price-period {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	color: #404040;
}

.pricing-tables__card--featured .pricing-tables__price-period {
	color: #d5c4ee;
}

.pricing-tables__price-vat {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	color: #737373;
}

.pricing-tables__card--featured .pricing-tables__price-vat {
	color: #d5c4ee;
}

.pricing-tables__price-custom {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 2rem;
	color: #513370;
}

.pricing-tables__price-subtitle {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	color: #404040;
}

.pricing-tables__price-note {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.25rem;
	color: #525252;
}

.pricing-tables__card--featured .pricing-tables__price-note {
	color: #d5c4ee;
}

.pricing-tables__actions {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: 100%;
}

.pricing-tables__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.75rem 1.125rem;
	border-radius: 9999px;
	background: #633e8b;
	color: #fff;
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	box-sizing: border-box;
	transition: background-color 0.15s ease;
}

.pricing-tables__toggle {
	appearance: none;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	width: 100%;
	margin: 0;
	padding: 0.75rem 1.125rem;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	color: #525252;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	cursor: pointer;
	box-sizing: border-box;
}

.pricing-tables__toggle:focus-visible {
	outline: 2px solid #a178d4;
	outline-offset: 2px;
}

.pricing-tables__toggle::after {
	content: "";
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
	background-color: currentColor;
	mask: url("../../assets/img/icon-chevron-down.svg") center / contain no-repeat;
	-webkit-mask: url("../../assets/img/icon-chevron-down.svg") center / contain no-repeat;
	transition: transform 0.15s ease;
}

.pricing-tables__card.is-expanded .pricing-tables__toggle::after {
	transform: rotate(180deg);
}

.pricing-tables__card--featured .pricing-tables__toggle {
	color: #e7def6;
}

.pricing-tables__cta:hover,
.pricing-tables__cta:focus-visible {
	background: #513370;
	color: #fff;
}

.pricing-tables__card--featured .pricing-tables__cta {
	background: #faf7fd;
	color: #513370;
}

.pricing-tables__card--featured .pricing-tables__cta:hover,
.pricing-tables__card--featured .pricing-tables__cta:focus-visible {
	background: #fff;
	color: #513370;
}

/*
 * Card body — Figma 17257:2324
 * padding 40 / 32 · gap 32 between feature groups
 */
.pricing-tables__card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2rem; /* 32px */
	padding: 2.5rem 2rem; /* 40px 32px */
	background: #fff;
	border-radius: 0 0 var(--pricing-card-inner-radius) var(--pricing-card-inner-radius);
	box-sizing: border-box;
}

/* Heading → list: 16px */
.pricing-tables__features {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	width: 100%;
}

.pricing-tables__features-heading {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5rem;
	color: #513370;
}

.pricing-tables__feature-list {
	display: flex;
	flex-direction: column;
	gap: 0.375rem; /* 6px */
	margin: 0;
	padding: 0;
	list-style: none;
}

.pricing-tables__feature {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

.pricing-tables__feature-icon {
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.5rem;
	overflow: hidden;
	border-radius: 9999px;
}

.pricing-tables__feature-icon img {
	display: block;
	width: 100%;
	height: 100%;
}

.pricing-tables__feature-text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.25rem;
	color: #525252;
}

.pricing-tables__feature-text--lead {
	font-weight: 600;
	color: #513370;
}

/* Editor placeholder */
.pricing-tables--editor .pricing-tables__editor-placeholder {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
	max-width: 40rem;
	margin-inline: auto;
	padding: 2rem 1.5rem;
	border: 1px dashed #d5c4ee;
	border-radius: 1rem;
	background: #faf7fd;
	text-align: center;
	box-sizing: border-box;
}

.pricing-tables__editor-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: #513370;
}

.pricing-tables__editor-help {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.4;
	color: #525252;
}

@media (min-width: 961px) {
	.pricing-tables__toggle {
		display: none;
	}

	.pricing-tables__card-body {
		display: flex;
	}
}

@media (max-width: 960px) {
	.pricing-tables__cards:not(.pricing-tables__cards--single) {
		flex-direction: column;
		align-items: stretch;
	}

	/*
	 * Desktop cards use flex: 1 1 0 for equal columns. In a column stack that
	 * collapses non-featured cards (overflow:hidden + flex-basis 0) to ~0 height.
	 */
	.pricing-tables__card {
		flex: 0 0 auto;
		width: 100%;
		overflow: visible;
	}

	.pricing-tables__card--single {
		flex: 0 0 auto;
		max-width: none;
	}

	.pricing-tables__toggle {
		display: inline-flex;
	}

	.pricing-tables__card-body {
		display: none;
	}

	.pricing-tables__card.is-expanded .pricing-tables__card-body {
		display: flex;
	}

	/* Featured: full-radius header when body is collapsed. */
	.pricing-tables__card--featured:not(.is-expanded) .pricing-tables__card-header {
		border-radius: var(--pricing-card-inner-radius);
	}
}

@media (max-width: 781px) {
	.pricing-tables__inner {
		gap: 2.5rem;
		padding-inline: 1rem;
	}

	.pricing-tables__tabs {
		flex-wrap: wrap;
		justify-content: center;
		width: 100%;
	}

	.pricing-tables__tab {
		flex: 1 1 auto;
	}

	.pricing-tables__card-header,
	.pricing-tables__card-body {
		padding-inline: 1.25rem;
	}

	.pricing-tables__price-amount,
	.pricing-tables__price-amount--from .pricing-tables__price-value {
		font-size: 2.5rem;
		line-height: 3rem;
	}
}
