/**
 * RCE front-end styles — SHIPPED BY THE PLUGIN.
 *
 * PROCESS.md §5.4: the plugin must ship its own layout. Until now the reward
 * overlay, ladder and price were styled only by rce-theme, so on any other
 * theme the reward box rendered tiny, unstyled and effectively invisible —
 * which is why an ad inside it looked like it "wasn't running".
 *
 * Scoped to .rce-* classes so it cannot fight a host theme's own styles.
 */

/* ===== Reward overlay: the ad/task surface ============================== */

.rce-reward {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 16px;
	background: rgba(10, 14, 20, .94);
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rce-reward__label {
	font-size: 13px;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .75;
}

/*
 * The ad surface. Deliberately LARGE: an ad that renders into a small box is
 * both worse for the visitor and worthless for revenue. Sized to the viewport
 * with sensible ceilings so it fills a phone screen and stays comfortable on
 * desktop.
 */
.rce-reward__ad {
	/* Height is the Ad Box's business, not this stylesheet's (2.2.7). */
	align-self: stretch;
	max-width: 720px;
	margin: 0 auto;
	width: auto;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.rce-reward__ad iframe,
.rce-reward__ad > * {
	width: 100% !important;
	max-width: 100% !important;
	border: 0;
	display: block;
}

.rce-reward__counter {
	font-size: 17px;
	font-weight: 700;
	min-height: 24px;
}

.rce-reward__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.rce-journey__cta--claim,
.rce-reward__close {
	min-height: 48px;
	padding: 0 26px;
	border: 0;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
.rce-journey__cta--claim { background: #5b4be0; color: #fff; }
.rce-journey__cta--claim[disabled] { opacity: .5; cursor: not-allowed; }
.rce-reward__close { background: rgba(255,255,255,.15); color: #fff; }

/* Deliberately no desktop height override any more (2.2.7): the Ad Box's
   `Reserved height` decides, and 0 means the content decides. */

/* ===== Ladder — plugin-owned, so it looks right on ANY theme ============ */

.rce-journey {
	margin: 18px 0;
	padding: 18px;
	background: #fff;
	border: 1px solid #e4e8ee;
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(20,24,31,.06), 0 8px 24px rgba(20,24,31,.06);
}

.rce-ladder__head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; font-weight: 700; }
.rce-ladder__track { height: 10px; border-radius: 999px; background: #f0f2f5; overflow: hidden; margin-bottom: 14px; }
.rce-ladder__fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg,#1a7f5a,#5b4be0); transition: width .4s ease; }

.rce-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rce-ladder__step {
	display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
	padding: 14px; border: 1px solid #e4e8ee; border-radius: 14px; background: #fff;
}
.rce-ladder__step--completed { background: #f2faf5; border-color: #cdeeda; }
.rce-ladder__step--current { border-color: #1a7f5a; box-shadow: 0 0 0 3px #e8f5ef; }
.rce-ladder__step--locked { opacity: .62; }
.rce-ladder__num {
	width: 40px; height: 40px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #e8f5ef; color: #1a7f5a; font-weight: 800;
}
.rce-ladder__step--completed .rce-ladder__num { background: #1a7f5a; color: #fff; }
.rce-ladder__step-title { font-weight: 700; font-size: 15px; }
.rce-ladder__step-desc { font-size: 13px; color: #5b6472; margin-top: 2px; }
.rce-ladder__side { text-align: right; display: grid; gap: 6px; justify-items: end; }
.rce-ladder__step-price { font-weight: 800; color: #5b4be0; font-size: 14px; white-space: nowrap; }
.rce-ladder__done { padding: 7px 14px; border-radius: 999px; background: #8d959f; color: #fff; font-weight: 700; font-size: 13px; }
.rce-ladder__locked { padding: 7px 14px; border-radius: 999px; background: #f0f2f5; color: #5b6472; font-weight: 700; font-size: 13px; }

.rce-journey__cta {
	display: inline-flex; align-items: center; justify-content: center;
	width: 100%; min-height: 50px; margin-top: 12px; padding: 0 20px;
	border: 0; border-radius: 10px; background: #1a7f5a; color: #fff;
	font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.rce-journey__cta--continue { background: #14181f; }
.rce-journey__cta[disabled] { opacity: .45; cursor: not-allowed; }
.rce-ladder__side .rce-journey__cta--continue { width: auto; min-height: 40px; margin-top: 0; padding: 0 16px; font-size: 14px; }

.rce-price { font-size: 26px; font-weight: 800; color: #1a7f5a; }
.rce-price__was { margin-left: 8px; color: #5b6472; font-weight: 500; }
.rce-price__hint { display: block; margin-top: 4px; font-size: 13px; color: #5b6472; }

.rce-takeover .single_add_to_cart_button,
.rce-takeover form.cart .quantity { display: none !important; }

@media (max-width: 480px) {
	.rce-ladder__step { grid-template-columns: 36px 1fr; }
	.rce-ladder__num { width: 36px; height: 36px; }
	.rce-ladder__side { grid-column: 2; justify-items: start; text-align: left; }
}

/* --------------------------------------------------------------------------
 * SEQUENTIAL REWARD BOX (PROCESS v2 §A2).
 *
 * Deliberately NOT an overlay. There is no position:fixed, no backdrop and no
 * z-index war here: the box is an ordinary block inside the journey mount, so
 * it scrolls with the page and cannot trap a mobile visitor behind a layer.
 * scroll-margin-top gives the #rce-reward anchor room under sticky headers.
 * ------------------------------------------------------------------------ */
.rce-seq {
	margin-top: 16px;
	padding: 18px;
	border: 1px solid #e4dcff;
	background: #fbfaff;
	border-radius: 16px;
	scroll-margin-top: 24px;
}
.rce-seq__title { margin: 0 0 6px; font-size: 18px; }
.rce-seq__unlock { margin: 6px 0; font-size: 22px; font-weight: 800; }
.rce-seq__body { margin: 6px 0 12px; }
.rce-seq__label { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
/* The host reserves NOTHING by default (2.2.7): an Ad Box may hold article
   links, a video, a poll or a banner, and only the box itself knows how tall
   that is. `Reserved height` on the Ad Box sets an explicit height when a slot
   genuinely needs to hold space before it loads. */
.rce-seq__ad {
	display: block;
	border: 1px solid #e4e4e4;
	border-radius: 12px;
	background: #fff;
	margin: 10px 0;
}
.rce-seq__ad > * { max-width: 100%; }
.rce-seq__ad iframe { width: 100%; border: 0; display: block; }
.rce-seq__counter { margin: 8px 0; font-size: 26px; font-weight: 800; text-align: center; }
.rce-seq__start,
.rce-seq__claim { width: 100%; }
.rce-seq__back {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 10px;
	border: 0;
	background: transparent;
	cursor: pointer;
	text-decoration: underline;
}
.rce-seq__progress { margin: 12px 0 4px; }
.rce-seq__progress-text { font-size: 13px; opacity: .75; }
.rce-seq__track { margin-top: 6px; height: 8px; border-radius: 999px; background: #ececec; overflow: hidden; }
.rce-seq__fill { height: 100%; background: #5b32ff; width: 0; transition: width .3s ease; }

/* Attested (T3) task controls. The note carries the honesty requirement of
 * §A5 into the visual hierarchy: it sits directly under the heading, before
 * the action, so the visitor reads what is and is not being checked before
 * they start rather than after. */
.rce-seq__note { margin: 6px 0 10px; font-size: 12px; opacity: .8; }
.rce-seq__attest { width: 100%; margin-bottom: 8px; }

/* ---------------------------------------------------------------------------
 * FINAL STAGES + progress
 * ------------------------------------------------------------------------ */

.rce-journey__fallback {
	margin: 0;
	padding: 12px 14px;
	border: 1px dashed #c9ced3;
	border-radius: 10px;
	color: #50575e;
	font-size: 14px;
	line-height: 1.5;
}

.rce-journey__progress { margin: 0 0 12px; }

.rce-journey__progress-bar {
	height: 6px;
	border-radius: 999px;
	background: #e6e9ec;
	overflow: hidden;
}

.rce-journey__progress-fill {
	height: 100%;
	background: #2271b1;
	border-radius: 999px;
	transition: width .3s ease;
}

.rce-journey__progress-label {
	margin: 6px 0 0;
	font-size: 13px;
	color: #50575e;
}

.rce-stage {
	margin-top: 14px;
	padding: 14px;
	border: 1px solid #e0e3e7;
	border-radius: 12px;
	background: #fff;
}

.rce-stage__step {
	margin: 0 0 6px;
	font-size: 12px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #787c82;
}

.rce-stage__heading { margin: 0 0 6px; font-size: 17px; }
.rce-stage__body { margin: 0 0 10px; color: #3c434a; line-height: 1.5; }
.rce-stage__meta { margin: 8px 0 0; font-size: 13px; color: #787c82; }
.rce-stage__status { margin: 8px 0 0; font-size: 13px; color: #b32d2e; min-height: 1em; }

.rce-stage__queue {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 10px 0;
	padding: 12px;
	border-radius: 10px;
	background: #f0f6fc;
}

.rce-stage__queue-label { font-size: 13px; color: #50575e; }
.rce-stage__queue-number { font-size: 30px; font-weight: 700; line-height: 1.1; color: #135e96; }

.rce-stage__form { display: flex; flex-direction: column; gap: 8px; }

.rce-stage__input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #c9ced3;
	border-radius: 8px;
	font-size: 15px;
}

.rce-reward__note { margin: 8px 0 0; font-size: 13px; color: #787c82; }

.rce-journey__diag {
	margin: 12px 0;
	padding: 12px 14px;
	border: 2px solid #d63638;
	border-radius: 10px;
	background: #fcf0f1;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.5;
}

.rce-journey__diag p { margin: 6px 0 0; }

.rce-stage__ad {
	margin: 10px 0;
	padding: 8px;
	border: 1px solid #e6e9ec;
	border-radius: 10px;
	background: #fafbfc;
}

.rce-stage__ad-label {
	margin: 0 0 6px;
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #8c9196;
}

/* No reserved height: see .rce-seq__ad. */
.rce-stage__ad-host { display: block; }

/* ------------------------------------------------------------------------
 * Parent-injected ad hosts (AdSense and friends).
 *
 * The framed hosts above are flex boxes that centre a fixed-size iframe.
 * A tag injected straight into the page needs ordinary block layout instead,
 * or `<ins class="adsbygoogle">` resolves to zero width and never fills.
 * ---------------------------------------------------------------------- */
/* FREE SIZING (operator request, 2.2.4). The plugin imposes NOTHING on a
 * parent-injected tag: no minimum height, no centring, no border, no reserved
 * box. The provider reads the container width and serves whatever fits the
 * device — which is the whole point of a responsive tag. The only constraint
 * kept is max-width:100%, so a creative can never overflow the card sideways
 * (that was the "half the ad is cut off" symptom: a fixed-width unit centred
 * in a flex box clips BOTH edges; a block clips neither once capped). */
.rce-ad-host--parent {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	border: 0 !important;
	background: transparent !important;
	overflow: visible !important;
	padding: 0 !important;
}
.rce-ad-host--parent > * {
	max-width: 100% !important;
}
.rce-ad-host--parent ins,
.rce-ad-host--parent .adsbygoogle,
.rce-ad-host--parent iframe {
	display: block;
	max-width: 100% !important;
}

/* ------------------------------------------------------------------------
 * Gated Demand-Test panel.
 *
 * Mounted hidden on products that also run a reward journey, and revealed by
 * rce-journey.js only at the final state. The attribute alone is enough in
 * every modern browser, but themes that set a display on the class would
 * otherwise win the cascade and leak the waiting list onto the page early.
 * ---------------------------------------------------------------------- */
.rce-demand[hidden],
.rce-demand--gated[hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------------
 * Panel notice line (Buy Now refusals, Demand-Test blocks).
 *
 * Before this existed a refused purchase redrew the panel identically and
 * said nothing, which reads as a dead button.
 * ---------------------------------------------------------------------- */
.rce-journey__notice {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f5f6f7;
	font-size: 14px;
	line-height: 1.45;
}
.rce-journey__notice:empty { display: none; }
.rce-journey__notice--error {
	background: #fcf0f1;
	color: #8a1f24;
}

/* ------------------------------------------------------------------------
 * Honeypot field (bugfix 2.2.3).
 *
 * rce-demand.js gives its spam trap this class and relies on CSS to hide it
 * — but no rule ever shipped, so the trap rendered as a mystery empty text
 * box under the email field. Visually hidden, never display:none (naive bots
 * skip display:none fields), out of the tab order via tabindex in the JS.
 * ---------------------------------------------------------------------- */
.rce-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Inline stage ad gate (2.2.3) — same visual language as the ladder task. */
.rce-stage__gate {
	margin-top: 10px;
}

/* Slot caption, wherever a box supplies one. Blank label = no node at all. */
.rce-ad__label {
	margin: 0 0 8px;
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .7;
}
.rce-ad-host > * { max-width: 100%; }
.rce-ad-host iframe { max-width: 100%; }

/* An empty native-mode mount must not draw a card outline (2.2.12): the
   panel exists only to bootstrap identity until there is an order. */
.rce-journey:has(> .rce-journey__inner:empty) {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

/* The post-order panel is a receipt block, not a product card. */
.rce-journey--post-order { margin-top: 18px; }
.rce-journey__owned {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
}
