/*
 * Price views (HMS\TaxDisplay\Price_Views): both are in the page, the class on <html> picks one.
 * Including VAT shows unless the customer chose the net view.
 */
.hms-tax-view--excl {
	display: none;
}

html.hms-prices-excl .hms-tax-view--incl {
	display: none;
}

html.hms-prices-excl .hms-tax-view--excl {
	display: inline;
}

/* The net view replaces HMS\Storefront's "(netto …)" line with "(brutto …)" where Price_Views rendered one. */
html.hms-prices-excl .price_netto:not(.hms-tax-view):has(~ .hms-tax-view--excl) {
	display: none;
}

/*
 * The switch (HMS\TaxDisplay\Tax_Display_Switch). Two classes deep throughout: WoodMart styles every button with
 * :is(.btn, .button, button, …) in a later stylesheet; its --btn-* variables are set to match.
 */
.hms-tax-switch .hms-tax-switch__option {
	--btn-color: #6b6b6b;
	--btn-color-hover: #333;
	--btn-bgcolor: transparent;
	--btn-bgcolor-hover: transparent;
	--btn-brd-color: transparent;
	--btn-brd-color-hover: transparent;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	margin: 0;
	padding: 8px 18px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--btn-color);
	font-size: inherit;
	font-weight: 400;
	line-height: 1.2;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.hms-tax-switch .hms-tax-switch__option:hover,
.hms-tax-switch .hms-tax-switch__option:focus-visible {
	background: transparent;
	color: var(--btn-color-hover);
}

.hms-tax-switch__icon {
	flex: none;
}

.hms-tax-switch__label {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.hms-tax-switch__who {
	font-size: 17px;
	font-weight: 600;
}

.hms-tax-switch__short {
	display: none;
}

.hms-tax-switch__what {
	font-size: 12px;
	letter-spacing: 0.01em;
	opacity: 0.8;
}

/* Active: the including view unless <html> carries the net class (also before the script runs). */
.hms-tax-switch .hms-tax-switch__option--incl,
html.hms-prices-excl .hms-tax-switch .hms-tax-switch__option--excl {
	--btn-color: var(--wd-primary-color);
	--btn-color-hover: var(--wd-primary-color);
}

html.hms-prices-excl .hms-tax-switch .hms-tax-switch__option--incl {
	--btn-color: #6b6b6b;
	--btn-color-hover: #333;
}

/*
 * Desktop: a dropdown at the right end of the header row with "Kategorien" (WoodMart's main menu). The item shows
 * the current choice; the column of the main menu takes the row's free width so the item can sit at its end.
 */
.whb-column:has(> .wd-header-main-nav .hms-tax-switch--dropdown) {
	flex: 1 1 auto;
}

.wd-header-main-nav:has(.hms-tax-switch--dropdown),
.wd-header-main-nav .wd-nav-main:has(.hms-tax-switch--dropdown) {
	width: 100%;
}

.wd-nav-main > .hms-tax-switch--dropdown {
	margin-inline-start: auto;
}

.hms-tax-switch--dropdown > .woodmart-nav-link {
	text-transform: none;
}

.hms-tax-switch__current {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--wd-primary-color);
	text-align: left;
}

.hms-tax-switch__current .hms-tax-switch__icon {
	width: 22px;
	height: 22px;
}

.hms-tax-switch__current .hms-tax-switch__who {
	font-size: 15px;
	line-height: 1.15;
}

.hms-tax-switch__current .hms-tax-switch__what {
	color: #777;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.2;
}

.hms-tax-switch__current--excl,
html.hms-prices-excl .hms-tax-switch__current--incl {
	display: none;
}

html.hms-prices-excl .hms-tax-switch__current--excl {
	display: flex;
}

/* A floating card: rounded, a hairline border and a soft layered shadow (WoodMart's own dropdown is flat). */
.wd-nav-main > .hms-tax-switch--dropdown > .wd-dropdown-menu {
	inset-inline-start: auto;
	inset-inline-end: 0;
	width: 280px;
	padding: 8px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 2px 6px rgba(16, 24, 16, 0.06), 0 14px 36px rgba(16, 24, 16, 0.14);
}

/* Desktop dropdown: a plain list, the active option green with a check mark. */
.hms-tax-switch--dropdown .hms-tax-switch__options {
	display: grid;
	gap: 2px;
}

.hms-tax-switch--dropdown .hms-tax-switch__option {
	width: 100%;
	min-height: 0;
	padding: 11px 14px;
	border-radius: 10px;
}

.hms-tax-switch .hms-tax-switch--dropdown .hms-tax-switch__option:hover,
.hms-tax-switch--dropdown .hms-tax-switch__option:hover {
	background: #f4f5f3;
}

/* The chosen option: a light green tint behind it, besides the green text and the check mark. */
.hms-tax-switch--dropdown .hms-tax-switch__option--incl,
.hms-tax-switch--dropdown .hms-tax-switch__option--incl:hover,
html.hms-prices-excl .hms-tax-switch--dropdown .hms-tax-switch__option--excl,
html.hms-prices-excl .hms-tax-switch--dropdown .hms-tax-switch__option--excl:hover {
	background: color-mix(in srgb, var(--wd-primary-color) 10%, #fff);
}

html.hms-prices-excl .hms-tax-switch--dropdown .hms-tax-switch__option--incl {
	background: transparent;
}

html.hms-prices-excl .hms-tax-switch--dropdown .hms-tax-switch__option--incl:hover {
	background: #f4f5f3;
}

.hms-tax-switch--dropdown .hms-tax-switch__option .hms-tax-switch__icon {
	width: 20px;
	height: 20px;
}

.hms-tax-switch--dropdown .hms-tax-switch__option .hms-tax-switch__who {
	font-size: 14px;
}

.hms-tax-switch--dropdown .hms-tax-switch__option .hms-tax-switch__short {
	display: none;
}

.hms-tax-switch__what {
	font-size: 12px;
}

.hms-tax-switch--dropdown .hms-tax-switch__option::after {
	content: "";
	flex: none;
	width: 6px;
	height: 11px;
	margin: -3px 4px 0 auto;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
}

.hms-tax-switch--dropdown .hms-tax-switch__option--incl::after,
html.hms-prices-excl .hms-tax-switch--dropdown .hms-tax-switch__option--excl::after {
	opacity: 1;
}

html.hms-prices-excl .hms-tax-switch--dropdown .hms-tax-switch__option--incl::after {
	opacity: 0;
}

/*
 * Mobile menu: a quiet setting at the end of the menu, a segmented control (grey track, the active half raised in
 * white). The icons say private or business; the segments say what the prices include.
 */
.hms-tax-switch--menu {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 20px 20px;
}

.hms-tax-switch__caption {
	color: #8a8a8a;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.02em;
}

.hms-tax-switch--menu .hms-tax-switch__options {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 2px;
	padding: 3px;
	border-radius: 10px;
	background: #f0f1ef;
}

.hms-tax-switch--menu .hms-tax-switch__option {
	justify-content: center;
	gap: 6px;
	min-height: 34px;
	padding: 4px 8px;
	border-radius: 8px;
	white-space: nowrap;
}

.hms-tax-switch--menu .hms-tax-switch__icon {
	width: 16px;
	height: 16px;
}

.hms-tax-switch--menu .hms-tax-switch__who,
.hms-tax-switch--menu .hms-tax-switch__what {
	display: none;
}

.hms-tax-switch--menu .hms-tax-switch__short {
	display: inline;
	font-size: 13px;
	font-weight: 500;
}

.hms-tax-switch--menu .hms-tax-switch__option--incl,
html.hms-prices-excl .hms-tax-switch--menu .hms-tax-switch__option--excl {
	--btn-color: #2b2b2b;
	--btn-color-hover: #2b2b2b;
	--btn-bgcolor: #fff;
	--btn-bgcolor-hover: #fff;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

html.hms-prices-excl .hms-tax-switch--menu .hms-tax-switch__option--incl {
	--btn-color: #6b6b6b;
	--btn-color-hover: #333;
	--btn-bgcolor: transparent;
	--btn-bgcolor-hover: transparent;
	background: transparent;
	box-shadow: none;
}

/* Not in the desktop dropdowns WoodMart may build from the same menu. */
@media (min-width: 1025px) {
	.hms-tax-switch--menu {
		display: none;
	}
}

/*
 * The dropdown also opens on keyboard focus, and stays open while the mouse crosses from the menu item into it
 * (an invisible bridge above the card).
 */
.hms-tax-switch--dropdown:has(:focus-visible) > .wd-dropdown {
	visibility: visible;
	opacity: 1;
	transform: none;
	pointer-events: unset;
}

.hms-tax-switch--dropdown > .wd-dropdown::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: 100%;
	height: 12px;
}

.hms-tax-switch--dropdown > .woodmart-nav-link,
.hms-tax-switch__option {
	cursor: pointer;
	user-select: none;
}
