/**
 * Macteck Button FX — natif Divi 5 (frontend uniquement si le bloc est rendu).
 * Préfixes : .mds-d5-button-fx, .mds-d5-button-fx--preset-*
 */

.mds_native_button_fx .mds-d5-button-fx {
	--mds-btn-radius: 9999px;
	--mds-btn-pad-x: 1.5rem;
	--mds-btn-pad-y: 0.75rem;
	--mds-btn-font: 600 0.95rem/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mds-btn-border-w: 0px;
	--mds-btn-border-c: transparent;
	--mds-btn-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
	--mds-btn-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.16);
	--mds-btn-hover-y: -3px;
	--mds-fx-scale: 1;

	/* Le wrapper est toujours neutre — styles visuels sur __link (bouton interne) */
	box-sizing:  border-box;
	background:  transparent;
	box-shadow:  none;
	border:      none;
}

/* ─── styleTarget : cible des styles Macteck ──────────────────── */
/* element (défaut) : styles sur __link — comportement standard, aucune règle sup. */

/* container : styles sur le wrapper, __link devient neutre */
.mds_native_button_fx .mds-d5-button-fx--style-target-container {
	background:    var(--mds-btn-bg, transparent);
	border-radius: var(--mds-btn-radius, 0);
	box-shadow:    var(--mds-btn-shadow, none);
	border:        var(--mds-btn-border-w, 0) solid var(--mds-btn-border-c, transparent);
	padding:       var(--mds-btn-pad-y) var(--mds-btn-pad-x);
}
.mds_native_button_fx .mds-d5-button-fx--style-target-container .mds-d5-button-fx__link {
	background:    transparent;
	box-shadow:    none;
	border:        none;
	border-radius: 0;
	padding:       0;
	min-height:    auto;
	color:         var(--mds-btn-color, inherit);
}

/* both : wrapper prend radius + bordure, __link garde fond + shadow */
.mds_native_button_fx .mds-d5-button-fx--style-target-both {
	border-radius: var(--mds-btn-radius, 0);
	border:        var(--mds-btn-border-w, 0) solid var(--mds-btn-border-c, transparent);
}

.mds_native_button_fx .mds-d5-button-fx__inner {
	display: flex;
	width: 100%;
}

.mds_native_button_fx .mds-d5-button-fx__track {
	display: inline-flex;
	max-width: 100%;
	box-sizing: border-box;
	background: transparent;
	padding: 0;
	border-radius: 0;
}

/* Track pleine largeur (si fond track activé) */
.mds_native_button_fx .mds-d5-button-fx--track-full .mds-d5-button-fx__inner {
	justify-content: stretch;
}

.mds_native_button_fx .mds-d5-button-fx--track-full .mds-d5-button-fx__track {
	width: 100%;
}

.mds_native_button_fx .mds-d5-button-fx--align-left .mds-d5-button-fx__inner {
	justify-content: flex-start;
}

.mds_native_button_fx .mds-d5-button-fx--align-center .mds-d5-button-fx__inner {
	justify-content: center;
}

.mds_native_button_fx .mds-d5-button-fx--align-right .mds-d5-button-fx__inner {
	justify-content: flex-end;
}

.mds_native_button_fx .mds-d5-button-fx--full .mds-d5-button-fx__inner {
	justify-content: stretch;
}

.mds_native_button_fx .mds-d5-button-fx--full .mds-d5-button-fx__track {
	width: 100%;
}

.mds_native_button_fx .mds-d5-button-fx--full .mds-d5-button-fx__link {
	width: 100%;
	justify-content: center;
}

/* Tailles */
.mds_native_button_fx .mds-d5-button-fx--size-small {
	--mds-btn-pad-x: 1rem;
	--mds-btn-pad-y: 0.5rem;
	--mds-btn-font: 600 0.8125rem/1.25 system-ui, sans-serif;
}

.mds_native_button_fx .mds-d5-button-fx--size-medium {
	--mds-btn-pad-x: 1.5rem;
	--mds-btn-pad-y: 0.75rem;
	--mds-btn-font: 600 0.95rem/1.25 system-ui, sans-serif;
}

.mds_native_button_fx .mds-d5-button-fx--size-large {
	--mds-btn-pad-x: 2rem;
	--mds-btn-pad-y: 1rem;
	--mds-btn-font: 600 1.0625rem/1.25 system-ui, sans-serif;
}

/* ---------- 8 presets vitrine ---------- */

/* Macteck Glow : ombre par défaut plus posée (hero + CTA premium sans halo excessif). */
.mds_native_button_fx .mds-d5-button-fx--preset-macteck-glow {
	--mds-btn-bg: linear-gradient(128deg, #4f46e5 0%, #7c3aed 38%, #a855f7 72%, #6366f1 100%);
	--mds-btn-color: #ffffff;
	--mds-btn-border-c: rgba(255, 255, 255, 0.22);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 6px 22px rgba(79, 70, 229, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
	--mds-btn-shadow-hover: 0 12px 36px rgba(124, 58, 237, 0.4), 0 0 32px rgba(168, 85, 247, 0.22);
	--mds-btn-hover-y: -3px;
	--mds-btn-font: 650 1rem/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mds-btn-radius: 9999px;
	--mds-btn-pad-x: 1.85rem;
	--mds-btn-pad-y: 0.95rem;
}

.mds_native_button_fx .mds-d5-button-fx--preset-apple-clean {
	--mds-btn-bg: #f5f5f7;
	--mds-btn-color: #1d1d1f;
	--mds-btn-border-c: rgba(0, 0, 0, 0.08);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
	--mds-btn-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.1);
	--mds-btn-hover-y: -2px;
	--mds-btn-font: 600 0.95rem/1.25 system-ui, -apple-system, sans-serif;
}

.mds_native_button_fx .mds-d5-button-fx--preset-dark-premium {
	--mds-btn-bg: linear-gradient(148deg, #2d2d38 0%, #16161f 48%, #0e0e12 100%);
	--mds-btn-color: #f4f4f8;
	--mds-btn-border-c: rgba(255, 255, 255, 0.1);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
	--mds-btn-shadow-hover: 0 18px 52px rgba(0, 0, 0, 0.58), 0 0 36px rgba(99, 102, 241, 0.15);
	--mds-btn-hover-y: -3px;
	--mds-btn-font: 650 0.95rem/1.25 system-ui, sans-serif;
}

.mds_native_button_fx .mds-d5-button-fx--preset-glass-pro {
	--mds-btn-bg: rgba(255, 255, 255, 0.14);
	--mds-btn-color: #ffffff;
	--mds-btn-border-c: rgba(255, 255, 255, 0.38);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
	--mds-btn-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.35);
	--mds-btn-hover-y: -3px;
	--mds-btn-font: 600 0.95rem/1.25 system-ui, sans-serif;
}

.mds_native_button_fx .mds-d5-button-fx--preset-glass-pro .mds-d5-button-fx__link {
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.mds_native_button_fx .mds-d5-button-fx--preset-cyber-neon {
	--mds-btn-bg: linear-gradient(115deg, #00f5d4 0%, #00bbf9 40%, #9b5de5 85%);
	--mds-btn-color: #0a0a12;
	--mds-btn-border-c: rgba(255, 255, 255, 0.35);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 0 36px rgba(0, 245, 212, 0.35), 0 12px 36px rgba(155, 93, 229, 0.35);
	--mds-btn-shadow-hover: 0 0 52px rgba(0, 187, 249, 0.5), 0 16px 44px rgba(155, 93, 229, 0.45);
	--mds-btn-hover-y: -4px;
	--mds-btn-font: 700 0.9rem/1.2 ui-monospace, "SF Mono", Menlo, monospace;
	--mds-btn-pad-x: 1.5rem;
}

.mds_native_button_fx .mds-d5-button-fx--preset-agency-blue {
	--mds-btn-bg: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
	--mds-btn-color: #ffffff;
	--mds-btn-border-c: rgba(255, 255, 255, 0.2);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
	--mds-btn-shadow-hover: 0 14px 40px rgba(29, 78, 216, 0.55);
	--mds-btn-hover-y: -3px;
	--mds-btn-font: 650 0.95rem/1.25 system-ui, sans-serif;
}

.mds_native_button_fx .mds-d5-button-fx--preset-luxury-black {
	--mds-btn-bg: linear-gradient(165deg, #121212 0%, #0a0a0a 100%);
	--mds-btn-color: #f5f0e6;
	--mds-btn-border-c: rgba(201, 162, 39, 0.55);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 10px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(201, 162, 39, 0.12);
	--mds-btn-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 28px rgba(201, 162, 39, 0.18);
	--mds-btn-hover-y: -2px;
	--mds-btn-font: 600 0.9rem/1.3 "Georgia", ui-serif, serif;
	--mds-btn-radius: 9999px;
}

.mds_native_button_fx .mds-d5-button-fx--preset-orange-impact {
	--mds-btn-bg: linear-gradient(135deg, #fb923c 0%, #f97316 45%, #ea580c 100%);
	--mds-btn-color: #ffffff;
	--mds-btn-border-c: rgba(255, 255, 255, 0.25);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 10px 32px rgba(234, 88, 12, 0.45);
	--mds-btn-shadow-hover: 0 16px 48px rgba(249, 115, 22, 0.55), 0 0 40px rgba(251, 146, 60, 0.35);
	--mds-btn-hover-y: -4px;
	--mds-btn-font: 700 0.95rem/1.2 system-ui, sans-serif;
}

/* Custom : base neutre ; couleurs finales = champs Style (inline) prioritaires */
.mds_native_button_fx .mds-d5-button-fx--preset-custom {
	--mds-btn-bg: #e5e7eb;
	--mds-btn-color: #111827;
	--mds-btn-border-c: rgba(0, 0, 0, 0.12);
	--mds-btn-border-w: 1px;
	--mds-btn-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	--mds-btn-shadow-hover: 0 10px 26px rgba(0, 0, 0, 0.12);
	--mds-btn-hover-y: -2px;
	--mds-btn-font: 600 0.95rem/1.25 system-ui, sans-serif;
}

/* Intensité */
.mds_native_button_fx .mds-d5-button-fx--intensity-low {
	--mds-fx-scale: 0.65;
}

.mds_native_button_fx .mds-d5-button-fx--intensity-medium {
	--mds-fx-scale: 1;
}

.mds_native_button_fx .mds-d5-button-fx--intensity-high {
	--mds-fx-scale: 1.35;
}

/* Lien bouton */
.mds_native_button_fx .mds-d5-button-fx__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: 2.75rem;
	padding: var(--mds-btn-pad-y) var(--mds-btn-pad-x);
	border-radius: var(--mds-btn-radius, 9999px);
	font: var(--mds-btn-font);
	text-decoration: none;
	cursor: pointer;
	overflow: hidden;
	color: var(--mds-btn-color, #fff);
	border-width: var(--mds-btn-border-w);
	border-style: solid;
	border-color: var(--mds-btn-border-c);
	box-shadow: var(--mds-btn-shadow);
	transition:
		transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.32s ease,
		filter 0.28s ease,
		opacity 0.2s ease,
		background 0.4s ease;
	isolation: isolate;
}

.mds_native_button_fx .mds-d5-button-fx__link:hover {
	transform: translateY(var(--mds-btn-hover-y, -2px));
	box-shadow: var(--mds-btn-shadow-hover, var(--mds-btn-shadow));
	filter: brightness(1.035);
}

.mds_native_button_fx .mds-d5-button-fx--no-url .mds-d5-button-fx__link--disabled {
	cursor: not-allowed;
	opacity: 0.82;
}

.mds_native_button_fx .mds-d5-button-fx__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.mds_native_button_fx .mds-d5-button-fx__link--disabled:focus-visible {
	outline-offset: 4px;
}

/* Fonds gradient / unis sur le lien */
.mds_native_button_fx .mds-d5-button-fx--preset-macteck-glow .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-dark-premium .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-cyber-neon .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-agency-blue .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-orange-impact .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-luxury-black .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-custom .mds-d5-button-fx__link {
	background: var(--mds-btn-bg);
}

.mds_native_button_fx .mds-d5-button-fx--preset-apple-clean .mds-d5-button-fx__link,
.mds_native_button_fx .mds-d5-button-fx--preset-glass-pro .mds-d5-button-fx__link {
	background: var(--mds-btn-bg);
}

.mds_native_button_fx .mds-d5-button-fx__label {
	pointer-events: none;
}

/* Effet : glow (renforce l’ombre au survol) */
.mds_native_button_fx .mds-d5-button-fx--effect-glow .mds-d5-button-fx__link:hover {
	filter: brightness(calc(1 + 0.06 * var(--mds-fx-scale, 1)));
	box-shadow:
		var(--mds-btn-shadow-hover, var(--mds-btn-shadow)),
		0 0 calc(26px * var(--mds-fx-scale, 1)) rgba(255, 255, 255, 0.18);
}

.mds_native_button_fx .mds-d5-button-fx--preset-macteck-glow.mds-d5-button-fx--effect-glow .mds-d5-button-fx__link:hover {
	box-shadow:
		var(--mds-btn-shadow-hover),
		0 0 calc(28px * var(--mds-fx-scale, 1)) rgba(168, 85, 247, 0.28);
}

.mds_native_button_fx .mds-d5-button-fx--preset-cyber-neon.mds-d5-button-fx--effect-glow .mds-d5-button-fx__link:hover {
	box-shadow:
		var(--mds-btn-shadow-hover),
		0 0 calc(36px * var(--mds-fx-scale, 1)) rgba(0, 245, 212, 0.5);
}

/* Effet : gradient shift */
@keyframes mds-d5-gradient-shift {
	0% {
		background-position: 0% 50%;
	}
	100% {
		background-position: 100% 50%;
	}
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift .mds-d5-button-fx__link {
	background-size: 220% 220%;
	animation: mds-d5-gradient-shift calc(8s / var(--mds-fx-scale, 1)) ease infinite alternate;
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-macteck-glow .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #4f46e5, #a855f7, #6366f1, #7c3aed);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-apple-clean .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #ffffff, #e8e8ed, #f5f5f7);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-dark-premium .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #2d2d38, #3d3d4d, #16161f);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-glass-pro .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.28));
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-cyber-neon .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #00f5d4, #00bbf9, #9b5de5, #00f5d4);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-agency-blue .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #60a5fa, #2563eb, #1d4ed8);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-luxury-black .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #1a1a1a, #2a2418, #0a0a0a);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-orange-impact .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #fb923c, #f97316, #ea580c, #fb923c);
}

.mds_native_button_fx .mds-d5-button-fx--effect-gradient-shift.mds-d5-button-fx--preset-custom .mds-d5-button-fx__link {
	background-image: linear-gradient(120deg, #e5e7eb, #d1d5db, #9ca3af, #e5e7eb);
}

/* Effet : shimmer */
@keyframes mds-d5-shimmer {
	0% {
		transform: translateX(-120%);
	}
	100% {
		transform: translateX(120%);
	}
}

.mds_native_button_fx .mds-d5-button-fx--effect-shimmer .mds-d5-button-fx__link::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		105deg,
		transparent 0%,
		rgba(255, 255, 255, calc(0.24 * var(--mds-fx-scale, 1))) 45%,
		transparent 80%
	);
	transform: translateX(-120%);
	animation: mds-d5-shimmer calc(2.8s / var(--mds-fx-scale, 1)) ease-in-out infinite;
	pointer-events: none;
}

/* Effet : magnetic soft */
.mds_native_button_fx .mds-d5-button-fx--effect-magnetic-soft .mds-d5-button-fx__link:hover {
	transform: translateY(calc(var(--mds-btn-hover-y, -3px) - 1px)) scale(calc(1 + 0.018 * var(--mds-fx-scale, 1)));
}

/* Effet : ripple */
@keyframes mds-d5-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
	}
	70% {
		box-shadow: 0 0 0 calc(14px * var(--mds-fx-scale, 1)) rgba(255, 255, 255, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
	}
}

.mds_native_button_fx .mds-d5-button-fx--effect-ripple .mds-d5-button-fx__link {
	animation: mds-d5-pulse calc(2.4s / var(--mds-fx-scale, 1)) ease-out infinite;
}

.mds_native_button_fx .mds-d5-button-fx--effect-none .mds-d5-button-fx__link:hover {
	transform: translateY(var(--mds-btn-hover-y, -2px));
	filter: brightness(1.04);
}

.mds_native_button_fx .mds-d5-button-fx--effect-none .mds-d5-button-fx__link::after {
	display: none !important;
}

.mds_native_button_fx .mds-d5-button-fx--effect-none .mds-d5-button-fx__link {
	animation: none !important;
	background-size: auto !important;
}

/* Mobile */
@media (max-width: 767px) {
	.mds_native_button_fx .mds-d5-button-fx--full .mds-d5-button-fx__link {
		min-height: 3rem;
		padding-top: max(var(--mds-btn-pad-y), 0.85rem);
		padding-bottom: max(var(--mds-btn-pad-y), 0.85rem);
	}

	.mds_native_button_fx .mds-d5-button-fx--size-large .mds-d5-button-fx__link {
		min-height: 3.125rem;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.mds_native_button_fx .mds-d5-button-fx__link,
	.mds_native_button_fx .mds-d5-button-fx__link::after {
		animation: none !important;
		transition: opacity 0.15s ease, color 0.15s ease, box-shadow 0.2s ease !important;
	}

	.mds_native_button_fx .mds-d5-button-fx--effect-magnetic-soft .mds-d5-button-fx__link:hover,
	.mds_native_button_fx .mds-d5-button-fx--effect-glow .mds-d5-button-fx__link:hover,
	.mds_native_button_fx .mds-d5-button-fx--effect-none .mds-d5-button-fx__link:hover,
	.mds_native_button_fx .mds-d5-button-fx--effect-ripple .mds-d5-button-fx__link {
		transform: none;
		filter: none;
	}

	.mds_native_button_fx .mds-d5-button-fx__link:hover {
		filter: brightness(1.02);
	}
}
