/* =============================================================================
   Widget "Find your trader" — [aperamrc_trader_finder_widget] + bouton sticky
   Variables dupliquees de trader-finder.css (fichiers charges independamment :
   celui-ci est global, trader-finder.css uniquement sur la page Trader Finder).
============================================================================= */

:root {
	--tfw-color-primary:    #771783;
	--tfw-color-accent:     #601268;
	--tfw-color-text:       #1a1a2a;
	--tfw-color-text-muted: #6b7280;
	--tfw-color-border:     #e2e8f0;
	--tfw-radius:           4px;
}

/* ── Formulaire partage (variant home + sticky) ─────────────────────────────── */
.aperamrc-tfw {
	width: 100%;
	max-width: 500px;
}

.aperamrc-tfw__title {
	font-size: 40px;
	font-weight: 300;
	color: var(--tfw-color-primary);
	margin: 0 0 .6rem;
}

.aperamrc-tfw__desc {
	font-size: 16px;
	font-weight: 400;
	color: #1E1E1E;
	line-height: 1.5;
	margin: 0 0 1.1rem;
}

.aperamrc-tfw__form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.aperamrc-tfw__group {
	display: flex;
	flex-direction: column;
	gap: .5rem;
}

.aperamrc-tfw__visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.aperamrc-tfw__select {
	width: 100%;
	padding: .6rem .9rem;
	border: 1px solid #D9D9D9;
	border-radius: var(--tfw-radius);
	font-size: .92rem;
	background: rgba(255, 255, 255, 0.4);
	color: var(--tfw-color-primary);
	cursor: pointer;
}

.aperamrc-tfw__label {
	font-size: 16px;
	font-weight: 600;
	color: #1E1E1E;
}

.aperamrc-tfw__checks {
	display: flex;
	flex-direction: column;
	gap: .45rem;
}

.aperamrc-tfw__check {
	display: flex;
	align-items: center;
	gap: .45rem;
	padding-bottom: 10px;
	font-size: 16px;
	font-weight: 400;
	color: var(--tfw-color-text);
	cursor: pointer;
	user-select: none;
}

.aperamrc-tfw__check input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	margin: 0;
	background: transparent;
	border: 1px solid var(--tfw-color-primary);
	border-radius: 2px;
	cursor: pointer;
	position: relative;
	transition: background-color .15s, border-color .15s;
}

.aperamrc-tfw__check input[type="checkbox"]:checked {
	background: var(--tfw-color-primary);
	border-color: var(--tfw-color-primary);
}

.aperamrc-tfw__check input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 45%;
	width: .3rem;
	height: .55rem;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: translate(-50%, -50%) rotate(45deg);
}

.aperamrc-tfw .aperamrc-tfw__form .aperamrc-tfw__submit {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	align-self: flex-start;
	background: var(--tfw-color-primary) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: .65rem 1.4rem !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	cursor: pointer;
	transition: background-color .2s;
}

.aperamrc-tfw .aperamrc-tfw__form .aperamrc-tfw__submit:hover { background: var(--tfw-color-accent) !important; color: #fff !important; }

.aperamrc-tfw__pin { flex-shrink: 0; }

.aperamrc-tfw .aperamrc-tfw__form .aperamrc-tfw__all-link {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-size: 16px;
	font-weight: 600;
	color: #1E1E1E;
	text-decoration: underline !important;
	align-self: flex-start;
}

.aperamrc-tfw .aperamrc-tfw__form .aperamrc-tfw__all-link-arrow {
	flex-shrink: 0;
	text-decoration: none !important;
}

.aperamrc-tfw .aperamrc-tfw__form .aperamrc-tfw__all-link:hover {
	color: #1E1E1E;
	text-decoration: none !important;
}

/* ── Variant "home" (shortcode header Elementor) ─────────────────────────────
   Pas de fond/carte ici : le bloc gris flou visible sur la home est un bloc
   Elementor existant (colonne/section), le shortcode ne rend que le formulaire. */

/* ── Variant "sticky" (popover bouton flottant) : fond blanc plein ─────────── */
.aperamrc-tfw--sticky { max-width: none; }

/* ── Bouton flottant "Find a trader" ────────────────────────────────────────── */
#aperamrc-tfw-sticky-btn.aperamrc-tfw-sticky-btn {
	position: fixed !important;
	right: 24px;
	bottom: 24px;
	z-index: 999;
	display: inline-flex !important;
	align-items: center;
	gap: .5rem;
	background: var(--tfw-color-primary) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	padding: .8rem 1.4rem !important;
	font-size: .9rem !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	cursor: pointer;
	box-shadow: 0 4px 18px rgba(119, 23, 131, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .25s, transform .25s, visibility .25s, background-color .2s;
}

#aperamrc-tfw-sticky-btn.aperamrc-tfw-sticky-btn:hover { background: var(--tfw-color-accent) !important; color: #fff !important; }

#aperamrc-tfw-sticky-btn.aperamrc-tfw-sticky-btn.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ── Popover (contenu du bouton sticky) ─────────────────────────────────────── */
.aperamrc-tfw-popover {
	position: fixed;
	right: 24px;
	bottom: 92px;
	z-index: 1000;
	width: 360px;
	max-width: calc(100vw - 2rem);
	max-height: calc(100vh - 140px);
	overflow-y: auto;
	background: #ffffff99;
	backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
	border-radius: var(--tfw-radius);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
	padding: 1.5rem;
}

.aperamrc-tfw-popover[hidden] { display: none; }

.aperamrc-tfw-popover .aperamrc-tfw-popover__close {
	position: absolute;
	top: .6rem;
	right: .6rem;
	width: 28px;
	height: 28px;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	color: var(--tfw-color-primary) !important;
	border: none !important;
	border-radius: 0 !important;
	font-size: 1.2rem !important;
	line-height: 1;
	cursor: pointer;
}

.aperamrc-tfw-popover .aperamrc-tfw-popover__close:hover {
	background: transparent !important;
	color: var(--tfw-color-primary) !important;
}

@media (max-width: 480px) {
	.aperamrc-tfw-sticky-btn { right: 16px; bottom: 16px; }

	.aperamrc-tfw-popover {
		right: 16px;
		left: 16px;
		width: auto;
		bottom: 84px;
	}
}
