@import "../../shared";

$redesign-table-cell-max-width: 280px;

.plan-features-2023-grid__header {
	display: flex;
	position: relative;
	align-items: flex-start;
	padding-inline: 20px 0;
	padding-block: 0 8px;
	background-color: var(--color-surface);
	justify-content: flex-start;
	font-weight: 400;

	&.is-woo-hosted-basic-plan {
		align-items: center;
		gap: 12px;
	}
}

.plan-features-2023-grid__header-logo {
	padding-left: 20px;

	@include plans-grid-medium-large {
		margin-top: 32px;
	}

	.plan-features-2023-grid__table-top & {
		@include plans-grid-large {
			margin-top: 62px;
		}
	}
}

.plan-features-2023-grid__plan-logo {
	margin-bottom: 9px;
}

.plan-features-2023-grid__header-text {
	flex: 1;
	padding: 6px 0 0;
}

.plan-features-2023-grid__actions-signup-plan-text {
	display: block;
}

.plan-features-2023-grid__actions-downgrade-context-mobile {
	font-size: $font-body-extra-small;
	margin-top: 10px;
}

.plans-grid-next-features-grid__mobile-plan-card-foldable-container {
	&.foldable-card.card {
		box-shadow: unset;
		margin-top: 24px;

		.foldable-card__main {
			font-weight: 500;
			font-size: $font-body-small;
			letter-spacing: -0.24px;
			line-height: 20px;

			* {
				color: inherit;
			}

			.foldable-card__expand .gridicon {
				width: 14px;
				fill: currentColor;
			}
		}

		&.is-compact .foldable-card__header {
			padding: 0 20px;
		}

		&.is-expanded {
			margin-top: 24px;

			.foldable-card__content {
				border-top: none;
				padding: 12px 0 0;
			}
		}

		.plans-grid-next-features-grid__mobile-plan-card.is-free-plan & {
			.foldable-card__main {
				color: var(--studio-blue-50);
			}
		}

		.plans-grid-next-features-grid__mobile-plan-card.is-personal-plan & {
			.foldable-card__main {
				color: var(--studio-blue-60);
			}
		}

		.plans-grid-next-features-grid__mobile-plan-card.is-premium-plan & {
			.foldable-card__main {
				color: var(--studio-blue-70);
			}
		}

		.plans-grid-next-features-grid__mobile-plan-card.is-business-plan & {
			.foldable-card__main {
				color: var(--studio-woocommerce-purple-50);
			}
		}

		.plans-grid-next-features-grid__mobile-plan-card.is-ecommerce-plan & {
			.foldable-card__main {
				color: var(--studio-woocommerce-purple-60);
			}
		}

		.plans-grid-next-features-grid__mobile-plan-card.is-wpcom-enterprise-plan & {
			.foldable-card__main {
				color: var(--studio-gray-80);
			}
		}
	}
}

.plan-features-2023-grid__mobile-view {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 20px;
	margin: 0 auto;
	max-width: $mobile-card-max-width;

	.plans-grid-next-features-grid__mobile-plan-card {
		background-color: var(--studio-white);
		border: 1px solid #e0e0e0;
		border-radius: 4px;
		padding: 20px 0 20px 0;

		/*
		 * TODO: Remove/refactor this once we have a better way to handle.
		 * .is-section-plans refers to external context.
		 */
		@include plans-grid-medium-large {
			.is-section-plans & {
				margin-left: 0;
				margin-right: 0;
			}
		}

		&:first-of-type {
			margin-top: 0;
		}

		.plan-features-2023-grid__table-item {
			.plans-grid-next-plan-storage {
				padding-top: 0;
			}
		}

		.plan-features-2023-grid__header,
		.plan-features-2023-grid__header-logo,
		.plans-grid-next-header-price,
		.plan-features-2023-grid__header-tagline,
		.plan-features-2023-grid__header-billing-info,
		.plan-features-2023-grid__table-item.is-top-buttons,
		.plan-features-2023-grid__item {
			padding-inline: 16px;
		}
	}

	.plans-grid-next-storage-feature-label__volume {
		font-size: 14px;
		font-weight: 500;
	}

	.plan-features-2023-grid__highlighted-feature .plan-features-2023-grid__item {
		padding-top: 16px;
	}

	.plan-features-2023-grid__header-title {
		line-height: normal;
	}

	.plan-features-2023-grid__table-item .is-experiment-last-feature {
		margin-block-end: 0;
	}

	.plan-features-2023-grid__header {
		padding-block-end: 0;
	}

	.plan-features-2023-grid__header-tagline {
		font-size: 14px;
		padding: 0 20px 16px 20px
	}
}

.plan-features-2023-grid__table {
	font-size: $font-body-small;
	color: var(--color-text-subtle);
	table-layout: fixed;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background-color: #fff;
	margin: 0 auto;
	border-spacing: 0;
	width: 100%;

	&.has-highlighted-plan {
		// margin (not padding) to not break internal borders/layout
		margin-top: 35px; // enough to cover `plans-grid__popular-badge` repositioning (top: -35px)
	}

	&.has-1-cols {
		max-width: $table-cell-max-width;
	}

	&.has-2-cols {
		max-width: $table-cell-max-width * 2;
	}

	&.has-3-cols {
		max-width: $table-cell-max-width * 3;
	}

	&.has-4-cols {
		max-width: $table-cell-max-width * 4;
	}
}

.plan-features-2023-grid__header-title {
	margin-top: 0;
	margin-bottom: 5px;
	font-size: $font-title-large;
	line-height: 0.7;
	color: var(--studio-gray-100);
	font-weight: 400;
	@include onboarding-font-recoleta;
	letter-spacing: 0;
}

.plan-features-2023-grid__header-badge {
	background-color: var(--studio-blue-5);
	color: var(--studio-blue-50);
	border-radius: 3px;
	display: inline-block;
	font-size: $font-body-extra-small;
	font-weight: 500;
	line-height: 20px;
	padding: 0 8px;
	white-space: nowrap;
}

.plan-features-2023-grid__header-tagline {
	font-size: $font-body;
	line-height: 24px;
	color: var(--studio-gray-80);
	font-weight: 400;
	padding: 0 20px 24px 20px;
	margin-bottom: 0;

	@include plans-grid-medium-large {
		font-size: $font-body-small;
		line-height: 20px;
	}

	@include plans-grid-large {
		font-size: 0.813rem; /* stylelint-disable-line */
		line-height: 16px;
		padding-bottom: 8px;
		min-height: 50px;
		text-wrap: balance;
	}
}

.plan-features-2023-grid__table-item {
	text-align: left;
	transition: opacity 0.05s;
	border: none;
	background-color: var(--color-surface);
	position: relative;
	vertical-align: top;

	.is-bold {
		font-weight: 600;
	}

	.is-plan-differentiators-experiment & .has-min-height {
		min-height: 32px;
	}

	&.is-top-buttons {
		padding: 0 20px;
		@include plans-grid-medium-large {
			button {
				margin-top: 16px;
				margin-bottom: 16px;
			}
		}
	}

	@include plans-grid-medium-large {
		// The .plan-features-2023-grid__table-item is used to render the plan spotlight which doesn't
		// use a table layout, but borders are only appropriate in table layout.
		&:is(td, th) {
			border-left: solid 1px #e0e0e0;
		}
	}
}

.plan-features-2023-grid__desktop-view,
.plan-features-2023-grid__tablet-view {
	.plan-features-2023-grid__table-item {
		max-width: $table-cell-max-width;
	}
}

.plan-features-2023-grid__plan-spotlight {
	background-color: var(--studio-white);
	position: relative;
	max-width: 100%;
	margin-bottom: 64px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	display: flex;
	justify-content: space-between;

	div.spotlight-plan__buttons  {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	div.plan-features-2023-grid__table-item {
		border: none;

		&.plan-features-2023-grid__header-billing-info {
			padding-bottom: 16px;

			@include plans-grid-medium-large {
				padding-bottom: 16px;
			}
		}

		&.popular-plan-parent-class .plan-features-2023-grid__popular-badge {
			padding-bottom: 23px;
			@include plans-grid-medium-large {
				position: unset;
				border: none;
			}
		}

		.plan-features-2023-grid__header-title {
			margin-top: 24px;
		}

		.plan-features-2023-grid__header-tagline {
			min-height: 0;
			padding-bottom: 16px;
		}

		.plan-features-2023-grid__header-logo {
			display: none;
		}
	}
}

.plans-grid-next-features-grid__feature-group-title {
	font-weight: 600;
	color: var(--studio-gray-80);

	&.is-wordpress-hosting {
		padding-top: 12px;
		font-size: 12px;
	}
}

.plans-grid-next-features-grid__feature-group-row {
	> .plan-features-2023-grid__table-item {
		padding-top: 24px;
	}

	/**
	 * This is only relevant to match the styling for the Enterprise plan's parter logos,
	 * which should probably be cleaned-up/refactored instead
	 */
	&.is-first-feature-group-row > .plan-features-2023-grid__table-item {
		@include plans-grid-medium-large {
			padding-top: 14px;
		}
	}

	&.is-reduced-feature-group-spacing > .plan-features-2023-grid__table-item {
		padding-top: 0;
	}
}

.plan-features-2023-grid__item-info {
	display: flex;
	flex-direction: column;
	flex: 1 0 0;
	width: 100%;

	.plan-features-2023-grid__ai-website-builder-break {
		@media ( max-width: 480px ) {
			display: none;
		}
	}

	.plan-features-2023-grid__item-title {
		color: var(--studio-gray-80);
		font-size: $font-body-small;
		font-weight: 400;
		line-height: 20px;
		overflow-wrap: break-word;
		text-wrap: balance; // Fallback until Safari supports `pretty`.
		text-wrap: pretty;
		margin: 0;
		flex: 1 0 0;
		width: 100%;

		&.is-bold {
			font-weight: 600;
		}

		// Experiment variants: domain included text gets green color
		// Applies to variants with "Everything in X, plus:" features (not focused long-list or control)
		&.is-domain-included-highlight {
			color: var(--studio-green-60);
		}

		@include plans-grid-medium-large {
			font-size: $font-body-extra-small;
			line-height: 16px;
		}
	}

	&:not(.is-available) {
		color: var(--studio-gray-20);

		.plan-features-2023-grid__item-title {
			text-decoration: line-through;
		}
	}

	.plan-features-2023-grid__item-sub-feature-list {
		margin-bottom: 0;
		& > li {
			margin-top: 8px;
		}
	}
}

// Pricing differentiators experiment (non-control): extra bottom margin after last feature in column
.plan-features-2023-grid__table-item .is-experiment-last-feature {
	margin-block-end: 37px;
}

.plan-features-2023-grid__row:last-of-type .plan-features-2023-grid__table-item {
	border-bottom: solid 1px var(--color-neutral-5);

	&.is-last-feature {
		.plan-features-2023-grid__item-info {
			padding-bottom: 30px;
		}
	}
}

.plan-features-2023-grid__item {
	padding: 0 20px 12px;
	text-align: left;

	.is-plan-differentiators-experiment & {
		padding-inline-end: 12px;
	}

	&.plan-features-2023-grid__item-available {
		display: flex;
		flex-direction: column;
		position: relative;

		& .plan-features-2023-grid__item-info-container {
			display: flex;
		}
	}

	.plan-features-2023-grid__common-title + & {
		padding-top: 24px;

		@include plans-grid-medium-large {
			padding-top: 14px;
		}
	}
}

.plan-features-2023-grid__item-logos {
	padding-top: 28px;

	@include plans-grid-medium-large {
		padding-top: 18px;
	}
}

.plan-features-2023-grid__item-checkmark.is-placeholder {
	visibility: hidden;
}

.plan-features-2023-grid__feature-badge.is-placeholder {
	visibility: hidden;
}

.plan-features-2023-grid__content {
	.plan-features-2023-grid__table-bottom {
		margin-top: 54px;
	}
}


/* stylelint-disable-next-line no-duplicate-selectors */
.plan-features-2023-grid__table-item {
	.plan-features-2023-grid__common-title {
		@include plans-grid-medium-large {
			margin-top: 20px;
			font-size: $font-body-extra-small;
		}
	}

	&.plan-features-2023-grid__header-billing-info {
		@include plans-grid-medium-large {
			padding-bottom: 0;
		}
	}

	&.popular-plan-parent-class {
		.plan-features-2023-grid__popular-badge {
			@include plans-grid-medium-large {
				position: absolute;
				top: -35px; // at -35px this covers the top border of the table, including its top-right radius, as intended
				right: -1px;
				border-color: #e0e0e0;
				border-width: 1px 1px 0 1px;
				/* stylelint-disable-next-line scales/radii */
				border-radius: 5px 5px 0 0;
				border-style: solid;
				padding-top: 20px;
				margin-bottom: 0;

				.plans-grid__plan-pill {
					transform: translate(20px, 0);
				}
			}
		}
	}
}

/**
 * TODO clk consolidate with the rest above
 */
.plans-grid-next {
	// insignificant padding important to prevent parent/child margins from collapsing
	// creates a barrier between parent/child elements
	// the alternative (oveflow: auto) would break the sticky behavior on the headers
	padding: 1px;

	&.is-small {
		padding: 0;
	}

	.plan-features-2023-grid__table-item {
		border-right: none;
		background-color: transparent;

		// Match both `td` and `th` so the first header cell has its border-left removed too;
		// the `:is()` keeps the specificity aligned with the rule that adds the border-left above.
		&:first-of-type:is(td, th) {
			border-left: none;
		}

		&.plan-features-2023-grid__header-billing-info {
			color: var(--studio-gray-50);
			font-weight: 400;
			font-size: $font-body-extra-small;
			padding: 0 19px 24px 20px;
		}

		&.popular-plan-parent-class {
			position: relative;

			.plan-features-2023-grid__popular-badge {
				margin-bottom: 24px;
				width: 100%;
				background: #fff;
				color: #fff;
				padding: 0 0 17px;

				.plans-grid__plan-pill {
					font-family: Inter, $sans;
					font-size: 0.75rem;
					font-weight: 500;
					color: var(--studio-white);
					letter-spacing: 0.2px;
					/* stylelint-disable-next-line declaration-property-unit-allowed-list */
					line-height: 1.25rem;
					padding: 0 9px;
					right: unset;
					left: unset;
					top: unset;
					bottom: 0;
					border-radius: 4px;
					background-color: var(--studio-gray-80);
					transform: translate(20px, -50px);
					text-transform: unset;
				}

				&:not(.with-plan-logo) {
					.plans-grid__plan-pill {
						transform: translate(20px, 0);
					}
				}

				&.is-current-plan {
					color: unset;
					.plans-grid__plan-pill {
						background: #e0e0e0;
						color: var(--studio-gray-100);
					}
				}
			}

			&.is-left-of-highlight {
				&:not(.is-last-in-row) {
					.plan-features-2023-grid__popular-badge {
						border-top-right-radius: 0;
					}
				}
			}
			&.is-right-of-highlight {
				&:not(.is-first-in-row) {
					.plan-features-2023-grid__popular-badge {
						border-top-left-radius: 0;
					}
				}
			}
		}

		.plan-features-2023-grid__jp-logo {
			padding: 24px 0 6px 20px;
		}

		&.plans-grid-next-plan-storage {
			padding: 24px 20px 38px 20px;
		}

		.plan-features-2023-grid__common-title {
			font-weight: 600;
			font-size: $font-body-small;
			padding: 0 20px;

			&.is-personal-plan {
				color: var(--studio-blue-60);
			}

			&.is-premium-plan {
				color: var(--studio-blue-70);
			}

			&.is-business-plan {
				color: var(--studio-woocommerce-purple-50);
			}

			&.is-ecommerce-plan {
				color: var(--studio-woocommerce-purple-60);
			}

			&.is-wpcom-enterprise-grid-plan {
				color: var(--studio-gray-80);
			}
		}
	}

	.is-sticky-top-buttons-row {
		.is-top-buttons.plan-features-2023-grid__table-item {
			border: none;
			background-color: #f9f9f9;
			box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.04);
		}

		.plans-grid-next-action-button__label {
			margin-bottom: 16px;
		}
	}

	.plan-features-2023-grid__header {
		background-color: transparent;
	}

	.plan-features-2023-grid__row:last-of-type .plan-features-2023-grid__table-item {
		border-bottom: none;
	}

	.plan-features-2023-grid__item.plan-features-2023-grid__item-available {
		.plan-features-2023-grid__item-annual-plan-container
		.plan-features-2023-grid__item-annual-plan {
			color: var(--studio-orange-40);
		}
	}
}

.plans-grid-next.is-plans-grid-redesign-experiment {
	.plan-features-2023-grid__table-item.popular-plan-parent-class {
		.plan-features-2023-grid__popular-badge {
			&.is-premium-plan,
			&.is-wooexpress-medium-plan {
				.plans-grid__plan-pill {
					background-color: var(--studio-white);
					border: 1px solid #e0e0e0;
					color: var(--studio-gray-100);
					transform: translate(20px, 0);
				}
			}

			&.is-business-plan,
			&.is-ecommerce-plan {
				.plans-grid__plan-pill {
					transform: translate(20px, 0);
				}
			}
		}
	}

	.plan-features-2023-grid__content,
	.plan-features-2023-grid__desktop-view,
	.plan-features-2023-grid__tablet-view {
		max-width: 1408px;
		margin-inline: auto;
	}

	.plan-features-2023-grid__table {
		border-color: #e0e0e0;
		border-radius: 8px;
		box-shadow: none;

		&.has-1-cols {
			max-width: $redesign-table-cell-max-width;
		}

		&.has-2-cols {
			max-width: $redesign-table-cell-max-width * 2;
		}

		&.has-3-cols {
			max-width: $redesign-table-cell-max-width * 3;
		}

		&.has-4-cols {
			max-width: $redesign-table-cell-max-width * 4;
		}

		&.has-5-cols {
			max-width: $redesign-table-cell-max-width * 5;
		}

		&.has-highlighted-plan {
			margin-top: 12px;
		}

		&.has-6-cols {
			max-width: 1408px;
		}
	}

	.plan-features-2023-grid__desktop-view,
	.plan-features-2023-grid__tablet-view {
		.plan-features-2023-grid__table-item {
			max-width: $redesign-table-cell-max-width;
		}
	}

	.plan-features-2023-grid__content.has-bottom-plan-card .plan-features-2023-grid__table {
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
	}

	&:not(.is-small) {
		.plan-features-2023-grid__content.has-bottom-plan-card {
			&.has-1-cols .plans-grid-next-features-grid__bottom-plan-card {
				max-width: $redesign-table-cell-max-width;
			}

			&.has-2-cols .plans-grid-next-features-grid__bottom-plan-card {
				max-width: $redesign-table-cell-max-width * 2;
			}

			&.has-3-cols .plans-grid-next-features-grid__bottom-plan-card {
				max-width: $redesign-table-cell-max-width * 3;
			}

			&.has-4-cols .plans-grid-next-features-grid__bottom-plan-card {
				max-width: $redesign-table-cell-max-width * 4;

				&.is-enterprise-bottom-card {
					--enterprise-bottom-card-logo-column-gap: 54px;
				}
			}

			&.has-5-cols .plans-grid-next-features-grid__bottom-plan-card {
				max-width: $redesign-table-cell-max-width * 5;
			}

			&.has-tablet-split-row {
				.plan-features-2023-grid__table-bottom .plan-features-2023-grid__table-item {
					max-width: none;
				}
			}

			&.has-tablet-split-row-width-3-cols {
				.plan-features-2023-grid__table-bottom .plan-features-2023-grid__table,
				.plans-grid-next-features-grid__bottom-plan-card {
					max-width: $redesign-table-cell-max-width * 3;
				}
			}
		}
	}

	.plans-grid-next-features-grid__bottom-plan-card {
		align-items: center;
		background-color: var( --studio-white );
		border: 1px solid #e0e0e0;
		border-radius: 0 0 8px 8px;
		border-top: 0;
		box-sizing: border-box;
		display: flex;
		gap: 20px;
		justify-content: space-between;
		margin: 0 auto;
		min-height: 136px;
		padding: 24px 32px;
		width: 100%;

		&.is-woocommerce-bottom-card {
			align-items: stretch;
			gap: 0;
			min-height: 176px;
			overflow: hidden;
			padding: 0 0 0 32px;
			position: relative;

			.plans-grid-next-features-grid__bottom-plan-card-copy {
				align-self: center;
				flex: 0 0 44%;
				max-width: 560px;
				padding: 24px 48px 24px 0;
				z-index: 1;
			}

			.plans-grid-next-features-grid__bottom-plan-card-media {
				align-self: stretch;
				inset: 0;
				position: absolute;
			}
		}
	}

	.plans-grid-next-features-grid__bottom-plan-card-copy {
		flex: 0 0 34%;
		max-width: 420px;
		min-width: 220px;
	}

	.plans-grid-next-features-grid__bottom-plan-card-title {
		color: var( --studio-gray-100 );
		font-family: 'SF Pro Display', $sans;
		font-size: 26px;
		font-weight: 400;
		letter-spacing: 0;
		line-height: 30px;
		margin: 0 0 4px;
	}

	.plans-grid-next-features-grid__bottom-plan-card-tagline {
		color: var( --studio-gray-80 );
		font-size: 13px;
		line-height: 20px;
		margin: 0 0 12px;
	}

	.plans-grid-next-features-grid__bottom-plan-card-action {
		.plans-grid-next-action-button,
		.plans-grid-next-action-button__content {
			display: inline-flex;
		}

		.button.plan-features-2023-grid__actions-button {
			height: 32px;
			min-width: 92px;
			padding: 6px 16px;
			width: auto;
		}
	}

	.plans-grid-next-features-grid__bottom-plan-card-media {
		align-items: center;
		display: flex;
		flex: 1;
		justify-content: flex-end;
		min-width: 0;
	}

	.plans-grid-next-features-grid__bottom-plan-card-media .plans-grid-next-client-logo-list {
		--bottom-plan-card-logo-height: 40px;
		align-items: center;
		column-gap: var( --enterprise-bottom-card-logo-column-gap, 64px );
		justify-content: flex-end;
		max-width: 1015px;
		row-gap: 16px;

		svg {
			color: var( --wp-components-color-gray-600, #949494 );
			fill: var( --wp-components-color-gray-600, #949494 );
			height: var( --bottom-plan-card-logo-height );
		}

		.plans-grid-next-client-logo-list__item {
			--adjustment-unit: calc( var( --bottom-plan-card-logo-height ) / 60 );
		}
	}

	@media ( max-width: 1019px ) {
		&:not(.is-small) {
			.plan-features-2023-grid__content.has-4-cols.has-bottom-plan-card {
				.plans-grid-next-features-grid__bottom-plan-card.is-enterprise-bottom-card {
					--enterprise-bottom-card-logo-column-gap: 34px;
				}
			}
		}
	}

	@media ( max-width: 930px ) {
		&:not(.is-small) {
			.plan-features-2023-grid__content.has-4-cols.has-bottom-plan-card {
				.plans-grid-next-features-grid__bottom-plan-card.is-enterprise-bottom-card {
					--enterprise-bottom-card-logo-column-gap: 14px;
				}
			}
		}
	}

	@media ( max-width: 769px ) {
		&:not(.is-small) {
			.plan-features-2023-grid__content.has-4-cols.has-bottom-plan-card {
				.plans-grid-next-features-grid__bottom-plan-card.is-enterprise-bottom-card {
					.plans-grid-next-features-grid__bottom-plan-card-media
						.plans-grid-next-client-logo-list {
						--bottom-plan-card-logo-height: 24px;
					}
				}
			}
		}
	}

	&.is-smedium,
	&.is-medium {
		.plans-grid-next-features-grid__bottom-plan-card-media .plans-grid-next-client-logo-list {
			--bottom-plan-card-logo-height: 32px;
		}
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-visual {
		--bottom-plan-card-woo-image-max-width: 428px;
		--bottom-plan-card-woo-product-width: 124px;
		--bottom-plan-card-woo-product-overlap: 40px;
		--bottom-plan-card-woo-image-width: clamp(
			0px,
			calc(
				50% - var( --bottom-plan-card-woo-product-width ) + var(
						--bottom-plan-card-woo-product-overlap
					)
			),
			var( --bottom-plan-card-woo-image-max-width )
		);
		display: block;
		height: 100%;
		min-height: 176px;
		position: relative;
		width: 100%;
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-image {
		display: block;
		height: 100%;
		left: 50%;
		object-fit: cover;
		object-position: center;
		position: absolute;
		top: 0;
		width: var( --bottom-plan-card-woo-image-width );
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-logo-badge {
		align-items: center;
		background: #873eff;
		border-radius: 16px;
		display: flex;
		height: 72px;
		justify-content: center;
		position: absolute;
		left: calc( 50% - 36px );
		top: 32px;
		width: 72px;
		z-index: 1;
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-logo {
		height: auto;
		width: 52px;

		.st0 {
			fill: var( --studio-white );
		}
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-product-card {
		background: var( --studio-white );
		border: 1px solid #e0e0e0;
		border-radius: 8px;
		box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.08 );
		box-sizing: border-box;
		left: calc(
			50% + var( --bottom-plan-card-woo-image-width ) - var(
					--bottom-plan-card-woo-product-overlap
				)
		);
		padding: 8px 8px 10px;
		position: absolute;
		top: 14px;
		width: var( --bottom-plan-card-woo-product-width );
		z-index: 1;
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-product-image {
		aspect-ratio: 1;
		background: #ece9ff;
		border-radius: 4px;
		display: block;
		margin-bottom: 8px;
		object-fit: cover;
		object-position: 45% 48%;
		width: 100%;
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-product-name {
		color: var( --studio-gray-60 );
		font-size: 10px;
		line-height: 14px;
	}

	.plans-grid-next-features-grid__bottom-plan-card-woo-product-price {
		color: var( --studio-gray-100 );
		font-size: 16px;
		line-height: 20px;
	}

	.plan-features-2023-grid__table-item {
		&:is( td, th ) {
			border-left-color: #e0e0e0;
		}

		&.plans-grid-next-plan-storage {
			padding: 0 16px 20px;
		}

		&.plan-features-2023-grid__header-billing-info {
			color: var( --studio-gray-50 );
			font-size: 12px;
			line-height: 16px;
			padding: 0 16px 20px;
		}
	}

	thead tr:first-child .plan-features-2023-grid__table-item {
		height: 0;
	}

	.plan-features-2023-grid__header-logo {
		display: none;
		margin: 0;
		padding: 0;
	}

	.plan-features-2023-grid__header {
		align-items: flex-start;
		background-color: transparent;
		flex-direction: column;
		padding: 32px 16px 0;
	}

	.plan-features-2023-grid__header-title {
		color: var( --studio-gray-100 );
		font-family: 'SF Pro Display', $sans;
		font-size: 26px;
		font-weight: 400;
		letter-spacing: 0;
		line-height: 30px;
		margin-bottom: 8px;
	}

	.plan-features-2023-grid__header-badge {
		background-color: var( --studio-gray-0 );
		color: var( --studio-gray-80 );
		font-size: 11px;
		line-height: 18px;
		margin-top: 2px;
	}

	.plan-features-2023-grid__header-tagline {
		color: var( --studio-gray-80 );
		font-size: 13px;
		line-height: 20px;
		min-height: 6px;
		padding: 0 16px 18px;
		text-wrap: pretty;
	}

	.plans-grid-next-header-price {
		margin-bottom: 8px;
		padding: 0 16px;

		.plan-price {
			font-family: 'SF Pro Display', $sans;
			line-height: 1;

			&.is-discounted,
			&.is-original {
				margin-right: 0;
			}

			&.is-original {
				color: var( --wp-components-color-gray-600, #949494 );
				font-size: 24px;
				margin-bottom: 3px;

				.plan-price__currency-symbol,
				.plan-price__integer,
				.plan-price__tax-amount {
					color: var( --wp-components-color-gray-600, #949494 );
				}

				.plan-price__integer {
					font-size: 24px;
				}
			}
		}

		.plan-price__currency-symbol,
		.plan-price.is-discounted .plan-price__currency-symbol {
			color: inherit;
			font-size: 14px;
			margin-top: 3px;
		}

		.plan-price__integer {
			font-size: 36px;
			letter-spacing: 0;
		}

		.plan-price__term {
			font-size: 12px;
		}
	}

	.plans-grid-next-header-price__badge {
		background-color: rgba( 184, 230, 191, 0.68 );
		border-radius: 2px;
		box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.08 );
		color: var( --studio-green-80 );
		font-size: 11px;
		font-weight: 500;
		height: 20px;
		letter-spacing: 0;
		line-height: 20px;
		margin-bottom: 10px;
		padding: 0 8px;
	}

	.plans-grid-next-header-price__pricing-group {
		align-items: last baseline;
		gap: 8px;
		justify-content: flex-end;

		&.is-large-currency {
			align-items: flex-start;
			justify-content: flex-start;
		}
	}

	.plan-features-2023-grid__table-item.is-top-buttons {
		padding: 0 16px;

		button {
			margin: 16px 0;
		}
	}

	.plans-grid-next-action-button__label {
		color: var( --studio-gray-50 );
		font-size: 11px;
		line-height: 16px;
		margin-top: 8px;

		&.is-left-aligned {
			font-size: 12px;
			margin-bottom: 16px;
		}
	}

	.plans-grid-next-features-grid__feature-group-row {
		> .plan-features-2023-grid__table-item {
			padding-top: 0;
		}
	}

	.plan-features-2023-grid__item {
		padding: 0 16px 10px;

		&.plan-features-2023-grid__item-available .plan-features-2023-grid__item-info-container {
			align-items: flex-start;
			display: flex;
			gap: 6px;
		}

		.plan-features-2023-grid__common-title + & {
			padding-top: 10px;
		}
	}

	.plan-features-2023-grid__item-info {
		flex: 1;
		min-width: 0;

		.plan-features-2023-grid__item-title {
			color: var( --studio-gray-80 );
			font-size: 12px;
			line-height: 16px;
			text-wrap: pretty;
		}
	}

	.plan-features-2023-grid__item-text-content {
		align-items: flex-start;
		display: flex;
		gap: 8px;
		justify-content: space-between;
		width: 100%;
	}

	.plan-features-2023-grid__item-title-label {
		min-width: 0;
	}

	.plan-features-2023-grid__feature-badge {
		box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.08 );
		flex: 0 0 auto;
		font-weight: 500;
		margin-inline-start: auto;
	}

	.plan-features-2023-grid__item-checkmark {
		color: var( --studio-green-60 );
		display: block;
		fill: var( --studio-green-60 );
		flex: 0 0 16px;
		height: 16px;
		margin-top: 0;
		width: 16px;
	}

	.plans-grid-next-features-grid__feature-group-title,
	.plan-features-2023-grid__common-title {
		color: var( --studio-gray-100 );
		font-size: 12px;
		line-height: 16px;
		margin-bottom: 8px;
	}

	.plans-grid-next-storage-feature-label__container {
		gap: 4px;

		&.is-add-more {
			align-items: flex-start;
			flex-direction: column;

			.plans-grid-next-storage-feature-label__volume,
			.plans-grid-next-storage-feature-label__text,
			.plans-grid-next-storage-feature-label__add-more,
			.plans-grid-next-storage-feature-label__offset-price {
				white-space: nowrap;
			}
		}
	}

	.plans-grid-next-storage-feature-label__volume {
		align-items: center;
		display: flex;
		font-size: 12px;
		gap: 4px;
		line-height: 16px;
		padding: 0;

		&.is-badge {
			justify-content: center;
			padding: 2px 8px;
			text-align: center;
		}
	}

	.plans-grid-next-storage-feature-label__icon {
		color: #000;
		flex: 0 0 17px;
		height: 12px;
		width: 17px;
	}

	.plans-grid-next-storage-feature-label__text {
		font-weight: 500;
	}

	.plans-grid-next-storage-feature-label__add-more {
		appearance: none;
		background: none;
		border: 0;
		color: #1e1e1ea3;
		cursor: pointer;
		font: inherit;
		line-height: inherit;
		padding: 0;
		text-decoration: underline;
	}

	&.is-smedium,
	&.is-medium,
	&.is-large,
	&.is-xlarge {
		.plan-features-2023-grid__table-item.is-top-buttons .plan-features-2023-grid__actions-button {
			margin-top: 0;
		}

		.plans-grid-next-features-grid__feature-group-row.is-first-feature-group-row.is-reduced-feature-group-spacing
			> .plan-features-2023-grid__table-item {
			padding-top: 0;
		}

		thead tr:first-child .plan-features-2023-grid__table-item.popular-plan-parent-class {
			height: 0;
			padding: 0;

			.plan-features-2023-grid__popular-badge {
				background: transparent;
				border: 0;
				height: 0;
				left: 0;
				margin: 0;
				padding: 0;
				position: absolute;
				right: 0;
				top: 0;
				width: auto;
				z-index: 1;

				.plans-grid__plan-pill {
					align-items: center;
					background-color: var( --studio-white );
					border: 1px solid #e0e0e0;
					border-radius: 4px;
					bottom: auto;
					color: var( --studio-gray-100 );
					display: flex;
					font-family: 'SF Pro Display', $sans;
					font-size: 12px;
					font-weight: 500;
					height: 24px;
					justify-content: center;
					left: 16px;
					letter-spacing: 0.25px;
					line-height: 20px;
					padding: 0 8px;
					position: absolute;
					right: auto;
					text-transform: none;
					top: -12px;
					transform: none;
					width: auto;
				}

				&.is-business-plan .plans-grid__plan-pill,
				&.is-ecommerce-plan .plans-grid__plan-pill {
					background-color: var( --studio-gray-100 );
					border-color: var( --studio-gray-100 );
					color: var( --studio-white );
				}
			}
		}
	}

	.is-sticky-top-buttons-row {
		.is-top-buttons.plan-features-2023-grid__table-item {
			background-color: var( --studio-white );
			box-shadow: 0 2px 2px rgba( 0, 0, 0, 0.04 );
		}

		.button.plan-features-2023-grid__actions-button {
			height: auto;
			min-height: 40px;
		}

		.plans-grid-next-action-button__label {
			margin-bottom: 16px;
		}
	}

	&.is-small {
		.plans-grid-next-features-grid__mobile-plan-card {
			border-radius: 8px;
			padding-block: 24px;

			.plan-features-2023-grid__popular-badge {
				.plans-grid__plan-pill {
					letter-spacing: 0.25px;
				}

				&.is-premium-plan .plans-grid__plan-pill,
				&.is-wooexpress-medium-plan .plans-grid__plan-pill {
					background-color: var( --studio-white );
					border: 1px solid #e0e0e0;
					color: var( --studio-gray-100 );
				}
			}

			.plan-features-2023-grid__table-item.is-current-plan {
				.plan-features-2023-grid__popular-badge {
					.plans-grid__plan-pill {
						background-color: var( --color-neutral-0 );
						border: 1px solid #e0e0e0;
						color: var( --color-neutral-80 );
					}
				}
			}
		}

		.plan-features-2023-grid__header {
			padding-top: 0;
		}

		.plan-features-2023-grid__header-tagline {
			min-height: 0;
		}

		.plan-features-2023-grid__content.has-bottom-plan-card {
			.plan-features-2023-grid__table {
				border-bottom-left-radius: 8px;
				border-bottom-right-radius: 8px;
			}
		}

		.plans-grid-next-features-grid__bottom-plan-card {
			align-items: flex-start;
			border-radius: 8px;
			border-top: 1px solid #e0e0e0;
			flex-direction: column;
			gap: 0;
			margin-top: 20px;
			max-width: 100%;
			min-height: 0;
			padding: 32px 24px 24px;

			&.is-woocommerce-bottom-card {
				overflow: hidden;
				padding: 32px 24px 24px;

				.plans-grid-next-features-grid__bottom-plan-card-copy {
					padding: 0;
				}

				.plans-grid-next-features-grid__bottom-plan-card-media {
					align-self: stretch;
					inset: auto;
					margin: 20px -24px;
					position: relative;
					width: calc( 100% + 48px );
				}
			}
		}

		.plans-grid-next-features-grid__bottom-plan-card-copy {
			display: contents;
			flex-basis: auto;
			max-width: none;
			min-width: 0;
			width: 100%;
		}

		.plans-grid-next-features-grid__bottom-plan-card-title {
			font-size: 26px;
			font-weight: 400;
			letter-spacing: 0.21px;
			line-height: 30px;
			margin-bottom: 8px;
			order: 1;
		}

		.plans-grid-next-features-grid__bottom-plan-card-tagline {
			font-size: 13px;
			font-weight: 400;
			letter-spacing: -0.15px;
			line-height: 20px;
			margin: 0;
			order: 2;
		}

		.plans-grid-next-features-grid__bottom-plan-card-media {
			justify-content: flex-start;
			margin: 20px 0;
			order: 3;
			width: 100%;
		}

		.plans-grid-next-features-grid__bottom-plan-card-media .plans-grid-next-client-logo-list {
			--bottom-plan-card-logo-height: 22px;
			column-gap: 12px;
			justify-content: space-between;
			row-gap: 8px;
			width: 100%;

			svg {
				color: var( --wp-components-color-gray-700, #757575 );
				fill: var( --wp-components-color-gray-700, #757575 );
			}
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-visual {
			height: 164px;
			overflow: hidden;
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-image {
			height: 100%;
			left: 0;
			max-width: none;
			right: auto;
			top: 0;
			transform: none;
			width: 100%;
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-logo-badge {
			border-radius: 16px;
			height: 64px;
			left: 24px;
			right: auto;
			top: 20px;
			width: 64px;
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-logo {
			width: 46px;
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-product-card {
			bottom: 16px;
			left: auto;
			right: 24px;
			top: auto;
			width: 104px;
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-product-name {
			font-size: 9px;
			line-height: 12px;
		}

		.plans-grid-next-features-grid__bottom-plan-card-woo-product-price {
			font-size: 14px;
			line-height: 18px;
		}

		.plans-grid-next-features-grid__bottom-plan-card-action {
			order: 4;
			width: 100%;

			.plans-grid-next-action-button,
			.plans-grid-next-action-button__content {
				display: flex;
				width: 100%;
			}

			.button.plan-features-2023-grid__actions-button {
				font-size: 16px;
				height: 48px;
				padding: 12px 16px;
				width: 100%;
			}
		}
	}
}

// Conditional styles for visual split layout (website-builder and wordpress-hosting intents)
.plans-features-main__group.is-visual-split-layout {
	.plans-grid-next-features-grid__feature-group-row {
		&:last-child > .plan-features-2023-grid__table-item {
			padding-bottom: 18px;
		}
	}
}
