/**
 * Promo modal + bookshelf banner.
 * Generic styles; per-campaign accent comes through --kd-promo-accent custom property.
 */

.kd-promo-modal {
	--kd-promo-accent: var(--color-black);
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.kd-promo-modal[hidden] {
	display: none;
}

.kd-promo-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	cursor: pointer;
}

.kd-promo-modal__card {
	position: relative;
	background: var(--color-background);
	color: var(--color-text);
	border-radius: 0;
	max-width: 480px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	display: flex;
	flex-direction: column;
}

.kd-promo-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	box-sizing: border-box;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: var(--color-text);
	cursor: pointer;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kd-promo-modal__close-icon {
	width: 14px;
	height: 14px;
	display: block;
}

.kd-promo-modal__close:hover {
	background: rgba(0, 0, 0, 0.12);
}

.kd-promo-modal__hero {
	width: 100%;
	height: 360px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	overflow: hidden;
	/* gray bg comes from .u-product-image */
}

.kd-promo-modal__hero[hidden],
.kd-promo-modal__hero[data-empty="1"] {
	display: none;
}

.kd-promo-modal__hero-img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.kd-promo-modal__body {
	padding: 24px;
}

.kd-promo-modal__title {
	font-family: "Maax Bold";
	font-weight: 400;
	font-size: 22px;
	line-height: 1.2;
	margin: 0 0 12px;
}

.kd-promo-modal__copy {
	font-size: 15px;
	line-height: 1.5;
	color: var(--color-text-2);
	margin: 0 0 20px;
}

.kd-promo-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* `display: flex` above defeats the browser-default `display: none` for the
 * hidden attribute, so JS variant-toggling (`el.hidden = true`) had no visual
 * effect — all three action groups rendered stacked. Explicit override. */
.kd-promo-modal__actions[hidden] {
	display: none;
}

.kd-promo-modal__cta {
	background: var(--kd-promo-accent);
	color: var(--color-white);
	border: 0;
	border-radius: 0;
	padding: 12px 16px;
	font-family: "Maax Medium";
	font-weight: 400;
	font-size: 15px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	display: inline-block;
}

a.kd-promo-modal__cta:hover,
a.kd-promo-modal__cta:focus {
	color: var(--color-white);
	text-decoration: none;
}

.kd-promo-modal__cta[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

.kd-promo-modal__defer {
	background: transparent;
	color: var(--color-text-2);
	border: 0;
	padding: 10px 16px;
	font-size: 14px;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	display: inline-block;
}

.kd-promo-modal__defer:hover {
	color: var(--color-text);
}

a.kd-promo-modal__defer:hover,
a.kd-promo-modal__defer:focus {
	text-decoration: none;
}

/* Variant: owned placeholder. Smaller hero, since the user has already
 * committed and we want the copy and CTA to lead. */
.kd-promo-modal__card[data-kd-promo-variant="owned_placeholder"] .kd-promo-modal__hero {
	height: 240px;
}

.kd-promo-modal__status {
	margin: 12px 0 0;
	font-size: 13px;
	color: var(--color-text-2);
	text-align: center;
}

.kd-promo-modal__status[data-tone="error"] {
	color: var(--color-red);
}

/* Bookshelf banner */
.kd-promo-banner {
	--kd-promo-accent: var(--color-black);
	background: var(--color-background-2);
	border-radius: 0;
	padding: 20px;
	margin-bottom: 24px;
}

.kd-promo-banner__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 20px;
}

.kd-promo-banner__hero {
	width: 80px;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	overflow: hidden;
	border-radius: 0;
	/* gray bg comes from .u-product-image */
}

.kd-promo-banner__hero[hidden],
.kd-promo-banner__hero[data-empty="1"] {
	display: none;
}

.kd-promo-banner__hero-img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.kd-promo-banner__copy {
	min-width: 0;
}

.kd-promo-banner__title {
	font-family: "Maax Medium";
	font-weight: 400;
	font-size: 18px;
	line-height: 1.2;
	margin: 0 0 6px;
}

.kd-promo-banner__body {
	font-size: 14px;
	line-height: 1.4;
	color: var(--color-text-2);
	margin: 0;
}

.kd-promo-banner__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 140px;
}

.kd-promo-banner__cta {
	background: var(--kd-promo-accent);
	color: var(--color-white);
	border: 0;
	border-radius: 0;
	padding: 10px 14px;
	font-family: "Maax Medium";
	font-weight: 400;
	font-size: 14px;
	cursor: pointer;
}

.kd-promo-banner__cta[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

.kd-promo-banner__decline {
	background: transparent;
	color: var(--color-text-2);
	border: 1px solid var(--color-line);
	border-radius: 0;
	padding: 9px 14px;
	font-size: 13px;
	cursor: pointer;
}

.kd-promo-banner__decline:hover {
	color: var(--color-text);
	border-color: var(--color-line-2);
}

.kd-promo-banner__status {
	grid-column: 1 / -1;
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--color-text-2);
}

.kd-promo-banner__status[data-tone="error"] {
	color: var(--color-red);
}

@media (max-width: 640px) {
	.kd-promo-banner__inner {
		grid-template-columns: 1fr;
		text-align: center;
	}
	.kd-promo-banner__hero {
		justify-self: center;
	}
	.kd-promo-banner__actions {
		min-width: 0;
	}
}
