/* ==========================================================================
   Cart drawer — slides in from the right, dims the page behind it.
   ========================================================================== */

.cart-drawer-scrim {
	position: fixed;
	inset: 0;
	background: rgba(10, 10, 8, 0.75);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	z-index: 190;
}

.cart-drawer-scrim.is-active {
	opacity: 1;
	visibility: visible;
}

.cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 360px;
	max-width: 100vw;
	background: #fff;
	border-left: 1px solid var(--deercoffe-color-bg);
	box-shadow: -18px 0 36px rgba(0, 0, 0, 0.15);
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 200;
	overflow-y: auto;
}

.cart-drawer.is-active {
	transform: translateX(0);
}

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

.cart-drawer-inner {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-height: 100%;
	padding: 20px 30px 30px;
}

.cart-drawer-top-row {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 32px;
}

.cart-drawer-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--deercoffe-color-text) !important;
	font-weight: 400;
	cursor: pointer;
}

.cart-drawer-close:hover,
.cart-drawer-close:focus-visible {
	color: var(--deercoffe-color-primary) !important;
}

.cart-drawer-title {
	font-family: var(--deercoffe-font-heading);
	font-size: 18px;
	letter-spacing: 0.04em;
	color: var(--deercoffe-color-primary);
	margin: 0;
}

.cart-drawer-empty {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cart-drawer-empty-title {
	font-family: var(--deercoffe-font-heading);
	font-size: 18px;
	color: var(--deercoffe-color-primary);
	margin: 0;
}

.cart-drawer-empty-text {
	font-size: 14px;
	color: var(--deercoffe-color-muted);
	margin: 0;
}

.cart-drawer-count {
	font-size: 12px;
	color: var(--deercoffe-color-muted);
	margin: 0;
}

.cart-drawer-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.cart-drawer-item {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cart-drawer-item-image {
	width: 64px;
	height: 80px;
	flex-shrink: 0;
	border-radius: 2px;
	overflow: hidden;
	background: var(--deercoffe-color-bg);
}

.cart-drawer-item-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cart-drawer-item-details {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.cart-drawer-item-name {
	font-family: var(--deercoffe-font-heading);
	font-size: 18px;
	color: var(--deercoffe-color-primary);
	margin: 0;
}

.cart-drawer-item-meta,
.cart-drawer-item-price {
	font-size: 12px;
	margin: 0;
}

.cart-drawer-item-meta {
	color: var(--deercoffe-color-muted);
}

.cart-drawer-item-price {
	color: var(--deercoffe-color-primary);
}

.cart-drawer-divider {
	height: 1px;
	background: var(--deercoffe-color-gray-200);
}

.cart-drawer-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cart-drawer-total-label {
	font-family: var(--deercoffe-font-heading);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.04em;
	color: var(--deercoffe-color-primary);
	margin: 0;
}

.cart-drawer-total-value {
	font-size: 13px;
	color: var(--deercoffe-color-primary);
	margin: 0;
}

.cart-drawer-checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 18px 30px;
	background: var(--deercoffe-color-primary);
	color: #fff;
	font-family: var(--deercoffe-font-body);
	font-size: 15px;
	border-radius: 4px;
	text-decoration: none !important;
}

.cart-drawer-checkout:hover,
.cart-drawer-checkout:focus {
	background: var(--deercoffe-color-primary-dark);
	color: #fff;
}

.cart-drawer-helper {
	font-size: 12px;
	color: var(--deercoffe-color-muted);
	margin: 0;
}

@media (max-width: 782px) {
	.cart-drawer {
		width: 100%;
	}

	.cart-drawer-inner {
		gap: 24px;
		padding: 24px;
	}

	.cart-drawer-top-row {
		min-height: 44px;
	}

	.cart-drawer-title {
		font-size: 20px;
		line-height: 26px;
	}

	.cart-drawer-empty {
		gap: 10px;
	}

	.cart-drawer-empty-title {
		font-size: 20px;
		line-height: 26px;
	}

	.cart-drawer-empty-text {
		font-size: 14px;
		line-height: 20px;
	}

	.cart-drawer-count {
		font-size: 13px;
	}

	.cart-drawer-item-name {
		font-size: 16px;
	}

	.cart-drawer-total-label {
		font-size: 16px;
	}
}
