/**
 * Header account and cart controls, and the cart drawer.
 */

.ezi-header-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.ezi-header-actions__item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.7rem;
	border: 0;
	border-radius: var(--ezi-radius-md, 8px);
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ezi-header-actions__item:hover,
.ezi-header-actions__item:focus-visible {
	background: rgba( 0, 0, 0, 0.05 );
	color: var(--ezi-gold-deep, #a07e32);
}

.ezi-header-actions__icon {
	position: relative;
	display: inline-flex;
}

.ezi-header-actions__label {
	white-space: nowrap;
}

.ezi-cart-toggle__count {
	position: absolute;
	top: -0.45rem;
	right: -0.55rem;
	min-width: 1.15rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: var(--ezi-gold-deep, #a07e32);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.15rem;
	text-align: center;
}

.ezi-cart-toggle__count.is-empty {
	display: none;
}

/* The label is the first thing to go on a narrow header. */
@media (max-width: 1024px) {
	.ezi-header-actions__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect( 0 0 0 0 );
		white-space: nowrap;
		border: 0;
	}
}

/* Drawer -------------------------------------------------------------------- */

.ezi-minicart {
	position: fixed;
	inset: 0;
	z-index: 10000;
}

.ezi-minicart[hidden] {
	display: none;
}

.ezi-minicart__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 20, 18, 14, 0.45 );
	opacity: 0;
	transition: opacity 0.25s ease;
}

.ezi-minicart.is-open .ezi-minicart__backdrop {
	opacity: 1;
}

.ezi-minicart__panel {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	width: min( 27rem, 100% );
	height: 100%;
	background: var(--ezi-ivory-2, #fff);
	box-shadow: -8px 0 32px rgba( 0, 0, 0, 0.18 );
	transform: translateX( 100% );
	transition: transform 0.25s ease;
}

.ezi-minicart.is-open .ezi-minicart__panel {
	transform: translateX( 0 );
}

.ezi-minicart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.15rem 1.35rem;
	border-bottom: 1px solid var(--ezi-rule, #e6e1d6);
}

.ezi-minicart__title {
	margin: 0;
	font-family: var(--ezi-font-display, Georgia, serif);
	font-weight: var(--ezi-fw-display, 600);
	font-size: 1.35rem;
	line-height: 1.15;
}

.ezi-minicart__close {
	display: inline-flex;
	padding: 0.4rem;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.ezi-minicart__body {
	flex: 1;
	overflow-y: auto;
	padding: 1.35rem;
}

/* WooCommerce's own mini cart markup, brought in line with the panel. */
.ezi-minicart__body .woocommerce-mini-cart {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ezi-minicart__body .woocommerce-mini-cart-item {
	position: relative;
	display: flex;
	gap: 0.85rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--ezi-rule, #e6e1d6);
}

.ezi-minicart__body .woocommerce-mini-cart-item img {
	order: -1;
	width: 4rem;
	height: auto;
	margin: 0;
	border-radius: var(--ezi-radius-md, 8px);
}

.ezi-minicart__body .woocommerce-mini-cart-item a {
	color: inherit;
	text-decoration: none;
}

.ezi-minicart__body .woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	margin: 1.15rem 0;
	font-size: 1.05rem;
}

.ezi-minicart__body .woocommerce-mini-cart__buttons {
	display: grid;
	gap: 0.6rem;
	margin: 0;
}

.ezi-minicart__body .woocommerce-mini-cart__buttons .button {
	display: block;
	width: 100%;
	padding: 0.85rem 1rem;
	border-radius: var(--ezi-radius-md, 8px);
	text-align: center;
	text-decoration: none;
}

.ezi-minicart__body .woocommerce-mini-cart__empty-message {
	margin: 0;
	color: var(--ezi-muted, #6b6459);
}

body.ezi-cart-open {
	overflow: hidden;
}
