/**
 * Saved & Abandoned Carts — storefront save / share UI.
 */
.aieo-cart-ops {
	margin: 1em 0;
}

/* After the Cart or Checkout block: at the block's end, under its totals; the share panel opens under the button. */
.aieo-cart-ops--block {
	margin-top: 1.25em;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.75em;
}
.aieo-cart-ops--block .aieo-cart-share {
	inline-size: min(100%, 26rem);
}
@media (max-width: 600px) {
	.aieo-cart-ops--block {
		align-items: stretch;
	}
}

/* The side cart's own Save button is drawn by the drawer's sheet (aieo-side-cart-contents.css): this sheet is the
   cart and checkout pages'. */
.aieo-save-cart {
	cursor: pointer;
}

.aieo-save-cart[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* The panel that opens in place, under its button (the blocks' end, the classic cart and checkout). Its look is not
   the window's (the cart head's, below): the exclusion sits in :where(), so these rules weigh what they did. */
.aieo-cart-share:where(:not(.aieo-cart-share--window)) {
	margin-top: 0.75em;
	padding: 0.85em 1em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.02);
	max-width: 520px;
}

.aieo-cart-share[hidden] {
	display: none;
}

.aieo-cart-share.is-error:where(:not(.aieo-cart-share--window)) {
	border-color: #c0392b;
	background: rgba(192, 57, 43, 0.06);
}

.aieo-cart-share-msg {
	margin: 0 0 0.5em;
	font-size: 0.95em;
}

.aieo-cart-share.is-error:where(:not(.aieo-cart-share--window)) .aieo-cart-share-msg {
	color: #c0392b;
}

.aieo-cart-share-row {
	display: flex;
	gap: 0.5em;
	align-items: stretch;
}

:where(.aieo-cart-share:not(.aieo-cart-share--window)) .aieo-cart-share-url {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.45em 0.6em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	font-size: 0.9em;
	background: #fff;
}

:where(.aieo-cart-share:not(.aieo-cart-share--window)) .aieo-cart-share-copy {
	cursor: pointer;
	white-space: nowrap;
	padding: 0.45em 0.9em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	background: #fff;
}

:where(.aieo-cart-share:not(.aieo-cart-share--window)) .aieo-cart-share-copy:hover {
	background: rgba(0, 0, 0, 0.04);
}

/* Under the theme's design authority Save / share is a secondary action: the outline recipe, so the cart page
   keeps one primary (Proceed to checkout) (UI review, 28 Oct 2026). */
html[data-rooster-design="theme"] .aieo-cart-ops .aieo-save-cart:not(.is-style-outline) {
	background: transparent;
	color: var(--wp--preset--color--fg);
	border: 1px solid var(--wp--preset--color--fg);
}
html[data-rooster-design="theme"] .aieo-cart-ops .aieo-save-cart:not(.is-style-outline):hover,
html[data-rooster-design="theme"] .aieo-cart-ops .aieo-save-cart:not(.is-style-outline):focus-visible {
	background: color-mix(in srgb, var(--wp--preset--color--fg) 8%, transparent);
	color: var(--wp--preset--color--fg);
}

/* The cart page's head (the theme's filter rooster/cart/head_actions; the designer's cart-b, 11 Nov 2026): the button
   at the end of the title's row, drawn by the theme's outline recipe (its classes ask for it), with its icon before
   its words. This sheet gives it only that row. */
.aieo-cart-ops--head {
	margin: 0;
}
.aieo-cart-ops--head .aieo-save-cart {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
}
.aieo-cart-ops--head .aieo-save-cart .aieo-icon {
	flex: none;
	stroke-width: 1.6;
}

/* The link's window, opened by that button: a native dialog, so nothing on the page moves, Escape and its close
   button shut it and the page behind it is inert; centred on a computer, a sheet from the bottom on a phone. The
   theme's tokens only, no colour of this sheet's own: the field is the theme's field and Copy its outline button. */
.aieo-cart-share--window {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	inline-size: min(100% - 32px, 520px);
	max-inline-size: none;
	block-size: fit-content;
	max-block-size: 86dvh;
	margin: auto;
	padding: 0;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--rooster--shape--panel);
	background: var(--wp--preset--color--bg);
	color: var(--wp--preset--color--fg);
	box-shadow: var(--wp--preset--shadow--lg);
	overflow: hidden;
}
.aieo-cart-share--window[open] {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
}
/* The side cart's scrim: the ground at 55 %. */
.aieo-cart-share--window::backdrop {
	background: color-mix(in srgb, var(--wp--preset--color--bg) 55%, transparent);
}
.aieo-cart-share__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--3);
	min-block-size: 68px;
	padding: 0 var(--wp--preset--spacing--3) 0 var(--wp--preset--spacing--5);
	border-block-end: 1px solid var(--wp--preset--color--line);
}
.aieo-cart-share__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xl);
	line-height: 1.25;
}
.aieo-cart-share-close {
	display: grid;
	place-items: center;
	flex: none;
	inline-size: 44px;
	block-size: 44px;
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--wp--custom--rooster--shape--button);
	background: none;
	color: inherit;
	cursor: pointer;
}
.aieo-cart-share__body {
	display: grid;
	gap: var(--wp--preset--spacing--4);
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--5) var(--wp--preset--spacing--5);
	overflow-y: auto;
	overscroll-behavior: contain;
}
.aieo-cart-share--window .aieo-cart-share-msg {
	margin: 0;
	font-size: var(--wp--preset--font-size--md);
	color: var(--wp--preset--color--muted);
}
.aieo-cart-share--window .aieo-cart-share-msg:empty {
	display: none;
}
.aieo-cart-share--window .aieo-cart-share-row {
	gap: var(--wp--preset--spacing--2);
}
.aieo-cart-share--window .aieo-cart-share-url {
	flex: 1 1 auto;
	min-inline-size: 0;
}
.aieo-cart-share--window .aieo-cart-share-copy {
	flex: none;
	min-inline-size: 96px;
	white-space: nowrap;
}
/* A request that failed: its message in the theme's danger ink, and no link to show. */
.aieo-cart-share--window.is-error .aieo-cart-share-msg {
	color: var(--wp--preset--color--danger);
}
.aieo-cart-share--window.is-error .aieo-cart-share-row {
	display: none;
}
@media (max-width: 599px) {
	.aieo-cart-share--window {
		inset: auto 0 0 0;
		inline-size: 100%;
		max-block-size: 92dvh;
		margin: 0;
		border-inline: 0;
		border-block-end: 0;
		border-radius: var(--wp--custom--rooster--shape--panel) var(--wp--custom--rooster--shape--panel) 0 0;
	}
	.aieo-cart-share--window[open] {
		grid-template-rows: auto auto minmax(0, 1fr);
	}
	/* The sheet's handle. */
	.aieo-cart-share--window::before {
		content: "";
		justify-self: center;
		inline-size: 36px;
		block-size: 3px;
		margin-block-start: 10px;
		border-radius: 3px;
		background: var(--wp--preset--color--line);
	}
	.aieo-cart-share__head {
		padding-inline-start: var(--wp--preset--spacing--4);
	}
	.aieo-cart-share__body {
		padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--4) calc(var(--wp--preset--spacing--5) + env(safe-area-inset-bottom, 0px));
	}
	.aieo-cart-share--window .aieo-cart-share-row {
		flex-wrap: wrap;
	}
	.aieo-cart-share--window .aieo-cart-share-copy {
		flex: 1 1 100%;
	}
}
@media (prefers-reduced-motion: no-preference) {
	.aieo-cart-share--window[open] {
		animation: aieo-cart-share-rise 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
	}
	.aieo-cart-share--window[open]::backdrop {
		animation: aieo-cart-share-fade 220ms;
	}
}
@keyframes aieo-cart-share-rise {
	from {
		opacity: 0;
		translate: 0 12px;
	}
}
@keyframes aieo-cart-share-fade {
	from {
		opacity: 0;
	}
}
