/* Welcome-offer dialog */
.m-promo { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; }
.m-promo[hidden] { display: none; }
.m-promo__overlay { position: absolute; inset: 0; background: rgba(43, 74, 107, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s ease; }
.m-promo__dialog {
	position: relative; width: min(860px, 100%); max-height: calc(100dvh - 2rem); overflow: auto;
	display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
	background: var(--m-surface, #fff); border-radius: var(--m-r-xl, 28px);
	box-shadow: 0 40px 80px rgba(43, 74, 107, .35);
	opacity: 0; transform: translateY(24px) scale(.97);
	transition: opacity .35s var(--m-ease, ease), transform .45s var(--m-ease, cubic-bezier(.2, .8, .2, 1));
}
.m-promo.is-open .m-promo__overlay { opacity: 1; }
.m-promo.is-open .m-promo__dialog { opacity: 1; transform: none; }
html.m-promo-open { overflow: hidden; }

.m-promo__close { position: absolute; top: .75rem; inset-inline-start: .75rem; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--m-ink, #263B52); cursor: pointer; box-shadow: 0 4px 12px rgba(43, 74, 107, .15); transition: transform .2s; }
.m-promo__close:hover { transform: rotate(90deg); }
.m-promo__close .m-icon { width: 20px; height: 20px; }

.m-promo__media { position: relative; margin: 0; min-height: 100%; background: var(--m-primary-50, #EDF4FB); }
.m-promo__img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.m-promo__badge { position: absolute; bottom: 1rem; inset-inline-end: 1rem; padding: .55rem 1rem; border-radius: 999px; background: var(--m-accent, #F6A64B); color: var(--m-ink, #263B52); font-weight: 700; font-size: 1.05rem; box-shadow: 0 8px 20px rgba(246, 166, 75, .35); }

.m-promo__body { padding: clamp(1.5rem, 3vw, 2.5rem); display: flex; flex-direction: column; gap: 1rem; }
.m-promo__title { margin: 0; font-size: clamp(1.35rem, 1rem + 1.4vw, 1.8rem); line-height: 1.35; text-wrap: balance; }
.m-promo__desc { margin: 0; color: var(--m-muted, #5F6E80); }
.m-promo__cat { display: inline-block; margin-inline-start: .4rem; padding: .1rem .6rem; border-radius: 999px; background: var(--m-primary-50, #EDF4FB); color: var(--m-primary-800, #2A5580); font-size: .8rem; font-weight: 600; }

.m-promo__timer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; direction: ltr; }
.m-promo__unit { display: grid; justify-items: center; gap: .15rem; padding: .7rem .25rem; border-radius: var(--m-r, 14px); background: var(--m-primary-800, #2A5580); color: #fff; }
.m-promo__unit span { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.m-promo__unit small { font-size: .75rem; opacity: .85; direction: rtl; }

.m-promo__price { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.m-promo__price strong { font-size: 1.7rem; color: var(--m-primary-800, #2A5580); }
.m-promo__price del { color: var(--m-muted, #5F6E80); }
.m-promo__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.m-promo__buy { flex: 1 1 auto; justify-content: center; }
.m-promo__note { margin: 0; font-size: .82rem; color: var(--m-muted, #5F6E80); }

@media (max-width: 767px) {
	.m-promo { place-items: end center; padding: 0; }
	.m-promo__dialog { grid-template-columns: minmax(0, 1fr); border-radius: 24px 24px 0 0; max-height: 92dvh; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
	.m-promo__img { aspect-ratio: 16 / 9; height: auto; }
	.m-promo__body { padding: 1.25rem 1.25rem 1.5rem; gap: .8rem; }
	.m-promo__unit span { font-size: 1.4rem; }
	.m-promo__actions { display: grid; }
	.m-promo__actions .m-link-arrow { justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { .m-promo__overlay, .m-promo__dialog { transition: none; } }

/* Dashboard-managed popups: per-popup colours + layout without image */
.m-promo__dialog { background: var(--mp-bg, #fff); }
.m-promo .m-promo__buy { --btn-bg: var(--mp-btn, var(--m-accent)); }
.m-promo--noimg .m-promo__dialog { grid-template-columns: minmax(0, 1fr); max-width: 520px; }

/* Design order: text on the right, picture on the left (RTL); close button on the picture corner */
.m-promo__media { order: 2; border-start-end-radius: var(--m-r-xl, 28px); border-end-end-radius: var(--m-r-xl, 28px); overflow: hidden; }
.m-promo__body { order: 1; justify-content: center; }
.m-promo__close { inset-inline-start: auto; inset-inline-end: .9rem; top: .9rem; }
.m-promo--noimg .m-promo__close { inset-inline-end: .9rem; }
.m-promo__img { height: 100%; min-height: 100%; aspect-ratio: auto; }
.m-promo__media { min-height: 420px; }
.m-promo__badge { inset-inline-end: auto; inset-inline-start: auto; left: 1rem; right: auto; }
[dir="ltr"] .m-promo__badge { right: 1rem; left: auto; }
.m-promo__actions .m-link-arrow { font-weight: 600; color: var(--m-primary, #1B75BB); }
@media (max-width: 767px) {
	.m-promo__media { order: 0; min-height: 0; border-radius: 0; }
	.m-promo__img { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
	.m-promo__close { inset-inline-end: .75rem; }
}

/* Design order v2: fixed-height picture, equal columns */
@media (min-width: 768px) {
	.m-promo__dialog:has(.m-promo__media) { grid-template-columns: 1fr 1fr; }
	.m-promo__media { position: relative; min-height: 460px; height: 100%; }
	.m-promo__media .m-promo__img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; aspect-ratio: auto; }
	.m-promo__body { padding: 2.25rem 2rem; }
}
.m-promo__cat { display: inline-block; margin-inline-start: .35rem; padding: .1rem .6rem; border-radius: 999px; background: var(--m-primary-50, #e8f2fa); color: var(--m-primary, #1B75BB); font-size: .8em; font-weight: 700; vertical-align: middle; }

/* Picture fully visible (no cropping): whole image on a soft blurred copy of itself */
.m-promo__media { background: var(--m-primary-50, #eef5fb); isolation: isolate; }
.m-promo__media::before { content: ""; position: absolute; inset: -24px; z-index: -1; background: var(--mp-img) center / cover no-repeat; filter: blur(22px) saturate(1.1); opacity: .55; }
.m-promo__media .m-promo__img { object-fit: contain !important; }
@media (min-width: 768px) {
	.m-promo__dialog:has(.m-promo__media) { grid-template-columns: 1fr 1.25fr; width: min(980px, calc(100vw - 2rem)); max-width: min(980px, calc(100vw - 2rem)); }
	.m-promo__media .m-promo__img { padding: 1rem; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.m-promo__dialog:has(.m-promo__media) { grid-template-columns: 1fr; max-height: calc(100vh - 2rem); }
	.m-promo__media { min-height: 0; height: auto; }
	.m-promo__media .m-promo__img { position: static; height: auto; max-height: 42vh; padding: 0; }
	.m-promo__media { order: 0; border-radius: 0; }
}
@media (max-width: 767px) {
	.m-promo__media .m-promo__img { aspect-ratio: auto; height: auto !important; min-height: 0 !important; max-height: 40vh; }
}

/* Days counter */
.m-promo__timer.has-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
