/**
 * VAT toggle — label | switch | label.
 *
 * Matches classic + block themes; resets theme button styles.
 */

.hz-vat-toggle {
	--hz-vat-toggle-text: var(--hz-vat-color-text, #333333);
	--hz-vat-toggle-muted: var(--hz-vat-color-muted, #b0b0b0);
	--hz-vat-toggle-border: var(--hz-vat-color-border, #1a1a1a);
	--hz-vat-toggle-surface: var(--hz-vat-color-surface, #ffffff);
	--hz-vat-toggle-knob: var(--hz-vat-color-active-bg, #1a1a1a);
	--hz-vat-toggle-focus: var(--hz-vat-color-focus, #0b57d0);
	--hz-vat-toggle-font-size: var(--hz-vat-font-size, 0.9375rem);
	--hz-vat-toggle-transition: var(--hz-vat-transition, 180ms ease);
	--hz-vat-toggle-track-w: 2.75rem;
	--hz-vat-toggle-track-h: 1.4rem;
	--hz-vat-toggle-thumb: 1rem;

	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 0.7rem;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--hz-vat-toggle-text);
	font-family: inherit;
	font-size: var(--hz-vat-toggle-font-size);
	line-height: 1.2;
	vertical-align: middle;
	max-width: 100%;
}

.hz-vat-toggle *,
.hz-vat-toggle *::before,
.hz-vat-toggle *::after {
	box-sizing: border-box;
}

/* Side labels */
.hz-vat-toggle button.hz-vat-toggle__btn,
.hz-vat-toggle .hz-vat-toggle__btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	min-width: 0;
	height: auto !important;
	width: auto !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--hz-vat-toggle-muted) !important;
	font: inherit !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-align: center;
	text-decoration: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	white-space: nowrap;
	cursor: pointer;
	transition: color var(--hz-vat-toggle-transition);
}

.hz-vat-toggle button.hz-vat-toggle__btn:hover,
.hz-vat-toggle button.hz-vat-toggle__btn:focus,
.hz-vat-toggle .hz-vat-toggle__btn:hover,
.hz-vat-toggle .hz-vat-toggle__btn:focus {
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: var(--hz-vat-toggle-text) !important;
	text-decoration: none !important;
}

.hz-vat-toggle button.hz-vat-toggle__btn.is-active,
.hz-vat-toggle button.hz-vat-toggle__btn[aria-pressed="true"],
.hz-vat-toggle .hz-vat-toggle__btn.is-active,
.hz-vat-toggle .hz-vat-toggle__btn[aria-pressed="true"] {
	background: transparent !important;
	background-color: transparent !important;
	color: var(--hz-vat-toggle-text) !important;
	font-weight: 600 !important;
}

.hz-vat-toggle button.hz-vat-toggle__btn:focus-visible,
.hz-vat-toggle .hz-vat-toggle__btn:focus-visible,
.hz-vat-toggle button.hz-vat-toggle__switch:focus-visible,
.hz-vat-toggle .hz-vat-toggle__switch:focus-visible {
	outline: 2px solid var(--hz-vat-toggle-focus);
	outline-offset: 3px;
}

/* Center switch */
.hz-vat-toggle button.hz-vat-toggle__switch,
.hz-vat-toggle .hz-vat-toggle__switch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: 0 0 auto;
	display: inline-block;
	width: var(--hz-vat-toggle-track-w);
	height: var(--hz-vat-toggle-track-h);
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	border: 1.5px solid var(--hz-vat-toggle-border) !important;
	border-radius: 999px !important;
	background: var(--hz-vat-toggle-surface) !important;
	background-color: var(--hz-vat-toggle-surface) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: inherit !important;
	font: inherit !important;
	line-height: 0 !important;
	text-indent: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer;
	vertical-align: middle;
}

.hz-vat-toggle button.hz-vat-toggle__switch:hover,
.hz-vat-toggle button.hz-vat-toggle__switch:focus,
.hz-vat-toggle button.hz-vat-toggle__switch:active,
.hz-vat-toggle .hz-vat-toggle__switch:hover,
.hz-vat-toggle .hz-vat-toggle__switch:focus,
.hz-vat-toggle .hz-vat-toggle__switch:active {
	background: var(--hz-vat-toggle-surface) !important;
	background-color: var(--hz-vat-toggle-surface) !important;
	background-image: none !important;
	border-color: var(--hz-vat-toggle-border) !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none !important;
}

.hz-vat-toggle__track {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

.hz-vat-toggle__thumb {
	position: absolute;
	top: 50%;
	left: 0.15rem;
	width: var(--hz-vat-toggle-thumb);
	height: var(--hz-vat-toggle-thumb);
	border-radius: 50%;
	background: var(--hz-vat-toggle-knob);
	transform: translateY(-50%);
	transition: left var(--hz-vat-toggle-transition);
	pointer-events: none;
}

.hz-vat-toggle[data-mode="excl"] .hz-vat-toggle__thumb {
	left: calc(100% - var(--hz-vat-toggle-thumb) - 0.15rem);
}

.hz-vat-toggle button.hz-vat-toggle__btn:disabled,
.hz-vat-toggle button.hz-vat-toggle__switch:disabled,
.hz-vat-toggle .hz-vat-toggle__btn:disabled,
.hz-vat-toggle .hz-vat-toggle__switch:disabled {
	cursor: wait;
	opacity: 0.7;
}

.hz-vat-toggle.is-loading {
	opacity: 0.75;
	pointer-events: none;
}

@media (max-width: 480px) {
	.hz-vat-toggle {
		gap: 0.5rem;
		font-size: 0.875rem;
	}

	.hz-vat-toggle {
		--hz-vat-toggle-track-w: 2.5rem;
		--hz-vat-toggle-track-h: 1.3rem;
		--hz-vat-toggle-thumb: 0.9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hz-vat-toggle__thumb,
	.hz-vat-toggle button.hz-vat-toggle__btn,
	.hz-vat-toggle .hz-vat-toggle__btn {
		transition: none;
	}
}
