@use "../../scss/mixins/breakpoints";
@use "../../scss/calypso-colors";
@use "../../scss/typography";

// My Plan Card
.my-plan-card {

	@include breakpoints.breakpoint( ">960px" ) {
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
	}

	&.plan-golden-token .my-plan-card__icon img {
		max-width: 80px;
		max-height: 80px;
	}
}

.my-plan-card__primary {
	display: flex;
	flex-flow: row nowrap;
	flex-grow: 1;
}

.my-plan-card__header {
	flex: 1;
	margin: auto;
}

.is-plan .my-plan-card__title {
	font-size: 24px;
}

.is-plan .my-plan-card__tag-line {
	font-size: 16px;
}

.is-plan .my-plan-card__header {
	margin: auto;
}

.my-plan-card__title {
	font-size: 20px;
	font-weight: 500;
	line-height: 30px;
	margin: 4px 0;
	color: calypso-colors.$black;

	@include breakpoints.breakpoint( "<960px" ) {
		padding-top: 16px;
	}
}

.my-plan-card__tag-line {
	$font-body-small: 14px;
	font-weight: 400;
	line-height: 1.65;
	margin: 0 0 4px 0;

	@include breakpoints.breakpoint( "<960px" ) {
		margin-bottom: 8px;
	}
}

.is-plan .my-plan-card__icon {
	width: 99px;
	height: 99px;
	margin: 0 16px 0 0;
	display: flex;
	justify-content: center;
	align-items: center;

	@include breakpoints.breakpoint( "<660px" ) {
		order: 99;
		width: 80px;
		height: 80px;
		margin: 20px 0 0 16px;
	}
}

.my-plan-card__icon {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	margin: 16px 24px 16px 0;

	@include breakpoints.breakpoint( "<660px" ) {
		display: none;
	}

	img {
		width: 100%;
		height: 100%;
	}
}

.my-plan-card__secondary {
	position: relative;
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	justify-content: space-between;
	padding: 0;

	@include breakpoints.breakpoint( ">960px" ) {
		flex-flow: column nowrap;
		justify-content: center;
		align-items: flex-end;
		padding: 0 0 0 24px;
	}

	&::before {
		content: "";
		position: absolute;
		left: -16px;
		right: -16px;
		border-bottom: 1px solid var(--jp-gray);
		bottom: 0;

		@include breakpoints.breakpoint( ">480px" ) {
			left: -24px;
			right: -24px;
		}

		@include breakpoints.breakpoint( ">960px" ) {
			content: none;
		}
	}

	.has-action-only & {
		padding-top: 0;
		justify-content: center;

		&::before {
			content: none;
		}
	}
}

.my-plan-card__details {
	padding: 8px 0 16px;
	color: calypso-colors.$gray-darken-10;
	display: contents;

	@include breakpoints.breakpoint( "<960px" ) {
		display: block;
	}

	@include breakpoints.breakpoint( ">480px" ) {
		white-space: nowrap;
	}

	@include breakpoints.breakpoint( ">960px" ) {
		padding-top: 0;
	}

	&.is-error {
		color: calypso-colors.$alert-red;
	}

	a.my-plan-card__renew {
		text-decoration: underline;
		margin-top: 8px;

		&:hover {
			text-decoration-thickness: 3px;
			color: calypso-colors.$black;
		}

		&:focus {
			text-decoration-line: none;
			border-radius: 2px;
			box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #000;
			outline: 3px solid transparent;
			color: calypso-colors.$black;
		}

		&:active {
			color: calypso-colors.$black;
		}
	}
}

.my-plan-card__action {
	padding-top: 8px;
	white-space: nowrap;

	.has-action-only & {
		padding-top: 0;
	}
}

.my-plan-card__expired {
	color: calypso-colors.$alert-red;
}

.my-plan-card__renew {
	display: flex;
	justify-content: flex-end;
	color: calypso-colors.$black;

	.components-external-link__icon {
		align-self: center;
	}

	@include breakpoints.breakpoint( "<960px" ) {
		justify-content: flex-start;
	}
}

