/**
 * WapuOS Base · Canonical Cart Offcanvas
 * Container only: product lines are the shared .wapu-cart-item component.
 */

.wapu-cart-offcanvas {
	position: fixed;
	inset: 0;
	z-index: calc(var(--wtds-z-modal, 1400) + 20);
	visibility: hidden;
	pointer-events: none;
}

.wapu-cart-offcanvas.is-open {
	visibility: visible;
	pointer-events: auto;
}

.wapu-cart-offcanvas__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wtds-scrim-strong, rgb(0 0 0 / .42));
	opacity: 0;
	cursor: default;
	transition: opacity var(--wtds-dur, .24s) var(--wtds-ease, ease);
}

.wapu-cart-offcanvas.is-open .wapu-cart-offcanvas__backdrop {
	opacity: 1;
}

.wapu-cart-offcanvas__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(31rem, 94vw);
	max-width: 100%;
	background: var(--wtds-surface);
	box-shadow: var(--wtds-shadow-lg);
	transform: translate3d(100%, 0, 0);
	transition: transform var(--wtds-dur, .24s) var(--wtds-ease-spring, cubic-bezier(.2,.8,.2,1));
	display: flex;
	flex-direction: column;
	outline: none;
	overflow: hidden;
}

.wapu-cart-offcanvas.is-open .wapu-cart-offcanvas__panel {
	transform: translate3d(0, 0, 0);
}

.wapu-cart-offcanvas .widget_shopping_cart_content,
.wapu-cart-offcanvas .wapu-mini-cart {
	display: flex;
	flex-direction: column;
	min-height: 0;
	height: 100%;
	width: 100%;
}

.wapu-cart-offcanvas .wapu-mini-cart__header {
	padding: 1rem 1.25rem;
	background: var(--wtds-surface);
	border-bottom: var(--wtds-border-thin, .5px) solid var(--wtds-outline-soft, var(--wtds-separator-soft));
}

.wapu-cart-offcanvas .wapu-mini-cart__items {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0 1.25rem;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* The drawer deliberately reuses the original cart line, not a mini row. */
.wapu-cart-offcanvas .wapu-cart-item-shell {
	width: 100%;
}

.wapu-cart-offcanvas .wapu-cart-item {
	width: 100%;
	min-height: 0;
	padding-block: 1rem;
}

.wapu-cart-offcanvas .wapu-cart-item__primary {
	grid-template-columns: 4.5rem minmax(0, 1fr);
	gap: .75rem;
}

.wapu-cart-offcanvas .wapu-cart-item__img-wrap {
	width: 4.5rem;
	height: 4.5rem;
	flex-basis: 4.5rem;
}

.wapu-cart-offcanvas .wapu-cart-item__commerce {
	min-width: 3.5rem;
}

.wapu-cart-offcanvas .wapu-cart-item__actions-col {
	min-width: 2.5rem;
}

.wapu-cart-offcanvas .wapu-cart-item__menu {
	right: 0;
	left: auto;
	z-index: 5;
}

.wapu-cart-offcanvas .wapu-mini-cart__footer {
	margin-top: auto;
	padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
	background: var(--wtds-surface);
	border-top: var(--wtds-border-thin, .5px) solid var(--wtds-outline-soft, var(--wtds-separator-soft));
}

.wapu-cart-offcanvas .wapu-mini-cart__empty {
	flex: 1 1 auto;
	min-height: 0;
}

body.wapu-cart-offcanvas-open {
	overflow: hidden;
}

@media (max-width: 61.9375rem) {
	.wapu-cart-offcanvas {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wapu-cart-offcanvas__backdrop,
	.wapu-cart-offcanvas__panel {
		transition: none;
	}
}


/* Compact Share Cart action belongs to the drawer footer, never to a line item. */
.wapu-cart-offcanvas .wapu-mini-cart__share {
	display: flex;
	justify-content: center;
	margin-top: .625rem;
}


/* The canonical cart editor opens above the cart drawer without closing it. */
#wapu-cart-edit-modal.wapu-dialog {
	z-index: calc(var(--wtds-z-modal, 1400) + 30);
}

/* 1.0.45 · The drawer owns one compact Share Cart action. Hide the legacy
   plugin mini-cart prompt when it is injected through Woo mini-cart hooks. */
.wapu-cart-offcanvas .wapu-share-btn-wrap--mini {
	display: none !important;
}
