/* HyperPop — front-end popups. Colors come from CSS variables set on each popup. */
.hyperpop {
	--hp-bg: #fff;
	--hp-text: #1d2327;
	--hp-accent: #e11d48;
	--hp-accent-text: #fff;
	--hp-radius: 16px;
	position: fixed;
	z-index: 999990;
	font-size: 16px;
	line-height: 1.45;
	color: var(--hp-text);
	box-sizing: border-box;
}
.hyperpop *, .hyperpop *::before, .hyperpop *::after { box-sizing: border-box; }
.hyperpop[hidden] { display: none !important; }
/* Keep theme styles for code and buttons from shifting things out of line. */
.hyperpop code {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	line-height: 1.2;
	white-space: nowrap;
	vertical-align: middle;
}
.hyperpop button {
	margin: 0;
	min-height: 0;
	min-width: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
	line-height: 1.2;
	vertical-align: middle;
}
.hyperpop__copy {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	height: 32px;
	padding: 0 16px !important;
	border: 0 !important;
	border-radius: 999px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	white-space: nowrap;
	cursor: pointer;
}

.hyperpop__box {
	position: relative;
	background: var(--hp-bg);
	color: var(--hp-text);
	border-radius: var(--hp-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	overflow: hidden;
}
.hyperpop__body { padding: 28px 28px 24px; text-align: center; }
.hyperpop__title {
	margin: 0 0 8px;
	font-size: 1.6em;
	font-weight: 800;
	line-height: 1.15;
	color: inherit;
	letter-spacing: -.01em;
}
.hyperpop__text { margin: 0 0 14px; opacity: .85; }
.hyperpop__text p { margin: 0 0 .6em; color: inherit; }
.hyperpop__text p:last-child { margin-bottom: 0; }
.hyperpop__media img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }

.hyperpop__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .08);
	color: inherit;
	font-size: 22px;
	line-height: 34px;
	cursor: pointer;
	box-shadow: none;
}
.hyperpop__close:hover, .hyperpop__close:focus-visible { background: rgba(0, 0, 0, .16); }
.hyperpop.has-image .hyperpop__close { background: rgba(255, 255, 255, .85); color: #111; }

.hyperpop__btn {
	display: inline-block;
	margin-top: 6px;
	padding: 13px 26px;
	border-radius: 999px;
	background: var(--hp-accent);
	color: var(--hp-accent-text) !important;
	font-weight: 700;
	text-decoration: none !important;
	transition: transform .15s ease, filter .15s ease;
}
.hyperpop__btn:hover, .hyperpop__btn:focus-visible { transform: translateY(-1px); filter: brightness(1.06); }
.hyperpop__dismiss {
	display: block;
	margin: 12px auto 0;
	padding: 2px 4px;
	border: 0;
	background: none;
	color: inherit;
	font-size: .85em;
	opacity: .65;
	text-decoration: underline;
	cursor: pointer;
	box-shadow: none;
}
.hyperpop__dismiss:hover { opacity: 1; background: none; }

/* Coupon */
.hyperpop__coupon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 6px auto 12px;
	padding: 10px 12px;
	border: 2px dashed currentColor;
	border-radius: 12px;
	max-width: 340px;
}
.hyperpop__coupon-label { width: 100%; font-size: .75em; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.hyperpop__code {
	padding: 0;
	background: none;
	color: inherit;
	font: 800 1.35em/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: .06em;
}
.hyperpop__copy {
	background: var(--hp-text);
	color: var(--hp-bg);
}
.hyperpop__copy.is-copied { background: #16a34a; color: #fff; }

/* Countdown */
.hyperpop__countdown { margin: 4px 0 12px; font-size: .9em; }
.hyperpop__countdown-label { display: block; font-size: .8em; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.hyperpop__units { font-variant-numeric: tabular-nums; }
.hyperpop__units b { font-size: 1.5em; font-weight: 800; margin-left: 2px; }
.hyperpop__units.no-days .hyperpop__u--d { display: none; }

/* ---------- Center popup ---------- */
.hyperpop--modal {
	z-index: 999995;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.hyperpop__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .55);
	backdrop-filter: blur(2px);
	animation: hyperpop-fade .25s ease both;
}
.hyperpop--modal .hyperpop__box {
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	animation: hyperpop-pop .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.hyperpop--modal.hyperpop--img-left.has-image .hyperpop__box { max-width: 720px; display: flex; }
.hyperpop--modal.hyperpop--img-left.has-image .hyperpop__media { flex: 0 0 42%; }
.hyperpop--modal.hyperpop--img-left.has-image .hyperpop__media img { height: 100%; max-height: none; }
.hyperpop--modal.hyperpop--img-left.has-image .hyperpop__body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Slide-in ---------- */
.hyperpop--slide { bottom: 20px; width: 340px; max-width: calc(100vw - 32px); }
.hyperpop--pos-right { right: 20px; }
.hyperpop--pos-left { left: 20px; }
.hyperpop--slide .hyperpop__box { animation: hyperpop-slide .4s cubic-bezier(.2, .9, .3, 1) both; }
.hyperpop--slide .hyperpop__body { padding: 22px 20px 18px; }
.hyperpop--slide .hyperpop__title { font-size: 1.25em; padding-right: 20px; }
.hyperpop--slide .hyperpop__media img { max-height: 170px; }

/* ---------- Bar ---------- */
.hyperpop--bar { left: 0; right: 0; }
.hyperpop--bar-top { top: 0; }
.hyperpop--bar-bottom { bottom: 0; }
.hyperpop__box:focus { outline: none; }
.hyperpop--bar .hyperpop__box { border-radius: 0; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); animation: hyperpop-fade .3s ease both; }
.hyperpop--bar .hyperpop__body {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 18px;
	padding: 10px 52px;
	font-size: .95em;
}
.hyperpop--bar .hyperpop__title { margin: 0; font-size: 1em; font-weight: 700; }
.hyperpop--bar .hyperpop__countdown { margin: 0; display: flex; align-items: center; gap: 6px; }
.hyperpop--bar .hyperpop__countdown-label { display: inline; }
.hyperpop--bar .hyperpop__units b { font-size: 1.1em; }
.hyperpop--bar .hyperpop__coupon { margin: 0; padding: 2px 8px; border-width: 1px; max-width: none; }
.hyperpop--bar .hyperpop__coupon-label { display: none; }
.hyperpop--bar .hyperpop__code { font-size: 1em; }
.hyperpop--bar .hyperpop__copy { height: 26px; padding: 0 12px !important; }
.hyperpop--bar .hyperpop__btn { margin: 0; padding: 6px 16px; font-size: .9em; }
.hyperpop--bar .hyperpop__close { top: 50%; transform: translateY(-50%); width: 28px; height: 28px; line-height: 28px; font-size: 18px; background: transparent; }


/* ---------- Image popup (the shop's own flyer) ---------- */
.hyperpop--image .hyperpop__box {
	width: auto;
	max-width: min(var(--hp-width, 520px), calc(100vw - 32px));
	background: transparent;
	box-shadow: none;
	overflow: visible;
	text-align: center;
}
.hyperpop--image .hyperpop__flyer-link {
	display: block;
	border-radius: var(--hp-radius);
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
	transition: transform .15s ease;
	cursor: pointer;
}
.hyperpop--image .hyperpop__flyer-link:hover, .hyperpop--image .hyperpop__flyer-link:focus-visible { transform: scale(1.01); }
.hyperpop--image .hyperpop__flyer {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(100vh - 140px);
	object-fit: contain;
}
.hyperpop--image .hyperpop__close {
	top: -14px;
	right: -14px;
	background: #fff;
	color: #111;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.hyperpop--image .hyperpop__close:hover { background: #f1f1f1; }
.hyperpop__strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 10px;
	margin: 8px auto 0;
	padding: 5px 6px;
	width: fit-content;
	max-width: 100%;
	border-radius: 12px;
	background: rgba(12, 12, 14, .88);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
	color: #fff;
	font-size: 12px;
}
.hyperpop__strip .hyperpop__countdown {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0 2px 0 6px;
}
.hyperpop__strip .hyperpop__countdown-label { font-size: 9px; font-weight: 700; letter-spacing: .12em; opacity: .65; }
.hyperpop__strip .hyperpop__units { display: flex; gap: 3px; }
.hyperpop__strip .hyperpop__u {
	display: inline-flex;
	align-items: baseline;
	gap: 1px;
	padding: 2px 4px;
	border-radius: 5px;
	background: rgba(255, 255, 255, .1);
	font-size: 9px;
}
.hyperpop__strip .hyperpop__u b { margin: 0; font-size: 12px; font-weight: 800; line-height: 1.1; }
.hyperpop__strip .hyperpop__coupon {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 3px 3px 3px 10px;
	max-width: none;
	border: 1px dashed rgba(255, 255, 255, .55);
	border-radius: 999px;
}
.hyperpop__strip .hyperpop__code { font-size: 12px; letter-spacing: .08em; font-weight: 800; }
.hyperpop__strip .hyperpop__copy { height: 22px; padding: 0 10px !important; font-size: 11px !important; background: #fff; color: #111; }
.hyperpop__strip .hyperpop__copy.is-copied { background: #16a34a; color: #fff; }
.hyperpop__tip { flex-basis: 100%; text-align: center; font-size: 11px; opacity: .8; }
.hyperpop__apply.is-busy { opacity: .7; cursor: progress; }
.hyperpop--image .hyperpop__dismiss { color: #fff; opacity: .85; }


/* ---------- Center & image popups placed in a corner (computers) ---------- */
.hyperpop--modal[class*="hyperpop--at-"] {
	inset: auto;
	display: block;
	padding: 0;
	max-width: calc(100vw - 40px);
}
.hyperpop--modal.hyperpop--at-top-left { top: 20px; left: 20px; }
.hyperpop--modal.hyperpop--at-top-right { top: 20px; right: 20px; }
.hyperpop--modal.hyperpop--at-bottom-left { bottom: 20px; left: 20px; }
.hyperpop--modal.hyperpop--at-bottom-right { bottom: 20px; right: 20px; }
.admin-bar .hyperpop--modal.hyperpop--at-top-left, .admin-bar .hyperpop--modal.hyperpop--at-top-right { top: 52px; }
.hyperpop--modal[class*="hyperpop--at-"] .hyperpop__box {
	max-width: 400px;
	max-height: calc(100vh - 40px);
	animation: hyperpop-slide .4s cubic-bezier(.2, .9, .3, 1) both;
}
.hyperpop--modal.hyperpop--image[class*="hyperpop--at-"] .hyperpop__box { max-width: min(var(--hp-width, 520px), calc(100vw - 40px)); }
.hyperpop--image[class*="hyperpop--at-"] .hyperpop__flyer { max-height: calc(100vh - 120px); }
.hyperpop--image.hyperpop--at-top-right .hyperpop__close, .hyperpop--image.hyperpop--at-bottom-right .hyperpop__close { right: -10px; }

/* ---------- Motion ---------- */
@keyframes hyperpop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hyperpop-pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hyperpop-slide { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.hyperpop.is-closing { animation: hyperpop-fade .2s ease reverse both; }
@media (prefers-reduced-motion: reduce) {
	.hyperpop *, .hyperpop.is-closing { animation: none !important; transition: none !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
	.hyperpop--modal:not(.hyperpop--image):not([class*="hyperpop--at-"]) { align-items: flex-end; padding: 0; }
	.hyperpop--modal:not(.hyperpop--image):not([class*="hyperpop--at-"]) .hyperpop__box { max-width: none !important; border-radius: var(--hp-radius) var(--hp-radius) 0 0; display: block !important; max-height: 88vh; }
	.hyperpop--modal .hyperpop__media img { max-height: 180px; height: auto !important; }
	.hyperpop--image .hyperpop__close { top: -10px; right: -6px; }
	.hyperpop__title { font-size: 1.35em; }
	.hyperpop--slide { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; }
	/* Popups set to a corner sit at the bottom of the phone screen, page stays usable. */
	.hyperpop--modal[class*="hyperpop--at-"] { top: auto !important; left: 12px; right: 12px; bottom: 12px; max-width: none; }
	.hyperpop--modal[class*="hyperpop--at-"] .hyperpop__box { max-width: none !important; margin: 0 auto; }
	.hyperpop--image[class*="hyperpop--at-"] .hyperpop__box { max-width: min(100%, 360px) !important; }
	.hyperpop--image[class*="hyperpop--at-"] .hyperpop__flyer { max-height: 55vh; }
	.hyperpop--bar .hyperpop__body { padding: 8px 40px 8px 14px; justify-content: flex-start; gap: 6px 10px; font-size: .88em; }
}
