/**
 * The «Додано в кошик» sheet.
 *
 * On a phone it is a sheet off the bottom edge, where a thumb already is; on a
 * wider screen a card in the middle. Either way it covers the page only partly
 * and never dims it to black: the shopper is meant to see the row she tapped
 * still sitting behind the confirmation, which is half of what makes the
 * confirmation believable.
 */

.gsl-sheet {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.gsl-sheet[hidden] {
	display: none;
}

.gsl-sheet__veil {
	position: absolute;
	inset: 0;
	background: var(--wp--preset--color--ink);
	opacity: 0.32;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.gsl-sheet__panel {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: 88vh;
	overflow-y: auto;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--large) var(--wp--custom--radius--large) 0 0;
	box-shadow: 0 -8px 32px color-mix(in srgb, var(--wp--preset--color--ink) 18%, transparent);
	transform: translateY(12px);
	opacity: 0;
	outline: none;
	transition: transform 0.18s ease, opacity 0.18s ease;
}

.gsl-sheet--open .gsl-sheet__panel {
	transform: translateY(0);
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.gsl-sheet__panel {
		transition: none;
	}
}

.gsl-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
}

.gsl-sheet__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

/* The check earns its place: it is the first thing seen and it says «done»
   before a word is read. */
.gsl-sheet__title::before {
	content: "✓";
	margin-right: 0.4em;
	color: var(--wp--preset--color--in-stock);
}

.gsl-sheet__close {
	width: 40px;
	height: 40px;
	flex: none;
	border: 0;
	background: none;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

.gsl-sheet__line {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 112px;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--30) 0;
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.gsl-sheet__img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--small);
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--base);
}

.gsl-sheet__img[hidden] {
	display: none;
}

.gsl-sheet__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

/* Two lines of the name, and the name is a link: the shopper who suspects she
   added the wrong thing can go and look at the right one. */
.gsl-sheet__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.gsl-sheet__price {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.gsl-sheet__qty {
	display: inline-flex;
	width: 100%;
	justify-content: space-between;
	align-items: center;
	border: 1.5px solid var(--wp--preset--color--brand-action);
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--color--brand-wash);
}

.gsl-sheet__step {
	width: 36px;
	min-height: 38px;
	border: 0;
	background: none;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--brand-text);
	cursor: pointer;
}

.gsl-sheet__value {
	width: 34px;
	border: 0;
	background: none;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--brand-text);
}

.gsl-sheet__sum {
	margin: var(--wp--preset--spacing--30) 0 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.gsl-sheet__goal {
	margin: 2px 0 0;
	font-size: var(--wp--preset--font-size--label);
	color: var(--wp--preset--color--muted);
}

.gsl-sheet__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--40);
}

/* «Продовжити» is the wider habit and stands first: the tray under the buy
   button lives on people adding a second and a third row, and a confirmation
   that pushes everyone to the cart would cost exactly that. */
.gsl-sheet__more {
	min-height: 48px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--brand-text);
	background: var(--wp--preset--color--base);
	border: 1.5px solid var(--wp--preset--color--brand-action);
	border-radius: var(--wp--custom--radius--small);
	cursor: pointer;
}

.gsl-sheet__go {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--gold);
	border-radius: var(--wp--custom--radius--small);
	text-decoration: none;
}

@media (min-width: 782px) {
	.gsl-sheet {
		align-items: center;
	}

	.gsl-sheet__panel {
		border-radius: var(--wp--custom--radius--large);
	}
}
