/* Landing funnel components (countdown + sticky CTA). Brand variables come from the child theme. */

.wpsa-countdown {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem .9rem;
	padding: .65rem 1rem;
	border-radius: 14px;
	background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .22);
	color: inherit;
	line-height: 1.3;
}
.wpsa-countdown__label { font-weight: 700; font-size: .95rem; }
.wpsa-countdown__clock { display: inline-flex; gap: .4rem; font-variant-numeric: tabular-nums; }
.wpsa-countdown__part {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 3.1rem;
	padding: .3rem .45rem;
	border-radius: 10px;
	background: #fff;
	color: var(--wpsa-navy, #0d1d40);
}
.wpsa-countdown__part[hidden] { display: none; }
.wpsa-countdown__part b { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.wpsa-countdown__part small { font-size: .68rem; opacity: .75; }

/* Light background variant (pricing card). */
.wpsa-price-card .wpsa-countdown { background: #fff4e5; border-color: #f3c27a; color: #7a4a00; }
.wpsa-price-card .wpsa-countdown__part { background: var(--wpsa-navy, #0d1d40); color: #fff; }

/* Expired: calm, informative — never a frozen 00:00. */
.wpsa-countdown.is-expired .wpsa-countdown__clock { display: none; }
.wpsa-countdown.is-expired { background: rgba(255, 255, 255, .08); border-style: dashed; }
.wpsa-price-card .wpsa-countdown.is-expired { background: #f5f8fd; border-color: #c9d6ee; color: #1f2d4d; }
.wpsa-countdown--compact { padding: 0; border: 0; background: none !important; gap: .25rem; }
.wpsa-countdown--compact .wpsa-countdown__label { display: none; }
.wpsa-countdown--compact .wpsa-countdown__part { min-width: 2.2rem; padding: .1rem .3rem; }
.wpsa-countdown--compact .wpsa-countdown__part b { font-size: 1rem; }
.wpsa-countdown--compact .wpsa-countdown__part small { display: none; }
.wpsa-countdown--compact.is-expired { display: none; }

/* Sticky mobile CTA */
.wpsa-sticky-cta { display: none; }
@media (max-width: 781px) {
	.wpsa-sticky-cta {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 900; /* below the consent banner */
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: .75rem;
		padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
		background: var(--wpsa-navy, #0d1d40);
		color: #fff;
		box-shadow: 0 -8px 24px rgba(13, 29, 64, .25);
		transform: translateY(110%);
		transition: transform .25s ease;
	}
	.wpsa-sticky-cta.is-visible { transform: translateY(0); }
	.wpsa-sticky-cta__info { display: flex; flex-direction: column; gap: .15rem; font-size: .85rem; }
	.wpsa-sticky-cta .wpsa-price-now { font-weight: 800; font-size: 1.05rem; }
	.wpsa-sticky-cta .wpsa-price-old { opacity: .65; font-size: .8rem; margin-inline-start: .35rem; }
	.wpsa-sticky-cta__btn {
		flex-shrink: 0;
		background: #fff;
		color: var(--wpsa-navy, #0d1d40) !important;
		font-weight: 800;
		border-radius: 999px;
		padding: .7rem 1.25rem;
		text-decoration: none;
	}
	/* Never on top of an open consent banner; reserve space so the footer stays readable. */
	body:has(.cmplz-cookiebanner.cmplz-show) .wpsa-sticky-cta { display: none; }
	body:has(.wpsa-sticky-cta.is-visible) { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) {
	.wpsa-sticky-cta { transition: none; }
}

/* ---------- Platform screenshots: slider + lightbox (Arabic funnel gallery only) ----------
   The existing Columns block becomes the slider viewport; its columns are the slides.
   Sizes are set in CSS before JS runs, and the bottom padding reserves the controls' space,
   so enhancing it causes no layout shift. */
.wpsa-funnel .wpsa-shots {
	--per-view: 2;
	--shot-gap: 24px;
	position: relative;
	overflow: hidden;
	flex-wrap: nowrap !important; /* core stacks columns below 782px with !important */
	gap: var(--shot-gap) !important;
	padding-block-end: 56px;
	touch-action: pan-y;
}
.wpsa-funnel .wpsa-shots > .wp-block-column {
	flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--shot-gap)) / var(--per-view)) !important;
	min-width: 0;
	margin: 0;
	transform: translateX(var(--shot-offset, 0px));
	transition: transform .65s cubic-bezier(.4, 0, .2, 1);
}
.wpsa-funnel .wpsa-shots img { cursor: zoom-in; transition: box-shadow .2s ease; }
.wpsa-funnel .wpsa-shots img:hover,
.wpsa-funnel .wpsa-shots img:focus-visible { box-shadow: 0 18px 40px -20px rgba(13, 29, 64, .55); }
.wpsa-funnel .wpsa-shots figcaption { font-weight: 600; }

.wpsa-shots__controls {
	position: absolute;
	inset-inline: 0;
	bottom: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
}
.wpsa-shots__btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--wpsa-border, #e1e8f5);
	background: #fff;
	color: var(--wpsa-navy, #0d1d40);
	font-size: 18px;
	line-height: 1;
	display: grid;
	place-items: center;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 6px 16px -10px rgba(13, 29, 64, .4);
}
.wpsa-shots__btn:hover { background: var(--wpsa-blue-soft, #e8f0fd); }
.wpsa-shots__dots { display: flex; gap: 8px; }
.wpsa-shots__dots button {
	width: 10px;
	height: 10px;
	border-radius: 999px;
	border: 0;
	padding: 0;
	background: #c9d6ee;
	cursor: pointer;
	transition: width .25s ease, background .25s ease;
}
.wpsa-shots__dots button[aria-current="true"] { width: 26px; background: var(--wpsa-blue, #1a63d6); }

@media (max-width: 781px) {
	.wpsa-funnel .wpsa-shots { --per-view: 1; --shot-gap: 16px; }
}

/* Lightbox (native <dialog>: focus trap, Esc to close, top layer above the sticky CTA). */
html.wpsa-lightbox-open { overflow: hidden; }
.wpsa-lightbox {
	width: min(96vw, 1440px);
	max-width: none;
	max-height: 96vh;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}
.wpsa-lightbox::backdrop { background: rgba(8, 21, 44, .88); }
.wpsa-lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wpsa-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
}
.wpsa-lightbox__caption { color: #fff; font-weight: 700; text-align: center; }
.wpsa-lightbox__counter { color: rgba(255, 255, 255, .7); font-size: .85rem; }
.wpsa-lightbox__btn {
	position: fixed;
	z-index: 2;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	background: rgba(255, 255, 255, .95);
	color: var(--wpsa-navy, #0d1d40);
	font-size: 22px;
	line-height: 1;
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .6);
}
.wpsa-lightbox__btn:hover { background: #fff; }
.wpsa-lightbox__close { top: 16px; inset-inline-end: 16px; }
.wpsa-lightbox__prev { top: 50%; transform: translateY(-50%); inset-inline-start: 16px; }
.wpsa-lightbox__next { top: 50%; transform: translateY(-50%); inset-inline-end: 16px; }
@media (max-width: 781px) {
	.wpsa-lightbox__prev, .wpsa-lightbox__next { top: auto; bottom: 16px; transform: none; }
	.wpsa-lightbox__img { max-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
	.wpsa-funnel .wpsa-shots > .wp-block-column { transition: none; }
}

/* Countdown: the clock is invisible (space reserved) until the script writes the visitor's real remaining time. */
.wpsa-countdown:not(.is-ready):not(.is-expired) .wpsa-countdown__clock { visibility: hidden; }

/* Slider / lightbox arrows are inline SVG chevrons (direction set per RTL/LTR in the script). */
.wpsa-shots__btn svg, .wpsa-lightbox__btn svg { display: block; }
.wpsa-lightbox__btn svg { width: 24px; height: 24px; }
