/**
 * The header cart link (lib/HeaderCart.php).
 *
 * The head script adds .has-valu-tickets-cart and --valu-tickets-cart-count to the
 * html element when the cart has items. Without the class the link is hidden.
 */
html:not(.has-valu-tickets-cart) .valu-tickets-header-cart {
	display: none !important;
}

/* Desktop: a square outline button (btn-brand), the same height as the "Lahjoita" button next to it. */
.middle-menu-link__link.valu-tickets-header-cart__link {
	display: inline-flex;
	position: relative;
	align-items: center;
	justify-content: center;
	min-width: 74px;
	padding-right: 12px;
	padding-left: 12px;
}

/* Desktop: the badge is in the upper right corner of the button, on the border (like the design). */
.valu-tickets-header-cart__link .valu-tickets-header-cart__icon-wrap {
	position: static;
}

.valu-tickets-header-cart__link .valu-tickets-header-cart__badge {
	top: -10px;
	right: -10px;
	min-width: 24px;
	height: 24px;
	box-sizing: border-box;
	padding: 0 4px;
	border: 2px solid #fff;
	border-radius: 12px;
	box-shadow: none;
	font-size: 12px;
	line-height: 20px;
}

/* Mobile: the same size as the search button of the mobile header. */
.valu-tickets-header-cart--mobile {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
}

/* martat-2022 shows the action navigation, and the desktop link in it, in the
   header from 992px. Below that the action navigation is in the hamburger menu. */
@media (min-width: 992px) {
	.valu-tickets-header-cart--mobile {
		display: none !important;
	}
}

/* The height of one text line of the button, so that the button has the same height as the text buttons. */
.valu-tickets-header-cart__icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	height: 1.55em;
	height: 1lh;
}

.valu-tickets-header-cart__icon {
	width: 24px;
	height: 24px;
}

/* The count in the upper right corner of the icon. Fixed colors: the hover state of
   btn-brand has a blue background and white text. The white ring separates the badge
   from the blue background. */
.valu-tickets-header-cart__badge {
	position: absolute;
	top: -6px;
	right: -11px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	box-shadow: 0 0 0 2px #fff;
	background-color: #2669ab;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.valu-tickets-header-cart__badge::before {
	content: var(--valu-tickets-cart-count, "");
	color: #fff;
}
