/**
 * 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;
}

/* Compact drawer: product identity left; amount and menu share the top row. */
body .wapu-cart-offcanvas .wapu-cart-item{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;gap:12px;padding:12px 0!important}
body .wapu-cart-offcanvas .wapu-cart-item__primary{display:grid;grid-template-columns:52px minmax(0,1fr)!important;gap:10px;min-width:0}
body .wapu-cart-offcanvas .wapu-cart-item__img-wrap{width:52px;height:52px;flex-basis:52px}
body .wapu-cart-offcanvas .wapu-cart-item__info{min-width:0;gap:4px}
body .wapu-cart-offcanvas .wapu-cart-item__name,
body .wapu-cart-offcanvas .wapu-cart-item__name a{font-size:13px!important;line-height:1.35!important;font-weight:500!important}
body .wapu-cart-offcanvas .wapu-cart-item__name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0}
body .wapu-cart-offcanvas .wapu-mini-cart__context{font-size:11px;line-height:1.4;color:var(--wtds-ink-3);overflow-wrap:anywhere}
body .wapu-cart-offcanvas .wapu-cart-item__purchase{position:relative;display:flex!important;align-items:flex-start;gap:6px;min-width:0;padding:0}
body .wapu-cart-offcanvas .wapu-cart-item__purchase>.wapu-cart-item__price{margin:0!important;text-align:right!important;align-self:flex-start}
body .wapu-cart-offcanvas .wapu-cart-item__price-stack{display:flex;flex-direction:column;align-items:flex-end;gap:3px;margin:0}
body .wapu-cart-offcanvas .wapu-cart-item__price-current{display:flex;align-items:center;min-height:28px;margin:0}
body .wapu-cart-offcanvas .wapu-cart-item__price :is(.amount,.wos-money){font-size:12px!important;line-height:1.3!important;font-weight:500!important}
body .wapu-cart-offcanvas .wapu-cart-item__price .wapu-currency-code{font-size:9px!important}
body .wapu-cart-offcanvas .wapu-cart-item__price-helper{font-size:11px!important;margin:0;line-height:1.3}
body .wapu-cart-offcanvas :is(.wapu-cart-item__price-before,.wapu-cart-item__price-savings,.wapu-cart-item__price-reason,.wapu-cart-item__quantity-last){display:none!important}
body .wapu-cart-offcanvas .wapu-cart-item__actions-col{position:static;min-width:0;align-self:flex-start;padding:0;margin:0}
body .wapu-cart-offcanvas .wapu-cart-item__menu-toggle{width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;padding:4px!important;margin:0!important;background:var(--wtds-surface-2);border-radius:8px}
body .wapu-cart-offcanvas .wapu-cart-item__actions-col:not(:has(.wapu-cart-item__menu-toggle)){display:none}
body .wapu-cart-offcanvas .wapu-cart-item__purchase{justify-content:flex-end}
body .wapu-cart-offcanvas .wapu-cart-item__purchase>.wapu-cart-item__price{flex:1 1 auto;min-width:0}
body .wapu-cart-offcanvas .wapu-cart-item__actions-col{flex:0 0 28px;width:28px}
body .wapu-cart-offcanvas .wapu-cart-item__price :is(.wos-money,.amount){white-space:nowrap}
