/* BF Web Calculator Styles */
.bf-calc-root {
	--bf-brand: #4f46e5;
	--bf-fab-size: 76px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #1a1a2e;
}

/* Some toggled elements below also declare their own `display`, which has
   the same specificity as the browser's [hidden] rule and would otherwise
   win the cascade just by loading later. Force hidden to always win.
   #bf-calc-overlay is targeted directly (not just via .bf-calc-root
   descendant) because JS re-parents it to <body> to escape the page's
   stacking context — it's no longer a descendant of .bf-calc-root at
   that point. */
.bf-calc-root [hidden],
#bf-calc-overlay[hidden],
#bf-calc-overlay [hidden] {
	display: none !important;
}

/* Floating Action Button */
.bf-calc-fab {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: var(--bf-fab-size);
	height: var(--bf-fab-size);
	border-radius: 50% !important;
	background: linear-gradient(135deg, var(--bf-brand), #7c3aed);
	color: #fff;
	border: none;
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
	cursor: pointer;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: calc(var(--bf-fab-size) * 0.45);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	animation: bf-fab-pulse 2.5s ease-out infinite;
}
.bf-calc-fab:hover {
	transform: scale(1.08);
	box-shadow: 0 8px 26px rgba(79, 70, 229, 0.55);
	animation-play-state: paused;
}
.bf-calc-fab:active {
	transform: scale(0.96);
}
.bf-calc-fab i {
	/* Font Awesome's own .fa-solid rule has the same specificity as a plain
	   class selector, so inherited font-size alone doesn't reliably win.
	   Target the icon directly and force it. */
	font-size: calc(var(--bf-fab-size) * 0.45) !important;
}
@keyframes bf-fab-pulse {
	0%   { box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45), 0 0 0 0 rgba(79, 70, 229, 0.55); }
	70%  { box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45), 0 0 0 18px rgba(79, 70, 229, 0); }
	100% { box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45), 0 0 0 0 rgba(79, 70, 229, 0); }
}

/* [bf_web_calculator_button] — a styled trigger usable anywhere on a page.
   --bf-brand has a fallback since this can render outside #bf-calc-root
   (e.g. placed elsewhere on a page where the modal was already rendered). */
.bf-calc-shortcode-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 28px;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #fff;
	background: linear-gradient(135deg, var(--bf-brand, #4f46e5), #7c3aed);
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bf-calc-shortcode-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
	color: #fff;
}

/* Overlay */
.bf-calc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 17, 27, 0.55);
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.25s ease;
}
.bf-calc-overlay.is-open {
	opacity: 1;
}
.bf-calc-overlay[hidden] {
	display: none;
}

/* Modal */
.bf-calc-modal {
	position: relative;
	background: #fff;
	border-radius: 18px;
	width: 100%;
	max-width: 760px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	transform: translateY(16px) scale(0.98);
	transition: transform 0.25s ease;
}
.bf-calc-overlay.is-open .bf-calc-modal {
	transform: translateY(0) scale(1);
}

.bf-calc-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}
.bf-calc-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Sticky header */
.bf-calc-sticky-header {
	background: linear-gradient(135deg, var(--bf-brand), #7c3aed);
	color: #fff;
	padding: 24px 24px 16px;
	flex-shrink: 0;
	position: relative;
	text-align: center;
}
.bf-calc-modal-title {
	margin: 0 30px 16px;
	font-size: 18px;
	font-weight: 700;
	opacity: 0.95;
	color: #fff !important;
}
.bf-calc-price-row {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
}
.bf-calc-price-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.85;
}
.bf-calc-price-value {
	font-size: 56px;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	display: inline-block;
	transition: transform 0.15s ease, color 0.15s ease;
}
.bf-calc-price-value.is-pulsing {
	transform: scale(1.08);
	color: #d9f99d;
}
.bf-calc-renewal-note {
	font-size: 13px;
	opacity: 0.85;
	margin-top: 4px;
	text-align: center;
}
.bf-calc-renewal-note[hidden] {
	display: none;
}

.bf-calc-breakdown-toggle {
	background: none;
	border: none;
	color: #fff;
	opacity: 0.85;
	font-size: 13px;
	cursor: pointer;
	padding: 8px 0 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.bf-calc-breakdown-toggle:hover {
	opacity: 1;
	text-decoration: underline;
}
.bf-calc-caret {
	transition: transform 0.2s ease;
	display: inline-block;
}
.bf-calc-breakdown-toggle.is-open .bf-calc-caret {
	transform: rotate(180deg);
}

.bf-calc-breakdown-panel {
	background: rgba(255, 255, 255, 0.97);
	color: #1a1a2e;
	border-radius: 10px;
	margin-top: 12px;
	padding: 14px 16px;
	max-height: 200px;
	overflow-y: auto;
}
.bf-calc-breakdown-panel[hidden] {
	display: none;
}
.bf-calc-breakdown-empty {
	margin: 0;
	font-size: 13px;
	color: #9ca3af;
}
.bf-calc-breakdown-item {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f0;
}
.bf-calc-breakdown-item:last-child {
	border-bottom: none;
}
.bf-calc-breakdown-item .bf-calc-bd-price {
	font-weight: 600;
	color: var(--bf-brand);
	flex-shrink: 0;
}

/* Sections (vertical, scrollable) */
.bf-calc-sections-wrap {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.bf-calc-sections {
	/* A normal flex child (not position:absolute) so it still contributes
	   real content height — that's what lets .bf-calc-modal's auto-height
	   grow up to its max-height cap before this scrolls internally. Making
	   it absolutely positioned collapsed the whole chain to 0 height. */
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 20px 24px;
	background: #f3f4f6;
}

/* Scroll indicators: fixed to the top/bottom edge of the scroll area
   itself (not the content), so they don't move as you scroll. */
.bf-calc-scroll-indicator {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.97);
	border: 1px solid #e5e7eb;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--bf-brand);
	font-size: 13px;
	z-index: 5;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.bf-calc-scroll-indicator.is-visible {
	opacity: 1;
	pointer-events: auto;
}
.bf-calc-scroll-indicator:hover {
	background: #f0f0ff;
}
.bf-calc-scroll-up {
	top: 8px;
}
.bf-calc-scroll-down {
	bottom: 8px;
}
.bf-calc-section {
	background: #fff;
	border: 1px solid #ececef;
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 14px;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
.bf-calc-section:last-child {
	margin-bottom: 0;
}
/* Alternating tints so adjacent sections are easy to tell apart at a glance. */
.bf-calc-section:nth-of-type(3n+2) {
	background: #dbeafe;
}
.bf-calc-section:nth-of-type(3n+3) {
	background: #fefce8;
}
.bf-calc-section-title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
	color: #1a1a2e;
	display: flex;
	align-items: center;
	gap: 10px;
}
.bf-calc-section-title i {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: rgba(79, 70, 229, 0.1);
	color: var(--bf-brand);
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Options grid */
.bf-calc-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}

/* Option card */
.bf-calc-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 16px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, transform 0.15s;
	position: relative;
	background: #fff;
}
.bf-calc-option:hover {
	border-color: #a5b4fc;
	background: #f5f3ff;
}
.bf-calc-option input[type="radio"],
.bf-calc-option input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.bf-calc-option.selected {
	border-color: var(--bf-brand);
	background: #f0f0ff;
}
.bf-calc-option.selected::after {
	content: '✓';
	position: absolute;
	top: 8px;
	right: 10px;
	width: 20px;
	height: 20px;
	background: var(--bf-brand);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.bf-calc-icon {
	font-size: 26px;
	line-height: 1;
}
.bf-calc-option-title {
	font-weight: 600;
	font-size: 14px;
	color: #1a1a2e;
}
.bf-calc-option-desc {
	font-size: 12px;
	color: #6b7280;
	line-height: 1.4;
}
.bf-calc-option-price {
	font-size: 12px;
	color: #059669;
	font-weight: 600;
	margin-top: 4px;
}

.bf-calc-empty-state {
	padding: 40px 24px;
	text-align: center;
	color: #6b7280;
}

/* Disclaimer + footer */
.bf-calc-disclaimer {
	font-size: 12px;
	color: #9ca3af;
	line-height: 1.5;
	padding: 12px 24px 0;
	margin: 0;
	flex-shrink: 0;
}
.bf-calc-footer {
	display: flex;
	gap: 10px;
	align-items: stretch;
	padding: 16px 24px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
}
.bf-calc-footer .bf-calc-btn-reset {
	flex: 0 0 auto;
}
.bf-calc-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 11px 22px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	text-decoration: none;
	transition: background 0.2s, opacity 0.2s, transform 0.15s;
}
.bf-calc-btn:active {
	transform: scale(0.97);
}
.bf-calc-btn-reset {
	background: transparent;
	color: #6b7280;
	border: 2px solid #e5e7eb;
}
.bf-calc-btn-reset:hover {
	background: #f9fafb;
}
.bf-calc-btn-cta {
	background: linear-gradient(135deg, #059669, #047857);
	color: #fff;
}
.bf-calc-btn-cta:hover {
	background: linear-gradient(135deg, #047857, #065f46);
}
.bf-calc-btn-whatsapp {
	background: #25d366;
	color: #fff;
	padding: 8px 14px;
}
.bf-calc-btn-whatsapp:hover {
	background: #1ebc59;
}
.bf-calc-btn-whatsapp i {
	font-size: 30px !important;
}
.bf-calc-cta-group {
	display: flex;
	gap: 10px;
	flex: 1;
	min-width: 0;
}
.bf-calc-cta-group .bf-calc-btn {
	flex: 1;
	min-width: 0;
}

/* Lead form */
.bf-calc-lead-form {
	padding: 20px 24px;
	overflow-y: auto;
	flex: 1;
}
.bf-calc-lead-intro {
	margin: 0 0 18px;
	color: #6b7280;
	font-size: 14px;
}
.bf-calc-field {
	margin-bottom: 14px;
}
.bf-calc-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1a1a2e;
	margin-bottom: 6px;
}
.bf-calc-field input,
.bf-calc-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
}
.bf-calc-field input:focus,
.bf-calc-field textarea:focus {
	outline: none;
	border-color: var(--bf-brand);
}
.bf-calc-lead-error {
	color: #dc2626;
	font-size: 13px;
	margin: 0 0 14px;
}
.bf-calc-lead-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

/* Lead success */
.bf-calc-lead-success {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 40px 24px;
}
.bf-calc-lead-success i {
	font-size: 48px;
	color: #059669;
	margin-bottom: 12px;
}
.bf-calc-lead-success h3 {
	margin: 0 0 8px;
	font-size: 20px;
}
.bf-calc-lead-success p {
	color: #6b7280;
	margin: 0 0 20px;
	max-width: 360px;
}

@media (max-width: 560px) {
	.bf-calc-price-value { font-size: 42px; }
	.bf-calc-options { grid-template-columns: 1fr 1fr; }
	.bf-calc-modal { max-height: 92vh; border-radius: 14px; }
	.bf-calc-footer { padding: 12px 14px; gap: 6px; }
	.bf-calc-btn {
		padding: 10px 6px;
		font-size: 12px;
		gap: 4px;
		white-space: normal;
		text-align: center;
		justify-content: center;
	}
	.bf-calc-footer .bf-calc-btn-reset { flex: 0 0 auto; padding: 10px 14px; }
	.bf-calc-cta-group { gap: 6px; }
	.bf-calc-btn-whatsapp .bf-calc-btn-label { display: none; }
}
