/*
 * MWD-3320 / MWD-3321: marketing sign-up popup ("Stay in the loop!") (views/.../popup/marketing-signup-popup.phtml),
 * used in guest mode (homepage, with fields) and signed-in mode (orders page, once after sign-up, without).
 * Everything is scoped under .marketing-popup. Colours and fonts are the site's own: #0099ff / #32abff, Centrale Sans.
 *
 * Mobile first: wide picture on top, white card overlapping its bottom.
 * 768px and up: tall picture on the left, card overlapping its right edge, up to 780px wide; both shrink
 * on narrow tablets. Bootstrap's .modal scrolls when the popup is taller than the window.
 */

/* ---------- Dialog and frame ---------- */

.marketing-popup .modal-dialog {
	max-width: 400px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 16px;
}

.marketing-popup .marketing-popup-content {
	position: relative;
	display: flex;
	flex-direction: column;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* ---------- Picture ---------- */

.marketing-popup .marketing-popup-media {
	display: block;
	line-height: 0;
}

.marketing-popup .marketing-popup-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 32px 32px 0 0;
}

/* ---------- Close (x) ---------- */

/* Mobile: white, over the picture's top-right corner (moved down a little, clear of the rounded corner) */
.marketing-popup .marketing-popup-close {
	position: absolute;
	top: 50px;
	right: 15px;
	z-index: 2;
	width: 1.25rem;
	height: 1.25rem;
	padding: 0.5rem;
	filter: invert(1) grayscale(100%) brightness(200%);
	opacity: 1;
	box-sizing: content-box;
}

.marketing-popup .marketing-popup-close:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
	box-shadow: none;
}

/* ---------- Card ---------- */

.marketing-popup .marketing-popup-card {
	position: relative;
	z-index: 1;
	/* Overlaps the bottom of the picture; % of width so it scales with the picture */
	margin-top: -16%;
	padding: 32px 24px 28px;
	background: #ffffff;
	border-radius: 32px;
	text-align: center;
	color: #000000;
}

.marketing-popup .marketing-popup-heading {
	margin: 0 0 16px;
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-weight: 700;
	font-size: 1.75rem;
	line-height: 1.15;
	color: #0099ff;
}

.marketing-popup .marketing-popup-benefit {
	margin: 0 0 20px;
	font-family: 'Centrale Sans Regular', Trebuchet, sans-serif;
	font-size: 1rem;
	line-height: 1.4;
	color: #000000;
}

/* ---------- Fields (newsletter only): label beside the box, as in the mock-ups ---------- */

.marketing-popup .marketing-popup-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 8px;
	text-align: left;
}

.marketing-popup .marketing-popup-label {
	flex: 0 0 82px;
	margin: 0;
	padding-top: 9px;
	font-family: 'Centrale Sans Bold', Trebuchet, sans-serif;
	font-weight: 700;
	font-size: 0.875rem;
	text-align: right;
	white-space: nowrap;
}

.marketing-popup .marketing-popup-field {
	flex: 1 1 auto;
	min-width: 0;
}

.marketing-popup .marketing-popup-input {
	display: block;
	width: 100%;
	height: 40px;
	padding: 6px 10px;
	border: 1px solid #d6d6d6;
	border-radius: 4px;
	background: #f4f4f4;
	font-size: 1rem; /* 16px stops iOS zooming in on focus */
	color: #000000;
}

.marketing-popup .marketing-popup-input-email {
	background: #ffffff;
}

.marketing-popup .marketing-popup-input:focus {
	border-color: #0099ff;
	outline: 2px solid #0099ff;
	outline-offset: 0;
	background: #ffffff;
}

.marketing-popup .marketing-popup-input[aria-invalid="true"] {
	border-color: #d0021b;
}

.marketing-popup .marketing-popup-input:disabled {
	opacity: 0.7;
}

/* ---------- Consent: unticked box, statement as its label ---------- */

.marketing-popup .marketing-popup-consent {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	text-align: left;
}

.marketing-popup .marketing-popup-row + .marketing-popup-consent {
	margin-top: 16px;
}

.marketing-popup .marketing-popup-checkbox {
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
	margin: 1px 0 0;
	cursor: pointer;
}

.marketing-popup .marketing-popup-checkbox:focus-visible {
	outline: 3px solid #0099ff;
	outline-offset: 2px;
}

.marketing-popup .marketing-popup-checkbox[aria-invalid="true"] {
	border-color: #d0021b;
}

/* Kept readable: never below 13px, even though the mock-up shows it smaller */
.marketing-popup .marketing-popup-statement {
	margin: 0;
	font-family: 'Centrale Sans Regular', Trebuchet, sans-serif;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #222222;
	cursor: pointer;
}

/* ---------- Messages ---------- */

.marketing-popup .marketing-popup-field-error,
.marketing-popup .marketing-popup-error {
	margin: 4px 0 0;
	font-size: 0.8125rem;
	line-height: 1.3;
	color: #d0021b;
	text-align: left;
}

.marketing-popup .marketing-popup-field-error:empty,
.marketing-popup .marketing-popup-error:empty,
.marketing-popup .marketing-popup-feedback:empty {
	display: none;
}

.marketing-popup .marketing-popup-consent-error {
	padding-left: calc(1.25rem + 12px);
}

.marketing-popup .marketing-popup-error {
	margin-top: 12px;
	text-align: center;
}

.marketing-popup .marketing-popup-feedback {
	margin: 16px 0 0;
	padding: 12px 16px;
	border-radius: 12px;
	background: #e9f6ff;
	font-family: 'Centrale Sans Regular', Trebuchet, sans-serif;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: #000000;
}

.marketing-popup .marketing-popup-feedback p {
	margin: 0;
}
/* ---------- Register button ---------- */

.marketing-popup .marketing-popup-button {
	display: block;
	width: 100%;
	max-width: 220px;
	min-height: 44px;
	margin: 20px auto 0;
	padding: 0.625rem 1.25rem;
	border: 0;
	border-radius: 999px;
	background-color: #0099ff;
	color: #ffffff;
	font-family: 'Centrale Sans Medium', Trebuchet, sans-serif;
	font-weight: 500;
	font-size: 1.125rem;
	line-height: 1.2;
	cursor: pointer;
}

.marketing-popup .marketing-popup-button:hover {
	background-color: #32abff;
	color: #ffffff;
}

.marketing-popup .marketing-popup-button:focus-visible {
	outline: 3px solid #000000;
	outline-offset: 2px;
}

.marketing-popup .marketing-popup-button:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ---------- Desktop and tablet: side by side ---------- */

@media (min-width: 768px) {
	.marketing-popup .modal-dialog {
		max-width: 812px; /* 780px popup + 16px padding each side */
	}

	.marketing-popup .marketing-popup-content {
		flex-direction: row;
		align-items: stretch;
	}

	/* Picture and card both shrink, so 768-812px (iPad) fits inside the window.
	   The picture fills the card's height (lightly cropped), whether or not the card has fields. */
	.marketing-popup .marketing-popup-media {
		flex: 0 1 290px;
		min-width: 200px;
	}

	.marketing-popup .marketing-popup-image {
		height: 100%;
		object-fit: cover;
		object-position: center;
		border-radius: 24px 0 0 24px;
	}

	/* Close: thin and grey, in the card's top-right corner */
	.marketing-popup .marketing-popup-close {
		top: 18px;
		right: 18px;
		filter: none;
		opacity: 0.55;
	}

	.marketing-popup .marketing-popup-close:hover {
		opacity: 0.85;
	}

	.marketing-popup .marketing-popup-close:focus-visible {
		outline-color: #000000;
	}

	/* 290px picture + 520px card - 30px overlap = 780px at full width */
	.marketing-popup .marketing-popup-card {
		flex: 1 1 520px;
		min-width: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: 336px;
		margin: 0 0 0 -30px;
		padding: 48px 48px 40px;
	}

	.marketing-popup .marketing-popup-heading {
		font-size: 2.5rem;
	}

	.marketing-popup .marketing-popup-label {
		flex-basis: 86px;
	}
}

/* ---------- Short screens (e.g. a phone held sideways) ---------- */

@media (min-width: 768px) and (max-height: 600px) {
	.marketing-popup .modal-dialog {
		max-width: 712px;
	}

	.marketing-popup .marketing-popup-media {
		flex-basis: 190px;
	}

	.marketing-popup .marketing-popup-card {
		min-height: 0;
		padding: 28px 36px 24px;
	}

	.marketing-popup .marketing-popup-heading {
		font-size: 1.75rem;
		margin-bottom: 10px;
	}

	.marketing-popup .marketing-popup-benefit {
		margin-bottom: 12px;
	}

	.marketing-popup .marketing-popup-button {
		margin-top: 14px;
	}
}
