/* Reckon Comparison Table – Divi 4 module
   Front end renders a real <table>; the Visual Builder preview uses divs with
   the same classes. Every rule is scoped under .rkn-ct:not(#rkn) so it outranks theme
   table styles (e.g. Divi's .entry-content tr td). */

.rkn-ct:not(#rkn) {
	--rkn-cols: 4;
	--rkn-text: #0a004a;
	--rkn-card: #f3f2f7;
	--rkn-hl: #fbe9e6;
	--rkn-line: #d9d7e0;
	--rkn-pill: #ffffff;
	--rkn-tick: #5a3fff;
	--rkn-cross: #ff5447;
	--rkn-tab: #E8E7EC;
	--rkn-tab-hl: #FF5548;
	--rkn-tab-hl-text: #FFFFFF;
	--rkn-btn: #5a3fff;
	--rkn-btn-text: #ffffff;
	--rkn-badge: #e6e0ff;
	--rkn-badge-border: #c7bbff;
	--rkn-badge-text: #1b1146;
	--rkn-label-w: 30%;
	--rkn-logo-h: 44px;
	--rkn-logo-h-m: 33px;
	--rkn-radius: 14px;

	color: var(--rkn-text);
	line-height: 1.3;
}

.rkn-ct:not(#rkn) *,
.rkn-ct:not(#rkn) *::before,
.rkn-ct:not(#rkn) *::after {
	box-sizing: border-box;
}

/* Visual Builder wraps each child row in .et_pb_module */
.rkn-ct:not(#rkn) .et_pb_module {
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
}

.rkn-sr,
.rkn-ct:not(#rkn) .rkn-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------- Reset: neutralise site/theme table styles ----------
   Wipes everything a site-wide table style might apply (borders, padding,
   stripes, hover colours, fonts, text-transform, ::before labels...),
   then the module styles below rebuild the table from scratch. */

.rkn-ct:not(#rkn) table.rkn-ct__table,
.rkn-ct:not(#rkn) .rkn-ct__table :where(caption, colgroup, col, thead, tbody, tfoot, tr, th, td) {
	all: unset;
	box-sizing: border-box;
}

.rkn-ct:not(#rkn) .rkn-ct__table :where(thead, tbody, tfoot, tr, th, td)::before,
.rkn-ct:not(#rkn) .rkn-ct__table :where(thead, tbody, tfoot, tr, th, td)::after {
	content: none;
	display: none;
}

.rkn-ct:not(#rkn) table.rkn-ct__table {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	border: 0;
	table-layout: auto;
}

.rkn-ct:not(#rkn) .rkn-ct__table :where(thead, tbody) {
	display: block;
}

/* ---------- Grid ---------- */

.rkn-ct:not(#rkn) .rkn-ct__row {
	display: grid;
	grid-template-columns: var(--rkn-label-w) repeat(var(--rkn-cols), minmax(0, 1fr));
	column-gap: 6px;
}

.rkn-ct:not(#rkn) .rkn-ct__label {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 16px 12px 16px 0;
	border-bottom: 1px solid var(--rkn-line);
	font-size: 16px;
	font-weight: 700;
	text-align: left;
}

.rkn-ct:not(#rkn) .rkn-ct__cell {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 57px;
	padding: 10px 8px;
	background: var(--rkn-card);
	border-bottom: 1px solid var(--rkn-line);
	font-size: 16px;
	font-weight: 400;
	text-align: center;
}

.rkn-ct:not(#rkn) .rkn-ct__cell.is-hl {
	background: var(--rkn-hl);
}

/* Highlighted column in the Visual Builder (front end also gets .is-hl) */
.rkn-ct:not(#rkn)[data-hl="1"] .rkn-ct__body .rkn-ct__cell[data-col="1"],
.rkn-ct:not(#rkn)[data-hl="2"] .rkn-ct__body .rkn-ct__cell[data-col="2"],
.rkn-ct:not(#rkn)[data-hl="3"] .rkn-ct__body .rkn-ct__cell[data-col="3"],
.rkn-ct:not(#rkn)[data-hl="4"] .rkn-ct__body .rkn-ct__cell[data-col="4"],
.rkn-ct:not(#rkn)[data-hl="5"] .rkn-ct__body .rkn-ct__cell[data-col="5"],
.rkn-ct:not(#rkn)[data-hl="6"] .rkn-ct__body .rkn-ct__cell[data-col="6"] {
	background: var(--rkn-hl);
}

/* Unused columns in the Visual Builder (front end omits them entirely) */
.rkn-ct:not(#rkn)[data-cols="2"] .rkn-ct__body .rkn-ct__cell:is([data-col="3"], [data-col="4"], [data-col="5"], [data-col="6"]),
.rkn-ct:not(#rkn)[data-cols="3"] .rkn-ct__body .rkn-ct__cell:is([data-col="4"], [data-col="5"], [data-col="6"]),
.rkn-ct:not(#rkn)[data-cols="4"] .rkn-ct__body .rkn-ct__cell:is([data-col="5"], [data-col="6"]),
.rkn-ct:not(#rkn)[data-cols="5"] .rkn-ct__body .rkn-ct__cell[data-col="6"] {
	display: none;
}

/* Last feature row: no divider */
.rkn-ct:not(#rkn) .rkn-ct__body > .rkn-ct__row:last-child > *,
.rkn-ct:not(#rkn) .rkn-ct__body > :last-child .rkn-ct__row > * {
	border-bottom: 0;
}

/* ---------- Icons ---------- */

.rkn-ct:not(#rkn) .rkn-ct__icon {
	display: block;
	width: 36px;
	height: 36px;
}

.rkn-ct:not(#rkn) .rkn-ct__cell--tick .rkn-ct__icon {
	color: var(--rkn-tick);
}

.rkn-ct:not(#rkn) .rkn-ct__cell--cross .rkn-ct__icon {
	width: 32px;
	height: 32px;
	color: var(--rkn-cross);
}

/* ---------- Header ---------- */

.rkn-ct:not(#rkn) .rkn-ct__head > * {
	border-bottom: 0;
}

.rkn-ct:not(#rkn) .rkn-ct__colhead {
	flex-direction: column;
	justify-content: flex-start;
	padding: 28px 8px 20px;
	border-radius: var(--rkn-radius) var(--rkn-radius) 0 0;
}

/* Name: screen-reader/crawler only on desktop when a logo exists */
.rkn-ct:not(#rkn) .rkn-ct__colhead:not(.no-logo) .rkn-ct__name {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.rkn-ct:not(#rkn) .rkn-ct__colhead.no-logo .rkn-ct__name {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--rkn-logo-h);
	margin-bottom: 16px;
	font-size: 22px;
	font-weight: 700;
}

.rkn-ct:not(#rkn) .rkn-ct__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--rkn-logo-h);
	margin-bottom: 18px;
}

.rkn-ct:not(#rkn) .rkn-ct__logo img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.rkn-ct:not(#rkn) .rkn-ct__logo .rkn-ct__logo-m,
.rkn-ct:not(#rkn) .rkn-ct__note .rkn-ct__note-m {
	display: none;
}

.rkn-ct:not(#rkn) .rkn-ct__price {
	font-size: 32px;
	font-weight: 700;
	line-height: 1.1;
}

.rkn-ct:not(#rkn) .rkn-ct__period {
	margin-top: 12px;
	font-size: 14px;
	letter-spacing: 0.02em;
}

.rkn-ct:not(#rkn) .rkn-ct__note {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 12px 8px;
	background: var(--rkn-pill);
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
}

/* ---------- Cap (rounded card bottoms) ---------- */

.rkn-ct:not(#rkn) .rkn-ct__cap > * {
	min-height: 0;
	height: var(--rkn-radius);
	padding: 0;
	border: 0;
}

.rkn-ct:not(#rkn) .rkn-ct__cap .rkn-ct__cell {
	border-radius: 0 0 var(--rkn-radius) var(--rkn-radius);
}

.rkn-ct:not(#rkn) .rkn-ct__cap .rkn-ct__cell.is-open {
	border-radius: 0;
}

/* ---------- Footer (button + badge) ---------- */

.rkn-ct:not(#rkn) .rkn-ct__foot > * {
	min-height: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.rkn-ct:not(#rkn) .rkn-ct__foot .rkn-ct__cell.has-cta {
	flex-direction: column;
	gap: 28px;
	padding: 6px 8px 20px;
}

.rkn-ct:not(#rkn) .rkn-ct__foot .rkn-ct__cell.has-cta.is-hl {
	background: var(--rkn-hl);
	border-radius: 0 0 var(--rkn-radius) var(--rkn-radius);
}

.rkn-ct:not(#rkn) .rkn-ct__btn {
	display: block;
	width: 100%;
	padding: 11px 16px;
	background: var(--rkn-btn);
	border-radius: 999px;
	color: var(--rkn-btn-text);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	transition: filter 0.2s;
}

.rkn-ct:not(#rkn) .rkn-ct__btn:hover {
	color: var(--rkn-btn-text);
	filter: brightness(1.12);
}

.rkn-ct:not(#rkn) .rkn-ct__btn:focus-visible {
	outline: 2px solid var(--rkn-btn);
	outline-offset: 3px;
}

.rkn-ct:not(#rkn) .rkn-ct__badge {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 18px;
	background: var(--rkn-badge);
	border: 1px solid var(--rkn-badge-border);
	border-radius: 8px;
	color: var(--rkn-badge-text);
	font-size: 16px;
	line-height: 1.15;
	text-align: left;
}

.rkn-ct:not(#rkn) .rkn-ct__badge svg {
	flex: none;
	width: 28px;
	height: 28px;
	transform: rotate(-8deg);
}

.rkn-ct:not(#rkn) .rkn-ct__badge b,
.rkn-ct:not(#rkn) .rkn-ct__badge b + span {
	display: block;
}

.rkn-ct:not(#rkn) .rkn-ct__badge b {
	font-weight: 700;
}

.rkn-ct:not(#rkn) .rkn-ct__badge b + span {
	font-weight: 600;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
	.rkn-ct:not(#rkn) .rkn-ct__row {
		grid-template-columns: repeat(var(--rkn-cols), minmax(0, 1fr));
		column-gap: 3px;
	}

	/* Feature label spans the full width above its cells */
	.rkn-ct:not(#rkn) .rkn-ct__label {
		grid-column: 1 / -1;
		padding: 20px 8px 10px;
		border: 0;
	}

	.rkn-ct:not(#rkn) .rkn-ct__head .rkn-ct__label,
	.rkn-ct:not(#rkn) .rkn-ct__cap {
		display: none;
	}

	.rkn-ct:not(#rkn) .rkn-ct__cell {
		min-height: 32px;
		padding: 6px 4px;
		border: 0;
		font-size: 14px;
	}

	.rkn-ct:not(#rkn) .rkn-ct__colhead {
		padding: 0 4px 8px;
		border-radius: 0;
	}

	/* Name becomes the coloured tab at the top of each column */
	.rkn-ct:not(#rkn) .rkn-ct__head .rkn-ct__colhead .rkn-ct__name {
		position: static;
		display: block;
		align-self: stretch;
		width: auto;
		height: auto;
		min-height: 0;
		margin: 0 -4px 10px;
		padding: 8px 2px;
		overflow: visible;
		clip: auto;
		background: var(--rkn-tab);
		font-size: 13px;
		font-weight: 500;
		white-space: normal;
	}

	.rkn-ct:not(#rkn) .rkn-ct__head .rkn-ct__colhead.is-hl .rkn-ct__name {
		background: var(--rkn-tab-hl);
		color: var(--rkn-tab-hl-text);
	}

	.rkn-ct:not(#rkn) .rkn-ct__logo {
		height: var(--rkn-logo-h-m);
		margin-bottom: 10px;
	}

	/* Logos render at 33px high with their own proportions.
	   A logo wider than its column scales down to fit instead of overflowing. */
	.rkn-ct:not(#rkn) .rkn-ct__logo img {
		width: auto;
		height: var(--rkn-logo-h-m);
		max-width: 100%;
		max-height: none;
		object-fit: contain;
	}

	.rkn-ct:not(#rkn) .rkn-ct__logo .rkn-ct__logo-d,
	.rkn-ct:not(#rkn) .rkn-ct__note .rkn-ct__note-d {
		display: none;
	}

	.rkn-ct:not(#rkn) .rkn-ct__logo .rkn-ct__logo-m {
		display: block;
	}

	.rkn-ct:not(#rkn) .rkn-ct__note .rkn-ct__note-m {
		display: inline;
	}

	.rkn-ct:not(#rkn) .rkn-ct__price {
		font-size: 20px;
		font-weight: 500;
	}

	.rkn-ct:not(#rkn) .rkn-ct__period {
		display: none;
	}

	.rkn-ct:not(#rkn) .rkn-ct__note {
		margin-top: 10px;
		padding: 6px 2px;
		font-size: 13px;
	}

	.rkn-ct:not(#rkn) .rkn-ct__icon {
		width: 23px;
		height: 23px;
	}

	.rkn-ct:not(#rkn) .rkn-ct__cell--cross .rkn-ct__icon {
		width: 20px;
		height: 20px;
	}

	/* Button + badge go full width under the table */
	.rkn-ct:not(#rkn) .rkn-ct__foot {
		display: block;
		margin-top: 28px;
	}

	.rkn-ct:not(#rkn) .rkn-ct__foot > :not(.has-cta) {
		display: none;
	}

	.rkn-ct:not(#rkn) .rkn-ct__foot .rkn-ct__cell.has-cta,
	.rkn-ct:not(#rkn) .rkn-ct__foot .rkn-ct__cell.has-cta.is-hl {
		gap: 24px;
		padding: 0;
		background: transparent;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rkn-ct:not(#rkn) .rkn-ct__btn {
		transition: none;
	}
}
