/* checkout/assets/site_cart.css  (TE-137, checkout UI v1)
 *
 * Site-wide, loaded by includes/page_elements/page_body.inc.php: the header cart badge
 * and the "Added to cart" dialog.  Scoped to .co-cart-badge and .co-atc*.
 * Colour follows the site: --brand-text where a site sets one, else --primary.
 * ASCII only.
 */

/* ---------------------------------------------------------------- header badge */
.site-header-cart { position: relative; }
.co-cart-badge {
	position: absolute;
	top: -8px;
	right: -8px;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--brand-text, var(--primary));
	color: #fff;
	border: 2px solid #fff;
	font-family: var(--font-display);
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
	display: inline-block;
}
.co-cart-badge[hidden] { display: none !important; }
/* The phone header hides every label span inside the pills; the badge must survive. */
.site-header-actions .site-header-pill > span.co-cart-badge:not([hidden]) { display: inline-block; }
.co-cart-badge.is-bumped { animation: co-badge-bump .35s ease-out; }
@keyframes co-badge-bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.co-cart-badge-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- dialog */
html.co-atc-open { overflow: hidden; }

.co-atc {
	--co-atc-accent: var(--brand-text, var(--primary));
	position: fixed;
	inset: 0;
	border: 0;
	padding: 0;
	margin: auto;
	width: min(420px, calc(100vw - 32px));
	height: fit-content;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	border-radius: 20px;
	background: #fff;
	color: #444a52;
	font-family: var(--font-display);
	box-shadow: 0 2px 4px rgba(20, 22, 28, .06), 0 20px 48px rgba(20, 22, 28, .18);
}
.co-atc[open] { animation: co-atc-in .22s ease-out; }
.co-atc::backdrop { background: rgba(15, 18, 24, .5); }
@keyframes co-atc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.co-atc-panel { padding: 28px; }
.co-atc-head { display: flex; align-items: center; gap: 14px; }
.co-atc-badge {
	width: 44px; height: 44px;
	flex-shrink: 0;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--co-atc-accent);
	color: #fff;
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--co-atc-accent) 18%, #fff);
}
.co-atc.is-error .co-atc-badge { background: #b42318; box-shadow: 0 0 0 5px #fee4e2; }
.co-atc-icon { width: 24px; height: 24px; }
.co-atc .co-atc-title {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 600;
	color: #1b1f24;
	text-align: left;
	line-height: 1.2;
}
.co-atc .co-atc-note { margin: 14px 0 0; font-size: 15px; color: #444a52; }
.co-atc .co-atc-note[hidden] { display: none; }

.co-atc-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}
.co-atc .co-atc-btn,
.co-atc .co-atc-btn:hover {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 20px;
	border-radius: 12px;
	border: 2px solid transparent;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	opacity: 1;
	transform: none;
	box-shadow: none;
}
.co-atc .co-atc-btn--secondary,
.co-atc .co-atc-btn--secondary:hover { background: #fff; color: #1b1f24; border-color: #c9ced6; }
.co-atc .co-atc-btn--primary,
.co-atc .co-atc-btn--primary:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.co-atc .co-atc-btn--primary:hover { background: color-mix(in srgb, var(--primary) 82%, #000); border-color: color-mix(in srgb, var(--primary) 82%, #000); }
.co-atc .co-atc-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--co-atc-accent); }
.co-atc .co-atc-btn[hidden] { display: none; }
.co-atc-btn-icon { width: 20px; height: 20px; }

/* Phones: a bottom sheet pinned to the visible bottom edge, clear of the home
   indicator; the primary OK on top, thumb-reachable. */
@media (max-width: 559px) {
	.co-atc {
		inset: auto 0 0 0;
		width: 100%;
		max-width: 100%;
		margin: 0;
		max-height: 100dvh;
		border-radius: 22px 22px 0 0;
	}
	.co-atc[open] { animation: co-atc-sheet .25s ease-out; }
	.co-atc-panel { padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
	.co-atc-actions { flex-direction: column-reverse; gap: 10px; margin-top: 20px; }
	.co-atc .co-atc-btn,
	.co-atc .co-atc-btn:hover { flex: 0 0 auto; width: 100%; }
}
@keyframes co-atc-sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.co-atc[open], .co-cart-badge.is-bumped { animation: none; }
}
