.cdf-campaign-tabs,
.cdf-template-tabs {
	--cdf-campaign-blue: #40b1b9;
	--cdf-campaign-green: #99ca3c;
	--cdf-campaign-yellow: #f1ba22;
	--cdf-campaign-red: #da4646;
	width: 100%;
}

.cdf-campaign-tabs__list,
.cdf-template-tabs__list {
	display: grid;
	grid-template-columns: repeat(var(--cdf-tabs-count, 3), minmax(0, 1fr));
	align-items: end;
	gap: 18px;
	margin: 0 0 42px;
	border-bottom: 2px solid var(--cdf-tabs-accent, var(--cdf-campaign-green));
}

.cdf-campaign-tabs__tab,
.cdf-template-tabs__tab {
	position: relative;
	min-height: 58px;
	margin: 0 !important;
	padding: 12px 20px !important;
	border: 2px solid currentColor !important;
	border-bottom: 0 !important;
	border-radius: 13px 13px 0 0 !important;
	background: #fff !important;
	box-shadow: none !important;
	font-family: "Raleway", sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.2s ease, color 0.2s ease;
}


.cdf-campaign-tabs__tab {
	color: var(--cdf-campaign-green) !important;
}

.cdf-campaign-tabs__tab:nth-child(2) {
	color: var(--cdf-campaign-yellow) !important;
}

.cdf-campaign-tabs__tab:nth-child(3) {
	color: var(--cdf-campaign-red) !important;
}

.cdf-campaign-tabs__list {
	position: relative;
	gap: 34px;
	width: min(100%, 1226px);
	margin-right: auto;
	margin-left: auto;
	border-bottom: 0;
}

.cdf-campaign-tabs__list::after {
	position: absolute;
	bottom: -10px;
	left: 50%;
	width: 100vw;
	height: 14px;
	content: '';
	background-color: var(--cdf-tabs-accent, var(--cdf-campaign-green));
	transform: translateX(-50%);
	-webkit-mask: url('../img/linhacampanhasverde.svg') center / 991px 14px repeat-x;
	mask: url('../img/linhacampanhasverde.svg') center / 991px 14px repeat-x;
	z-index: 0;
	pointer-events: none;
}

.cdf-campaign-tabs__tab {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 386 / 133;
	min-height: 0;
	padding: 14px 24px 18px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	font-family: 'Chalkduster', cursive;
	font-size: clamp(18px, 2vw, 23px) !important;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	isolation: isolate;
	z-index: 1;
}

.cdf-campaign-tabs__tab::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	content: '';
	background-color: currentColor;
	-webkit-mask: url('../img/retangulocampanhasverde.svg') center / 100% 100% no-repeat;
	mask: url('../img/retangulocampanhasverde.svg') center / 100% 100% no-repeat;
	pointer-events: none;
}

.cdf-campaign-tabs__tab.is-active {
	background: #fff !important;
}

.cdf-campaign-tabs__tab:hover:not(.is-active),
.cdf-campaign-tabs__tab:focus-visible:not(.is-active) {
	background: transparent !important;
}

.cdf-template-tabs__tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: var(--cdf-template-tab-color, var(--cdf-campaign-green)) !important;
}

/* The template tabs use the hand-drawn SVG artwork rather than CSS borders. */
.cdf-template-tabs__list {
	position: relative;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 47px;
	width: min(100%, 780px);
	margin-right: auto;
	margin-left: auto;
	border-bottom: 0;
}

.cdf-template-tabs__list::after {
	position: absolute;
	/* Align the line with the bottom of the SVG's open vertical strokes. */
	bottom: 21px;
	left: 50%;
	width: 100vw;
	height: 14px;
	content: '';
	background-color: var(--cdf-tabs-accent, var(--cdf-campaign-green));
	transform: translateX(-50%);
	-webkit-mask: url('../img/linhacompridaseparadores.svg') center / 780px 14px repeat-x;
	mask: url('../img/linhacompridaseparadores.svg') center / 780px 14px repeat-x;
	z-index: 0;
	pointer-events: none;
}

.cdf-template-tabs__tab {
	/* Match the 386 x 201 tab frame in the Figma layout. */
	aspect-ratio: 386 / 201;
	min-height: 0;
	padding: 16px 20px 28px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	isolation: isolate;
	z-index: 1;
}

/* The active tab covers the line beneath it; inactive tabs stay open. */
.cdf-template-tabs__tab.is-active {
	background: #fff !important;
}

.cdf-template-tabs__tab:hover:not(.is-active),
.cdf-template-tabs__tab:focus-visible:not(.is-active) {
	background: transparent !important;
}

/* Template separators have a fixed two-tab colour system. */
.cdf-template-tabs__tab:nth-child(1) {
	color: #f2a23a !important;
}

.cdf-template-tabs__tab:nth-child(2) {
	color: #d96969 !important;
}

.cdf-template-tabs__tab::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	content: '';
	background-color: currentColor;
	-webkit-mask: url('../img/retangulooseparador.svg') center / 100% 100% no-repeat;
	mask: url('../img/retangulooseparador.svg') center / 100% 100% no-repeat;
	pointer-events: none;
}

.cdf-template-tabs__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	padding-top: 10px;
}

.cdf-template-tabs__icon img {
	display: block;
	max-width: 98px;
	max-height: 96px;
	width: auto;
	height: auto;
}

.cdf-template-tabs__label {
	display: inline-block;
	font-family: 'Chalkduster', cursive;
	font-size: 25px;
	font-style: normal;
	font-weight: 400;
	line-height: 35px;
	letter-spacing: normal;
	text-align: center;
	vertical-align: middle;
}

.cdf-campaign-tabs__tab:hover,
.cdf-campaign-tabs__tab:focus-visible,
.cdf-campaign-tabs__tab.is-active,
.cdf-template-tabs__tab:hover,
.cdf-template-tabs__tab:focus-visible,
.cdf-template-tabs__tab.is-active {
	transform: translateY(3px);
	background: #fff !important;
	box-shadow: none !important;
}

.cdf-campaign-tabs__tab:focus-visible,
.cdf-template-tabs__tab:focus-visible {
	outline: 2px solid var(--cdf-campaign-blue);
	outline-offset: 4px;
}

.cdf-template-tabs .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cdf-campaign-tabs__panel,
.cdf-template-tabs__panel {
	min-width: 0;
}

/* Saved Elementor containers lose their document-scoped flex setting when embedded. */
.cdf-campaign-tabs__panel .e-con.e-parent,
.cdf-campaign-tabs__panel .e-flex.e-parent,
.cdf-template-tabs__panel .e-con.e-parent,
.cdf-template-tabs__panel .e-flex.e-parent {
	--flex-direction: column !important;
	flex-direction: column !important;
}

.cdf-campaign-tabs__panel[hidden],
.cdf-template-tabs__panel[hidden] {
	display: none !important;
}

@media (max-width: 767px) {
	.cdf-campaign-tabs__list,
	.cdf-template-tabs__list {
		gap: 7px;
		margin-bottom: 28px;
	}

	.cdf-campaign-tabs__list {
		grid-template-columns: repeat(3, 103px);
		justify-content: center;
		gap: 8px;
		width: min(100%, 325px);
	}

	.cdf-campaign-tabs__list::after {
		bottom: 10px;
		height: 6px;
		transform: translateX(-50%) scaleY(0.45);
		transform-origin: center bottom;
		-webkit-mask-size: 340px 14px;
		mask-size: 340px 14px;
	}

	.cdf-template-tabs__list {
		grid-template-columns: repeat(2, 103px);
		gap: 16px;
		width: 222px;
	}

	.cdf-template-tabs__list::after {
		bottom: 5px;
		height: 6px;
		transform: translateX(-50%) scaleY(0.45);
		transform-origin: center bottom;
		-webkit-mask: url('../img/linhacurtaseparador.svg') center / 344px 14px repeat-x;
		mask: url('../img/linhacurtaseparador.svg') center / 344px 14px repeat-x;
	}

	.cdf-campaign-tabs__tab,
	.cdf-template-tabs__tab {
		min-height: 54px;
		padding: 8px 6px !important;
		font-size: 12px !important;
	}

	.cdf-campaign-tabs__tab {
		aspect-ratio: auto;
		height: 68px !important;
		min-height: 0;
		padding: 0px 5px 10px !important;
		font-size: 10px !important;
		line-height: 1.15;
		white-space: normal;
		overflow-wrap: anywhere;
		text-wrap: balance;
	}

	/* Scale the SVG frame only; the tab label retains its 12px size. */
	.cdf-campaign-tabs__tab::before {
		transform: scaleY(1.25);
		transform-origin: center bottom;
	}

	/* Keep every campaign tab aligned with the selected tab. */
	.cdf-campaign-tabs__tab:not(.is-active) {
		transform: translateY(9px);
	}

	.cdf-campaign-tabs__label {
		display: block;
		max-width: 100%;
		white-space: normal !important;
		overflow-wrap: anywhere;
		transform: translateY(-5px);
	}

	.cdf-template-tabs__tab {
		aspect-ratio: 103 / 53;
		min-height: 0;
		padding: 8px 6px 14px !important;
	}

	.cdf-template-tabs__tab:has(.cdf-template-tabs__icon) {
		padding: 0 !important;
	}

	.cdf-template-tabs__label {
		font-size: 12px;
		line-height: 14px;
	}

	.cdf-template-tabs__icon img {
		max-width: 28px;
		max-height: 28px;
	}
}
