/* _Product layout uses main { overflow-y: hidden } which can clip tall cart pages; allow scroll on /cart */
body[data-page="cart"] main {
	overflow-y: auto;
	overflow-x: hidden;
	max-height: none;
}

/* Cart Button */
.cart-icon {
	position: fixed;
	top: 20px;
	right: 20px;
	background: #ff9900;
	color: white;
	padding: 10px 15px;
	border-radius: 5px;
	cursor: pointer;
	font-weight: bold;
	z-index: 1000;
}

 
/* Flyout Cart */
.cart-flyout {
	position: fixed;
	top: 0;
	right: 0;
	width: 400px;
	height: 100%;
	background: #ffffff; /* Light mode background */
	/*box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);*/
	border-left: 1px solid #dee2e6;
	border-top: 1px solid #dee2e6;
	/* Use transform instead of right to avoid layout shifts - transform doesn't trigger reflow */
	/* Inline style on HTML element ensures cart is hidden before CSS loads */
	transform: translateX(100%);
	transition: transform 0.3s ease-in-out;
	padding: 15px;
	overflow-y: auto;
	z-index: 9999;
}

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

.cart-container::before {
	content: "◀"; /* Left-facing caret */
	font-size: 16px;
	margin-right: 10px;
	transition: transform 0.3s ease-in-out;
}


/* Cart always overlays content - never pushes it - CRITICAL: Override all possible margin/padding */
body.cart-open,
html body.cart-open {
	margin-right: 0 !important; /* Never push content - always overlay */
	/* padding-right is set via JavaScript to compensate for scrollbar width - don't override it */
	/* Don't use overflow: hidden - it causes scrollbar to disappear and page to jump */
	/* Instead, prevent scrolling via pointer-events on a backdrop or let the fixed cart handle it */
}

/* Prevent any container elements from being pushed */
body.cart-open .container,
body.cart-open .container-fluid,
body.cart-open main,
body.cart-open #renderTarget {
	margin-right: 0 !important;
	padding-right: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
}

/* Ensure no media queries can override margin (but allow padding-right for scrollbar compensation) */
@media (min-width: 1400px) {
	body.cart-open,
	html body.cart-open {
		margin-right: 0 !important;
		/* padding-right is set via JavaScript to compensate for scrollbar width */
	}
	
	body.cart-open .container,
	body.cart-open .container-fluid,
	body.cart-open main,
	body.cart-open #renderTarget {
		margin-right: 0 !important;
		padding-right: 0 !important;
	}
}

@media (min-width: 1200px) {
	body.cart-open,
	html body.cart-open {
		margin-right: 0 !important;
		/* padding-right is set via JavaScript to compensate for scrollbar width */
	}
	
	body.cart-open .container,
	body.cart-open .container-fluid,
	body.cart-open main,
	body.cart-open #renderTarget {
		margin-right: 0 !important;
		padding-right: 0 !important;
	}
}

/* Mobile: Cart overlays content full width */
@media (max-width: 767.98px) {
	/* Mobile phones */
	.cart-flyout {
		width: 100%; /* Full width on mobile for better UX */
		border-left: none !important; /* Remove left border on mobile full-width */
		border-top: none !important;
	}
}

/* Tablet/iPad and Desktop: Cart overlays content with fixed width */
@media (min-width: 768px) {
	/* Tablets and all desktop sizes */
	.cart-flyout {
		width: 400px; /* Fixed width for tablet and desktop */
	}
}

.dark-mode > .cart-flyout {
	background: #161a25;
	border-color: rgba(255, 255, 255, 0.12);
}

.cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 18px;
	font-weight: bold;
	border-bottom: 2px solid #ddd;
	padding-bottom: 10px;
	margin-bottom: 10px;
}

.cart-header button {
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
}

/* Push cart header below fixed header on all screen sizes */
.cart-header {
	margin-top: 60px;
}

.cart-items {
	margin: 20px 0;
}

.cart-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid #ddd;
	gap: 12px; /* Add spacing between image, details, and remove button */
}

.cart-item img {
	width: 75px;
	height: 75px;
	object-fit: cover;
	flex-shrink: 0; /* Prevent image from shrinking */
}

.cart-item-details {
	flex: 1;
	padding-left: 4px; /* Extra padding for better spacing */
}

/* Digital download: pixel size + aspect (inherits flyout text color; dim via opacity for theme safety) */
.digital-cart-dimensions {
	font-size: 0.8125rem;
	line-height: 1.35;
	margin-top: 4px;
	opacity: 0.9;
}
.digital-cart-dim-primary {
	font-weight: 500;
}
.digital-cart-dim-secondary {
	font-size: 0.75rem;
	line-height: 1.3;
	margin-top: 3px;
	opacity: 0.82;
}
/* Print-size reference at 300 DPI (same opacity tier as secondary) */
.digital-cart-dim-tertiary {
	font-size: 0.75rem;
	line-height: 1.3;
	margin-top: 3px;
	opacity: 0.85;
}

.cart-total {
	font-size: 16px;
	font-weight: bold;
	margin-top: 15px;
	text-align: right;
}

.checkout-btn {
	display: block;
	width: 100%;
	cursor: pointer;
	margin-top: 10px;
}

/* Light pill on dark flyout: global .dark-mode a / --bs-link-* must not wash out label text */
.cart-flyout a#gotoCart.btn-light,
.cart-flyout a#gotoCart.btn-light:focus {
	color: #14161c;
	text-decoration: none;
}

.cart-flyout a#gotoCart.btn-light:hover {
	color: #050608;
	text-decoration: none;
}

 
#cartRoot img {
	  width: 200px;
}

#cartRoot input {
	width: 100px;
}