/* Buy one, get one free: checkout banner and popup. */

.barn2-mpd-banner {
	margin: 20px 0 0;
	padding: 14px 16px;
	border: 1px solid #03a0c7;
	border-radius: 6px;
	background: #eaf7fb;
	text-align: center;
}

.barn2-mpd-banner.is-applied {
	border-color: #2e9e5b;
	background: #edf8f1;
}

/* Same as the plugin names in the checkout cart. */
.barn2-mpd-banner__title {
	margin: 0 0 4px;
	color: #424242;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.3;
}

.barn2-mpd-banner__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
}

/* Shrink-wraps the text so the button is as wide as the longest line above it. */
.barn2-mpd-banner__content {
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
	max-width: 100%;
}

.barn2-mpd-banner__button.btn {
	margin-top: 12px;
	width: 100%;
	padding-left: 12px;
	padding-right: 12px;
	white-space: normal;
	line-height: 1.25;
}

.barn2-mpd-free-tag {
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 3px;
	background: #edf8f1;
	color: #2e9e5b;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.barn2-mpd-dialog {
	width: calc(100% - 32px);
	max-width: 720px;
	max-height: 85vh;
	padding: 0;
	border: 0;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	color: inherit;
	/* The banner is centred; the popup inside it must not inherit that. */
	text-align: left;
	/* Pin the top edge so opening a description grows the popup downwards instead of re-centring it. */
	margin: 7vh auto auto;
}

.barn2-mpd-dialog::backdrop {
	background: rgba(15, 23, 42, 0.55);
}

.barn2-mpd-dialog__inner {
	padding: 40px;
}

.barn2-mpd-dialog__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.barn2-mpd-dialog__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
}

.barn2-mpd-dialog__close {
	flex: none;
	width: 36px;
	height: 36px;
	margin: -6px -6px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.barn2-mpd-dialog__close:hover,
.barn2-mpd-dialog__close:focus-visible {
	background: #f0f2f4;
}

.barn2-mpd-dialog__intro {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #424242;
}

.barn2-mpd-dialog__message {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 4px;
	background: #fcf0f1;
	color: #8a2424;
	font-size: 14px;
}

.barn2-mpd-dialog__section-title {
	margin: 24px 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #50575e;
}

.barn2-mpd-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.barn2-mpd-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 0;
	border-top: 1px solid #e2e4e7;
}

.barn2-mpd-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.barn2-mpd-card__name {
	margin: 0;
	font-weight: 400;
	font-size: 15px;
}

.barn2-mpd-card__excerpt {
	margin: 4px 0 0;
	font-size: 14px;
	line-height: 1.45;
	color: #50575e;
}

.barn2-mpd-card__action {
	flex: none;
}

.barn2-mpd-dialog [hidden] {
	display: none !important;
}

.barn2-mpd-card__name {
	display: flex;
	align-items: center;
	gap: 4px;
}

.barn2-mpd-card__toggle {
	position: relative;
	flex: none;
	width: 26px;
	height: 26px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #03a0c7;
	cursor: pointer;
}

.barn2-mpd-card__toggle::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translate(-50%, -70%) rotate(45deg);
	transition: transform 0.15s ease;
}

.barn2-mpd-card__toggle[aria-expanded="true"]::before {
	transform: translate(-50%, -25%) rotate(-135deg);
}

.barn2-mpd-card__toggle:hover,
.barn2-mpd-card__toggle:focus-visible {
	background: #eaf7fb;
}

.barn2-mpd-dialog__show-more {
	display: block;
	width: 100%;
	margin: 18px 0 0;
	padding: 8px 12px;
	border: 1px solid #03a0c7;
	border-radius: 999px;
	background: transparent;
	color: #03a0c7;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}

/* Each list sits in a bordered table with a tinted header row. */
.barn2-mpd-table {
	margin-top: 24px;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	overflow: hidden;
}

.barn2-mpd-table .barn2-mpd-dialog__section-title {
	margin: 0;
	padding: 9px 20px;
	border-bottom: 1px solid #e2e4e7;
	background: #eaf7fb;
	color: #1d242e;
	letter-spacing: 0.04em;
	text-align: center;
}

.barn2-mpd-table .barn2-mpd-card {
	padding: 11px 20px;
}

.barn2-mpd-table .barn2-mpd-card:first-child {
	border-top: 0;
}

.barn2-mpd-dialog__more.has-divider .barn2-mpd-table {
	margin-top: 16px;
}

.barn2-mpd-dialog__show-more:hover,
.barn2-mpd-dialog__show-more:focus-visible {
	background: #eaf7fb;
}

.barn2-mpd-card__button.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 110px;
	height: 35px;
	padding: 0 16px;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
}

.barn2-mpd-card__button.btn.is-added,
.barn2-mpd-card__button.btn.is-added:disabled {
	border-color: #2e9e5b;
	background: #2e9e5b;
	color: #fff;
	opacity: 1;
}

.barn2-mpd-dialog__footer {
	position: sticky;
	bottom: 0;
	display: flex;
	justify-content: flex-end;
	padding: 12px 40px;
	border-top: 1px solid #e2e4e7;
	background: #fff;
}

.barn2-mpd-dialog__done.btn {
	min-width: 140px;
}

.barn2-mpd-card__name a {
	color: inherit;
	text-decoration: none;
}

.barn2-mpd-card__name a:hover,
.barn2-mpd-card__name a:focus-visible {
	color: #03a0c7;
	text-decoration: underline;
}

@media (max-width: 575px) {
	.barn2-mpd-dialog {
		margin-top: 16px;
		max-height: calc(100vh - 32px);
	}

	.barn2-mpd-dialog__inner {
		padding: 18px 16px;
	}

	.barn2-mpd-card,
	.barn2-mpd-table .barn2-mpd-card {
		gap: 10px;
		padding: 12px 16px;
	}

	.barn2-mpd-table .barn2-mpd-dialog__section-title {
		padding: 9px 16px;
	}

	.barn2-mpd-dialog__footer {
		padding: 12px 16px;
	}
}
