#cart-backdrop.cart-flyout-backdrop,
.cart-flyout-backdrop {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 99998 !important;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	cursor: pointer;
	pointer-events: none;
}

body.cart-open #cart-backdrop.cart-flyout-backdrop,
body.cart-open .cart-flyout-backdrop {
	display: block;
	opacity: 1;
	pointer-events: auto;
}

body.cart-open #cart,
body.cart-open header,
body.cart-open header#header {
	overflow: visible !important;
}

body.cart-open,
html.cart-open {
	overflow-x: hidden !important;
	overflow-y: hidden !important;
}

#cart-flyout.cart-flyout-panel,
.cart-flyout-panel {
	position: fixed !important;
	top: 0 !important;
	right: -450px !important;
	left: auto !important;
	bottom: 0 !important;
	width: 450px !important;
	max-width: 90vw !important;
	height: 100vh !important;
	height: 100dvh !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
	background: #fff;
	box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
	z-index: 99999 !important;
	display: flex !important;
	flex-direction: column !important;
	transition: right 0.3s ease;
	overflow: hidden;
	transform: none !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

#cart #cart-flyout.cart-flyout-panel,
#cart-flyout.cart-flyout-panel {
	position: fixed !important;
	display: flex !important;
	flex-direction: column !important;
	top: 0 !important;
	left: auto !important;
	right: -450px !important;
	bottom: 0 !important;
	will-change: right !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: 100vh !important;
	height: 100dvh !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
}

body.cart-open #cart #cart-flyout.cart-flyout-panel,
body.cart-open #cart-flyout.cart-flyout-panel,
body.cart-open .cart-flyout-panel {
	right: 0 !important;
	top: 0 !important;
	bottom: 0 !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: 100vh !important;
	height: 100dvh !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
}

.cart-flyout-header {
	padding: 1.5rem;
	padding-right: 2rem;
	border-bottom: 1px solid var(--km-border, #e0e0e0);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
	background: #fff;
	color: #111;
}

.cart-flyout-controls {
	display: flex;
	align-items: center;
	padding-right: 0.5rem;
}

.cart-flyout-clear-btn {
	background: transparent;
	border: 2px solid #111;
	color: #111;
	padding: 0.35rem 0.75rem;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	margin-right: 0.5rem;
	border-radius: 4px;
	transition: all 0.2s ease;
}
.cart-flyout-clear-btn:hover {
	background: #111;
	color: #fff;
}

.cart-flyout-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: #111;
}

.cart-flyout-close {
	background: transparent;
	border: none;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 4px;
	transition: background-color 0.2s ease;
	color: #111;
}

.cart-flyout-close:hover {
	background-color: rgba(0, 0, 0, 0.06);
}

.cart-flyout-close i {
	font-size: 24px;
}

.cart-flyout-items {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 1rem;
	min-height: 0;
	flex-shrink: 1;
	background: #fff;
}

.cart-flyout-item {
	display: flex;
	gap: 0.875rem;
	padding: 0.875rem 0;
	border-bottom: 1px solid var(--km-border, #e0e0e0);
}

.cart-flyout-item:last-child {
	border-bottom: none;
}

.cart-flyout-item-image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
}

.cart-flyout-item-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 1px solid var(--km-border, #e0e0e0);
	border-radius: 4px;
	padding: 4px;
	background: var(--km-bg, #fff);
}

.cart-flyout-item-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.cart-flyout-item-name {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.4;
	margin-bottom: 0.25rem;
	text-transform: none !important;
}

.cart-flyout-item-name a {
	color: var(--km-text, #111);
	text-decoration: none;
	font-size: 0.95rem;
	line-height: 1.4;
	text-transform: none !important;
}

.cart-flyout-item-name a:hover {
	text-decoration: underline;
}

.cart-flyout-item-options,
.cart-flyout-item-recurring {
	font-size: 0.8rem;
	color: var(--km-text-muted, #666);
	line-height: 1.3;
	margin-top: 0.125rem;
}

.cart-flyout-item-options .cart-option-text {
	display: inline !important;
}

.cart-flyout-item-controls {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
	flex-wrap: wrap;
}

.cart-flyout-item-quantity {
	display: flex;
	align-items: center;
	border: 1px solid var(--km-border, #e0e0e0);
	border-radius: 4px;
	overflow: hidden;
}

.qty-btn {
	background: var(--km-bg-alt, #f5f5f5);
	border: none;
	width: 30px;
	height: 30px;
	min-width: 30px;
	min-height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 0.9rem;
	transition: background-color 0.2s ease;
	color: var(--km-text, #111);
	padding: 0;
}

.qty-btn:hover {
	background: #e0e0e0;
}

.qty-input {
	width: 45px;
	height: 30px;
	min-width: 45px;
	border: none;
	text-align: center;
	font-size: 0.85rem;
	padding: 0;
	background: var(--km-bg, #fff);
}

.cart-flyout-item-price {
	font-weight: 600;
	color: var(--km-text, #111);
	font-size: 1rem;
	margin-left: auto;
	white-space: nowrap;
}

.cart-flyout-item-remove {
	background: transparent;
	border: 2px solid var(--km-text, #111);
	color: var(--km-text, #111);
	width: 34px;
	height: 34px;
	min-width: 34px;
	min-height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.2s ease;
	padding: 0;
	flex-shrink: 0;
}

.cart-flyout-item-remove:hover {
	background: var(--km-text, #111);
	color: #fff;
}

.cart-flyout-item-remove i {
	font-size: 18px;
}

.cart-flyout-empty {
	padding: 3rem 1rem;
	text-align: center;
	color: var(--km-text-muted, #666);
}

.cart-flyout-footer {
	padding: 1.5rem;
	border-top: 2px solid #e0e0e0;
	background: #fff;
	color: #111;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	box-sizing: border-box;
}

.cart-flyout-totals-table {
	width: 100%;
	margin-bottom: 1rem;
	border-collapse: collapse;
	table-layout: fixed;
}

.cart-flyout-totals-table td {
	padding: 0.5rem 0;
	vertical-align: middle;
}

.total-label {
	text-align: left;
	font-weight: 600;
	color: #111;
	width: 50%;
	font-size: 0.95rem;
}

.total-amount {
	text-align: right;
	font-weight: 700;
	font-size: 1rem;
	color: #111;
	width: 50%;
}

.cart-flyout-actions {
	display: flex;
	gap: 0.75rem;
	width: 100%;
	box-sizing: border-box;
}

.cart-flyout-actions .btn {
	flex: 1;
	padding: 14px 24px;
	border-radius: 4px;
	text-decoration: none;
	text-align: center;
	font-weight: 600;
	transition: background-color 0.2s ease;
	border: none;
	cursor: pointer;
	box-sizing: border-box;
	min-width: 0;
	white-space: nowrap;
}

#cart-flyout .btn-checkout,
.cart-flyout-panel .btn-checkout {
	background: #111;
	color: #fff;
}

#cart-flyout .btn-checkout:hover,
.cart-flyout-panel .btn-checkout:hover {
	background: #333;
	color: #fff;
}

.checkout-login-prompt {
	text-align: center;
	margin-top: 1rem;
	color: #111;
}

#cart-flyout .checkout-login-prompt a,
.cart-flyout-panel .checkout-login-prompt a {
	color: #111;
	text-decoration: none;
	font-weight: 600;
}

#cart-flyout .checkout-login-prompt a:hover,
.cart-flyout-panel .checkout-login-prompt a:hover {
	text-decoration: underline;
}

@media (max-width: 1024px) {
	#cart-flyout.cart-flyout-panel,
	.cart-flyout-panel {
		width: min(450px, 90vw) !important;
		max-width: min(450px, 90vw) !important;
	}
	.cart-flyout-footer {
		padding: 1rem 1.5rem !important;
		padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0)) !important;
		flex-shrink: 0 !important;
	}
	.cart-flyout-actions .btn {
		padding: 12px 20px;
		font-size: 0.9rem;
		min-width: 120px;
	}
}

@media (max-width: 768px) {
	body.cart-open {
		overflow: hidden !important;
		position: fixed !important;
		width: 100% !important;
		height: 100% !important;
		max-width: 100vw !important;
	}
	html.cart-open {
		overflow: hidden !important;
	}
	#cart-flyout.cart-flyout-panel,
	.cart-flyout-panel,
	#cart #cart-flyout.cart-flyout-panel,
	body:not(.cart-open) #cart #cart-flyout.cart-flyout-panel,
	body:not(.cart-open) #cart-flyout.cart-flyout-panel {
		width: 100vw !important;
		width: 100% !important;
		right: -100vw !important;
		left: auto !important;
		max-width: 100vw !important;
		max-width: 100% !important;
		bottom: 0 !important;
		top: 0 !important;
		height: 100vh !important;
		height: 100dvh !important;
		max-height: 100vh !important;
		max-height: 100dvh !important;
	}
	body.cart-open #cart-flyout.cart-flyout-panel,
	body.cart-open .cart-flyout-panel,
	body.cart-open #cart #cart-flyout.cart-flyout-panel {
		right: 0 !important;
		left: auto !important;
		bottom: 0 !important;
		top: 0 !important;
	}
	.cart-flyout-item-image {
		width: 60px;
		height: 60px;
	}
	.cart-flyout-actions {
		flex-direction: column;
	}
	.cart-flyout-header {
		padding: 1rem !important;
		padding-top: calc(1rem + env(safe-area-inset-top, 0)) !important;
		flex-shrink: 0 !important;
		position: sticky !important;
		top: 0 !important;
		background: #fff !important;
		z-index: 10 !important;
	}
	.cart-flyout-items {
		padding: 0.75rem !important;
		min-height: 0 !important;
		flex: 1 1 0% !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch !important;
	}
	.cart-flyout-footer {
		padding: 1rem !important;
		padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0)) !important;
		flex-shrink: 0 !important;
		position: sticky !important;
		bottom: 0 !important;
		background: #fff !important;
		z-index: 10 !important;
	}
	.cart-flyout-item {
		padding: 0.75rem 0 !important;
		gap: 0.75rem !important;
	}
	.cart-flyout-item-details {
		gap: 0.4rem !important;
	}
	.qty-btn {
		width: 28px !important;
		height: 28px !important;
		min-width: 28px !important;
		min-height: 28px !important;
		font-size: 0.85rem !important;
		padding: 0 !important;
	}
	.qty-input {
		width: 40px !important;
		height: 28px !important;
		min-width: 40px !important;
		font-size: 0.8rem !important;
		padding: 0 !important;
	}
	.cart-flyout-item-remove {
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
		min-height: 32px !important;
		flex-shrink: 0 !important;
	}
	.cart-flyout-totals-table td.total-label {
		text-align: left !important;
		font-size: 0.9rem !important;
		width: 50% !important;
		padding-right: 0.5rem !important;
		font-weight: 600 !important;
	}
	.cart-flyout-totals-table td.total-amount {
		text-align: right !important;
		font-size: 0.95rem !important;
		width: 50% !important;
		padding-left: 0.5rem !important;
		font-weight: 700 !important;
	}
}

.km-cart-trigger {
	position: relative;
	background: none;
	border: none;
	outline: none;
	cursor: pointer;
	font-size: 14px;
	padding: .3rem;
	color: #111 !important;
	min-width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.km-cart-trigger:focus {
	outline: none;
}
.km-cart-trigger i,
.km-cart-trigger .fa {
	color: #111 !important;
}
.km-cart-trigger .km-cart-svg {
	flex-shrink: 0;
	stroke: currentColor;
	width: 18px !important;
	height: auto !important;
	max-height: 20px;
}
.km-cart-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	background: var(--km-text, #111);
	color: #fff;
	border-radius: 50%;
	width: 16px;
	height: 16px;
	font-size: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}
