.sp-mega-menu {
	position: relative;
}

.sp-mega-menu__desktop {
	display: block;
}

.sp-mega-menu__top-level {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 1rem;
	margin: 0;
	padding: 0;
}

.sp-mega-menu__item {
	position: relative;
}

.sp-mega-menu__trigger,
.sp-mega-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--sp-color-text-strong);
	font: inherit;
	font-size: 1rem;
	font-weight: var(--sp-type-weight-medium);
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity var(--sp-motion-duration-standard) ease;
}

.sp-mega-menu__trigger:hover,
.sp-mega-menu__trigger:focus-visible,
.sp-mega-menu__link:hover,
.sp-mega-menu__link:focus-visible,
.sp-mega-menu__item.is-open > .sp-mega-menu__trigger {
	color: var(--sp-color-text-strong);
	opacity: 0.8;
	outline: none;
}

.sp-mega-menu__trigger svg,
.sp-mega-menu__group-link svg,
.sp-mega-menu__card-title svg {
	width: 1rem;
	height: 1rem;
	flex: 0 0 auto;
}

.sp-mega-menu__item.is-open > .sp-mega-menu__trigger svg {
	transform: rotate(180deg);
}

.sp-mega-menu__panel {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	width: min(48rem, calc(100vw - 2rem));
	z-index: var(--sp-z-menu);
}

.sp-mega-menu__panel::before {
	content: "";
	position: absolute;
	top: -0.375rem;
	left: var(--sp-panel-arrow-offset, 50%);
	width: 0.75rem;
	height: 0.75rem;
	background: var(--sp-component-mega-menu-panel-bg);
	border-radius: 2px 0 0 0;
	box-shadow: var(--sp-component-mega-menu-panel-arrow-shadow);
	transform: translateX(-50%) rotate(45deg);
}

.sp-mega-menu__panel-inner {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	padding: 2.5rem;
	border: 0;
	border-radius: 0.75rem;
	background: var(--sp-component-mega-menu-panel-bg);
	color: var(--sp-component-mega-menu-panel-text);
	box-shadow: var(--sp-component-mega-menu-panel-shadow);
}

.sp-mega-menu__panel-groups {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.sp-mega-menu__panel-parent {
	font-family: var(--sp-type-family-sans);
	font-size: 0.875rem;
	font-weight: var(--sp-type-weight-semibold);
	text-transform: uppercase;
	color: var(--sp-component-mega-menu-panel-text);
}

.sp-mega-menu__group {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	align-content: stretch;
}

.sp-mega-menu__group-heading {
	margin: 0;
	font-family: var(--sp-type-family-sans);
	font-size: 0.875rem;
	font-weight: var(--sp-type-weight-semibold);
	line-height: var(--sp-type-line-height-heading);
	text-transform: uppercase;
	color: var(--sp-component-mega-menu-panel-text);
}

.sp-mega-menu__group-link,
.sp-mega-menu__group-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--sp-component-mega-menu-panel-text);
	text-decoration: none;
}

.sp-mega-menu__group-link::after,
.sp-mega-menu__group-title::after {
	content: "";
	flex: 1;
	order: 3;
	border-bottom: 1px dashed var(--sp-component-mega-menu-panel-divider);
}

.sp-mega-menu__group-link svg {
	order: 2;
	opacity: 0;
	transform: translateX(-10px);
	transition: opacity var(--sp-motion-duration-standard) ease, transform var(--sp-motion-duration-standard) ease;
}

.sp-mega-menu__group-link:hover svg,
.sp-mega-menu__group-link:focus-visible svg {
	opacity: 1;
	transform: translateX(0);
}

.sp-mega-menu__group-link:focus-visible {
	outline: none;
}

.sp-mega-menu__cards {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
}

.sp-mega-menu__card {
	display: flex;
	flex: 0 0 17.5rem;
	gap: 0.625rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--sp-component-mega-menu-panel-text);
	text-decoration: none;
	transition: none;
}

.sp-mega-menu__card:hover,
.sp-mega-menu__card:focus-visible {
	background: transparent;
	transform: none;
	outline: none;
}

.sp-mega-menu__card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0.5rem;
	border-radius: var(--uplift-radius-sm);
	background: var(--sp-component-mega-menu-icon-bg);
	overflow: hidden;
}

.sp-mega-menu__card-icon-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sp-mega-menu__card-content {
	display: grid;
	gap: 0.25rem;
}

.sp-mega-menu__card-title {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	font-weight: var(--sp-type-weight-semibold);
	line-height: 1.2;
	color: var(--sp-component-mega-menu-panel-text);
}

.sp-mega-menu__card-title svg {
	opacity: 0;
	transform: translateX(-10px);
	transition: opacity var(--sp-motion-duration-standard) ease, transform var(--sp-motion-duration-standard) ease;
}

.sp-mega-menu__card:hover .sp-mega-menu__card-title svg,
.sp-mega-menu__card:focus-visible .sp-mega-menu__card-title svg {
	opacity: 1;
	transform: translateX(0);
}

.sp-mega-menu__card-description {
	color: var(--sp-component-mega-menu-panel-muted);
	font-size: 0.875rem;
	line-height: 1.35;
}

.sp-mega-menu__card:hover .sp-mega-menu__card-description,
.sp-mega-menu__card:focus-visible .sp-mega-menu__card-description {
	color: var(--sp-component-mega-menu-panel-text);
}

/* Phone menu (sp_render_mobile_menu()): the header itself grows downward to
   show it, in either the flush or the floating state, as on Uplift Bank. The
   panel opens from zero height (grid rows 0fr to 1fr) and stops 12px short of
   the screen's end; --sp-header-bottom is the header bar's bottom edge,
   measured as it opens (header-menu.js). The header's own motion values
   (--sp-header-expand and friends) are set in header.css. */
.sp-mobile-menu {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--sp-header-expand) var(--sp-header-ease-drawer);
}

.sp-mobile-menu[hidden] {
	display: none;
}

.sp-mobile-menu.is-open {
	grid-template-rows: 1fr;
}

.sp-mobile-menu__inner {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: calc(100vh - var(--sp-header-bottom, 101px) - 12px);
	max-height: calc(100dvh - var(--sp-header-bottom, 101px) - 12px);
	overflow: hidden;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity var(--sp-motion-duration-fast) ease,
		transform var(--sp-header-expand) var(--sp-header-ease-drawer);
}

.sp-mobile-menu.is-open .sp-mobile-menu__inner {
	opacity: 1;
	transform: none;
	transition: opacity var(--sp-motion-duration-standard) var(--sp-header-ease-out) 40ms,
		transform var(--sp-header-expand) var(--sp-header-ease-drawer);
}

/* The header's menu button closes the panel, so the panel's own top row only
   appears inside a section, to hold Back. */
.sp-mobile-menu__header {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	height: 52px;
	padding: 0 var(--uplift-space-4) 0 var(--uplift-space-3);
	border-bottom: 1px solid var(--sp-header-rule);
}

.sp-mobile-menu.has-back .sp-mobile-menu__header {
	display: flex;
}

.sp-mobile-menu__back {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--uplift-space-2);
	padding: 0;
	border: 0;
	background: none;
	color: var(--sp-header-ink);
	font: inherit;
	font-size: var(--sp-type-size-body);
	font-weight: var(--sp-type-weight-medium);
	cursor: pointer;
	transition: opacity var(--sp-motion-duration-fast) ease,
		transform var(--sp-header-press) var(--sp-header-ease-out);
}

.sp-mobile-menu__back[hidden] {
	display: none;
}

/* The panel sizes to the open level and scrolls once it reaches the bottom
   of the screen. */
.sp-mobile-menu__content {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* Levels slide over each other. Only the open level is in flow and sets the
   panel's height; the others are clipped to it so they add no scrolling. */
.sp-mobile-menu__level {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 100%;
	overflow: hidden;
	padding: 0 var(--uplift-space-4) var(--uplift-space-6);
	opacity: 0;
	visibility: hidden;
	transform: translateX(100%);
	transition: transform var(--sp-header-slide) var(--sp-header-ease-drawer),
		opacity var(--sp-motion-duration-standard) var(--sp-header-ease-out),
		visibility 0s linear var(--sp-header-slide);
}

.sp-mobile-menu__level.is-active {
	position: relative;
	max-height: none;
	overflow: visible;
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
	transition-delay: 0s;
}

.sp-mobile-menu__level.is-prev {
	transform: translateX(-12%);
}

.sp-mobile-menu__level--branch {
	padding-top: var(--uplift-space-5);
}

.sp-mobile-menu__list,
.sp-mobile-menu__sections,
.sp-mobile-menu__sublist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sp-mobile-menu__list {
	flex: 1;
}

.sp-mobile-menu__item {
	border-bottom: 1px dashed var(--sp-header-rule);
}

.sp-mobile-menu__item:last-child {
	border-bottom: 0;
}

.sp-mobile-menu__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: var(--uplift-space-4) 0;
	border: 0;
	background: none;
	color: var(--sp-header-ink);
	font: inherit;
	font-size: var(--sp-type-size-body);
	font-weight: var(--sp-type-weight-medium);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: opacity var(--sp-motion-duration-fast) ease,
		transform var(--sp-header-press) var(--sp-header-ease-out);
}

/* The new-tab arrow follows the title. */
.sp-mobile-menu__link > span,
.sp-mobile-menu__card-copy strong {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

.sp-mobile-menu__link svg,
.sp-mobile-menu__back svg,
.sp-mobile-menu__cta svg {
	flex-shrink: 0;
}

.sp-mobile-menu__link > span svg,
.sp-mobile-menu__card-copy strong svg {
	width: 1rem;
	height: 1rem;
}

.sp-mobile-menu__section {
	padding: var(--uplift-space-5) 0;
	border-bottom: 1px solid var(--sp-header-rule);
}

.sp-mobile-menu__section:first-child {
	padding-top: 0;
}

.sp-mobile-menu__section:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.sp-mobile-menu__section-header {
	margin-bottom: var(--uplift-space-4);
}

.sp-mobile-menu__section-title {
	display: block;
	color: var(--sp-color-text-primary);
	font-size: var(--sp-type-size-sm);
	font-weight: var(--sp-type-weight-semibold);
	letter-spacing: 0.5px;
	text-decoration: none;
	text-transform: uppercase;
}

.sp-mobile-menu__sublist {
	display: flex;
	flex-direction: column;
	gap: var(--uplift-space-1);
}

.sp-mobile-menu__card {
	display: flex;
	align-items: flex-start;
	gap: var(--uplift-space-3);
	padding: var(--uplift-space-3);
	border-radius: var(--uplift-radius-md);
	color: var(--sp-header-ink);
	text-decoration: none;
	transition: background-color var(--sp-motion-duration-fast) ease,
		transform var(--sp-header-press) var(--sp-header-ease-out);
}

.sp-mobile-menu__icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	overflow: hidden;
	border-radius: var(--uplift-radius-sm);
	background: var(--sp-component-mega-menu-icon-bg);
}

.sp-mobile-menu__icon-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sp-mobile-menu__card-copy {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--uplift-space-1);
	min-width: 0;
}

.sp-mobile-menu__card-copy strong {
	color: var(--sp-header-ink);
	font-size: var(--sp-type-size-sm);
	font-weight: var(--sp-type-weight-semibold);
	line-height: 1.3;
}

.sp-mobile-menu__card-copy > span {
	color: var(--sp-color-text-primary);
	font-family: var(--sp-type-family-sans);
	font-size: 0.8125rem;
	font-weight: var(--sp-type-weight-regular);
	line-height: 1.3;
}

.sp-mobile-menu__footer {
	margin-top: auto;
	padding-top: var(--uplift-space-6);
}

/* The Customizer's Login action, as Uplift Bank's Online Banking button. */
.sp-mobile-menu__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--uplift-space-2);
	padding: var(--uplift-space-3) var(--uplift-space-6);
	border-radius: var(--uplift-radius-sm);
	background: var(--sp-color-action-highlight-bg);
	color: var(--sp-color-action-highlight-text);
	font-size: var(--sp-type-size-body);
	font-weight: var(--sp-type-weight-semibold);
	text-decoration: none;
	transition: opacity var(--sp-motion-duration-fast) ease,
		transform var(--sp-header-press) var(--sp-header-ease-out);
}

.sp-mobile-menu__cta svg {
	width: 1.25rem;
	height: 1.25rem;
}

/* Hover polish only for a true hover pointer. */
@media (hover: hover) and (pointer: fine) {
	.sp-mobile-menu__link:hover {
		opacity: 0.8;
	}

	.sp-mobile-menu__card:hover {
		background-color: var(--sp-header-pill);
	}

	.sp-mobile-menu__cta:hover {
		opacity: 0.9;
	}
}

.sp-breadcrumbs {
	color: var(--sp-color-text-muted);
	font-size: var(--sp-type-size-meta);
	line-height: 1.4;
}

.sp-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sp-breadcrumbs__item {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.sp-breadcrumbs__separator {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	margin: 0 0.45rem;
	color: var(--sp-color-text-subtle);
}

.sp-breadcrumbs__separator .sp-icon,
.sp-breadcrumbs__separator svg {
	width: 0.85rem;
	height: 0.85rem;
	stroke-width: 2;
}

.sp-breadcrumbs__link {
	color: var(--sp-color-text-muted);
	font-weight: var(--sp-type-weight-regular);
	text-decoration: none;
}

.sp-breadcrumbs__link:hover,
.sp-breadcrumbs__link:focus-visible {
	color: var(--sp-color-link-hover);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	outline: none;
}

.sp-breadcrumbs__current {
	color: var(--sp-color-text-muted);
}

@media (max-width: 580px) {
	.sp-breadcrumbs {
		font-size: 0.95rem;
		overflow: hidden;
	}

	.sp-breadcrumbs__list {
		flex-wrap: nowrap;
		overflow: hidden;
	}

	.sp-breadcrumbs__item {
		flex: 0 0 auto;
		white-space: nowrap;
	}

	.sp-breadcrumbs__item:last-child {
		flex: 1 1 auto;
		min-width: 0;
	}

	.sp-breadcrumbs__link {
		display: block;
		white-space: nowrap;
	}

	.sp-breadcrumbs__current {
		display: block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

@media (max-width: 980px) {
	.sp-mega-menu__desktop {
		display: none;
	}
}
