/*
 * Visifib configurator CTA button.
 *
 * Scoped under `.visifib-dc-cta` so our rules never clobber other Jet Buttons
 * rendered elsewhere on the page. Ships a self-contained reimplementation of
 * Jet Elements' `hover-effect-2` vertical slide so the shortcode looks the
 * same whether or not the Jet Elements CSS happens to be enqueued on the
 * current page.
 */

.visifib-dc-cta {
	/* Flex wrapper centering the anchor in its column. */
	display: flex;
	justify-content: flex-start;
	margin: 2% 0 3% 0;
}

.visifib-dc-cta .jet-button__instance {
	/* The clipping frame — overflow:hidden so sliding states stay inside. */
	position: relative;
	overflow: hidden;
	display: inline-block;
	box-sizing: border-box;
	cursor: pointer;
	text-decoration: none;
	padding: 0 40px;            /* horizontal only — height is fixed */
	height: 50px;
	max-height: 50px;
	min-width: 240px;
	border-radius: 4px;
	background: #b9b8a8;        /* fallback, in case the plane layers fail to paint */
	transform: translateZ(0);
	transition: all 0.3s cubic-bezier(0.5, 0.12, 0.46, 0.88);
}

.visifib-dc-cta .jet-button__plane {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.visifib-dc-cta .jet-button__plane-normal {
	z-index: 1;
	background-color: #b9b8a8;           /* matches live site's c577c81 override */
}

.visifib-dc-cta .jet-button__plane-hover {
	z-index: 3;
	background-color: #191919;           /* --e-global-color-secondary */
}

.visifib-dc-cta .jet-button__state {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
}

.visifib-dc-cta .jet-button__state-normal {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	color: #191919;
}

.visifib-dc-cta .jet-button__state-hover {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 4;
	color: #ffffff;
	padding: 0 40px;                      /* match instance's horizontal padding */
}

.visifib-dc-cta .jet-button__instance--icon-right .jet-button__state .jet-button__label {
	order: 1;
}
.visifib-dc-cta .jet-button__instance--icon-right .jet-button__state .jet-button__icon {
	order: 2;
}

.visifib-dc-cta .jet-button__label {
	font-family: 'Roboto', system-ui, sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-align: left;
	white-space: nowrap;
}

/* Explicit label colors + sizes, high-specificity so theme CSS can't win the cascade. */
.visifib-dc-cta .jet-button__instance .jet-button__state-normal .jet-button__label {
	color: #191919;
}
.visifib-dc-cta .jet-button__instance .jet-button__state-hover .jet-button__label {
	color: #ffffff;
	font-size: 20px;
}

.visifib-dc-cta .jet-button__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}
.visifib-dc-cta .jet-button__icon svg {
	width: 100%;
	height: 100%;
}
.visifib-dc-cta .jet-button__state-normal .jet-button__icon svg {
	fill: #b9b8a8;                       /* matches normal-plane background */
}
.visifib-dc-cta .jet-button__state-normal .jet-button__icon svg path {
	fill: #b9b8a8;
	stroke: #191919;
}
.visifib-dc-cta .jet-button__state-hover .jet-button__icon svg {
	fill: #191919;                       /* matches hover-plane background */
}
.visifib-dc-cta .jet-button__state-hover .jet-button__icon svg path {
	fill: #191919;
	stroke: #ffffff;
}

/* Configurator wrapper.
 *
 * Hidden by default via the HTML `hidden` attribute. The toggle JS:
 *   1. Shows the loader dialog.
 *   2. Calls window.visifibDoorConfigurator.mount() → React first-renders.
 *   3. Listens for the `visifib:ready` event from App.tsx.
 *   4. Removes `hidden` from #configurator, adds display:none to the CTA's
 *      section (via `.visifib-dc-section-hidden`), dismisses the loader,
 *      pushState's /configurator or /configurateur.
 */
.visifib-dc-configurator {
	position: relative;
	width: 100%;
	min-height: 100vh;
}
.visifib-dc-configurator[hidden] {
	display: none;
}
.visifib-dc-section-hidden {
	display: none !important;
}

/* #primary bottom-gap control — zero while the configurator is open,
 * 60px when it's closed (explicit value requested, not the theme default). */
#primary.visifib-dc-primary-collapsed {
	margin-bottom: 0 !important;
}
#primary.visifib-dc-primary-restored {
	margin-bottom: 60px !important;
}

/* Close button — tight against the top-right corner of the configurator. */
.visifib-dc-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 50%;
	color: #191919;
	cursor: pointer;
	z-index: 10;
	padding: 0;
	transition: background-color 0.2s ease, transform 0.2s ease;
}
.visifib-dc-close:hover {
	background: #191919;
	color: #ffffff;
	transform: scale(1.05);
}
.visifib-dc-close svg {
	width: 20px;
	height: 20px;
}

/* Native <dialog> used for the loader popup. Browser handles open/closed
 * state via showModal() / close() — no JS class toggle needed, and the
 * built-in ::backdrop pseudo-element gets the blur overlay. */
dialog.visifib-dc-loading {
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	overflow: visible;
	margin: auto;
}
dialog.visifib-dc-loading::backdrop {
	background: rgba(0, 0, 0, 0.25);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

/* Loader spinner — ring, white with a green-accent bottom segment,
 * 360° per second. Uses `.loader-configurator` instead of plain `.loader`
 * because WooCommerce ships its own `.loader` class that would clobber
 * this one on product pages. */
.visifib-dc-loading .loader-configurator {
	width: 48px;
	height: 48px;
	border: 5px solid #fff;
	border-bottom-color: #00b76f;
	border-radius: 50%;
	display: inline-block;
	box-sizing: border-box;
	animation: visifib-dc-loader-rotation 1s linear infinite;
}
@keyframes visifib-dc-loader-rotation {
	0%   { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* hover-effect-2: vertical slide. */
.visifib-dc-cta .jet-button__instance.hover-effect-2 .jet-button__plane-normal,
.visifib-dc-cta .jet-button__instance.hover-effect-2 .jet-button__state-normal {
	transform: translateY(0%);
	transition: all 0.3s cubic-bezier(0.5, 0.12, 0.46, 0.88);
}
.visifib-dc-cta .jet-button__instance.hover-effect-2 .jet-button__plane-hover,
.visifib-dc-cta .jet-button__instance.hover-effect-2 .jet-button__state-hover {
	transform: translateY(100%);
	transition: all 0.3s cubic-bezier(0.5, 0.12, 0.46, 0.88);
}

.visifib-dc-cta .jet-button__instance.hover-effect-2:hover .jet-button__plane-normal,
.visifib-dc-cta .jet-button__instance.hover-effect-2:hover .jet-button__state-normal {
	transform: translateY(-100%);
	transition-delay: .1s;
}
.visifib-dc-cta .jet-button__instance.hover-effect-2:hover .jet-button__plane-hover {
	transform: translateY(0%);
	transition-delay: .1s;
}
.visifib-dc-cta .jet-button__instance.hover-effect-2:hover .jet-button__state-hover {
	transform: translateY(0%);
	transition-delay: .15s;
}
