.tvw-fcd-root,
.tvw-fcd-root * {
	box-sizing: border-box;
}

.tvw-fcd-floating-button {
	position: fixed;
	top: auto; /* Removed top 45% */
	bottom: 20px; /* Positioned at bottom */
	right: 0;
	z-index: 99998;
	min-width: 74px;
	min-height: 58px;
	padding: 10px 12px;
	border: 0;
	border-radius: 14px 0 0 14px;
	background: var(--tvw-fcd-button-bg, #111111);
	color: var(--tvw-fcd-button-text, #ffffff);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	display: flex;
	gap: 6px;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	transition: transform 0.28s ease, right 0.28s ease, left 0.28s ease; /* Added transition for smooth movement */
}

/* When drawer opens, move button to the edge of the drawer */
body.tvw-fcd-open .tvw-fcd-root:not(.tvw-fcd-left) .tvw-fcd-floating-button {
	transform: translateX(calc(-1 * var(--tvw-fcd-width, 420px)));
}

.tvw-fcd-left .tvw-fcd-floating-button {
	right: auto;
	left: 0;
	border-radius: 0 14px 14px 0;
}

/* When drawer opens on the left, move button to the right edge of drawer */
body.tvw-fcd-open .tvw-fcd-left .tvw-fcd-floating-button {
	transform: translateX(var(--tvw-fcd-width, 420px));
}

.tvw-fcd-cart-icon {
	font-size: 18px;
	line-height: 1;
}

.tvw-fcd-count-bubble {
	position: absolute;
	top: -8px;
	right: 8px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #e11d48;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.tvw-fcd-left .tvw-fcd-count-bubble {
	right: auto;
	left: 8px;
}

.tvw-fcd-overlay {
	position: fixed;
	inset: 0;
	z-index: 99996;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.24s ease, visibility 0.24s ease;
}

.tvw-fcd-drawer {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 99997;
	width: min(var(--tvw-fcd-width, 420px), 92vw);
	height: 100vh;
	background: #ffffff;
	box-shadow: -18px 0 42px rgba(0, 0, 0, 0.22);
	transform: translateX(105%);
	transition: transform 0.28s ease;
	outline: none;
}

.tvw-fcd-left .tvw-fcd-drawer {
	right: auto;
	left: 0;
	box-shadow: 18px 0 42px rgba(0, 0, 0, 0.22);
	transform: translateX(-105%);
}

body.tvw-fcd-open .tvw-fcd-overlay {
	opacity: 1;
	visibility: visible;
}

body.tvw-fcd-open .tvw-fcd-drawer {
	transform: translateX(0);
}

body.tvw-fcd-open {
	overflow: hidden;
}

.tvw-fcd-drawer-panel {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #ffffff;
}

.tvw-fcd-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	border-bottom: 1px solid #eeeeee;
}

.tvw-fcd-header h2 {
	margin: 0;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 800;
	color: #111827;
}

.tvw-fcd-mini-count {
	display: inline-block;
	margin-top: 4px;
	font-size: 13px;
	color: #6b7280;
}

.tvw-fcd-close {
	border: 0;
	background: transparent;
	color: #111827;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
}

.tvw-fcd-progress-wrap {
	padding: 16px 20px;
	border-bottom: 1px solid #eeeeee;
}

.tvw-fcd-progress-wrap:empty {
	display: none;
}

.tvw-fcd-progress-title {
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #111827;
	margin-bottom: 6px;
}

.tvw-fcd-progress-message {
	font-size: 13px;
	line-height: 1.45;
	color: #374151;
	margin-bottom: 10px;
}

.tvw-fcd-progress-track {
	height: 10px;
	border-radius: 999px;
	background: #e5e7eb;
	overflow: hidden;
}

.tvw-fcd-progress-track span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--tvw-fcd-accent, #111111);
	transition: width 0.28s ease;
}

.tvw-fcd-progress-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 7px;
	font-size: 12px;
	font-weight: 700;
	color: #6b7280;
}

.tvw-fcd-notice {
	display: none;
	margin: 12px 20px 0;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.35;
}

.tvw-fcd-notice.is-success {
	background: #ecfdf5;
	color: #047857;
}

.tvw-fcd-notice.is-error {
	background: #fef2f2;
	color: #b91c1c;
}

.tvw-fcd-items {
	flex: 1;
	overflow-y: auto;
	padding: 14px 20px 18px;
}

.tvw-fcd-empty {
	height: 100%;
	min-height: 280px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 12px;
	color: #374151;
}

.tvw-fcd-empty-icon {
	font-size: 42px;
}

.tvw-fcd-empty p {
	margin: 0;
	font-size: 15px;
}

.tvw-fcd-continue {
	border: 1px solid #111827;
	border-radius: 999px;
	padding: 10px 18px;
	background: #ffffff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.tvw-fcd-cart-item {
	display: grid;
	grid-template-columns: 82px 1fr;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid #eeeeee;
}

.tvw-fcd-item-image img {
	width: 82px;
	height: 82px;
	object-fit: cover;
	border-radius: 12px;
	background: #f3f4f6;
}

.tvw-fcd-item-content {
	min-width: 0;
}

.tvw-fcd-item-top {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	justify-content: space-between;
}

.tvw-fcd-item-title,
.tvw-fcd-item-title a {
	font-size: 14px;
	line-height: 1.35;
	font-weight: 800;
	color: #111827;
	text-decoration: none;
}

.tvw-fcd-remove {
	border: 0;
	background: transparent;
	color: #6b7280;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

/* === FIXED: Variation Data Styling === */
.tvw-fcd-item-meta {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.35;
	color: #6b7280;
	display: block !important; /* Ensure it is visible */
}

.tvw-fcd-item-meta dl {
	margin: 0;
	padding: 0;
	display: block;
}

.tvw-fcd-item-meta dt {
	font-weight: 700;
	color: #374151;
	display: inline;
}

.tvw-fcd-item-meta dd {
	margin: 0;
	display: inline;
	padding-right: 8px;
}

.tvw-fcd-item-meta dd:after {
	content: " ";
}
/* ==================================== */

.tvw-fcd-item-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
}

.tvw-fcd-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	overflow: hidden;
	background: #ffffff;
}

.tvw-fcd-qty button {
	width: 30px;
	height: 30px;
	border: 0;
	background: #ffffff;
	color: #111827;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.tvw-fcd-qty input {
	width: 42px;
	height: 30px;
	border: 0;
	border-left: 1px solid #d1d5db;
	border-right: 1px solid #d1d5db;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	padding: 0;
	-moz-appearance: textfield;
}

.tvw-fcd-qty input::-webkit-outer-spin-button,
.tvw-fcd-qty input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tvw-fcd-item-price {
	font-size: 14px;
	font-weight: 800;
	color: #111827;
	white-space: nowrap;
}

.tvw-fcd-footer {
	padding: 16px 20px 20px;
	border-top: 1px solid #eeeeee;
	background: #ffffff;
	box-shadow: 0 -10px 22px rgba(0, 0, 0, 0.04);
}

.tvw-fcd-subtotal-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	font-size: 16px;
	color: #111827;
}

.tvw-fcd-subtotal-row strong {
	font-size: 18px;
}

.tvw-fcd-footer-note {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.35;
	color: #6b7280;
}

.tvw-fcd-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 14px;
}

.tvw-fcd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 11px 14px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	text-align: center;
}

.tvw-fcd-btn-primary {
	background: var(--tvw-fcd-accent, #111111);
	color: #ffffff;
	border: 1px solid var(--tvw-fcd-accent, #111111);
}

.tvw-fcd-btn-secondary {
	background: #ffffff;
	color: #111827;
	border: 1px solid #111827;
}

.tvw-fcd-loading .tvw-fcd-drawer-panel {
	cursor: progress;
}

.tvw-fcd-loading .tvw-fcd-items,
.tvw-fcd-loading .tvw-fcd-footer,
.tvw-fcd-loading .tvw-fcd-progress-wrap {
	opacity: 0.58;
	pointer-events: none;
}

@media (max-width: 600px) {
	.tvw-fcd-floating-button {
		bottom: 18px;
		right: 12px;
		border-radius: 999px;
		min-width: 76px;
		min-height: 48px;
	}

	.tvw-fcd-left .tvw-fcd-floating-button {
		left: 12px;
		border-radius: 999px;
	}

	/* On mobile, floating button usually stays hidden or simplifies to avoid overlap */
	body.tvw-fcd-open .tvw-fcd-floating-button {
		opacity: 0;
		pointer-events: none;
	}

	.tvw-fcd-drawer {
		width: 94vw;
	}

	.tvw-fcd-header,
	.tvw-fcd-progress-wrap,
	.tvw-fcd-items,
	.tvw-fcd-footer {
		padding-left: 16px;
		padding-right: 16px;
	}

	.tvw-fcd-actions {
		grid-template-columns: 1fr;
	}
}