/* Cart Drawer Overlay */
.cart-drawer-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.cart-drawer-overlay.is-visible {
	display: block;
	opacity: 1;
}

/* Cart Drawer */
.cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 462px;
	height: 100vh;
	background: #fff;
	z-index: 10001;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

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

/* Header */
.cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	background: var(--text-primary);
	color: var(--accent);
	flex-shrink: 0;
}

.cart-drawer__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 18px;
	font-weight: 600;
	color: var(--accent);
}

.cart-drawer__close {
	background: none;
	border: none;
	color: var(--accent);
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.cart-drawer__close:hover {
	opacity: 0.7;
}

/* Body */
.cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	position: relative;
}

/* Loading spinner */
.cart-drawer__loading {
	display: none;
	justify-content: center;
	align-items: center;
	padding: 48px 0;
}

.cart-drawer__loading.is-active {
	display: flex;
}

.cart-drawer__spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #e5e0db;
	border-top-color: #1a0f0a;
	border-radius: 50%;
	animation: cart-drawer-spin 0.7s linear infinite;
}

@keyframes cart-drawer-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Items */
.cart-drawer__items {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.cart-drawer__item {
	padding-bottom: 24px;
	border-bottom: 1px solid #e5e0db;
}

.cart-drawer__item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.cart-drawer__item-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 12px;
}

.cart-drawer__item-name {
	font-size: 15px;
	font-weight: 600;
	color: #1a0f0a;
	flex: 1;
	margin-right: 12px;
}

.cart-drawer__item-remove {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13px;
	color: #866752;
	padding: 0;
	text-decoration: underline;
	white-space: nowrap;
	flex-shrink: 0;
}

.cart-drawer__item-remove:hover {
	color: #1a0f0a;
}

.cart-drawer__item-body {
	display: flex;
	gap: 12px;
}

.cart-drawer__item-image {
	width: 72px;
	height: 72px;
	object-fit: cover;
	flex-shrink: 0;
	border-radius: 4px;
}

.cart-drawer__item-image-placeholder {
	width: 72px;
	height: 72px;
	background: #f0ebe6;
	flex-shrink: 0;
	border-radius: 4px;
}

.cart-drawer__item-meta {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cart-drawer__item-variation {
	font-size: 13px;
	color: #666;
}

.cart-drawer__item-price {
	font-size: 14px;
	font-weight: 500;
	color: #1a0f0a;
	margin-top: auto;
}

/* Footer */
.cart-drawer__footer {
	padding: 20px 24px;
	border-top: 1px solid #e5e0db;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cart-drawer__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 16px;
	font-weight: 600;
	color: #1a0f0a;
	padding-bottom: 8px;
}

.cart-drawer__total-price {
	font-size: 18px;
}

/* Buttons */
.cart-drawer__btn {
	display: block;
	width: 100%;
	padding: 14px 24px;
	border-radius: 100px;
	font-size: 15px;
	font-weight: 500;
	text-align: center;
	cursor: pointer;
	transition:
		opacity 0.2s,
		background 0.2s;
	text-decoration: none;
	border: none;
}

.cart-drawer__btn--primary {
	background: #1a0f0a;
	color: #fff;
}

.cart-drawer__btn--primary:hover {
	opacity: 0.85;
}

.cart-drawer__btn--outline {
	background: transparent;
	color: #1a0f0a;
	border: 1.5px solid #1a0f0a;
}

.cart-drawer__btn--outline:hover {
	background: #1a0f0a;
	color: #fff;
}

/* Empty state */
.cart-drawer__empty {
	text-align: center;
	color: #888;
	padding: 48px 0;
	font-size: 15px;
}

/* Mobile */
@media (max-width: 520px) {
	.cart-drawer {
		width: 100%;
	}
}
