/*
 * GES Checkout UI - the header cart dropdown.
 * Desktop: a dropdown hanging from the header's cart icon, with a caret under the icon
 * (cart-drop.js sets --ges-drop-top / --ges-drop-end / --ges-caret-end from the icon's position).
 * Under 1024px: a bottom sheet over a backdrop.
 * Design language: globalesim-web CartLine / CartSummary (ink #0a2a52, brand #0072b8, pill #e8f5ff).
 */

/* The nav hides its cart icon under 1024px (the mobile menu lists "Cart" instead); with the
   dropdown the icon is the way in on every screen, so it shows beside the burger. */
.ges-nav .ges-nav__cart {
	display: inline-flex !important;
}
.ges-nav__cart[aria-expanded="true"] {
	color: var(--gnv-primary, #0087d8) !important;
}

.ges-cart-drop {
	--ges-ink: #0a2a52;
	--ges-text: #1f2937;
	--ges-muted: #54708a;
	--ges-border: #e8eff6;
	--ges-input: #e5e7eb;
	--ges-pill: #e8f5ff;
	--ges-brand: #0072b8;
	--ges-danger: #d92d20;
	--ges-hover: #f1f5f9;

	position: fixed;
	inset: 0;
	z-index: 9996; /* above the nav's mobile panel (9995) */
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ges-text);
}
.ges-cart-drop[hidden] {
	display: none;
}
/* The page behind the bottom sheet does not scroll (cart-drop.js sets the class under 1024px). */
html.ges-cart-drop-open {
	overflow: hidden;
}
.ges-cart-drop__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(10 42 82 / 0.35);
}
.ges-cart-drop__panel {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	max-height: min(85vh, 85dvh);
	background: #fff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -8px 40px rgb(10 42 82 / 0.18);
	outline: none;
	animation: ges-cart-drop-up 0.18s ease-out;
}
@media (min-width: 1024px) {
	.ges-cart-drop__backdrop {
		background: transparent;
	}
	.ges-cart-drop__panel {
		inset-inline: auto var(--ges-drop-end, 16px);
		top: var(--ges-drop-top, 64px);
		bottom: auto;
		width: 360px;
		max-height: calc(100vh - var(--ges-drop-top, 64px) - 16px);
		border: 1px solid var(--ges-border);
		border-radius: 12px;
		box-shadow: 0 10px 30px rgb(10 42 82 / 0.16);
		animation: ges-cart-drop-in 0.15s ease-out;
	}
	/* The caret, pointing at the icon. */
	.ges-cart-drop__panel::before {
		content: "";
		position: absolute;
		top: -7px;
		inset-inline-end: var(--ges-caret-end, 18px);
		width: 12px;
		height: 12px;
		background: #fff;
		border-top: 1px solid var(--ges-border);
		border-inline-start: 1px solid var(--ges-border);
		transform: rotate(45deg);
	}
	.ges-cart-drop .ges-cart-drop__close {
		display: none;
	}
}
@keyframes ges-cart-drop-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: none; opacity: 1; }
}
@keyframes ges-cart-drop-in {
	from { transform: translateY(-6px); opacity: 0; }
	to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.ges-cart-drop__panel {
		animation: none;
	}
}

.ges-cart-drop__body {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
}
.ges-cart-drop__body[aria-busy="true"] .ges-cart-drop__lines,
.ges-cart-drop__body[aria-busy="true"] .ges-cart-drop__foot {
	opacity: 0.6;
	pointer-events: none;
}

/* Buttons: Twenty Twenty-One paints every button with the primary colour through
   `button:not(:hover):not(:active):not(.has-background)`; these outrank it. */
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__head button.ges-cart-drop__close,
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__qty button.ges-cart-drop__step,
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__row button.ges-cart-drop__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	background-color: transparent;
	color: var(--ges-muted);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ges-cart-drop__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 10px;
	border-bottom: 1px solid var(--ges-border);
}
.ges-cart-drop .ges-cart-drop__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--ges-ink);
}
.ges-cart-drop__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--ges-pill);
	color: var(--ges-brand);
	font-size: 12px;
	font-weight: 700;
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__head button.ges-cart-drop__close {
	width: 34px;
	height: 34px;
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__head button.ges-cart-drop__close:hover {
	background-color: var(--ges-hover);
	color: var(--ges-ink);
}

/* The empty card, compact inside the dropdown. */
.ges-cart-drop .ges-cart-empty {
	padding: 22px 16px 20px;
}
.ges-cart-drop .ges-cart-empty__icon {
	width: 52px;
	height: 52px;
}
.ges-cart-drop .ges-cart-empty__title {
	margin-top: 12px;
	font-size: 15px;
}
.ges-cart-drop .ges-cart-empty__text {
	font-size: 13px;
}
.ges-cart-drop .ges-cart-empty .ges-cart-empty__btn {
	min-height: 40px;
	margin-top: 14px;
	font-size: 14px;
}

/* Lines */
.ges-cart-drop .ges-cart-drop__lines {
	list-style: none;
	margin: 0;
	padding: 2px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	flex: 1;
	min-height: 0;
}
.ges-cart-drop .ges-cart-drop__line {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 12px 0;
	border-bottom: 1px solid var(--ges-border);
}
.ges-cart-drop .ges-cart-drop__line:last-child {
	border-bottom: 0;
}
/* !important: an image plugin injects style="width:100%;height:…" on every attachment image. */
.ges-cart-drop .ges-cart-drop__thumb {
	flex: none;
	width: 48px !important;
	height: 48px !important;
	max-width: 48px !important;
	border-radius: 8px;
	object-fit: cover;
}
.ges-cart-drop__text {
	flex: 1;
	min-width: 0;
}
.ges-cart-drop .ges-cart-drop__name {
	display: block;
	font-size: 14px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--ges-ink) !important;
	text-decoration: none !important;
	overflow-wrap: anywhere;
}
.ges-cart-drop a.ges-cart-drop__name:hover {
	color: var(--ges-brand) !important;
}
.ges-cart-drop .ges-cart-drop__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 5px 0 0;
}
.ges-cart-drop__chip {
	display: inline-flex;
	align-items: center;
	padding: 1px 9px;
	border-radius: 999px;
	background: var(--ges-pill);
	color: var(--ges-ink);
	font-size: 12px;
	line-height: 1.5;
	font-weight: 600;
}
.ges-cart-drop__row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}
.ges-cart-drop__qty {
	display: inline-flex;
	align-items: stretch;
	overflow: hidden;
	border: 1px solid var(--ges-input);
	border-radius: 8px;
	background: #fff;
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__qty button.ges-cart-drop__step {
	width: 30px;
	height: 30px;
	border-radius: 0;
	color: var(--ges-ink);
	font-size: 16px;
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__qty button.ges-cart-drop__step:hover:not(:disabled) {
	background-color: var(--ges-hover);
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__qty button.ges-cart-drop__step:disabled {
	color: #b8c4d2;
	cursor: not-allowed;
}
.ges-cart-drop .ges-cart-drop__input {
	width: 38px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	border-inline: 1px solid var(--ges-input);
	border-radius: 0;
	background: #fff;
	color: var(--ges-ink);
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	appearance: textfield;
	-moz-appearance: textfield;
}
.ges-cart-drop .ges-cart-drop__input::-webkit-inner-spin-button,
.ges-cart-drop .ges-cart-drop__input::-webkit-outer-spin-button {
	appearance: none;
	margin: 0;
}
.ges-cart-drop .ges-cart-drop__input:focus {
	outline: 2px solid var(--ges-brand);
	outline-offset: -2px;
}
.ges-cart-drop__total {
	margin-inline-start: auto;
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--ges-ink);
	white-space: nowrap;
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__row button.ges-cart-drop__remove {
	width: 30px;
	height: 30px;
}
.ges-cart-drop .ges-cart-drop__body .ges-cart-drop__row button.ges-cart-drop__remove:hover {
	background-color: var(--ges-hover);
	color: var(--ges-danger);
}

/* Footer */
.ges-cart-drop__foot {
	padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--ges-border);
	background: #fff;
}
.ges-cart-drop__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	color: var(--ges-text);
}
.ges-cart-drop__amount {
	font-size: 20px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--ges-ink);
}
.ges-cart-drop .ges-cart-drop__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	margin-top: 10px;
	border-radius: 8px;
	background: var(--ges-brand);
	color: #fff !important;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none !important;
	transition: background-color 0.15s ease;
}
.ges-cart-drop .ges-cart-drop__checkout:hover,
.ges-cart-drop .ges-cart-drop__checkout:focus-visible {
	background: var(--ges-ink);
}
.ges-cart-drop .ges-cart-drop__perks {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ges-muted);
}
.ges-cart-drop .ges-cart-drop__perks li {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	margin: 0;
}
.ges-cart-drop__perks svg {
	flex: none;
	width: 14px;
	height: 14px;
	margin-top: 2px;
	color: var(--ges-brand);
}

/* Focus rings */
.ges-cart-drop button:focus-visible,
.ges-cart-drop a:focus-visible {
	outline: 2px solid var(--ges-brand);
	outline-offset: 2px;
}
