/* Campaign top bar + login popup (cs-*): black + red like the Black Friday page.
   Only transform/opacity animate. */
.cs-topbar,
.cs-pop {
	--cs-red: #e5182d;
	--cs-red2: #b50f1f;
	--cs-dark: #8c0c18;
	font-family: inherit;
	color: #fff;
}

.cs-topbar *,
.cs-pop *,
.cs-topbar *::before,
.cs-pop *::before,
.cs-topbar *::after,
.cs-pop *::after {
	box-sizing: border-box;
}

/* ---------- top bar ---------- */
.cs-topbar {
	position: relative;
	z-index: 50;
	display: block;
	overflow: hidden;
	color: #fff !important;
	text-decoration: none !important;
	background:
		radial-gradient(38% 260% at 90% 0%, rgba(229, 24, 45, .4), transparent 70%),
		radial-gradient(26% 220% at 4% 100%, rgba(229, 24, 45, .16), transparent 70%),
		#0b0b10;
}

.cs-topbar__in {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	max-width: 1360px;
	min-height: 74px;
	margin: 0 auto;
	padding: 9px 18px;
}

.cs-topbar__txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.5;
}

.cs-topbar__txt b {
	font-size: 22px;
	font-weight: 900;
	color: #fff;
	white-space: nowrap;
}

.cs-topbar em,
.cs-pop em {
	font-style: normal;
	color: #ff3347;
}

.cs-topbar__txt > span {
	display: flex;
	align-items: center;
	font-size: 14px;
	color: #c9c9d6;
}

/* small red tick at the end of the subtitle, as in the mock-up */
.cs-topbar__txt > span::after {
	content: "";
	width: 3px;
	height: 15px;
	margin-inline-start: 10px;
	border-radius: 2px;
	background: var(--cs-red);
}

/* ---------- hourglass ---------- */
.cs-hg {
	--f: 1;
	flex: none;
	width: 38px;
	height: 63px;
	filter: drop-shadow(0 0 10px rgba(229, 24, 45, .45));
}

.cs-hg__top,
.cs-hg__bot {
	transform-box: fill-box;
	transform-origin: 50% 100%;
}

.cs-hg__top {
	transform: scaleY(var(--f));
}

.cs-hg__bot {
	transform: scaleY(calc(1 - var(--f)));
}

.cs-hg__grain {
	opacity: 0;
	animation: cs-grain 1.2s linear infinite;
}

.cs-hg__grain.g2 {
	animation-delay: -.6s;
}

@keyframes cs-grain {
	0% {
		opacity: 0;
		transform: translateY(0);
	}
	15% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: translateY(24px);
	}
}

/* ---------- the percentage sticker: red slab with a darker layer behind it ---------- */
.cs-pct {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex: none;
	gap: 6px;
	padding: 4px 18px 6px;
	border-radius: 14px;
	background: linear-gradient(180deg, #f0293c, var(--cs-red));
	transform: rotate(-3deg);
	box-shadow: -7px 7px 0 -1px var(--cs-dark), -10px 11px 14px rgba(0, 0, 0, .45);
}

.cs-pct small {
	font-size: 14px;
	font-weight: 800;
	color: #ffd2d6;
}

.cs-pct b {
	font-size: 34px;
	font-weight: 900;
	line-height: 1.2;
	color: #fff;
	text-shadow: 0 2px 0 rgba(90, 4, 14, .4);
}

/* ---------- button: outlined pill with an arrow ---------- */
.cs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	gap: 14px;
	min-height: 42px;
	padding: 0 22px;
	border: 2px solid var(--cs-red);
	border-radius: 99px;
	background: rgba(229, 24, 45, .08);
	color: #fff !important;
	font-size: 14.5px;
	font-weight: 800;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 0 18px -4px rgba(229, 24, 45, .6);
	transition: background .2s;
}

.cs-btn svg {
	width: 20px;
	height: 20px;
	color: var(--cs-red);
}

.cs-topbar:hover .cs-btn,
.cs-btn:hover {
	background: rgba(229, 24, 45, .25);
}

/* staff-only marker while the slot is a draft */
.cs-draft {
	position: absolute;
	bottom: 0;
	left: 10px;
	padding: 0 8px;
	border-radius: 8px 8px 0 0;
	background: #7d0a16;
	color: #fff;
	font-size: 9px;
	font-weight: 800;
	line-height: 1.6;
}

/* ---------- phones: two rows (hourglass, sticker, text / button) ---------- */
@media (max-width: 720px) {
	.cs-topbar__in {
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 8px 12px;
		min-height: 0;
		padding: 10px 14px 12px;
	}

	.cs-hg {
		width: 32px;
		height: 53px;
	}

	.cs-pct {
		padding: 3px 12px 5px;
		border-radius: 12px;
	}

	.cs-pct small {
		font-size: 12px;
	}

	.cs-pct b {
		font-size: 27px;
	}

	.cs-topbar__txt {
		flex: 1;
	}

	.cs-topbar__txt b {
		font-size: 17px;
	}

	.cs-topbar__txt > span {
		font-size: 12.5px;
	}

	.cs-btn {
		flex-basis: 66%;
		margin-inline-end: auto;
		min-height: 40px;
		padding: 0 16px;
		font-size: 13.5px;
	}
}

@media (max-width: 360px) {
	.cs-pct b {
		font-size: 23px;
	}

	.cs-topbar__txt b {
		font-size: 15px;
	}
}

/* ---------- login popup: drops from the top, closes on X / outside tap ---------- */
.cs-pop {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 18px 14px;
	background: rgba(3, 3, 6, .62);
	opacity: 0;
	transition: opacity .3s;
}

.cs-pop[hidden] {
	display: none;
}

.cs-pop.is-open {
	opacity: 1;
}

.cs-pop__card {
	position: relative;
	width: min(460px, 100%);
	padding: 30px 26px 26px;
	border-radius: 26px;
	background:
		radial-gradient(70% 60% at 85% 0%, rgba(229, 24, 45, .45), transparent 70%),
		linear-gradient(180deg, #14141c, #08080c);
	box-shadow: 0 0 0 2px var(--cs-red), 0 0 60px -6px rgba(229, 24, 45, .7), 0 30px 60px -20px #000;
	text-align: center;
	transform: translateY(-120%);
	transition: transform .6s cubic-bezier(.2, 1.3, .4, 1);
}

.cs-pop.is-open .cs-pop__card {
	transform: translateY(0);
}

.cs-pop__x {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.cs-pop__art {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 22px;
	margin-bottom: 14px;
}

.cs-pop .cs-hg {
	width: 56px;
	height: 93px;
}

.cs-pct--lg {
	padding: 6px 24px 10px;
}

.cs-pct--lg small {
	font-size: 18px;
}

.cs-pct--lg b {
	font-size: 56px;
}

.cs-pop h3 {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 900;
	color: #fff;
}

.cs-pop p {
	margin: 0 0 20px;
	font-size: 14.5px;
	line-height: 1.9;
	color: #c9c9d6;
}

.cs-btn--lg {
	width: 100%;
	min-height: 52px;
	font-size: 16px;
	background: linear-gradient(180deg, #f0293c, var(--cs-red2));
	box-shadow: 0 12px 28px -8px var(--cs-red), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.cs-btn--lg svg {
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.cs-hg__grain {
		animation: none;
	}

	.cs-pop,
	.cs-pop__card {
		transition: none;
	}
}

/* the site styles em with a pale background; keep the red word clean */
.cs-topbar em,
.cs-pop em {
	padding: 0;
	background: none;
}

/* =========================================================
   Round 12: slimmer bar, no "تا", no red tick, art/body groups,
   phone = two columns, centred taller popup, home + dashboard fixes
   ========================================================= */
.cs-topbar__art,
.cs-topbar__body {
	display: contents;
}

.cs-topbar__in {
	gap: 16px;
	min-height: 60px;
	padding: 5px 18px;
}

.cs-topbar__txt {
	line-height: 1.45;
}

.cs-topbar__txt b {
	font-size: 19px;
}

.cs-topbar__txt > span {
	font-size: 13px;
}

.cs-topbar__txt > span::after {
	display: none;
}

.cs-topbar .cs-hg {
	width: 31px;
	height: 52px;
}

.cs-topbar .cs-pct {
	padding: 3px 14px 5px;
	border-radius: 12px;
	box-shadow: -6px 6px 0 -1px var(--cs-dark), -8px 9px 12px rgba(0, 0, 0, .45);
}

.cs-topbar .cs-pct b {
	font-size: 28px;
}

.cs-topbar .cs-btn {
	gap: 12px;
	min-height: 36px;
	padding: 0 18px;
	font-size: 13.5px;
}

.cs-topbar .cs-btn svg {
	width: 18px;
	height: 18px;
}

/* phone: right column = hourglass + percent, left column = title, subtitle, small button */
@media (max-width: 720px) {
	.cs-topbar__in {
		flex-wrap: nowrap;
		align-items: stretch;
		justify-content: space-between;
		gap: 12px;
		padding: 9px 14px 10px;
	}

	.cs-topbar__art {
		display: flex;
		align-items: center;
		gap: 10px;
		flex: none;
	}

	.cs-topbar__body {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		gap: 6px;
		min-width: 0;
	}

	.cs-topbar .cs-hg {
		width: 40px;
		height: 66px;
	}

	.cs-topbar .cs-pct {
		padding: 2px 11px 4px;
	}

	.cs-topbar .cs-pct b {
		font-size: 26px;
	}

	.cs-topbar__txt {
		flex: none;
		gap: 0;
	}

	.cs-topbar__txt > span {
		display: block;
		font-size: 12px;
	}

	.cs-topbar__txt b {
		font-size: 15.5px;
	}

	.cs-topbar .cs-btn {
		flex: none;
		width: auto;
		min-height: 28px;
		margin: 0;
		padding: 0 12px;
		gap: 8px;
		font-size: 12px;
	}

	.cs-topbar .cs-btn svg {
		width: 15px;
		height: 15px;
	}
}

@media (max-width: 360px) {
	.cs-topbar .cs-pct b {
		font-size: 22px;
	}

	.cs-topbar__txt b {
		font-size: 14px;
	}
}

/* home page: its header is absolute over the hero, so it has to sit below the bar */
body:has(.cs-topbar) .sh--dark {
	top: var(--cs-bar-h, 60px);
}

body:has(> .admin-bar):has(.cs-topbar) .sh--dark {
	top: calc(30px + var(--cs-bar-h, 60px));
}

/* dashboard: the bar lives in the content column and tucks under the menu's rounded corner */
.dash-main > .cs-topbar {
	z-index: 1;
}

@media (min-width: 1025px) {
	body:has(.dash-main > .cs-topbar) .dash-sidebar {
		position: sticky;
		z-index: 5;
	}

	.dash-main > .cs-topbar {
		margin-right: -30px;
		padding-right: 30px;
	}
}

/* ---------- popup: centred, taller, a little wider ---------- */
.cs-pop {
	align-items: center;
	padding: 20px 14px;
}

.cs-pop__card {
	width: min(560px, 100%);
	padding: 48px 34px 36px;
	border-radius: 30px;
	transform: scale(.85);
	opacity: 0;
	transition: transform .5s cubic-bezier(.2, 1.3, .4, 1), opacity .3s;
}

.cs-pop.is-open .cs-pop__card {
	transform: scale(1);
	opacity: 1;
}

.cs-pop__art {
	gap: 30px;
	margin-bottom: 22px;
}

.cs-pop .cs-hg {
	width: 70px;
	height: 116px;
}

.cs-pct--lg b {
	font-size: 64px;
}

.cs-pop h3 {
	margin-bottom: 10px;
	font-size: 32px;
}

.cs-pop p {
	margin-bottom: 22px;
	font-size: 15px;
}

.cs-pop__tiers {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 26px;
}

.cs-pop__tiers span {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 96px;
	padding: 10px 8px;
	border-radius: 16px;
	background: rgba(255, 255, 255, .05);
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .14);
}

.cs-pop__tiers b {
	font-size: 24px;
	font-weight: 900;
	color: #fff;
}

.cs-pop__tiers small {
	font-size: 12px;
	color: #a9a9bb;
}

.cs-pop__tiers .t1 {
	box-shadow: inset 0 0 0 1.5px var(--cs-red), 0 0 18px -6px var(--cs-red);
}

.cs-pop__tiers .t1 b {
	color: #ff4a5c;
}

.cs-pop__tiers .t2 {
	box-shadow: inset 0 0 0 1.5px #2d9bff;
}

.cs-pop__tiers .t2 b {
	color: #6fb8ff;
}

.cs-btn--lg {
	min-height: 56px;
	font-size: 17px;
}

@media (max-width: 520px) {
	.cs-pop__card {
		padding: 44px 18px 26px;
	}

	.cs-pop .cs-hg {
		width: 56px;
		height: 93px;
	}

	.cs-pct--lg b {
		font-size: 50px;
	}

	.cs-pop h3 {
		font-size: 26px;
	}

	.cs-pop__tiers span {
		min-width: 0;
		flex: 1;
	}
}

/* the subtitle holds an inline <bdi>; a flex row would swallow the spaces around it */
.cs-topbar__txt > span {
	display: block;
}

/* =========================================================
   Round 13 (phone): three columns, right = hourglass + percent,
   middle = title + subtitle, left = small button; holds down to 320px
   ========================================================= */
@media (max-width: 720px) {
	.cs-topbar__in {
		align-items: center;
		gap: 10px;
		padding: 8px 12px;
	}

	.cs-topbar__body {
		flex: 1 1 auto;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
	}

	.cs-topbar__txt {
		min-width: 0;
		flex: 0 1 auto;
	}

	.cs-topbar__txt b,
	.cs-topbar__txt > span {
		white-space: nowrap;
	}

	.cs-topbar .cs-hg {
		width: 30px;
		height: 50px;
	}

	.cs-topbar .cs-btn {
		flex: none;
		min-height: 30px;
		padding: 0 10px;
		gap: 6px;
		white-space: nowrap;
	}
}

@media (max-width: 400px) {
	.cs-topbar__in {
		gap: 7px;
		padding: 7px 8px;
	}

	.cs-topbar__art {
		gap: 6px;
	}

	.cs-topbar__body {
		gap: 6px;
	}

	.cs-topbar .cs-hg {
		width: 24px;
		height: 42px;
	}

	.cs-topbar .cs-pct {
		padding: 1px 7px 3px;
	}

	.cs-topbar .cs-pct b {
		font-size: 19px;
	}

	.cs-topbar__txt b {
		font-size: 13px;
	}

	.cs-topbar__txt > span {
		font-size: 10.5px;
	}

	.cs-topbar .cs-btn {
		min-height: 28px;
		padding: 0 8px;
		font-size: 11px;
	}

	.cs-topbar .cs-btn svg {
		display: none;
	}
}

/* countdown (campaign.show_timer): <span class="cs-timer" data-cs-timer></span> */
.cs-timer {
	flex: none;
	direction: rtl;
	font-weight: 800;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: #fff;
	white-space: nowrap;
}

.cs-pop .cs-timer {
	margin: 4px 0 0;
	font-size: 18px;
	color: #ff4a5c;
}
