/* Msallati Loyalty — styles for the floating notice + My Account dashboard.
   Brand olive palette; responsive; RTL + LTR aware. Scoped to .msloy-* only. */

:root {
	--msloy-olive-900: #1B1F0E;
	--msloy-olive-700: #394024;
	--msloy-olive-500: #5B653B;
	--msloy-olive-400: #7C8A52;
	--msloy-gold: #C8A24B;
	--msloy-cream: #FAF8F3;
	--msloy-line: #e7e3d6;
}

/* ---------- Homepage loyalty pop-up (centered modal) ---------- */
html.msloy-locked, html.msloy-locked body { overflow: hidden; }

/* Inactive overlay must behave as if it does not exist: removed from layout AND
   from hit-testing. High specificity (#id + class) so the theme can't force it
   visible, plus a hard [hidden] guard as the ultimate backstop. Hiding is done
   with display/visibility/pointer-events — never opacity alone. */
#msloy-notice.msloy-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	visibility: hidden;
	pointer-events: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(27, 31, 14, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity .32s ease;
	font-family: inherit;
	box-sizing: border-box;
}
/* Active: in layout, visible and interactive (the backdrop intentionally blocks
   the page only while the modal is open). */
#msloy-notice.msloy-overlay.is-visible {
	display: flex;
	visibility: visible;
	pointer-events: auto;
}
/* Fade/scale-in target (added one frame after is-visible). */
#msloy-notice.msloy-overlay.is-shown { opacity: 1; }
/* Hard guard: the hidden attribute always wins, even over the active rules. */
#msloy-notice[hidden] {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.msloy-modal {
	position: relative;
	width: 640px;
	max-width: 90vw;
	max-height: 90dvh;
	overflow-y: auto;
	box-sizing: border-box;
	background: linear-gradient(180deg, #FEFCF7, var(--msloy-cream));
	border: 1px solid #efe9da;
	border-radius: 24px;
	padding: 40px 44px 36px;
	text-align: center;
	box-shadow: 0 30px 80px rgba(27, 31, 14, 0.38);
	transform: translateY(18px) scale(.97);
	transition: transform .34s cubic-bezier(.2, .8, .25, 1);
	color: var(--msloy-olive-700);
}
.msloy-overlay.is-shown .msloy-modal { transform: translateY(0) scale(1); }

.msloy-overlay .msloy-modal-close {
	position: absolute !important;
	top: 14px !important;
	right: 16px !important;
	left: auto !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 38px !important;
	height: 38px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(57, 64, 36, 0.08) !important;
	color: var(--msloy-olive-700) !important;
	font-size: 26px !important;
	line-height: 1 !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: background .2s ease, transform .2s ease;
}
.msloy-overlay .msloy-modal-close:hover { background: rgba(57, 64, 36, 0.16) !important; transform: rotate(90deg); }

.msloy-modal-head { margin-bottom: 22px; }
.msloy-modal-title {
	margin: 0 0 10px;
	font-size: 25px;
	line-height: 1.3;
	font-weight: 800;
	color: var(--msloy-olive-700);
}
.msloy-modal-sub {
	margin: 0 auto;
	max-width: 44ch;
	font-size: 15px;
	line-height: 1.6;
	color: var(--msloy-olive-500);
}

/* brand-mark circles + dotted connectors */
.msloy-modal-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	margin: 6px auto 24px;
}
.msloy-m-dot {
	flex: 0 0 auto;
	width: 74px;
	height: 74px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #e7ddc3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(57, 64, 36, 0.10);
	overflow: hidden;
}
.msloy-m-dot img { width: 72%; height: 72%; object-fit: contain; }
/* Completed loyalty circles turn olive-green (brand). */
.msloy-m-dot.is-done {
	border-color: var(--msloy-olive-400);
	background: #f2f6e8;
	box-shadow: 0 6px 20px rgba(124, 138, 82, 0.32);
}
.msloy-m-link {
	flex: 0 1 46px;
	min-width: 20px;
	height: 0;
	border-top: 3px dotted #cfc6ab;
	margin: 0 6px;
}
.msloy-m-link.is-done { border-top-color: var(--msloy-olive-400); }

.msloy-modal-body { margin-bottom: 26px; }
.msloy-modal-main {
	margin: 0 auto 10px;
	max-width: 42ch;
	font-size: 18px;
	line-height: 1.5;
	font-weight: 800;
	color: var(--msloy-olive-900);
}
.msloy-modal-fine {
	margin: 0 auto;
	max-width: 46ch;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--msloy-olive-500);
}

.msloy-modal-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.msloy-modal-btn {
	display: inline-block;
	min-width: 230px;
	background: var(--msloy-olive-700);
	color: #fff !important;
	font-weight: 800;
	font-size: 16px;
	text-decoration: none;
	padding: 15px 40px;
	border-radius: 999px;
	box-shadow: 0 10px 24px rgba(57, 64, 36, 0.28);
	transition: background .2s ease, transform .15s ease;
}
.msloy-modal-btn:hover { background: var(--msloy-olive-900); transform: translateY(-1px); color: #fff !important; }
.msloy-modal-link {
	color: var(--msloy-olive-500);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.msloy-modal-link:hover { color: var(--msloy-olive-700); }

/* "reward ready" accent (all circles complete) */
.msloy-modal.is-ready { background: linear-gradient(180deg, #FEFBF0, #F6EFDC); border-color: #ecd9a6; }

@media (max-width: 560px) {
	.msloy-overlay { padding: 14px; align-items: center; }
	.msloy-modal { width: 92vw; max-height: 88dvh; padding: 34px 22px 26px; border-radius: 20px; }
	.msloy-modal-title { font-size: 21px; }
	.msloy-modal-sub { font-size: 14px; }
	.msloy-m-dot { width: 60px; height: 60px; }
	.msloy-m-link { flex-basis: 28px; margin: 0 4px; }
	.msloy-modal-main { font-size: 16px; }
	.msloy-modal-btn { width: 100%; min-width: 0; font-size: 15px; padding: 14px 24px; }
}

/* ---------- My Account dashboard ---------- */
.msloy-dash { max-width: 680px; }
.msloy-card {
	background: #fff;
	border: 1px solid var(--msloy-line);
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 18px;
}
.msloy-hero {
	display: flex;
	gap: 16px;
	align-items: center;
	background: linear-gradient(135deg, var(--msloy-cream), #fff);
	border-color: #ece7d6;
}
.msloy-dash.is-ready .msloy-hero {
	background: linear-gradient(135deg, var(--msloy-olive-700), var(--msloy-olive-500));
	border-color: var(--msloy-olive-700);
}
.msloy-dash.is-ready .msloy-hero-title,
.msloy-dash.is-ready .msloy-hero-text { color: #fff; }
.msloy-hero-icon { font-size: 40px; flex: 0 0 auto; }
.msloy-hero-title { margin: 0 0 6px; font-size: 20px; color: var(--msloy-olive-700); }
.msloy-hero-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--msloy-olive-500); }
.msloy-btn {
	display: inline-block;
	margin-top: 12px;
	background: var(--msloy-gold);
	color: var(--msloy-olive-900) !important;
	font-weight: 700;
	text-decoration: none;
	padding: 9px 20px;
	border-radius: 999px;
}
.msloy-sub { margin: 0 0 14px; font-size: 15px; color: var(--msloy-olive-700); font-weight: 700; }

/* progress steps */
.msloy-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.msloy-step { flex: 0 0 auto; }
.msloy-step-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #f1efe6;
	border: 2px solid var(--msloy-line);
	color: var(--msloy-olive-500);
	font-weight: 700;
	font-size: 14px;
}
.msloy-step.done .msloy-step-dot {
	background: var(--msloy-olive-400);
	border-color: var(--msloy-olive-400);
	color: #fff;
}
.msloy-step-reward .msloy-step-dot { border-style: dashed; border-color: var(--msloy-gold); color: var(--msloy-gold); background: #fff; }
.msloy-step-reward.done .msloy-step-dot { background: var(--msloy-gold); border-style: solid; color: var(--msloy-olive-900); }
.msloy-step-line { flex: 1 1 14px; min-width: 14px; height: 3px; background: var(--msloy-line); }
.msloy-step-line.done { background: var(--msloy-olive-400); }
.msloy-steps-caption { margin: 12px 0 0; font-size: 13px; color: #6b6b5e; }

.msloy-how { margin: 0; padding-inline-start: 18px; }
.msloy-how li { font-size: 14px; line-height: 1.7; color: #4a4a40; }

.msloy-history { width: 100%; border-collapse: collapse; }
.msloy-history th, .msloy-history td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--msloy-line); font-size: 13.5px; }
.msloy-history th { color: var(--msloy-olive-700); font-weight: 700; }
