/* ===================================================================
   Cart Drawer
   =================================================================== */

.cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	visibility: hidden;
	pointer-events: none;
}
.cart-drawer.is-open {
	visibility: visible;
	pointer-events: auto;
}

.cart-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.cart-drawer.is-open .cart-drawer__overlay {
	opacity: 1;
}

.cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 420px;
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
}
.cart-drawer.is-open .cart-drawer__panel {
	transform: translateX(0);
}

.cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid #ececec;
	flex: 0 0 auto;
}
.cart-drawer__title {
	font-size: 17px;
	font-weight: 700;
}
.cart-drawer__close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #333;
	padding: 4px 8px;
}

.cart-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px;
}

/* 1. Just-added product */
.cart-drawer__added {
	display: flex;
	gap: 14px;
	align-items: center;
	margin-bottom: 20px;
}
.cart-drawer__added:empty {
	display: none;
	margin-bottom: 0;
}
.cart-drawer__added-image img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #eee;
	display: block;
}
.cart-drawer__added-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.cart-drawer__added-name {
	font-weight: 600;
	font-size: 14px;
	color: #111;
}
.cart-drawer__added-label {
	font-size: 12px;
	color: #2c8a3d;
	font-weight: 600;
}

/* 2. Checkout / Continue Shopping */
.cart-drawer__actions {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}
.cart-drawer__btn {
	flex: 1;
	text-align: center;
	padding: 12px 10px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid #111;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}
.cart-drawer__btn--checkout {
	background: #111;
	color: #fff;
}
.cart-drawer__btn--checkout:hover {
	opacity: 0.88;
	color: #fff;
}
.cart-drawer__btn--continue {
	background: #fff;
	color: #111;
}
.cart-drawer__btn--continue:hover {
	background: #f5f5f5;
}

/* 3. Totals */
.cart-drawer__totals {
	border-top: 1px solid #ececec;
	border-bottom: 1px solid #ececec;
	padding: 14px 0;
	margin-bottom: 20px;
}
.cart-drawer__totals-row {
	display: flex;
	justify-content: space-between;
	font-weight: 600;
	font-size: 15px;
}
.cart-drawer__totals-note {
	font-size: 12px;
	color: #767676;
	margin: 6px 0 0;
}

/* 4. Cart items */
.cart-drawer__items {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.cart-drawer__item {
	display: flex;
	gap: 12px;
}
.cart-drawer__item-image img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #eee;
	display: block;
}
.cart-drawer__item-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.cart-drawer__item-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
}
.cart-drawer__item-name a {
	font-size: 14px;
	font-weight: 600;
	color: #111;
	text-decoration: none;
}
.cart-drawer__item-remove {
	color: #999;
	text-decoration: none;
	font-size: 18px;
	line-height: 1;
	flex: 0 0 auto;
}
.cart-drawer__item-remove:hover {
	color: #d63638;
}
.cart-drawer__item-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.cart-drawer__item-price {
	font-weight: 600;
	font-size: 14px;
}

.cart-drawer__item-qty {
	display: flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
}
.cart-drawer__qty-btn {
	width: 28px;
	height: 28px;
	border: none;
	background: #f7f7f7;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
}
.cart-drawer__qty-btn:hover {
	background: #eee;
}
.cart-drawer__qty-input {
	width: 36px;
	text-align: center;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	-moz-appearance: textfield;
}
.cart-drawer__qty-input::-webkit-outer-spin-button,
.cart-drawer__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cart-drawer__empty {
	color: #767676;
	font-size: 14px;
}

body.cart-drawer-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.cart-drawer__panel {
		max-width: 100%;
	}
}