/**
 * Nexio Toolkit — Menu Cart widget.
 *
 * Specificity note: every rule that styles the toggle, the remove
 * control or the panel buttons is written with the `.nexio-menu-cart`
 * ancestor as well as its own class. The Elementor kit styles bare
 * `button` and `a.button` elements at one-class-plus-one-element, which
 * beats a lone BEM class and would otherwise hand these controls the
 * kit's padding, font size and text colour.
 */

.nexio-menu-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.nexio-menu-cart__inner {
	position: relative;
	display: inline-flex;
	align-items: center;
}

/* ---------- Toggle button ---------- */

.nexio-menu-cart .nexio-menu-cart__toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	height: 44px;
	padding: 0 10px;
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	color: inherit;
	font-size: inherit;
	line-height: 0;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nexio-menu-cart__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	font-size: 22px;
	line-height: 0;
}

/* max-width:none defeats the common theme rule
   `img, picture, video, canvas, svg { max-width: 100% }`, which
   collapses an SVG inside a shrink-to-fit flex item to zero width. */
.nexio-menu-cart__icon svg,
.nexio-menu-cart .nexio-menu-cart__remove svg {
	width: 1em;
	height: 1em;
	max-width: none;
	flex: 0 0 auto;
	display: block;
}

/* ---------- Count badge ---------- */

.nexio-menu-cart__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background-color: #4f46e5;
	color: #fff;
	border-radius: 50%;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}

.nexio-menu-cart-count-bubble .nexio-menu-cart__count {
	position: absolute;
	top: -2px;
	right: -2px;
}

/* "Hide when empty" — the wrapper carries the state so the badge can
   vanish without the icon shifting. */
.nexio-menu-cart--empty .nexio-menu-cart__count {
	display: none;
}

.nexio-menu-cart__subtotal {
	line-height: 1.2;
	white-space: nowrap;
}

/* ---------- Dropdown panel ---------- */

.nexio-menu-cart__panel {
	position: absolute;
	top: 100%;
	z-index: 9999;
	width: 340px;
	max-width: calc(100vw - 32px);
	margin-top: 10px;
	padding: 18px;
	background-color: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(15, 23, 42, 0.06);
	text-align: left;
}

.nexio-menu-cart__panel[hidden] {
	display: none;
}

.nexio-menu-cart-align-right .nexio-menu-cart__panel {
	right: 0;
}

.nexio-menu-cart-align-left .nexio-menu-cart__panel {
	left: 0;
}

.nexio-menu-cart__heading {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 600;
}

.nexio-menu-cart__empty {
	margin: 0;
	opacity: 0.75;
}

/* ---------- Items ---------- */

.nexio-menu-cart__items {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nexio-menu-cart__item {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nexio-menu-cart__item-thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 8px;
	line-height: 0;
}

.nexio-menu-cart__item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nexio-menu-cart__item-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.nexio-menu-cart__item-name {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
}

.nexio-menu-cart__item-meta {
	font-size: 12px;
	opacity: 0.75;
}

.nexio-menu-cart__item-price {
	flex: 0 0 auto;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
}

.nexio-menu-cart .nexio-menu-cart__remove {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: inherit;
	font-size: 15px;
	line-height: 0;
	opacity: 0.55;
	text-decoration: none;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.nexio-menu-cart .nexio-menu-cart__remove:hover {
	opacity: 1;
	background-color: rgba(0, 0, 0, 0.06);
}

/* ---------- Totals + actions ---------- */

.nexio-menu-cart__totals {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--nexio-menu-cart-divider, rgba(0, 0, 0, 0.08));
	font-weight: 600;
}

.nexio-menu-cart__actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.nexio-menu-cart .nexio-menu-cart__button {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 16px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	background: transparent;
	color: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.nexio-menu-cart .nexio-menu-cart__button--checkout {
	background-color: #4f46e5;
	border-color: transparent;
	color: #fff;
}

.nexio-menu-cart .nexio-menu-cart__button:hover {
	opacity: 0.9;
}

/* Removal in flight. */
.nexio-menu-cart.is-busy .nexio-menu-cart__panel {
	opacity: 0.6;
	pointer-events: none;
}

.nexio-menu-cart__notice {
	padding: 10px 14px;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
	.nexio-menu-cart .nexio-menu-cart__toggle,
	.nexio-menu-cart .nexio-menu-cart__remove {
		transition: none;
	}
}

/*
 * WooCommerce wraps sale prices in <ins>, which browsers underline by
 * default. A parent's `text-decoration: none` cannot clear a child's
 * own decoration, so the element itself has to be reset. <del> keeps
 * its line-through — that one carries meaning.
 */
.nexio-menu-cart__item-price ins,
.nexio-menu-cart ins {
	text-decoration: none;
	background: none;
}
