/* ==========================================================================
   Custom Cart UX — styles
   Colors are CSS custom properties (not hardcoded) so they can be
   re-themed later, matching the token approach used in Custom Checkout
   Pro (--ccp-*). Prefixed --ccux- here to stay independent of that
   plugin.
   ========================================================================== */

:root {
	--ccux-ink: #1d1d1f;
	--ccux-ink-soft: #3a3a3c;
	--ccux-muted: #6e6e73;
	--ccux-bg: #ffffff;
	--ccux-surface: #f5f5f7;
	--ccux-border: #e5e5e7;
	--ccux-success-bg: #e1f5ee;
	--ccux-success-border: #5dcaa5;
	--ccux-success-text: #0f6e56;
	--ccux-radius: 10px;
	--ccux-font-family: inherit;
	--ccux-qty-icon-color: #b2d234;
}

/* ---------- Toast ---------- */

.ccux-toast {
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 100000;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--ccux-success-bg);
	color: var(--ccux-success-text);
	border: 1px solid var(--ccux-success-border);
	border-radius: var(--ccux-radius);
	padding: 10px 14px;
	font-family: var(--ccux-font-family);
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.22s ease, transform 0.22s ease;
	pointer-events: none;
}

.ccux-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.ccux-toast__icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

@media (max-width: 480px) {
	.ccux-toast {
		left: 12px;
		right: 12px;
		top: 12px;
		justify-content: center;
		text-align: center;
	}
}

/* ---------- Force the side-cart drawer to open from the left ---------- */
/* This overrides Elementor Pro's own left/right + transform logic so
   the drawer is consistent regardless of the widget's internal RTL
   handling. Kept as a small, isolated override rather than editing
   Elementor's own CSS. */

.elementor-menu-cart__container {
	right: auto !important;
	left: 0 !important;
}

.elementor-menu-cart__container.elementor-menu-cart--container-slide-in {
	transform: translateX(-100%);
}

.elementor-menu-cart__container[aria-hidden='false'].elementor-menu-cart--container-slide-in {
	transform: translateX(0);
}

/* Lightweight skeleton shown for the brief moment between the drawer
   opening and the fragments finishing their update. */
.ccux-skeleton-row {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 14px 16px;
}

.ccux-skeleton-thumb,
.ccux-skeleton-line {
	background: var(--ccux-surface);
	border-radius: 6px;
	animation: ccux-pulse 1.1s ease-in-out infinite;
}

.ccux-skeleton-thumb {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
}

.ccux-skeleton-lines {
	flex: 1;
}

.ccux-skeleton-line {
	height: 11px;
	margin-bottom: 8px;
}

.ccux-skeleton-line:last-child {
	width: 55%;
	margin-bottom: 0;
}

@keyframes ccux-pulse {
	0%, 100% { opacity: 0.6; }
	50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ccux-toast,
	.ccux-skeleton-thumb,
	.ccux-skeleton-line {
		transition: none;
		animation: none;
	}
}

/* ---------- Cart-drawer header: title + item-count pill + close (×) ---------- */

.ccux-cart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--ccux-border);
	font-family: var(--ccux-font-family);
}

.ccux-cart-header__titles {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ccux-cart-header__title {
	font-size: 15px;
	font-weight: 500;
	color: var(--ccux-ink);
}

.ccux-cart-header__count {
	font-size: 11px;
	color: var(--ccux-muted);
	background: var(--ccux-surface);
	border-radius: 20px;
	padding: 3px 9px;
	display: none;
}

.ccux-cart-header__count.is-visible {
	display: inline-block;
}

.ccux-cart-header__close {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	border-radius: 50%;
	color: var(--ccux-ink-soft);
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease;
}

.ccux-cart-header__close:hover {
	background: var(--ccux-surface);
}

/* Elementor's own close button assumes the drawer opens from the
   right; forcing the drawer open from the left (further up in this
   file) leaves it positioned off-screen on desktop's fixed-width
   drawer. Rather than fight that positioning, it's kept fully
   functional (JS proxies a click onto it) but visually hidden, and
   our own reliably-positioned close button above replaces it. */
.elementor-menu-cart__close-button {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ---------- Per-item remove (×) button ---------- */
/* This markup renders two overlapping remove links per row with
   identical hrefs (WC's own class, plus Elementor's own variant).
   Rather than hiding one by class name — fragile, since it silently
   breaks again if markup order or caching changes — both are
   stacked exactly on top of each other via position:absolute, so
   only a single × is ever visible regardless of which one a given
   page load actually renders first, and clicking either one removes
   the item (their hrefs point to WooCommerce's own built-in
   remove-item URL either way, so it works even without JS). */

.elementor-menu-cart__product-remove {
	position: relative;
	width: 28px;
	height: 28px;
}

.elementor-menu-cart__product-remove a {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	inset: 0;
	display: flex !important;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--ccux-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.elementor-menu-cart__product-remove a:hover {
	background: var(--ccux-surface);
	color: #d3402c;
}

.elementor-menu-cart__product-remove a::before {
	content: '';
	display: block;
	width: 14px;
	height: 14px;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

/* ---------- Our own inline quantity control inside the mini-cart ---------- */
/* Elementor's own cart-row template has no quantity field at all, so
   this control is injected entirely by JS and placed on its own row
   below the product name/price/remove row (not beside the name),
   which also keeps long product names from ever being clipped. */

.ccux-qty {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	background: var(--ccux-surface);
	border-radius: 8px;
	padding: 3px;
	margin-top: 8px;
	width: fit-content;
	/* This template lays each cart row out with CSS Grid and has no
	   quantity column of its own — span the full row width on a new
	   line underneath, rather than fighting the existing grid tracks. */
	grid-column: 1 / -1;
}

.ccux-qty__btn {
	width: 30px;
	height: 30px;
	min-width: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	border-radius: 6px;
	color: var(--ccux-qty-icon-color) !important;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease;
}

.ccux-qty__btn:hover {
	background: var(--ccux-border);
}

.ccux-qty__btn:disabled {
	opacity: 0.4;
	cursor: default;
	background: transparent;
}

.ccux-qty__value {
	min-width: 26px;
	text-align: center;
	font-size: 13px;
	font-weight: 500;
	color: var(--ccux-ink);
}

/* Comfortable touch targets on small screens (44px minimum per
   platform guidelines), a step up from the desktop 30px. */
@media (max-width: 480px) {
	.ccux-qty__btn {
		width: 38px;
		height: 38px;
		min-width: 38px;
		font-size: 17px;
	}

	.ccux-qty__value {
		min-width: 32px;
		font-size: 14px;
	}

	.elementor-menu-cart__container {
		width: 100% !important;
		max-width: 100% !important;
	}
}

.ccux-qty.is-updating {
	opacity: 0.6;
	pointer-events: none;
}
