// Pro upsells (resources/js/admin/pro): badge, upgrade modal, locked buttons, "More Display
// Options in Pro" box, the Pro Features tab and the animated feature demos. Values are the
// design's literal values ("Smart Swatches Free" prototype).
@use "../tokens" as *;

$pro-ring: #8fb8e0;
$pro-sub: #646970;
$pro-ink: #1d2327;

// The Pro roots may render outside .ssw-admin (modal, Attributes / Terms islands): give them the
// design's base (border-box, 14px / 1.5, body ink) themselves.
.ssw-pro-page,
.ssw-pro-modal,
.ssw-pro-box {
	font-family: $font;
	font-size: 14px;
	line-height: 1.5;
	color: $ink-2;
	-webkit-font-smoothing: antialiased;

	&,
	*,
	*::before,
	*::after {
		box-sizing: border-box;
	}
}

/* Crown badge ------------------------------------------------------------------------------- */

.ssw-pro-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	box-sizing: border-box;
	min-width: 20px;
	height: 20px;
	padding: 0;
	border-radius: 50%;
	background: $tint;
	color: $blue;
	box-shadow: inset 0 0 0 1px $pro-ring;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1;
	vertical-align: middle;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;

	&:hover {
		background: $blue;
		color: #fff;
		box-shadow: inset 0 0 0 1px $blue;
	}

	&.is-static {
		cursor: default;
		pointer-events: none;
	}

	@include focus-visible;
}

/* Upgrade modal ----------------------------------------------------------------------------- */

.ssw-pro-modal {
	position: fixed;
	inset: 0;
	z-index: 100000; // over the WP admin bar (99999)
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 24px;
	background: rgba(16, 17, 20, 0.42);
	font-family: $font;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 180ms ease, visibility 0s linear 180ms;

	&.is-open {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transition: opacity 180ms ease;
	}
}

.ssw-pro-modal__box {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 400px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 24px 60px rgba(16, 17, 20, 0.22), 0 0 0 1px rgba(16, 17, 20, 0.04);
	outline: none;
	transform: translateY(8px) scale(0.98);
	transition: transform 220ms $ease;

	&.has-visual {
		max-width: 560px;
	}

	.is-open > & {
		transform: none;
	}
}

.ssw-pro-modal__close {
	position: absolute;
	top: 7px;
	right: 7px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	color: $pro-sub;
	cursor: pointer;
	transition: background 140ms ease, color 140ms ease;

	&:hover {
		background: $line-list;
		color: $pro-ink;
	}

	@include focus-visible;
}

.ssw-pro-modal__visual {
	position: relative;
	box-sizing: border-box;
	margin: 28px 28px 0;
	aspect-ratio: 3 / 2;
	border: 1px solid $line-card;
	border-radius: 6px;
	overflow: hidden;
	background: #f9fafa;
}

.ssw-pro-modal__visual-in {
	position: absolute;
	inset: 0;
	border-radius: 5px;
	overflow: hidden;
}

.ssw-pro-modal__crown {
	display: flex;
	justify-content: center;
	padding: 28px 28px 0;

	> span {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		border-radius: 50%;
		background: $tint;
		color: $blue;
		box-shadow: inset 0 0 0 1px $pro-ring;
	}
}

.ssw-pro-modal__text {
	padding: 20px 28px 0;
	text-align: center;
}

.ssw-pro-modal__title {
	font-size: 18px;
	font-weight: 600;
	color: $pro-ink;
	text-wrap: pretty;
}

.ssw-pro-modal__desc {
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.55;
	color: $pro-sub;
	text-wrap: pretty;
}

.ssw-pro-modal__points {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 9px;
	width: max-content;
	max-width: 100%;
	margin: 16px auto 0;
	padding: 0;
	list-style: none;
	text-align: left;

	li {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		margin: 0;
		font-size: 14px;
		line-height: 1.45;
		color: $text;
	}
}

.ssw-pro-modal__check {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border-radius: 50%;
	background: $line-list;
	color: $faint;
}

.ssw-pro-modal__foot {
	padding: 24px 28px 28px;
}

.ssw-pro-modal__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: 46px;
	padding: 0 28px;
	border-radius: 4px;
	background: $blue;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: filter 140ms ease;

	&:hover,
	&:focus,
	&:active {
		color: #fff;
	}

	&:hover {
		filter: brightness(1.1);
	}

	@include focus-visible;
}

/* Locked toolbar buttons (Attributes: Import / Export; Terms: Bulk Add / Bulk Edit) ---------- */

.ssw-pro-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	height: 36px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid $blue;
	border-radius: 4px;
	background: #fff;
	color: $blue;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;

	@include focus-visible;

	// `.tbtn2`: grey toolbar button, the crown in blue.
	&.is-neutral {
		height: 34px;
		border-color: #dcdce0;
		color: $pro-sub;
		opacity: 0.5;
		transition: border-color 150ms ease, color 150ms ease;

		svg:last-child {
			margin-left: 2px;
			color: $blue;
		}

		&:hover {
			border-color: $faint-2;
			color: $pro-ink;
		}
	}

	// `.tbtn` (Bulk Add Terms) and the filled variant (Bulk Edit Terms).
	&.is-outline,
	&.is-primary {
		gap: 8px;
		opacity: 0.55;
		transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;

		&:hover {
			opacity: 0.7;
		}
	}

	&.is-outline:hover {
		background: $tint;
	}

	&.is-primary {
		background: $blue;
		color: #fff;

		&:hover {
			border-color: $blue-2;
			background: $blue-2;
		}
	}
}

/* "More Display Options in Pro" box --------------------------------------------------------- */

.ssw-pro-box {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 8px;
	padding: 18px 20px 20px;
	border-radius: 8px;
	background: linear-gradient(135deg, #eaf2fb 0%, #f6f9fd 50%, #fff 100%);
	box-shadow: inset 0 0 0 1px #e1e8f0;
}

.ssw-pro-box__head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ssw-pro-box__crown {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: $tint;
	color: $blue;
	box-shadow: inset 0 0 0 1px $pro-ring;
}

.ssw-pro-box__title {
	font-size: 14px;
	font-weight: 600;
	color: $pro-ink;
}

.ssw-pro-box__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ssw-pro-box__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 0;
	font-size: 14px;
	font-weight: 400;
	color: $text;
	cursor: pointer;
	transition: color 140ms ease;

	&:hover {
		color: $blue;
	}

	@include focus-visible;
}

.ssw-pro-box__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: inset 0 0 0 1px $blue-ring;
	color: $blue;
}

.ssw-pro-box__text {
	min-width: 0;
}

.ssw-pro-box__cta {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	height: 36px;
	padding: 0 16px;
	border-radius: 4px;
	background: transparent;
	box-shadow: inset 0 0 0 1px #b6cfe8;
	color: $blue;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background 150ms ease, box-shadow 150ms ease;

	&:hover,
	&:focus {
		color: $blue;
	}

	&:hover {
		background: #fff;
		box-shadow: inset 0 0 0 1px $blue;
	}

	@include focus-visible;
}

/* Pro Features tab -------------------------------------------------------------------------- */

.ssw-pro-page {
	box-sizing: border-box;
	padding: 20px max(20px, calc((100% - 1260px) / 2)) 96px;
	background: #fff;
	box-shadow: inset 0 1px 0 $line-row;
	font-family: $font;

	h1,
	h2,
	h3,
	p {
		padding: 0;
	}
}

.ssw-pro-page__upgrade {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding: 0 26px;
	border-radius: 6px;
	background: $blue;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: transform 160ms ease, filter 160ms ease;

	&:hover,
	&:focus,
	&:active {
		color: #fff;
	}

	&:hover {
		filter: brightness(1.08);
		transform: translateY(-1px);
	}

	&.is-dark:hover {
		filter: brightness(1.1);
	}

	@include focus-visible;
}

.ssw-pro-page__eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: $muted-2;
}

.ssw-pro-page__heading {
	max-width: 640px;
	margin: 72px auto 0;
	text-align: center;

	&.is-more {
		margin-top: 0;
	}
}

.ssw-pro-page__h2 {
	margin: 10px 0 0;
	font-size: 30px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: $pro-ink;
	text-wrap: balance;
}

.ssw-pro-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 88px 24px 96px;
	border-radius: 24px;
	background: radial-gradient(60% 80% at 50% 0%, rgba(34, 113, 177, 0.12), transparent 70%), #f8f9fa;
	box-shadow: inset 0 0 0 1px $line-row;
	text-align: center;
}

.ssw-pro-hero__pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 32px;
	padding: 0 14px 0 5px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 0 0 1px $line-card;
	font-size: 13px;
	font-weight: 500;
	color: $text;
}

.ssw-pro-hero__title {
	max-width: 760px;
	margin: 22px 0 0;
	font-size: 46px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: $pro-ink;
	text-wrap: balance;
}

.ssw-pro-hero__desc {
	max-width: 600px;
	margin: 16px 0 0;
	font-size: 17px;
	line-height: 1.6;
	color: $pro-sub;
	text-wrap: pretty;
}

.ssw-pro-hero__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 28px;
}

.ssw-pro-hero__note {
	font-size: 13px;
	color: $faint;
}

.ssw-pro-rows {
	display: flex;
	flex-direction: column;
	gap: 40px;
	margin-top: 36px;
}

.ssw-pro-row {
	overflow: hidden;
	border-radius: 20px;
	background: #f6f7f8;
	box-shadow: inset 0 0 0 1px $line-row;

	&.is-wide {
		display: flex;
		flex-wrap: wrap;
		min-height: 440px;

		&.is-reverse {
			flex-direction: row-reverse;
		}
	}

	&.is-card {
		display: flex;
		flex-direction: column;
		transition: box-shadow 200ms ease;

		&:hover {
			box-shadow: inset 0 0 0 1px #dcdcde;
		}
	}
}

.ssw-pro-row__text {
	display: flex;
	flex: 1 1 340px;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 52px 48px;
}

.ssw-pro-row__title {
	margin: 12px 0 0;
	font-size: 30px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: $pro-ink;
	text-wrap: pretty;
}

.ssw-pro-row__desc {
	max-width: 440px;
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: $pro-sub;
	text-wrap: pretty;
}

.ssw-pro-row__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.ssw-pro-row__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	background: #fff;
	box-shadow: inset 0 0 0 1px $line-card;
	font-size: 13px;
	color: $text;
	white-space: nowrap;
}

.ssw-pro-row__visual {
	position: relative;
	flex: 1 1 380px;
	min-width: 0;
	min-height: 400px;
	margin-top: 40px;
	border-radius: 12px 0 20px 0;

	.is-reverse & {
		border-radius: 0 12px 0 20px;
	}
}

.ssw-pro-row__head {
	padding: 30px 30px 0;
}

.ssw-pro-row__card-title {
	margin: 0;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.25;
	color: $pro-ink;
	text-wrap: pretty;
}

.ssw-pro-row__card-desc {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: $pro-sub;
	text-wrap: pretty;
}

.ssw-pro-row__card-visual {
	position: relative;
	flex: 1 1 auto;
	min-height: 250px;
	margin: 24px 30px 0;
	border-radius: 12px 12px 0 0;

	.is-tall & {
		min-height: 300px;
	}
}

.ssw-pro-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: 40px 32px;

	&.is-half {
		grid-template-columns: repeat(auto-fit, minmax(max(360px, calc(50% - 16px)), 1fr));
	}
}

// Absolute box that a ProFeatureVisual fills.
.ssw-pro-fill {
	position: absolute;
	inset: 0;
}

.ssw-pro-more {
	margin-top: 112px;
}

.ssw-pro-more__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin-top: 32px;
}

.ssw-pro-more__card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 10px 10px 20px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 0 0 1px $line-card;
	cursor: pointer;
	transition: box-shadow 200ms ease, transform 200ms ease;

	&:hover {
		box-shadow: 0 18px 40px -20px rgba(16, 17, 20, 0.22), 0 0 0 1px #dcdcde;
		transform: translateY(-2px);
	}

	@include focus-visible;
}

.ssw-pro-more__visual {
	position: relative;
	min-width: 0;
	aspect-ratio: 3 / 2;
	border-radius: 10px;
	overflow: hidden;
}

.ssw-pro-more__text {
	min-width: 0;
	padding: 0 10px;
}

.ssw-pro-more__title {
	font-size: 16px;
	font-weight: 600;
	color: $pro-ink;
}

.ssw-pro-more__desc {
	margin-top: 3px;
	font-size: 13px;
	line-height: 1.5;
	color: $pro-sub;
	text-wrap: pretty;
}

.ssw-pro-cta {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 120px;
	padding: 64px 32px;
	overflow: hidden;
	border-radius: 24px;
	background: $pro-ink;
	text-align: center;
}

.ssw-pro-cta__dots {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
	background-size: 18px 18px;
}

.ssw-pro-cta__in {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ssw-pro-cta__title {
	margin: 0;
	font-size: 34px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: #fff;
	text-wrap: balance;
}

.ssw-pro-cta__desc {
	max-width: 520px;
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: $line-ring-strong;
	text-wrap: pretty;
}

.ssw-pro-cta__action {
	margin-top: 28px;
}

/* Feature demos (ProFeatureVisual) ---------------------------------------------------------- */

.ssw-pro-visual {
	position: relative;
	container-type: size;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	min-height: 90px;
	overflow: hidden;
	font-family: $font;
	-webkit-font-smoothing: antialiased;
	text-align: left;

	*,
	*::before,
	*::after {
		box-sizing: border-box;
	}
}

.ssw-pro-visual__chrome {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	height: 36px;
	padding: 0 14px;
	background: $line-list;
	box-shadow: inset 0 -1px 0 $line-card;
}

.ssw-pro-visual__dots {
	display: flex;
	gap: 6px;

	span {
		width: 9px;
		height: 9px;
		border-radius: 50%;
		background: #dcdcde;
	}
}

.ssw-pro-visual__url {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	max-width: 260px;
	height: 22px;
	margin: 0 auto;
	border-radius: 6px;
	background: #fff;
	box-shadow: inset 0 0 0 1px $line-card;
	font-size: 11px;
	color: $faint;
}

.ssw-pro-visual__ghost {
	position: absolute;
	inset: 0;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 0 0 1px $line-card;
}

.ssw-pro-visual__card {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	font-size: 12px;
	line-height: 1.35;
	color: $text;
}

.ssw-pro-visual__edge {
	position: absolute;
	inset: 0;
	z-index: 6;
	pointer-events: none;
}

// The design's global reduced-motion rule for the demos (each demo also carries its own).
@media (prefers-reduced-motion: reduce) {

	[data-pfv-demo] * {
		animation-duration: 0s !important;
		animation-iteration-count: 1 !important;
	}

	.ssw-pro-modal,
	.ssw-pro-modal__box,
	.ssw-pro-more__card,
	.ssw-pro-page__upgrade {
		transition: none;
	}
}
