/* Funnel Booster — front-end styles */

:root {
	--wfb-accent: #15803d;
	--wfb-accent-dark: #166534;
	--wfb-warn: #b45309;
	--wfb-line: #e5e7eb;
	--wfb-ink: #111827;
	--wfb-muted: #6b7280;
	--wfb-surface: #ffffff;
	--wfb-tint: #f0fdf4;
	--wfb-radius: 14px;
}

/* ---------------------------------------------------------------- Order bump */

.wfb-bump {
	position: relative;
	border: 2px dashed var(--wfb-warn);
	border-radius: var(--wfb-radius);
	background: #fffbeb;
	padding: 16px;
	margin: 20px 0;
	transition: border-color .2s ease, background .2s ease;
}

.wfb-bump.is-active {
	border-style: solid;
	border-color: var(--wfb-accent);
	background: var(--wfb-tint);
}

.wfb-bump.is-loading { opacity: .6; pointer-events: none; }

.wfb-bump__head {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	margin: 0 0 10px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--wfb-ink);
}

.wfb-bump__toggle {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.wfb-bump__box {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	border: 2px solid var(--wfb-warn);
	border-radius: 5px;
	background: #fff;
	position: relative;
}

.wfb-bump__toggle:focus-visible + .wfb-bump__box {
	outline: 2px solid var(--wfb-accent);
	outline-offset: 2px;
}

.wfb-bump__toggle:checked + .wfb-bump__box {
	background: var(--wfb-accent);
	border-color: var(--wfb-accent);
}

.wfb-bump__toggle:checked + .wfb-bump__box::after {
	content: "";
	position: absolute;
	inset-inline-start: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.wfb-bump__headline { flex: 1; }

.wfb-bump__body { display: flex; gap: 14px; align-items: flex-start; }
.wfb-bump__media { flex: 0 0 82px; }
.wfb-bump__img { width: 82px; height: auto; border-radius: 8px; display: block; }
.wfb-bump__content { flex: 1; min-width: 0; }
.wfb-bump__desc { font-size: .9em; color: var(--wfb-muted); margin-bottom: 6px; }
.wfb-bump__desc p { margin: 0 0 .4em; }

.wfb-bump__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wfb-bump__price del { color: var(--wfb-muted); font-size: .9em; }
.wfb-bump__price ins { text-decoration: none; font-weight: 800; font-size: 1.15em; color: var(--wfb-ink); }
.wfb-bump__save {
	background: var(--wfb-accent);
	color: #fff;
	border-radius: 999px;
	padding: 2px 10px;
	font-size: .78em;
	font-weight: 700;
}

/* ---------------------------------------------------------------- Auto-pay overlay */

.wfb-autopay-overlay {
	position: fixed;
	inset: 0;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
}

.wfb-autopay-box { text-align: center; font-size: 1.05em; color: var(--wfb-ink); }

.wfb-spinner,
.wfb-bump__loading {
	display: inline-block;
	width: 34px;
	height: 34px;
	border: 3px solid var(--wfb-line);
	border-top-color: var(--wfb-accent);
	border-radius: 50%;
	animation: wfb-spin .8s linear infinite;
}

.wfb-bump__loading {
	position: absolute;
	inset-inline-end: 12px;
	top: 12px;
	width: 20px;
	height: 20px;
	display: none;
}

.wfb-bump.is-loading .wfb-bump__loading { display: inline-block; }

@keyframes wfb-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.wfb-spinner, .wfb-bump__loading { animation-duration: 3s; }
}

/* ---------------------------------------------------------------- Offer page */

body.wfb-offer-page {
	margin: 0;
	background: #f6f7f9;
	color: var(--wfb-ink);
	font-family: -apple-system, "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
}

.wfb-offer { max-width: 940px; margin: 0 auto; padding: 28px 16px 48px; }

.wfb-offer__progress {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 20px;
	font-size: .82em;
}

.wfb-step {
	padding: 6px 14px;
	border-radius: 999px;
	background: #e5e7eb;
	color: #4b5563;
}
.wfb-step.is-done { background: #dcfce7; color: var(--wfb-accent-dark); }
.wfb-step.is-current { background: var(--wfb-ink); color: #fff; }

.wfb-offer__card {
	background: var(--wfb-surface);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(17, 24, 39, .08);
	padding: 28px;
}

.wfb-offer__eyebrow { margin: 0 0 6px; color: var(--wfb-accent-dark); font-weight: 600; font-size: .92em; }

.wfb-offer__title { margin: 0 0 14px; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.3; }

.wfb-offer__timer {
	background: #fef3c7;
	border: 1px solid #fcd34d;
	border-radius: 10px;
	padding: 10px 14px;
	margin-bottom: 20px;
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	font-size: .92em;
}
.wfb-offer__clock { font-size: 1.2em; font-variant-numeric: tabular-nums; color: var(--wfb-warn); }
.wfb-offer__timer.is-expired { background: #fee2e2; border-color: #fca5a5; }

.wfb-offer__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }

@media (max-width: 720px) {
	.wfb-offer__grid { grid-template-columns: 1fr; gap: 20px; }
	.wfb-offer__card { padding: 20px; }
}

.wfb-offer__media img { width: 100%; height: auto; border-radius: 12px; display: block; }

.wfb-offer__product { margin: 0 0 10px; font-size: 1.25rem; }
.wfb-offer__desc { color: #374151; margin-bottom: 16px; }
.wfb-offer__desc p { margin: 0 0 .6em; }

.wfb-offer__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.wfb-offer__price del { color: var(--wfb-muted); }
.wfb-offer__price ins { text-decoration: none; font-size: 1.7rem; font-weight: 800; }
.wfb-offer__badge { background: #fee2e2; color: #b91c1c; border-radius: 999px; padding: 3px 12px; font-size: .8em; font-weight: 700; }

.wfb-offer__accept {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 12px;
	background: var(--wfb-accent);
	color: #fff;
	font-size: 1.1rem;
	font-weight: 800;
	padding: 16px 20px;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}
.wfb-offer__accept:hover { background: var(--wfb-accent-dark); }
.wfb-offer__accept:active { transform: translateY(1px); }
.wfb-offer__accept[disabled] { background: #6b7280; cursor: not-allowed; }

.wfb-offer__decline {
	display: block;
	text-align: center;
	margin-top: 14px;
	color: var(--wfb-muted);
	font-size: .92em;
	text-decoration: underline;
}

.wfb-offer__note { margin-top: 14px; font-size: .82em; color: var(--wfb-muted); text-align: center; }
.wfb-offer__error { margin-top: 12px; color: #b91c1c; font-size: .9em; }
.wfb-offer__footer { text-align: center; color: var(--wfb-muted); font-size: .82em; margin-top: 22px; }

/* ---------------------------------------------------------------- Quick order popup */

.wfb-cta-wrap { display: block; margin: 18px 0; }
.wfb-cta-wrap.is-full { width: 100%; }

.wfb-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid transparent;
	border-radius: 14px;
	background: var(--wfb-accent);
	color: #fff;
	font-family: inherit;
	font-weight: 800;
	line-height: 1.45;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 6px 16px -6px rgba(21, 128, 61, .5);
	transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
	max-width: 100%;
}

.wfb-cta__inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.wfb-cta__icon { flex: 0 0 auto; }
/* The chevron points toward the start edge, so it mirrors with the text. */
[dir="rtl"] .wfb-cta__icon--arrow { transform: scaleX(-1); }

.wfb-cta__price {
	background: rgba(255, 255, 255, .18);
	border-radius: 999px;
	padding: 2px 12px;
	font-size: .88em;
	font-weight: 700;
	white-space: nowrap;
}

.wfb-cta:hover { background: var(--wfb-accent-dark); color: #fff; box-shadow: 0 10px 22px -8px rgba(21, 128, 61, .55); }
.wfb-cta:active { transform: translateY(1px); box-shadow: 0 4px 10px -6px rgba(21, 128, 61, .5); }
.wfb-cta:focus-visible { outline: 3px solid var(--wfb-ink); outline-offset: 3px; }
.wfb-cta[disabled] { cursor: default; }

/* Sizes */
.wfb-cta--sm { font-size: .95rem; padding: 10px 20px; border-radius: 11px; }
.wfb-cta--md { font-size: 1.02rem; padding: 13px 26px; }
.wfb-cta--lg { font-size: 1.12rem; padding: 17px 36px; }

.wfb-cta--full { display: flex; width: 100%; }

/* Variants */
.wfb-cta--gradient {
	background: linear-gradient(135deg, #15803d 0%, #0f9b6c 100%);
}
.wfb-cta--gradient:hover { background: linear-gradient(135deg, #166534 0%, #0b8159 100%); }

.wfb-cta--outline {
	background: transparent;
	color: var(--wfb-accent-dark);
	border-color: var(--wfb-accent);
	box-shadow: none;
}
.wfb-cta--outline .wfb-cta__price { background: rgba(21, 128, 61, .12); }
.wfb-cta--outline:hover { background: var(--wfb-tint); color: var(--wfb-accent-dark); box-shadow: none; }

.wfb-cta--dark {
	background: var(--wfb-ink);
	box-shadow: 0 6px 16px -6px rgba(17, 24, 39, .5);
}
.wfb-cta--dark:hover { background: #000; }

/* Optional attention pulse */
@keyframes wfb-cta-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.025); }
}
.wfb-cta--pulse { animation: wfb-cta-pulse 2.4s ease-in-out infinite; }

.wfb-cta__sub {
	margin: 9px 0 0;
	font-size: .85rem;
	color: var(--wfb-muted);
	text-align: center;
	line-height: 1.6;
}

@media (max-width: 480px) {
	.wfb-cta { width: 100%; }
	.wfb-cta--lg { font-size: 1.05rem; padding: 16px 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.wfb-cta--pulse { animation: none; }
}

body.wfb-modal-open { overflow: hidden; }

.wfb-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.wfb-modal[hidden] { display: none; }

.wfb-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); }

.wfb-modal__dialog {
	position: relative;
	background: var(--wfb-surface);
	color: var(--wfb-ink);
	border-radius: 16px;
	width: 100%;
	max-width: 480px;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
	padding: 24px;
	font-family: -apple-system, "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
}

.wfb-modal__close {
	position: absolute;
	inset-inline-end: 12px;
	top: 8px;
	border: 0;
	background: none;
	font-size: 28px;
	line-height: 1;
	color: var(--wfb-muted);
	cursor: pointer;
	padding: 4px 8px;
}

.wfb-modal__title { margin: 0 0 4px; font-size: 1.35rem; }
.wfb-modal__sub { margin: 0 0 14px; color: var(--wfb-muted); font-size: .92em; }

.wfb-modal__steps { list-style: none; display: flex; gap: 8px; margin: 0 0 18px; padding: 0; font-size: .8em; }
.wfb-modal__steps li {
	flex: 1;
	background: #e5e7eb;
	color: #4b5563;
	border-radius: 999px;
	padding: 5px 10px;
	text-align: center;
}
.wfb-modal__steps li::before { content: attr(data-step-label) ". "; }
.wfb-modal__steps li.is-current { background: var(--wfb-ink); color: #fff; }
.wfb-modal__steps li.is-done { background: #dcfce7; color: var(--wfb-accent-dark); }

.wfb-offerbox {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	border: 1px solid var(--wfb-line);
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 18px;
	background: #fafafa;
}
.wfb-offerbox__media { flex: 0 0 92px; }
.wfb-offerbox__media img { width: 92px; height: auto; border-radius: 9px; display: block; }
.wfb-offerbox__body { flex: 1; min-width: 0; }
.wfb-offerbox__name { margin: 0 0 5px; font-size: 1.05rem; }
.wfb-offerbox__text { font-size: .87em; color: var(--wfb-muted); }
.wfb-offerbox__text p { margin: 0 0 .4em; }
.wfb-offerbox__price { margin: 6px 0 0; display: flex; gap: 8px; align-items: baseline; }
.wfb-offerbox__price del { color: var(--wfb-muted); font-size: .9em; }
.wfb-offerbox__price ins { text-decoration: none; font-weight: 800; font-size: 1.2em; }

.wfb-modal__warning {
	background: #fef3c7;
	border: 1px solid #fcd34d;
	border-radius: 9px;
	padding: 10px 12px;
	font-size: .9em;
	margin: 0 0 12px;
}

.wfb-field { display: block; margin-bottom: 14px; }
.wfb-field > span { display: block; font-weight: 600; margin-bottom: 5px; font-size: .92em; }
.wfb-field input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #d1d5db;
	border-radius: 9px;
	padding: 12px 14px;
	font-size: 1rem;
	background: #fff;
	color: var(--wfb-ink);
}
.wfb-field input:focus { outline: 2px solid var(--wfb-accent); outline-offset: 1px; border-color: var(--wfb-accent); }
.wfb-field small { display: block; margin-top: 4px; color: var(--wfb-muted); font-size: .82em; }

.wfb-modal__next,
.wfb-modal__submit {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 12px;
	background: var(--wfb-accent);
	color: #fff;
	font-size: 1.05rem;
	font-weight: 800;
	padding: 15px 20px;
	cursor: pointer;
	margin-top: 6px;
}
.wfb-modal__next:hover,
.wfb-modal__submit:hover { background: var(--wfb-accent-dark); }
.wfb-modal__submit[disabled] { background: #6b7280; cursor: not-allowed; }

.wfb-modal__back {
	display: block;
	width: 100%;
	margin-top: 10px;
	border: 0;
	background: none;
	color: var(--wfb-muted);
	font-size: .9em;
	cursor: pointer;
	text-decoration: underline;
}

.wfb-summary { border: 1px solid var(--wfb-line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.wfb-summary__row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.wfb-summary__total {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	border-top: 1px solid var(--wfb-line);
	padding-top: 10px;
	margin-top: 4px;
	font-size: 1.12em;
}
.wfb-summary__amount { color: var(--wfb-accent-dark); }

.wfb-modal__bump {
	border: 2px dashed var(--wfb-warn);
	background: #fffbeb;
	border-radius: 10px;
	padding: 12px;
	margin: 10px 0;
}
.wfb-modal__bump.is-active { border-style: solid; border-color: var(--wfb-accent); background: var(--wfb-tint); }
.wfb-modal__bump label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-weight: 700; }
.wfb-modal__bump input { margin-top: 5px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--wfb-accent); }
.wfb-modal__bump-desc { margin: 6px 0 4px; font-size: .86em; color: var(--wfb-muted); }
.wfb-modal__bump-price { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.wfb-modal__bump-price del { color: var(--wfb-muted); font-size: .88em; }
.wfb-modal__bump-price ins { text-decoration: none; font-weight: 800; }

.wfb-gateways { margin-bottom: 14px; }
.wfb-gateways__label { font-weight: 600; margin: 0 0 6px; font-size: .92em; }
.wfb-gateway { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--wfb-line); border-radius: 9px; margin-bottom: 6px; cursor: pointer; }
.wfb-gateway img { max-height: 22px; width: auto; }

.wfb-modal__note { margin-top: 12px; font-size: .82em; color: var(--wfb-muted); text-align: center; }
.wfb-modal__error { margin-top: 12px; color: #b91c1c; font-size: .9em; }

@media (max-width: 480px) {
	.wfb-modal { padding: 0; align-items: flex-end; }
	.wfb-modal__dialog { max-width: none; border-radius: 16px 16px 0 0; max-height: 94vh; }
}

/* ---------------------------------------------------------------- Delivery panel */

.wfb-delivery {
	border: 1px solid var(--wfb-line);
	border-radius: var(--wfb-radius);
	background: var(--wfb-surface);
	padding: 20px;
	margin: 0 0 28px;
}

.wfb-delivery__title { margin: 0 0 6px; font-size: 1.2rem; }
.wfb-delivery__sub { margin: 0 0 16px; color: var(--wfb-muted); font-size: .92em; }

.wfb-delivery__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.wfb-delivery__item {
	display: flex;
	gap: 12px;
	align-items: center;
	border: 1px solid var(--wfb-line);
	border-radius: 10px;
	padding: 12px;
}

.wfb-delivery__item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: 0 0 52px; }
.wfb-delivery__name { font-weight: 700; margin: 0 0 2px; }
.wfb-delivery__meta { font-size: .84em; color: var(--wfb-muted); margin: 0; }
.wfb-delivery__body { flex: 1; min-width: 0; }

.wfb-delivery__btn {
	display: inline-block;
	background: var(--wfb-accent);
	color: #fff !important;
	border-radius: 9px;
	padding: 9px 16px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.wfb-delivery__btn:hover { background: var(--wfb-accent-dark); }

.wfb-delivery__pending {
	background: #fef3c7;
	border: 1px solid #fcd34d;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: .92em;
}

.wfb-delivery__support { margin-top: 16px; font-size: .9em; }
.wfb-delivery__whatsapp {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #25d366;
	color: #fff !important;
	border-radius: 9px;
	padding: 9px 16px;
	font-weight: 700;
	text-decoration: none;
}
