/**
 * VisionaryCue Commerce Pro - floating cart, drawer and cart page.
 */

/* ------------------------------------------------------- Floating cart --- */

.vc-floating-cart {
	position: fixed;
	bottom: calc(var(--vc-space-4) + env(safe-area-inset-bottom, 0px));
	z-index: var(--vc-z-floating);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition: opacity var(--vc-transition) var(--vc-ease),
		transform 0.24s var(--vc-ease),
		visibility 0s linear 0.24s;
}

.vc-floating-cart.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.vc-floating-cart--bottom-center { left: 50%; transform: translate(-50%, 16px); }
.vc-floating-cart--bottom-center.is-visible { transform: translateX(-50%); }
.vc-floating-cart--bottom-right { right: var(--vc-space-4); }
.vc-floating-cart--bottom-left { left: var(--vc-space-4); }

.vc-floating-cart__btn {
	display: flex;
	align-items: center;
	gap: var(--vc-space-3);
	min-height: 56px;
	padding: 8px 10px 8px 16px;
	border: 0;
	border-radius: var(--vc-radius-pill);
	background: var(--vc-primary);
	color: var(--vc-on-primary);
	font: inherit;
	cursor: pointer;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--vc-primary) 35%, transparent);
	transition: background var(--vc-transition) var(--vc-ease), transform var(--vc-transition) var(--vc-ease);
}

.vc-floating-cart__btn:hover { background: var(--vc-primary-dark); transform: translateY(-1px); }

.vc-floating-cart__icon { display: grid; place-items: center; flex: none; }

.vc-floating-cart__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.25;
	text-align: left;
}

.vc-floating-cart__count { font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.vc-floating-cart__total { font-size: 0.98em; font-weight: 700; }

.vc-floating-cart__cta {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 9px 14px;
	border-radius: var(--vc-radius-pill);
	background: color-mix(in srgb, #000 16%, transparent);
	font-size: 0.8em;
	font-weight: 700;
	white-space: nowrap;
}

.vc-floating-cart.is-bumping .vc-floating-cart__btn { animation: vc-bump 0.35s var(--vc-ease); }

/* The floating cart is fixed, so the page has to give back the space it
   covers. Without this it sits on top of whatever ends the page — a stat
   card, the last row of a table, a submit button. The class is toggled with
   the cart's own visibility, so an empty cart costs no space. */
body.vc-floating-cart-visible {
	padding-bottom: calc(var(--vc-floating-cart-space) + env(safe-area-inset-bottom, 0px));
}

/* -------------------------------------------------------------- Drawer --- */

.vc-side-cart .vc-drawer__body { padding-inline: var(--vc-space-4); }

.vc-cart-lines { list-style: none; margin: 0; padding: 0; }

.vc-cart-line {
	position: relative;
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) 28px;
	gap: var(--vc-space-3);
	padding: var(--vc-space-3) 0;
	border-bottom: 1px solid var(--vc-border);
}

.vc-cart-line.is-busy { opacity: 0.5; pointer-events: none; }

.vc-cart-line__media {
	width: 72px;
	height: 72px;
	border: 1px solid var(--vc-border);
	border-radius: var(--vc-radius-sm);
	background: var(--vc-background);
	overflow: hidden;
	display: grid;
	place-items: center;
}

.vc-cart-line__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.vc-cart-line__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.vc-cart-line__title.vc-cart-line__title {
	margin: 0;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.vc-cart-line__title a { color: inherit; text-decoration: none; }
.vc-cart-line__title a:hover { color: var(--vc-primary); }

.vc-cart-line__variation { font-size: 0.78em; color: var(--vc-muted); }
.vc-cart-line__variation p { margin: 0; }
.vc-cart-line__variation dl { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.vc-cart-line__variation dt { font-weight: 600; }
.vc-cart-line__variation dd { margin: 0 8px 0 0; }

.vc-cart-line__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--vc-space-2);
	margin-top: auto;
}

.vc-cart-line__qty .vc-qty__btn { width: 30px; height: 32px; }
.vc-cart-line__qty .vc-qty__input { width: 36px; height: 32px; font-size: 0.86em; }
.vc-cart-line__price { font-weight: 700; font-size: 0.92em; }

.vc-cart-line__remove {
	align-self: flex-start;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--vc-muted);
	cursor: pointer;
}

.vc-cart-line__remove:hover { background: var(--vc-background); color: var(--vc-error); }

.vc-drawer__crosssell { padding-top: var(--vc-space-4); }

.vc-drawer__crosssell-title.vc-drawer__crosssell-title {
	margin: 0 0 var(--vc-space-2);
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--vc-muted);
}

.vc-drawer__crosssell .vc-product-card { width: 150px; }
.vc-drawer__crosssell .vc-product-card__body { padding: 8px; }

.vc-drawer__actions { display: flex; flex-direction: column; gap: 8px; }
.vc-drawer__actions-row { display: flex; justify-content: space-between; gap: 8px; }
.vc-drawer__footer--empty { border-top: 0; }

/* -------------------------------------------------------------- Totals --- */

.vc-totals { margin: 0 0 var(--vc-space-3); }

.vc-totals__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--vc-space-3);
	padding: 6px 0;
	font-size: 0.9em;
}

.vc-totals__row dt { margin: 0; color: var(--vc-muted); }
.vc-totals__row dd { margin: 0; font-weight: 600; text-align: right; }
.vc-totals__row--discount dd { color: var(--vc-success); }
.vc-totals__free { color: var(--vc-success); font-weight: 700; }

.vc-totals__coupons {
	display: block;
	font-size: 0.82em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--vc-success);
}

.vc-totals__row--total {
	margin-top: 6px;
	padding-top: 12px;
	border-top: 1px solid var(--vc-border);
	font-size: 1.05em;
}

.vc-totals__row--total dt { color: var(--vc-text); font-weight: 700; }
.vc-totals__row--total dd { font-weight: 700; font-size: 1.12em; }

/* -------------------------------------------------------------- Coupon --- */

.vc-coupon { margin-bottom: var(--vc-space-3); }

.vc-coupon__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}

.vc-coupon__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 6px 5px 10px;
	border-radius: var(--vc-radius-pill);
	background: color-mix(in srgb, var(--vc-success) 12%, transparent);
	color: var(--vc-success);
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.vc-coupon__remove {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: color-mix(in srgb, var(--vc-success) 18%, transparent);
	color: inherit;
	cursor: pointer;
}

.vc-coupon__remove:hover { background: var(--vc-success); color: #fff; }
.vc-coupon--compact .vc-input { min-height: 40px; font-size: 0.9em; }
.vc-coupon--compact .vc-btn { min-height: 40px; }

/* ----------------------------------------------------------- Cart page --- */

.vc-cart-page {
	background: var(--vc-background);
	padding-bottom: var(--vc-space-8);
}

.vc-cart-page .vc-section__head { padding-top: var(--vc-space-5); }

.vc-cart-page__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 372px;
	gap: var(--vc-space-5);
	align-items: start;
}

.vc-cart-page__main {
	background: var(--vc-surface);
	border: 1px solid var(--vc-border);
	border-radius: var(--vc-card-radius);
	box-shadow: var(--vc-shadow-offset);
	padding: var(--vc-space-4) var(--vc-space-5);
}

.vc-cart-page__actions { padding-top: var(--vc-space-4); }
.vc-cart-page__aside { position: sticky; top: calc(var(--vc-sticky-offset) + var(--vc-space-4)); }

.vc-cart-items__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 140px 110px;
	gap: var(--vc-space-3);
	padding-bottom: var(--vc-space-2);
	border-bottom: 1px solid var(--vc-border);
	font-size: 0.74em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--vc-muted);
}

.vc-cart-items__head span:nth-child(2) { text-align: center; }
.vc-cart-items__head span:nth-child(3) { text-align: right; }

.vc-cart-items__list { list-style: none; margin: 0; padding: 0; }

.vc-cart-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 140px 110px;
	gap: var(--vc-space-3);
	align-items: center;
	padding: var(--vc-space-4) 0;
	border-bottom: 1px solid var(--vc-border);
}

.vc-cart-row.is-busy { opacity: 0.5; pointer-events: none; }
.vc-cart-row:last-child { border-bottom: 0; }

.vc-cart-row__product { display: flex; gap: var(--vc-space-3); min-width: 0; }

.vc-cart-row__media {
	flex: none;
	width: 88px;
	height: 88px;
	border: 1px solid var(--vc-border);
	border-radius: var(--vc-radius-sm);
	background: var(--vc-background);
	overflow: hidden;
	display: grid;
	place-items: center;
}

.vc-cart-row__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.vc-cart-row__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vc-cart-row__title { margin: 0; font-size: 0.98em; font-weight: 600; line-height: 1.3; }
.vc-cart-row__title a { color: inherit; text-decoration: none; }
.vc-cart-row__title a:hover { color: var(--vc-primary); }
.vc-cart-row__variation { font-size: 0.8em; color: var(--vc-muted); }
.vc-cart-row__variation dl { margin: 0; }
.vc-cart-row__variation dt,
.vc-cart-row__variation dd { display: inline; margin: 0 4px 0 0; }
.vc-cart-row__unit { font-size: 0.82em; color: var(--vc-muted); }
.vc-cart-row__stock { font-size: 0.78em; font-weight: 600; }
.vc-cart-row__links { display: flex; flex-wrap: wrap; gap: var(--vc-space-3); margin-top: 4px; }

.vc-linkbtn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--vc-muted);
	font: inherit;
	font-size: 0.8em;
	font-weight: 600;
	cursor: pointer;
}

.vc-linkbtn:hover { color: var(--vc-primary); }
.vc-cart-row__qty { display: flex; justify-content: center; }
.vc-cart-row__subtotal { text-align: right; font-weight: 700; }

/* Matches the checkout panels: flat offset shadow, and a torn foot below. */
.vc-cart-summary {
	background: var(--vc-surface);
	border: 1px solid var(--vc-border);
	border-radius: var(--vc-card-radius) var(--vc-card-radius) 0 0;
	box-shadow: var(--vc-shadow-offset);
	padding: var(--vc-space-5);
}

/*
 * Torn edge under the summary. Declared here as well as in checkout.css
 * because the cart page never loads that stylesheet.
 */
.vc-ticket-edge {
	height: 14px;
	background: var(--vc-surface);
	clip-path: polygon(
		0% 0%, 5% 100%, 10% 0%, 15% 100%, 20% 0%, 25% 100%, 30% 0%, 35% 100%,
		40% 0%, 45% 100%, 50% 0%, 55% 100%, 60% 0%, 65% 100%, 70% 0%, 75% 100%,
		80% 0%, 85% 100%, 90% 0%, 95% 100%, 100% 0%
	);
}

.vc-cart-summary__foot-note {
	margin: var(--vc-space-3) 0 0;
	text-align: center;
	font-size: 0.8em;
	color: var(--vc-muted);
}

.vc-cart-summary__title.vc-cart-summary__title {
	margin: 0 0 var(--vc-space-3);
	font-size: 1.05em;
	font-weight: var(--vc-heading-weight);
}

.vc-cart-summary__note { margin: -2px 0 6px; font-size: 0.78em; color: var(--vc-muted); }
.vc-cart-summary__checkout { margin-top: var(--vc-space-2); }

.vc-cart-summary__secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: var(--vc-space-3) 0 0;
	font-size: 0.78em;
	color: var(--vc-muted);
}

/* --------------------------------------------------------- Responsive --- */

@media (max-width: 1023px) {
	.vc-cart-page__layout { grid-template-columns: minmax(0, 1fr); }
	.vc-cart-page__aside { position: static; }
}

@media (max-width: 767px) {
	.vc-floating-cart { bottom: calc(var(--vc-mobilenav-height) + 12px + env(safe-area-inset-bottom, 0px)); }
	body:not(.vc-has-mobilenav) .vc-floating-cart { bottom: calc(var(--vc-space-4) + env(safe-area-inset-bottom, 0px)); }

	/* On mobile the cart stacks above the bottom nav, so the page has to
	   clear both. Two classes here outrank the single-class .vc-has-mobilenav
	   rule in global.css. */
	body.vc-floating-cart-visible.vc-has-mobilenav {
		padding-bottom: calc(
			var(--vc-mobilenav-height) + var(--vc-floating-cart-space) + env(safe-area-inset-bottom, 0px)
		);
	}

	.vc-floating-cart--bottom-center,
	.vc-floating-cart--bottom-right,
	.vc-floating-cart--bottom-left {
		left: var(--vc-space-3);
		right: var(--vc-space-3);
		transform: translateY(16px);
	}

	.vc-floating-cart.is-visible { transform: none; }
	.vc-floating-cart__btn { width: 100%; }
	.vc-floating-cart__info { flex: 1 1 auto; }

	.vc-cart-page__main { padding: var(--vc-space-3); border-radius: var(--vc-radius); }
	.vc-cart-items__head { display: none; }

	.vc-cart-row {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--vc-space-3);
		padding: var(--vc-space-3) 0;
	}

	.vc-cart-row__qty { justify-content: flex-start; }

	.vc-cart-row__subtotal {
		text-align: left;
		font-size: 1.02em;
	}

	.vc-cart-row__media { width: 72px; height: 72px; }
	.vc-cart-summary { padding: var(--vc-space-4); border-radius: var(--vc-radius); }
}
