/* Pop-ups (Pop-ups in the admin menu). Albert Sans, square buttons, Yuna pink accent.
   Width, padding, radius, background, text colour and overlay come from the pop-up's sidebar settings. */
.yuna-popup {
	--yp-width: 880px;
	--yp-padding: 0px;
	--yp-radius: 10px;
	--yp-bg: #fff;
	--yp-text: #545454;
	--yp-heading: #000;
	--yp-accent: #f7539b;
	--yp-button-bg: #000;
	--yp-button-color: #fff;
	--yp-border: #ebebeb;
	--yp-overlay: .5;

	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: inherit;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease-out, visibility 0s linear .3s;
}

.yuna-popup[hidden] { display: none; }

.yuna-popup.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .3s ease-out;
}

.yuna-popup:focus { outline: none; }

.yuna-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--yp-overlay));
	pointer-events: auto;
}

.yuna-popup__panel {
	position: relative;
	box-sizing: border-box;
	width: min(var(--yp-width), 100%);
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow: auto;
	padding: var(--yp-padding);
	background: var(--yp-bg);
	color: var(--yp-text);
	border-radius: var(--yp-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	pointer-events: auto;
	transform: translateY(14px) scale(.98);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

.yuna-popup.is-open .yuna-popup__panel { transform: none; }

/* The blocks the editor built */
.yuna-popup__content > :first-child { margin-top: 0; }
.yuna-popup__content > :last-child { margin-bottom: 0; }
.yuna-popup__content .wp-block-columns { margin: 0; gap: 0; }
.yuna-popup__content .wp-block-column { margin: 0; }
.yuna-popup__content .yuna-popup-image { height: 100%; margin: 0; }
.yuna-popup__content .yuna-popup-image img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 560px;
	object-fit: cover;
	object-position: center 20%;
}
.yuna-popup__content .yuna-popup-body { box-sizing: border-box; padding: 56px 52px 40px; text-align: center; }
.yuna-popup__content .yuna-popup-body > * { margin-left: auto; margin-right: auto; }
.yuna-popup__content .wp-block-buttons { justify-content: center; }
.yuna-popup__content .wp-block-button__link { border-radius: 0; }

/* Corner pop-ups: no dimming, the page stays usable */
.yuna-popup--bottom-left,
.yuna-popup--bottom-right {
	inset: auto;
	bottom: 0;
	padding: 20px;
	align-items: flex-end;
}

.yuna-popup--bottom-left { left: 0; justify-content: flex-start; }
.yuna-popup--bottom-right { right: 0; justify-content: flex-end; }

.yuna-popup--bottom-left .yuna-popup__overlay,
.yuna-popup--bottom-right .yuna-popup__overlay { display: none; }

.yuna-popup--bottom-left .yuna-popup__panel,
.yuna-popup--bottom-right .yuna-popup__panel { width: min(var(--yp-width), 420px); }

.yuna-popup--bottom-left .wp-block-columns,
.yuna-popup--bottom-right .wp-block-columns { flex-direction: column; }
.yuna-popup--bottom-left .yuna-popup-image img,
.yuna-popup--bottom-right .yuna-popup-image img { min-height: 0; height: 200px; }
.yuna-popup--bottom-left .yuna-popup-body,
.yuna-popup--bottom-right .yuna-popup-body { padding: 32px 28px 26px; }

/* Coupon tab: what stays on the side of the screen after the pop-up is closed */
.yuna-popup-tab {
	position: fixed;
	top: var(--yp-tab-top, 50%);
	z-index: 1190;
	margin: 0;
	padding: 18px 11px;
	border: 0;
	background: var(--yp-tab-bg, #f7539b);
	color: var(--yp-tab-color, #fff);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .14em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
	outline: 1px dashed color-mix(in srgb, var(--yp-tab-color, #fff) 60%, transparent);
	outline-offset: -5px;
	transition: transform .35s cubic-bezier(.2, .7, .2, 1), padding .2s;
}

.yuna-popup-tab[hidden] { display: none; }

.yuna-popup-tab > span { display: block; writing-mode: vertical-rl; }

.yuna-popup-tab--right { right: 0; border-radius: 10px 0 0 10px; transform: translate(100%, -50%); }
.yuna-popup-tab--left { left: 0; border-radius: 0 10px 10px 0; transform: translate(-100%, -50%); }
.yuna-popup-tab--left > span { transform: rotate(180deg); }

.yuna-popup-tab.is-visible { transform: translate(0, -50%); }

.yuna-popup-tab--right:hover { padding-right: 16px; }
.yuna-popup-tab--left:hover { padding-left: 16px; }
.yuna-popup-tab:focus-visible { outline: 2px solid var(--yp-tab-color, #fff); outline-offset: -4px; }

.yuna-popup-signup__success { animation: yuna-popup-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.yuna-popup-signup__success[hidden],
.yuna-popup-signup__form-step[hidden] { display: none; }
.yuna-popup-signup__success:focus { outline: none; }

@keyframes yuna-popup-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.yuna-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: #000;
	cursor: pointer;
	transition: background-color .2s;
}

.yuna-popup__close:hover { background: #fff; }

/* Content */
.yuna-popup__eyebrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 0 18px;
	color: var(--yp-heading);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .28em;
	text-transform: uppercase;
}

.yuna-popup__eyebrow::before,
.yuna-popup__eyebrow::after {
	content: "";
	width: 22px;
	height: 1px;
	background: var(--yp-accent);
}

.yuna-popup__title {
	margin: 0 0 14px;
	color: var(--yp-heading);
	font-size: clamp(26px, 3vw, 34px);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -.01em;
}

.yuna-popup--bottom-left .yuna-popup__title,
.yuna-popup--bottom-right .yuna-popup__title { font-size: 24px; }

.yuna-popup__text {
	margin: 0 0 28px;
	color: var(--yp-text);
	font-size: 15px;
	line-height: 1.6;
}

.yuna-popup__title:last-child,
.yuna-popup__text:last-child { margin-bottom: 0; }

.yuna-popup__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
}

.yuna-popup .yuna-popup__input {
	box-sizing: border-box;
	width: 100%;
	height: 50px;
	padding: 0 18px;
	border: 1px solid var(--yp-border);
	border-radius: 0;
	background: #fff;
	color: #000;
	font-family: inherit;
	font-size: 14px;
	transition: border-color .2s;
}

.yuna-popup .yuna-popup__input:focus { border-color: var(--yp-heading); outline: none; }
.yuna-popup .yuna-popup__input[aria-invalid="true"] { border-color: #db1215; }

.yuna-popup__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.yuna-popup .yuna-popup__button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 50px;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	background: var(--yp-button-bg);
	color: var(--yp-button-color);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .14em;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity .2s;
}

.yuna-popup .yuna-popup__button:hover,
.yuna-popup .yuna-popup__button:focus-visible { opacity: .85; color: var(--yp-button-color); }

.yuna-popup .yuna-popup__button[aria-busy="true"] { pointer-events: none; opacity: .75; }
.yuna-popup .yuna-popup__button[aria-busy="true"]::after {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: yuna-popup-spin .7s linear infinite;
}

@keyframes yuna-popup-spin { to { transform: rotate(360deg); } }

.yuna-popup__error {
	margin: 2px 0 0;
	color: #db1215;
	font-size: 13px;
	text-align: left;
}

.yuna-popup__micro {
	margin: 16px 0 0;
	color: #8a8a8a;
	font-size: 12px;
	line-height: 1.5;
}

.yuna-popup .yuna-popup__dismiss {
	align-self: center;
	margin: 14px 0 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--yp-text);
	font-family: inherit;
	font-size: 12px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.yuna-popup .yuna-popup__dismiss:hover { background: none; color: var(--yp-heading); }

/* Step 2: code reveal */
.yuna-popup__code {
	display: flex;
	align-items: stretch;
	margin: 0 0 12px;
	border: 1px dashed var(--yp-heading);
}

.yuna-popup__code-value {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 58px;
	padding: 0 16px;
	color: var(--yp-heading);
	font-size: 22px;
	font-weight: 600;
	letter-spacing: .2em;
	user-select: all;
}

.yuna-popup .yuna-popup__copy {
	flex: 0 0 auto;
	min-width: 96px;
	padding: 0 18px;
	border: 0;
	border-left: 1px dashed var(--yp-heading);
	border-radius: 0;
	background: transparent;
	color: var(--yp-heading);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.yuna-popup .yuna-popup__copy:hover { background: var(--yp-heading); color: var(--yp-bg); }
.yuna-popup .yuna-popup__copy.is-copied { background: var(--yp-accent); color: #fff; }

.yuna-popup__test-note {
	margin: 14px 0 0;
	color: #b26b00;
	font-size: 11px;
}

@media (max-width: 767px) {
	.yuna-popup { padding: 12px; }

	.yuna-popup--bottom-left,
	.yuna-popup--bottom-right {
		left: 0;
		right: 0;
		justify-content: center;
		padding: 12px;
	}

	.yuna-popup__content .yuna-popup-image img { min-height: 0; height: 170px; }
	.yuna-popup__content .yuna-popup-body,
	.yuna-popup--bottom-left .yuna-popup-body,
	.yuna-popup--bottom-right .yuna-popup-body { padding: 30px 22px 24px; }
	.yuna-popup__eyebrow { margin-bottom: 12px; }
	.yuna-popup__text { margin-bottom: 20px; font-size: 14px; }
	.yuna-popup__code-value { font-size: 18px; letter-spacing: .14em; }
	.yuna-popup .yuna-hide-mobile { display: none; }
	.yuna-popup-tab { padding: 14px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	.yuna-popup,
	.yuna-popup__panel,
	.yuna-popup-tab,
	.yuna-popup-signup__success { transition: none; animation: none; }
}
