/* ============================================
   Cart Drawer - Shopify-style sliding panel
   ============================================ */

/* Overlay */
#cart-drawer-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cart-drawer-overlay.open {
	opacity: 1;
	visibility: visible;
}

/* Drawer Panel */
#cart-drawer {
	position: fixed;
	top: 0;
	right: -420px;
	width: 400px;
	max-width: 90vw;
	height: 100%;
	background: #ffffff;
	z-index: 9999;
	box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
	transition: right 0.3s ease;
	display: flex;
	flex-direction: column;
	font-family: Arial, Helvetica, sans-serif;
}

#cart-drawer.open {
	right: 0;
}

/* Drawer Header */
.cart-drawer-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #e0e0e0;
	background: #f8f8f8;
	flex-shrink: 0;
}

.cart-drawer-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.cart-drawer-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0 4px;
	line-height: 1;
}

.cart-drawer-close:hover {
	color: #000;
}

/* Drawer Body (scrollable items area) */
.cart-drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

/* Empty cart message */
.cart-drawer-empty {
	text-align: center;
	padding: 60px 20px;
	color: #888;
}

.cart-drawer-empty p {
	font-size: 16px;
	margin-bottom: 20px;
}

/* Cart Items */
.cart-drawer-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cart-drawer-item {
	display: flex;
	padding: 16px 20px;
	border-bottom: 1px solid #f0f0f0;
	gap: 12px;
	align-items: flex-start;
}

.cart-drawer-item:last-child {
	border-bottom: none;
}

.cart-drawer-item-image {
	width: 70px;
	height: 70px;
	flex-shrink: 0;
	border: 1px solid #eee;
	border-radius: 4px;
	overflow: hidden;
	background: #f9f9f9;
}

.cart-drawer-item-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cart-drawer-item-details {
	flex: 1;
	min-width: 0;
}

.cart-drawer-item-title {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin: 0 0 4px 0;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.cart-drawer-item-price {
	font-size: 14px;
	color: #666;
	margin: 0 0 8px 0;
}

.cart-drawer-item-qty {
	display: flex;
	align-items: center;
	gap: 8px;
}

.cart-drawer-item-qty span {
	font-size: 13px;
	color: #555;
}

.cart-drawer-item-remove {
	background: none;
	border: none;
	color: #c00;
	font-size: 12px;
	cursor: pointer;
	padding: 2px 0;
	text-decoration: underline;
}

.cart-drawer-item-remove:hover {
	color: #900;
}

.cart-drawer-item-line-total {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
	text-align: right;
	min-width: 60px;
}

/* Drawer Footer */
.cart-drawer-footer {
	border-top: 1px solid #e0e0e0;
	padding: 16px 20px;
	background: #f8f8f8;
	flex-shrink: 0;
}

.cart-drawer-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	font-size: 16px;
}

.cart-drawer-subtotal-label {
	font-weight: 600;
	color: #333;
}

.cart-drawer-subtotal-value {
	font-weight: 700;
	color: #333;
	font-size: 18px;
}

.cart-drawer-shipping-note {
	font-size: 12px;
	color: #888;
	margin-bottom: 16px;
	text-align: center;
}

.cart-drawer-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow: visible;
}

.cart-drawer-btn {
	display: block;
	width: 100%;
	padding: 13px 16px;
	text-align: center;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: background-color 0.2s ease, transform 0.2s ease;
	letter-spacing: 0.3px;
	box-sizing: border-box;
}

.cart-drawer-btn-checkout {
	background-color: #04AA6D;
	color: #fff;
}

.cart-drawer-btn-checkout:hover {
	background-color: #16836f;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}

.cart-drawer-btn-viewcart {
	background-color: #fff;
	color: #04AA6D;
	border: 1px solid #04AA6D;
}

	.cart-drawer-btn-viewcart:hover {
		background-color: #16836f;
		text-decoration: none;
		color: #fff;
		transform: translateY(-1px);
	}

.cart-drawer-btn-guest {
	background-color: #fff;
	color: #04AA6D;
	border: 1px solid #04AA6D;
}

.cart-drawer-btn-guest:hover {
	background-color: #16836f;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}

.cart-drawer-btn-continue {
	background: none;
	color: #04AA6D;
	border: none;
	font-size: 13px;
	font-weight: 600;
}

.cart-drawer-btn-continue:hover {
	text-decoration: underline;
	color: #16836f;
}

/* Loading state */
.cart-drawer-loading {
	text-align: center;
	padding: 40px 20px;
	color: #888;
}

/* Mobile responsive */
@media (max-width: 480px) {
	#cart-drawer {
		width: 100%;
		max-width: 100vw;
		right: -100%;
	}
}


/* Quantity +/- buttons */
.cart-drawer-qty-btn {
	width: 26px;
	height: 26px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 3px;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #333;
}

.cart-drawer-qty-btn:hover {
	background: #f0f0f0;
	border-color: #999;
}

.cart-drawer-item-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.cart-drawer-item-qty span {
	font-size: 14px;
	font-weight: 600;
	min-width: 20px;
	text-align: center;
}
