/* Cart flyout — Forest & Copper theme */

#cart-backdrop.cart-flyout-backdrop,
.cart-flyout-backdrop {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background: rgba(18, 43, 37, 0.4);
	z-index: 99998 !important;
	display: none;
	opacity: 0;
	transition: opacity var(--transition);
	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: -420px !important;
	left: auto !important;
	bottom: 0 !important;
	width: 420px !important;
	max-width: 90vw !important;
	height: 100vh !important;
	height: 100dvh !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
	background: var(--white);
	box-shadow: var(--shadow-modal);
	z-index: 99999 !important;
	display: flex !important;
	flex-direction: column !important;
	transition: right 0.28s 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: -420px !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 {
	flex-shrink: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 20px;
	border-bottom: 1px solid var(--border);
	background: var(--white);
}

.cart-flyout-header--theme {
	background: var(--forest-dark);
	border-bottom: 2px solid var(--copper);
	padding: 16px 20px;
}

.cart-flyout-header--theme .cart-flyout-title {
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin: 0;
}

.cart-flyout-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.cart-flyout-header--theme .cart-flyout-clear-btn {
	color: var(--sage);
	border-color: var(--sage);
	font-size: 11px;
}

.cart-flyout-header--theme .cart-flyout-clear-btn:hover {
	background: var(--forest-mid);
	color: #fff;
	border-color: var(--sage);
}

.cart-flyout-title {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 700;
	color: var(--charcoal);
}

.cart-flyout-close {
	background: transparent;
	border: none;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: var(--radius-md);
	transition: var(--transition);
	color: var(--charcoal);
}

.cart-flyout-header--theme .cart-flyout-close {
	color: var(--sage);
}

.cart-flyout-close:hover {
	background: var(--sage-bg);
}

.cart-flyout-header--theme .cart-flyout-close:hover {
	background: rgba(255,255,255,0.12);
	color: #fff;
}

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

.cart-flyout-items {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 16px;
	min-height: 0;
	flex-shrink: 1;
	background: var(--bg);
}

.cart-flyout-item {
	display: flex;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}

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

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

.cart-flyout-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--white);
}

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

.cart-flyout-item-name {
	margin: 0;
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--charcoal);
}

.cart-flyout-item-name a {
	color: var(--charcoal);
	text-decoration: none;
}

.cart-flyout-item-name a:hover {
	color: var(--forest);
}

.cart-flyout-item-options,
.cart-flyout-item-recurring {
	font-family: var(--font-data);
	font-size: 10px;
	color: var(--text-muted);
	line-height: 1.4;
}

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

.cart-flyout-item-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
	flex-wrap: wrap;
}

.cart-flyout-item-quantity {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--white);
}

.qty-btn {
	background: var(--sage-bg);
	border: none;
	width: 28px;
	height: 28px;
	min-width: 28px;
	min-height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 14px;
	font-family: var(--font-data);
	color: var(--forest);
	transition: var(--transition);
	padding: 0;
}

.qty-btn:hover {
	background: var(--forest-border);
	color: var(--forest-dark);
}

.qty-input {
	width: 40px;
	height: 28px;
	min-width: 40px;
	border: none;
	text-align: center;
	font-size: 12px;
	font-family: var(--font-data);
	padding: 0;
	background: var(--white);
	color: var(--charcoal);
}

.cart-flyout-item-price {
	font-family: var(--font-data);
	font-weight: 700;
	font-size: 12px;
	color: var(--charcoal);
	margin-left: auto;
	white-space: nowrap;
}

.cart-flyout-item-remove {
	background: transparent;
	border: 1.5px solid var(--border);
	color: var(--text-muted);
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: var(--radius-md);
	transition: var(--transition);
	padding: 0;
	flex-shrink: 0;
}

.cart-flyout-item-remove:hover {
	background: var(--red-light);
	border-color: var(--red);
	color: var(--red);
}

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

.cart-flyout-empty {
	padding: 40px 16px;
	text-align: center;
	color: var(--text-muted);
	font-family: var(--font-body);
	font-size: 13px;
}

.cart-flyout-footer {
	padding: 20px;
	border-top: 2px solid var(--border);
	background: var(--bg);
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	box-sizing: border-box;
}

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

.cart-flyout-totals-table td {
	padding: 6px 0;
	vertical-align: middle;
	font-family: var(--font-body);
	font-size: 12px;
}

.total-label {
	text-align: left;
	font-weight: 600;
	color: var(--text-body);
}

.total-amount {
	text-align: right;
	font-weight: 700;
	font-family: var(--font-data);
	color: var(--charcoal);
}

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

.cart-flyout-actions .btn-primary-moov {
	min-height: 44px;
	font-size: 13px;
}

.cart-flyout-footer a.btn-primary-moov:hover,
.cart-flyout-footer a.btn-primary-moov:focus {
	color: var(--copper-contrast, #fff);
	text-decoration: none;
	background: var(--copper-hover);
}

.cart-flyout-footer a.btn-primary-moov:active {
	color: var(--copper-contrast, #fff);
	text-decoration: none;
	background: var(--copper-active);
}

.cart-flyout-action a.btn-primary-moov:hover,
.cart-flyout-action a.btn-primary-moov:focus {
	color: var(--copper-contrast, #fff);
	text-decoration: none;
	background: var(--copper-hover);
}

.cart-flyout-action a.btn-primary-moov:active {
	color: var(--copper-contrast, #fff);
	text-decoration: none;
	background: var(--copper-active);
}

.cart-flyout-login-prompt {
	text-align: center;
	margin: 12px 0 0;
	font-family: var(--font-body);
	font-size: 12px;
	color: var(--text-muted);
}

.cart-flyout-login-prompt a {
	color: var(--forest);
	font-weight: 700;
	text-decoration: none;
}

.cart-flyout-login-prompt a:hover {
	text-decoration: underline;
}

@media (max-width: 1024px) {
	#cart-flyout.cart-flyout-panel,
	.cart-flyout-panel {
		width: min(420px, 90vw) !important;
		max-width: min(420px, 90vw) !important;
	}
	.cart-flyout-footer {
		padding-bottom: calc(20px + env(safe-area-inset-bottom, 0)) !important;
	}
}

@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-header--theme {
		padding-top: calc(16px + env(safe-area-inset-top, 0)) !important;
	}
	.cart-flyout-item-image {
		width: 56px;
		height: 56px;
	}
	.cart-flyout-footer {
		padding: 16px !important;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0)) !important;
	}
	.qty-btn {
		width: 26px !important;
		height: 26px !important;
		min-width: 26px !important;
		min-height: 26px !important;
		font-size: 13px !important;
	}
	.qty-input {
		width: 36px !important;
		height: 26px !important;
		min-width: 36px !important;
		font-size: 11px !important;
	}
	.cart-flyout-item-remove {
		width: 30px !important;
		height: 30px !important;
		min-width: 30px !important;
		min-height: 30px !important;
	}
}

.moov-cart-trigger {
	position: relative;
	background: none;
	border: none;
	outline: none;
	cursor: pointer;
	font-size: 14px;
	padding: 6px;
	color: var(--charcoal) !important;
	min-width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-md);
	transition: var(--transition);
}

.moov-cart-trigger:hover {
	color: var(--forest) !important;
}

.moov-cart-trigger:focus-visible {
	outline: 2px solid var(--copper);
	outline-offset: 2px;
}

.moov-cart-trigger i,
.moov-cart-trigger .fa {
	color: inherit !important;
}

.moov-cart-trigger .moov-cart-svg {
	flex-shrink: 0;
	stroke: currentColor;
	width: 20px !important;
	height: auto !important;
	max-height: 22px;
}

.moov-cart-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: var(--copper);
	color: #fff;
	border-radius: var(--radius-pill);
	min-width: 18px;
	height: 18px;
	font-size: 10px;
	font-family: var(--font-data);
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Staff Pricing Controls — shared by cart page + flyout
   (Only visible to salesman / manager roles)
   ═══════════════════════════════════════════════════════════════════════ */

.staff-ctrl {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.staff-ctrl__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.staff-ctrl__row {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.staff-ctrl__row .staff-ctrl__field {
	flex: 1;
	min-width: 0;
}


.staff-ctrl__label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-family: var(--font-body);
	font-size: 10px;
	font-weight: 700;
	color: var(--forest);
	letter-spacing: 0.6px;
	text-transform: uppercase;
}

.staff-ctrl__cap {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 1px 6px;
	border-radius: var(--radius-pill);
	background: var(--red-light);
	color: var(--red);
	border: 1px solid rgba(var(--forest-rgb), 0);
	border-color: #F1C8C3;
	font-family: var(--font-data);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: none;
	white-space: nowrap;
}

.staff-ctrl__input-wrap {
	display: flex;
	align-items: stretch;
	background: var(--white);
	border: 1.5px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.staff-ctrl__input-wrap:focus-within {
	border-color: var(--copper);
	box-shadow: 0 0 0 3px var(--copper-bg-subtle);
}

.staff-ctrl__prefix,
.staff-ctrl__suffix {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 10px;
	background: var(--sage-bg);
	color: var(--forest);
	font-family: var(--font-data);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.staff-ctrl__prefix { border-right: 1px solid var(--border); }
.staff-ctrl__suffix { border-left: 1px solid var(--border); }

.staff-ctrl__input {
	flex: 1;
	min-width: 0;
	width: 100%;
	padding: 0 10px;
	height: 32px;
	border: 0 !important;
	background: transparent;
	box-shadow: none !important;
	outline: none;
	font-family: var(--font-data);
	font-size: 13px;
	font-weight: 600;
	color: var(--charcoal);
	appearance: textfield;
}

.staff-ctrl__input::-webkit-outer-spin-button,
.staff-ctrl__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.staff-ctrl__input::placeholder {
	color: var(--text-light);
	font-weight: 500;
}

.staff-ctrl__input.is-capped {
	color: var(--red);
	background: var(--red-light);
}

/* Sample toggle chip */
.staff-ctrl__sample {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	margin: 0;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--white);
	color: var(--text-body);
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	cursor: pointer;
	user-select: none;
	transition: var(--transition);
}

.staff-ctrl__sample:hover {
	border-color: var(--copper-border);
	color: var(--copper-active);
}

.staff-ctrl__sample-cb {
	width: 14px;
	height: 14px;
	margin: 0;
	accent-color: var(--copper);
	cursor: pointer;
}

.staff-ctrl__sample:has(.staff-ctrl__sample-cb:checked) {
	background: var(--copper-light);
	border-color: var(--copper);
	color: var(--copper-active);
}

/* Inline save status (flyout) */
.staff-ctrl__status {
	font-family: var(--font-data);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.3px;
	min-height: 14px;
	transition: opacity 0.2s;
}

.staff-ctrl__status.is-saving { color: var(--text-muted); }
.staff-ctrl__status.is-saved  { color: var(--s-avail-text); }
.staff-ctrl__status.is-error  { color: var(--red); }

/* ── Cart line badges (status-pill-flavored) ── */
.cart-line-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: var(--radius-pill);
	font-family: var(--font-data);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	line-height: 1.3;
	vertical-align: middle;
	white-space: nowrap;
}

.cart-line-badge i { font-size: 9px; }

.cart-line-badge--sample {
	background: var(--copper-light);
	color: var(--copper-active);
	border: 1px solid var(--copper-border);
}

.cart-line-badge--override {
	background: var(--forest-light);
	color: var(--forest-dark);
	border: 1px solid var(--forest-border);
}

.cart-line-badge--discount {
	background: var(--s-avail-bg);
	color: var(--s-avail-text);
	border: 1px solid var(--s-avail-bd);
}

/* ── Cart-page table row tints ── */
.cart-line-table tr.is-sample-row td {
	background: var(--copper-light) !important;
}
.cart-line-table tr.is-sample-row td:first-child {
	box-shadow: inset 3px 0 0 var(--copper);
}

.cart-line-table tr.is-override-row td {
	background: var(--forest-light) !important;
}
.cart-line-table tr.is-override-row td:first-child {
	box-shadow: inset 3px 0 0 var(--forest);
}

/* Staff controls column width on the cart page */
.cart-line-table .staff-ctrl-col {
	width: 220px;
	min-width: 200px;
	vertical-align: top;
	padding-top: 14px !important;
}

/* Hide legacy standalone discount column (merged into staff controls) */
.cart-line-table__linedisc { display: none !important; }

/* ── Flyout-specific staff controls spacing ── */
.cart-flyout-item .staff-ctrl {
	margin-top: 10px;
	padding: 10px 0 2px;
	border-top: 1px dashed var(--border);
}

.cart-flyout-item.is-sample {
	background: var(--copper-light);
	border-left: 3px solid var(--copper);
	padding-left: 10px;
	margin-left: -12px;
	padding-right: 2px;
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.cart-flyout-item.is-override {
	background: var(--forest-light);
	border-left: 3px solid var(--forest);
	padding-left: 10px;
	margin-left: -12px;
	padding-right: 2px;
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

@media (max-width: 768px) {
	.cart-line-table .staff-ctrl-col {
		width: auto;
		min-width: 0;
	}
}
