/* GN2 — add-to-cart drawer. Content-height bottom sheet, safe-area aware.
   Uses the existing Graination tokens; no new palette. */

.gn2-ad {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-end;
	background: rgba(19, 19, 19, .28);
	opacity: 0;
	transition: opacity .18s ease;
}
.gn2-ad.is-up { opacity: 1; }

.gn2-ad__sheet {
	width: 100%;
	/* Content height, not a fixed panel — but never taller than the viewport. */
	max-height: min(78vh, 640px);
	overflow-y: auto;
	background: var(--paper, #fff);
	border-radius: 14px 14px 0 0;
	box-shadow: 0 -8px 40px rgba(19, 19, 19, .18);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	transform: translateY(12px);
	transition: transform .2s ease;
	-webkit-overflow-scrolling: touch;
}
.gn2-ad.is-up .gn2-ad__sheet { transform: translateY(0); }

.gn2-ad__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 6px;
}
.gn2-ad__ok {
	font-family: var(--mono, ui-monospace, monospace);
	font-size: 11.5px;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--ok, #1c7c4a);
}
.gn2-ad__x {
	flex: none;
	width: 40px; height: 40px;
	margin: -8px -8px -8px 0;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: var(--ink, #131313);
	cursor: pointer;
}

.gn2-ad__body { padding: 0 16px 4px; }
.gn2-ad__name {
	margin: 0 0 10px;
	font-family: var(--sans, system-ui, sans-serif);
	font-size: 16px;
	font-weight: 650;
	line-height: 1.3;
	color: var(--ink, #131313);
}

/* Two columns so a long spec value wraps under its own label, not across it. */
.gn2-ad__specs {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 3px 12px;
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.4;
}
.gn2-ad__specs dt { color: var(--mut, #6a6a6a); }
.gn2-ad__specs dd { margin: 0; color: var(--ink, #131313); }

.gn2-ad__line {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding-top: 10px;
	border-top: 1px solid var(--line, #DAD7CC);
	font-size: 14px;
}
.gn2-ad__qty { color: var(--mut, #6a6a6a); }
.gn2-ad__amt { font-family: var(--mono, ui-monospace, monospace); font-weight: 650; }

.gn2-ad__acts {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
}
.gn2-ad__go, .gn2-ad__more {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 18px;
	border-radius: 8px;
	font-family: var(--sans, system-ui, sans-serif);
	font-size: 15px;
	font-weight: 650;
	text-decoration: none;
	cursor: pointer;
}
.gn2-ad__go {
	background: var(--ink, #131313);
	color: var(--white, #fff);
	border: 1px solid var(--ink, #131313);
}
.gn2-ad__more {
	background: none;
	color: var(--ink, #131313);
	border: 1px solid var(--line, #DAD7CC);
}
.gn2-ad__go:focus-visible, .gn2-ad__more:focus-visible, .gn2-ad__x:focus-visible {
	outline: 2px solid var(--cobalt, #005BFF);
	outline-offset: 2px;
}

@media (min-width: 640px) {
	/* On a wide screen a full-width sheet reads as a banner, so keep it a card. */
	.gn2-ad { align-items: flex-end; justify-content: flex-end; padding: 0 20px 20px; }
	.gn2-ad__sheet { max-width: 420px; border-radius: 14px; }
	.gn2-ad__acts { flex-direction: row-reverse; }
	.gn2-ad__go, .gn2-ad__more { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.gn2-ad, .gn2-ad__sheet { transition: none; }
}
