/**
 * "More" blocks
 */
.contractor-more-block {
	@include font-primary-regular;
	color: $color-charcoal4;
	display: block;
	font-size: 14px;
	line-height: 18px;
	margin: 0 0 15px;
	transition: color $trans-time $trans-func;

	&__header {
		margin-bottom: 10px;
	}

	&__badge {
		@include font-primary-bold;
		background: $color-charcoal4;
		border-radius: 4px;
		color: $color-white;
		font-size: 10px;
		line-height: 13px;
		margin-right: 5px;
		padding: 3px 5px;
		text-transform: uppercase;
		transition: background-color $trans-time $trans-func;
		white-space: nowrap;
	}

	&__note {
		color: $color-charcoal2;
		font-size: 14px;
		line-height: 18px;
		vertical-align: middle;
		white-space: nowrap;
	}

	&__cta {
		@include font-primary-bold;
		color: $color-blue5;
		font-size: 12px;
		line-height: 15px;
		text-transform: uppercase;
		transition: color $trans-time $trans-func;
		white-space: nowrap;

		&::after {
			@include icon-basic;
			content: '\e907';
			font-size: 10px;
		}
	}

	&--review {
		.contractor-more-block {
			&__text {
				&::before {
					content: '“';
				}

				&::after {
					content: '”';
				}
			}
		}
	}

	&--promo {
		color: $color-green5;

		.contractor-more-block {
			&__badge {
				background: $color-green5;
			}

			&__cta {
				color: $color-green6;

				&:hover,
				&:focus,
				&:active {
					color: $color-green7;
				}
			}
		}
	}
}

a {
	&.contractor-more-block {
		color: $color-charcoal4;

		&:hover,
		&:focus,
		&:active {
			color: $color-charcoal5;
		}

		&--promo {
			color: $color-green5;

			&:hover,
			&:focus,
			&:active {
				color: $color-green6;

				.contractor-more-block {
					&__badge {
						background: $color-green6;
					}

					&__cta {
						color: $color-green7;
					}
				}
			}
		}
	}
}

/**
 * Bullets list
 */
.contractor-icons-list {
	color: $color-charcoal4;
	font-size: 16px;
	line-height: 26px;
	list-style: none;
	margin: 0;
	padding: 0;

	li {
		margin: 0 0 5px;
		padding: 0 0 0 24px;
		position: relative;

		[class^='icon-'],
		[class*=' icon-'] {
			color: $color-charcoal5;
			font-size: 18px;
			line-height: 26px;
			left: 0;
			position: absolute;
			top: 0;
		}
	}

	> :last-child {
		margin-bottom: 0;
	}
}

/**
 * Appointment details
 */
.appt-details {
	margin: 0 0 15px;
	padding: 0 0 0 23px;
	position: relative;

	&__label {
		@include font-primary-bold;
		color: $color-charcoal2;
		font-size: 10px;
		line-height: 13px;
		margin: 0 0 5px;
		text-transform: uppercase;
	}

	&__title {
		@include font-primary-bold;
		color: $color-charcoal5;
		font-size: 14px;
		line-height: 18px;
		margin: 0 0 5px;
		position: relative;

		&::before {
			@include icon-stroke;
			content: '\e900';
			font-size: 18px;
			left: -23px;
			position: absolute;
			top: -1px;
		}
	}

	&__text {
		@include font-primary-regular;
		color: $color-charcoal4;
		font-size: 14px;
		line-height: 17px;
	}

	&--confirmed {
		.appt-details {
			&__title {
				color: $color-green5;

				&::before {
					@include icon-fill;
					content: '\e920';
					font-size: 18px;
					line-height: 18px;
				}
			}
		}
	}
}

/**
 * Contractor card
 */
.contractor-card {
	background: $color-white;
	border: 1px solid $color-charcoal1;
	border-radius: 4px;
	box-shadow: 0 2px 4px 0 rgba($color-black, .1);
	font-size: 12px;
	line-height: 1.27;
	max-width: 400px;
	margin: 0 auto 30px;
	text-align: center;

	&__column {
		flex: 0 0 100%;
		padding: 20px;

		&--trust {
			border-top: 1px solid $color-charcoal1;
		}

		&--info {
			display: flex;
			gap: 20px;
			text-align: left;
		}

		&--actions {
			background-color: $color-ivory2;
			border-top: 1px solid $color-charcoal1;
			display: flex;
			flex-direction: column-reverse;
			gap: 15px 30px;
			justify-content: flex-end;
		}

		&--banner-cta {
			border-top: 1px solid $color-charcoal1;
			flex: 0 0 30%;
			padding-top: 0;
		}
	}

	&__expand {
		color: $color-blue5;
		font-weight: 700;
	}

	&__expand-text--less {
		display: none;
	}

	[data-read-more-expanded] {
		cursor: pointer;

		.contractor-card__expand-area {
			max-height: 50em;
			overflow: hidden;
			transition: max-height .3s;
		}
	}

	[data-read-more-expanded='false'] {
		.contractor-card__expand-area {
			max-height: 2em;
			margin-bottom: 0;

			&--highlights {
				max-height: 1.5em;
			}
		}
	}

	&__cta--banner {
		margin: 0;

		&,
		&:hover,
		&:focus {
			border: 0;
		}
	}

	&__action-row {
		&--text {
			padding: 10px 0;
		}

		& + & {
			border-top: 1px solid $color-charcoal1;
		}

		.appt-details {
			margin-bottom: 0;
		}
	}

	&__action-btn {
		border-radius: 4px;
		font-size: 14px;
		margin: 0;

		&.btn-secondary {
			border-radius: $color-charcoal1;
			color: $color-blue5;
		}

		&,
		&:hover,
		&:focus {
			border-width: 1px;
		}
	}

	.star-rating__stars {
		margin-bottom: 4px;
		z-index: 0;
	}

	.star-rating__label {
		&--verified,
		&--link {
			display: block;
		}

		&--link {
			color: $color-blue5;
			font-weight: 600;
			margin-top: 5px;
		}
	}

	.ratings-set {
		margin: 0;
	}

	.ratings-set__group {
		font-size: 14px;
	}
}

[data-read-more-expanded='true'] {
	.contractor-card__expand-text--more {
		display: none;
	}

	.contractor-card__expand-text--less {
		display: inline;
	}
}

.contractor-info {
	&__logo {
		border: 1px solid $color-charcoal1;
		border-radius: 4px;
		display: block;
		height: 98px;
		object-fit: contain;
		overflow: hidden;
		width: 98px;

		&--banner {
			border: 0;
			object-position: top;
		}

		img {
			height: 100%;
			object-fit: contain;
			width: 100%;
		}
	}

	&__name {
		color: $color-charcoal5;
		font-size: 16px;
		font-weight: 700;
		margin-bottom: .5em;

		a {
			color: inherit;
		}

		a:hover,
		a:focus {
			color: $color-blue5;
		}
	}

	&__highlights {
		line-height: 1.3;
	}

	&__trades-list {
		display: flex;
		flex-direction: column;
		font-weight: 600;
		gap: 1em;
		line-height: 1;
		list-style: none;
		padding: 0;
	}

	&__trade-icon {
		color: $color-blue5;
	}

	&__active-promos {
		color: inherit;
		display: block;
		font-size: 12px;
		font-weight: 600;
		margin-top: 15px;

		i {
			color: $color-green5;
		}
	}
}

@include breakpoint-sm {
	.contractor-card {
		max-width: 100%;

		&__column {
			padding: 23px;

			&--actions {
				flex-direction: row;
			}

			&--trust {
				padding-left: 0;
			}

			&--info {
				padding-right: 0;
			}

			&--banner-cta {
				border-top: 0;
			}
		}

		&__expand--mobile-only {
			display: none;
		}

		[data-read-more-expanded] {
			.contractor-card__expand-area--mobile-only {
				max-height: none;
			}
		}

		&__action-btn {
			max-width: 50%;
		}

		.star-rating__label {
			&--verified {
				display: inline-block;
			}
		}
	}

	.contractor-info {
		&__name {
			font-size: 22px;
		}

		&__logo {
			height: 120px;
			width: 120px;
		}


		&__trades-list {
			flex-direction: row;
			flex-wrap: wrap;
		}
	}

	.contractor-card--horizontal {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		.contractor-card__column {
			&--info {
				flex: 0 0 55%;
			}

			&--trust {
				flex: 0 0 44%;
				border: 0;
			}
		}
	}
}
