/* Modern Cart - Journal3 */
.modern-cart-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

html.modern-cart-open .modern-cart-overlay {
	opacity: 1;
	visibility: visible;
}

html.modern-cart-open,
html.modern-cart-open body {
	overflow: hidden;
}

html.modern-cart-active #cart-content,
html.modern-cart-active #cart .dropdown-menu {
	display: none !important;
}

/* Sheet / Drawer shared layout */
.modern-cart-sheet,
.modern-cart-drawer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	background: var(--mc-bg, #ffffff);
	color: var(--mc-text, #1c1c1c);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
	border-radius: var(--mc-radius, 18px) var(--mc-radius, 18px) 0 0;
	max-height: 85vh;
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
	will-change: transform;
}

.modern-cart-sheet.is-open,
.modern-cart-drawer.is-open {
	transform: translateY(0);
}

.modern-cart-sheet-inner,
.modern-cart-drawer-inner {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

@media (min-width: 992px) {
	.modern-cart-sheet,
	.modern-cart-drawer {
		left: auto;
		right: 0;
		top: 0;
		bottom: 0;
		width: var(--mc-drawer-width, 420px);
		max-height: 100vh;
		border-radius: 0;
		box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
		transform: translateX(100%);
	}

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

/* Header */
.modern-cart-sheet-header,
.modern-cart-drawer-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--mc-border, #eef0f2);
	flex-shrink: 0;
}

.modern-cart-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #e8f5e9;
	color: var(--mc-success, #4caf50);
	font-size: 14px;
}

.modern-cart-added,
.modern-cart-drawer-title {
	font-weight: 700;
	font-size: 16px;
	color: var(--mc-text, #1c1c1c);
}

.modern-cart-close {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: #f2f3f5;
	color: #555;
	font-size: 15px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.modern-cart-close:hover {
	background: #e4e6ea;
}

/* Body */
.modern-cart-sheet-body,
.modern-cart-drawer-body {
	padding: 18px;
	overflow-y: auto;
	flex: 1 1 auto;
	-webkit-overflow-scrolling: touch;
}

/* Product row (sheet) */
.modern-cart-product {
	display: flex;
	gap: 14px;
}

.modern-cart-product-image {
	flex-shrink: 0;
	width: 76px;
	height: 76px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--mc-border, #eef0f2);
}

.modern-cart-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.modern-cart-product-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.modern-cart-product-name {
	font-weight: 600;
	font-size: 14px;
	color: var(--mc-text, #1c1c1c);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.modern-cart-product-price {
	font-weight: 700;
	font-size: 15px;
	color: var(--mc-text, #1c1c1c);
}

.modern-cart-product-old-price {
	font-size: 13px;
	font-weight: 500;
	color: #9aa0a6;
	text-decoration: line-through;
}

/* Stepper */
.modern-cart-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid #d9dce0;
	border-radius: 999px;
	overflow: hidden;
	background: #fff;
	height: 34px;
}

.modern-cart-step-btn {
	width: 32px;
	height: 34px;
	border: 0;
	background: transparent;
	font-size: 17px;
	line-height: 1;
	color: #333;
	cursor: pointer;
}

.modern-cart-step-btn:hover {
	background: #f2f3f5;
}

.modern-cart-step-input {
	width: 42px;
	height: 34px;
	text-align: center;
	border: 0;
	border-left: 1px solid var(--mc-border, #eef0f2);
	border-right: 1px solid var(--mc-border, #eef0f2);
	font-size: 14px;
	font-weight: 600;
	-moz-appearance: textfield;
	appearance: textfield;
}

.modern-cart-step-input::-webkit-outer-spin-button,
.modern-cart-step-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Free shipping bar */
.modern-cart-free {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--mc-border, #eef0f2);
}

.modern-cart-free-info {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #555;
}

.modern-cart-free-info .fa {
	color: #f59e0b;
	font-size: 16px;
}

.modern-cart-free-track {
	height: 8px;
	background: var(--mc-border, #eef0f2);
	border-radius: 999px;
	margin-top: 10px;
	overflow: hidden;
}

.modern-cart-free-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--mc-success, #4caf50);
	transition: width 0.4s ease;
}

.modern-cart-free-banner {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #e8f5e9;
	color: var(--mc-success, #4caf50);
	border-radius: 12px;
	padding: 11px 14px;
	font-weight: 600;
	font-size: 13px;
}

/* Footer */
.modern-cart-sheet-footer,
.modern-cart-drawer-footer {
	padding: 14px 18px 18px;
	border-top: 1px solid var(--mc-border, #eef0f2);
	background: var(--mc-bg, #ffffff);
	flex-shrink: 0;
}

.modern-cart-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	font-size: 14px;
	color: #555;
}

.modern-cart-subtotal-value {
	font-weight: 700;
	font-size: 17px;
	color: var(--mc-text, #1c1c1c);
}

.modern-cart-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 16px;
	border: 0;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.modern-cart-btn i {
	font-size: 14px;
}

.modern-cart-btn-primary {
	background-color: var(--mc-primary, hsla(var(--j-color-scheme-background-primary-h, 205), var(--j-color-scheme-background-primary-s, 70%), var(--j-color-scheme-background-primary-l, 47%), var(--j-color-scheme-background-primary-a, 1)));
	color: var(--mc-primary-text, #ffffff);
}

.modern-cart-btn-primary:hover {
	opacity: 0.9;
	color: var(--mc-primary-text, #ffffff);
}

.modern-cart-btn-secondary {
	background: #f2f3f5;
	color: var(--mc-text, #1c1c1c);
	margin-top: 10px;
}

.modern-cart-btn-secondary:hover {
	background: #e4e6ea;
	color: var(--mc-text, #1c1c1c);
}

/* Drawer items */
.modern-cart-items {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.modern-cart-item {
	position: relative;
	display: flex;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--mc-border, #eef0f2);
	border-radius: 14px;
}

.modern-cart-item-image {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 10px;
	overflow: hidden;
}

.modern-cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.modern-cart-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.modern-cart-item-name {
	font-weight: 600;
	font-size: 13px;
	color: var(--mc-text, #1c1c1c);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.modern-cart-item-option {
	font-size: 11px;
	color: #888;
}

.modern-cart-item-price {
	font-size: 13px;
	color: #555;
}

.modern-cart-item-side {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	min-width: 0;
}

.modern-cart-item-total {
	font-weight: 700;
	font-size: 13px;
	color: var(--mc-text, #1c1c1c);
	white-space: nowrap;
}

.modern-cart-item-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: #fdecea;
	color: #d32f2f;
	cursor: pointer;
}

.modern-cart-item-remove:hover {
	background: #fbdbd8;
}

.modern-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 40px 0;
	color: #888;
	font-size: 14px;
	text-align: center;
}

.modern-cart-empty .fa {
	font-size: 32px;
	color: #ccc;
}

/* Totals */
.modern-cart-totals {
	margin-bottom: 14px;
}

.modern-cart-total-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 13px;
	color: #555;
}

.modern-cart-total-grand {
	border-top: 1px solid var(--mc-border, #eef0f2);
	margin-top: 6px;
	padding-top: 10px;
	font-weight: 700;
	font-size: 15px;
	color: var(--mc-text, #1c1c1c);
}

.modern-cart-total-value {
	font-size: 18px;
}

/* Free shipping inside drawer */
.modern-cart-drawer-body .modern-cart-free {
	margin: 6px 0 18px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.modern-cart-sheet,
	.modern-cart-drawer,
	.modern-cart-overlay {
		transition: none;
	}
}

/* ===== Checkout (OnePage) cart block ===== */
.cart-section .modern-checkout-items {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cart-section .modern-checkout-item {
	display: flex;
	gap: 14px;
	padding: 14px;
	border: 1px solid var(--mc-border, #eef0f2);
	border-radius: 16px;
	background: var(--mc-bg, #ffffff);
}

.cart-section .modern-checkout-item-image {
	flex-shrink: 0;
	width: 88px;
	height: 88px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--mc-border, #eef0f2);
}

.cart-section .modern-checkout-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cart-section .modern-checkout-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cart-section .modern-checkout-item-name {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
	color: var(--mc-text, #1c1c1c);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cart-section .modern-checkout-item-option {
	font-size: 12px;
	color: #888;
}

.cart-section .modern-checkout-item-qty {
	margin-top: 8px;
}

.cart-section .modern-checkout-item-price {
	flex-shrink: 0;
	font-weight: 600;
	font-size: 14px;
	color: #555;
	white-space: nowrap;
}

.cart-section .modern-checkout-item-side {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	min-width: 0;
}

.cart-section .modern-checkout-item-total {
	font-weight: 700;
	font-size: 14px;
	color: var(--mc-text, #1c1c1c);
	white-space: nowrap;
}

.cart-section .modern-checkout-voucher {
	align-items: center;
}

.cart-section .modern-checkout-voucher .modern-checkout-item-side {
	align-items: flex-end;
}

.cart-section .modern-cart-free {
	margin: 18px 0 0;
}

.cart-section .modern-checkout-totals {
	margin-top: 18px;
	border-top: 1px solid var(--mc-border, #eef0f2);
	padding-top: 10px;
}

.cart-section .modern-checkout-total-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 14px;
	color: #555;
}

.cart-section .modern-checkout-total-row:last-child {
	border-top: 1px solid var(--mc-border, #eef0f2);
	margin-top: 6px;
	padding-top: 10px;
	font-weight: 700;
	font-size: 16px;
	color: var(--mc-text, #1c1c1c);
}

.cart-section .modern-checkout-total-row:last-child span:last-child {
	font-size: 18px;
}

.cart-section .modern-checkout-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 40px 0;
	color: #888;
	font-size: 14px;
	text-align: center;
}

.cart-section .modern-checkout-empty .fa {
	font-size: 32px;
	color: #ccc;
}

@media (max-width: 480px) {
	.cart-section .modern-checkout-item {
		flex-wrap: wrap;
	}

	.cart-section .modern-checkout-item-image {
		width: 72px;
		height: 72px;
	}

	.cart-section .modern-checkout-item-price {
		flex-basis: 100%;
		order: 3;
	}

	.cart-section .modern-checkout-item-side {
		order: 2;
	}
}