/**
 * Header tools and slide-out cart.
 */

.header-tools {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 0.1rem;
}

.header-tool {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--am-ink, #2c2c2c);
	cursor: pointer;
	text-decoration: none;
}

.header-tool:hover,
.header-tool:focus-visible {
	color: var(--am-gold, #d4a843);
}

.header-tool .lucide,
.header-tool svg {
	width: 1.4rem;
	height: 1.4rem;
	stroke-width: 1.75;
	display: block;
}

@media (max-width: 599px) {
	.header-tool {
		width: 1.95rem;
		height: 1.95rem;
	}

	.header-tool .lucide,
	.header-tool svg {
		width: 1.2rem;
		height: 1.2rem;
	}
}

.am-cart-count {
	position: absolute;
	top: 0.05rem;
	right: 0.02rem;
	min-width: 1rem;
	height: 1rem;
	padding: 0 0.22rem;
	border-radius: 999px;
	background: var(--am-gold, #d4a843);
	color: var(--am-white, #fff);
	font-family: var(--am-body, "DM Sans", ui-sans-serif, system-ui, sans-serif);
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 1rem;
	text-align: center;
}

.am-cart-count[hidden],
.am-cart-count[data-count="0"] {
	display: none;
}

/* Drawer */

.am-cart-overlay {
	position: fixed;
	inset: 0;
	z-index: 220;
	background: rgba(44, 44, 44, 0.38);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.am-cart-open .am-cart-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.am-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 230;
	display: flex;
	flex-direction: column;
	width: min(26.5rem, 100vw);
	height: 100%;
	background: var(--am-white, #fff);
	box-shadow: -12px 0 40px rgba(44, 44, 44, 0.12);
	transform: translateX(100%);
	transition: transform 0.28s ease;
}

body.am-cart-open .am-cart-drawer {
	transform: translateX(0);
}

.am-cart-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.35rem 0.85rem;
}

.am-cart-drawer__title {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	font-family: var(--am-heading, "DM Serif Display", Georgia, serif);
	font-size: 1.55rem;
	font-weight: 400;
	color: var(--am-ink, #2c2c2c);
}

.am-cart-drawer__title .lucide {
	width: 1.25rem;
	height: 1.25rem;
	stroke-width: 1.7;
}

.am-cart-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--am-ink, #2c2c2c);
	cursor: pointer;
}

.am-cart-drawer__close .lucide {
	width: 1.15rem;
	height: 1.15rem;
}

.am-cart-ship {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 1.15rem 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 0.7rem;
	background: #f3eadc;
	color: #8a6d55;
	font-size: 0.82rem;
	font-weight: 500;
}

.am-cart-ship .lucide {
	width: 1rem;
	height: 1rem;
	stroke-width: 1.8;
	flex: 0 0 auto;
}

.am-cart-drawer__panel {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.am-cart-items {
	flex: 1 1 auto;
	margin: 0;
	padding: 0 1.15rem 1rem;
	overflow: auto;
	list-style: none;
}

.am-cart-item {
	display: flex;
	gap: 0.85rem;
	margin: 0 0 0.85rem;
	padding: 0.85rem;
	border-radius: 1rem;
	background: #f7f0e6;
}

.am-cart-item__image {
	flex: 0 0 4.5rem;
}

.am-cart-item__image a,
.am-cart-item__image img {
	display: block;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 0.7rem;
	object-fit: cover;
}

.am-cart-item__body {
	flex: 1 1 auto;
	min-width: 0;
}

.am-cart-item__title {
	margin: 0 0 0.2rem;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
}

.am-cart-item__title a {
	color: inherit;
}

.am-cart-item__meta {
	margin: 0 0 0.2rem;
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--am-muted, #6b6560);
}

.am-cart-item__meta-key {
	font-weight: 600;
	color: var(--am-ink, #2c2c2c);
}

.am-cart-item__price {
	margin: 0.35rem 0 0.65rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--am-tan, #cba98a);
}

.am-cart-item__price .woocommerce-Price-amount {
	color: inherit;
	font-weight: 600;
}

.am-cart-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.am-cart-item__row--no-qty {
	justify-content: flex-end;
}

.am-cart-qty {
	display: inline-flex;
	align-items: center;
	height: 1.85rem;
	padding: 0 0.2rem;
	border: 1px solid #e4d6c4;
	border-radius: 999px;
	background: var(--am-white, #fff);
}

.am-cart-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.45rem;
	height: 1.45rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--am-ink, #2c2c2c);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.am-cart-qty__val {
	min-width: 1.1rem;
	text-align: center;
	font-size: 0.85rem;
	font-weight: 500;
}

.am-cart-item__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7rem;
	height: 1.7rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--am-muted, #6b6560);
	cursor: pointer;
}

.am-cart-item__remove .lucide {
	width: 1rem;
	height: 1rem;
	stroke-width: 1.7;
}

.am-cart-footer {
	margin-top: auto;
	padding: 0.5rem 1.35rem 1.4rem;
	background: var(--am-white, #fff);
}

.am-cart-totals {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	margin: 0 0 1.15rem;
	font-size: 0.92rem;
	color: var(--am-muted, #6b6560);
}

.am-cart-totals__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.am-cart-totals__row--total {
	margin-top: 0.25rem;
	font-family: var(--am-heading, "DM Serif Display", Georgia, serif);
	font-size: 1.2rem;
	color: var(--am-ink, #2c2c2c);
}

.am-cart-checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 3.15rem;
	border-radius: 999px;
	background: var(--am-tan, #cba98a);
	color: var(--am-white, #fff) !important;
	font-family: var(--am-body, "DM Sans", ui-sans-serif, system-ui, sans-serif);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none !important;
}

.am-cart-checkout:hover {
	background: var(--am-gold, #d4a843);
	color: var(--am-white, #fff) !important;
}

.am-cart-continue {
	display: block;
	width: 100%;
	margin: 0.85rem 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--am-muted, #6b6560);
	font-size: 0.88rem;
	font-weight: 500;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.am-cart-empty {
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: var(--am-muted, #6b6560);
}

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