/**
 * WLRE Theme - Mobile Menu Styles
 */

.wlre-mobile-menu {
	position: fixed;
	top: 0;
	right: 0;
	width: 100%;
	height: 100%;
	z-index: 200;
	background: var(--wlre-color-white);
	/* transform-based slide instead of right/left positioning — physical
	 * `right/left: ±100%` on a fixed element expands the html element's
	 * scroll width in RTL mode, causing Chrome to initialize scrollX at
	 * −1170 px and blank the page. transform does not affect layout/overflow. */
	transform: translateX(100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
	display: none;
}

.wlre-mobile-menu--open {
	transform: translateX(0);
}

/* === Backdrop === */
.wlre-mobile-menu__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 199;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.wlre-mobile-menu__backdrop--visible {
	display: block;
	opacity: 1;
}

/* === Header bar === */
.wlre-mobile-menu__header {
	background: var(--wlre-color-white);
	border-bottom: 1px solid var(--wlre-color-neutral-200, #E5E5E5);
	padding: 10px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 1;
}

/* Logo link — forces currentColor in the SVG to navy (not the global
 * link aqua) so the wordmark reads correctly on the white header. */
.wlre-mobile-menu__logo-link {
	color: var(--wlre-color-brand-900);
	text-decoration: none;
	display: inline-flex;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

.wlre-mobile-menu__logo-mark {
	display: inline-flex;
	width: 130px;
	height: 34px;
}

.wlre-mobile-menu__logo-mark svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* === Close button (inside header bar) === */
.wlre-mobile-menu__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	border-radius: 50%;
	color: var(--wlre-color-text-900);
	cursor: pointer;
	transition: background-color 0.15s ease;
	flex-shrink: 0;
}

.wlre-mobile-menu__close:hover {
	background: var(--wlre-color-surface-50);
}

/* === Content area === */
.wlre-mobile-menu__content {
	position: relative;
	padding: 24px 20px;
}

/* === Dashboard CTA card === */
.wlre-mobile-menu__cta {
	background: var(--wlre-color-surface-50);
	border-radius: var(--wlre-radius-md);
	padding: 16px 20px;
	text-align: center;
	margin-bottom: 32px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.wlre-mobile-menu__cta-title {
	font-family: var(--wlre-font-body);
	font-weight: 700;
	font-size: var(--wlre-font-size-l);
	line-height: 1.48;
	color: var(--wlre-color-text-900);
	margin: 0 0 4px;
}

.wlre-mobile-menu__cta-text {
	font-size: var(--wlre-font-size-s);
	line-height: 1.48;
	color: var(--wlre-color-text-900);
	margin: 0;
}

.wlre-mobile-menu__cta .wlre-btn {
	width: auto;
	height: var(--wlre-tap-target);
	padding: 0 var(--wlre-space-24);
}

/* === Section titles === */
.wlre-mobile-menu__section-title {
	font-family: var(--wlre-font-heading);
	font-weight: 600;
	font-size: 22px;
	line-height: 1.2;
	color: var(--wlre-color-text-900);
	margin: 0 0 16px;
}

/* === List items === */
.wlre-mobile-menu__list {
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
}

.wlre-mobile-menu__list-item a,
.wlre-mobile-menu__item-button {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	height: 48px;
	padding: 12px;
	border: 0.5px solid var(--wlre-color-neutral-400);
	border-radius: var(--wlre-radius-md);
	margin-bottom: 8px;
	text-decoration: none;
	color: var(--wlre-color-text-900);
	font-family: var(--wlre-font-body);
	font-size: 14px;
	line-height: 1.48;
	transition: background-color 0.2s ease;
}

.wlre-mobile-menu__item-button {
	background: var(--wlre-color-white);
	cursor: pointer;
	text-align: left;
}

.wlre-mobile-menu__list-item a:hover,
.wlre-mobile-menu__item-button:hover {
	background: var(--wlre-color-surface-50);
}

.wlre-mobile-menu__list-item svg,
.wlre-mobile-menu__item-button svg {
	flex-shrink: 0;
	color: var(--wlre-color-neutral-400);
}

.wlre-mobile-menu__item-button[aria-expanded="true"] .wlre-mobile-menu__lang-value svg {
	transform: rotate(90deg);
}

/* === Language value === */
.wlre-mobile-menu__lang-value {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--wlre-color-text-900);
	font-size: var(--wlre-font-size-s);
	font-weight: 700;
}

.wlre-mobile-menu__language-list {
	list-style: none;
	margin: -2px 0 12px;
	padding: 0 0 0 12px;
	display: grid;
	gap: 8px;
}

.wlre-mobile-menu__language-list[hidden] {
	display: none;
}

.wlre-mobile-menu__language-link {
	gap: 12px;
	margin-bottom: 0;
}

.wlre-mobile-menu__language-link--active {
	border-color: var(--wlre-color-brand-900);
	background: var(--wlre-color-surface-50);
}

/* === Logged-in greeting === */
.wlre-mobile-menu__greeting {
	padding: 32px 0 12px;
	margin-bottom: 4px;
}

.wlre-mobile-menu__greeting-title {
	font-family: var(--wlre-font-heading);
	font-weight: 600;
	font-size: 32px;
	line-height: 1.2;
	color: var(--wlre-color-text-900);
	margin: 0 0 4px;
}

.wlre-mobile-menu__greeting-sub {
	font-family: var(--wlre-font-body);
	font-weight: 400;
	font-size: 14px;
	line-height: 1.48;
	color: var(--wlre-color-text-900);
	margin: 0;
}

/* === Account dashboard cards === */
.wlre-mobile-menu__account-cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 12px 0 20px;
	margin-bottom: 8px;
}

.wlre-mobile-menu__account-card {
	display: block;
	background: var(--wlre-color-white);
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
	text-decoration: none;
	color: var(--wlre-color-text-900);
	transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.wlre-mobile-menu__account-card:hover {
	box-shadow: 0 12px 28px rgba(149, 157, 165, 0.3);
	transform: translateY(-1px);
}

.wlre-mobile-menu__account-card-title {
	font-family: var(--wlre-font-heading);
	font-weight: 600;
	font-size: 18px;
	line-height: 1.2;
	margin: 0 0 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wlre-mobile-menu__account-card-body {
	font-family: var(--wlre-font-body);
	font-weight: 400;
	font-size: 13px;
	line-height: 1.48;
	margin: 0;
}

/* === Bottom logout row === */
.wlre-mobile-menu__logout-row {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 0 32px;
}

.wlre-mobile-menu__logout-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	color: var(--wlre-color-error);
	font-family: var(--wlre-font-body);
	font-weight: 700;
	font-size: 14px;
	line-height: 1.48;
	cursor: pointer;
	padding: 10px 0;
	min-height: var(--wlre-tap-target);
	transition: opacity 0.2s ease;
}

.wlre-mobile-menu__logout-link:hover {
	opacity: 0.75;
}

/* === Show on mobile only === */
@media (max-width: 767px) {
	.wlre-mobile-menu {
		display: block;
		/* Leave room so last menu item scrolls above the bottom nav bar. */
		padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
	}
}

/* ==========================================================================
   Language bottom-sheet (mobile menu)
   ========================================================================== */

.wlre-lang-sheet {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-end;
	visibility: hidden;
}

.wlre-lang-sheet[aria-hidden="false"] {
	visibility: visible;
}

.wlre-lang-sheet__scrim {
	position: absolute;
	inset: 0;
	background: rgba(10, 36, 56, 0.6);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.wlre-lang-sheet[aria-hidden="false"] .wlre-lang-sheet__scrim {
	opacity: 1;
}

.wlre-lang-sheet__panel {
	position: relative;
	width: 100%;
	background: var(--wlre-color-white);
	border-radius: 20px 20px 0 0;
	display: flex;
	flex-direction: column;
	max-height: 85vh;
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.wlre-lang-sheet[aria-hidden="false"] .wlre-lang-sheet__panel {
	transform: translateY(0);
}

.wlre-lang-sheet__grabber-row {
	display: flex;
	justify-content: center;
	padding: 12px 10px;
	flex-shrink: 0;
}

.wlre-lang-sheet__grabber {
	width: 60px;
	height: 6px;
	background: var(--wlre-color-neutral-400);
	border-radius: 20px;
}

.wlre-lang-sheet__body {
	overflow-y: auto;
	padding: 16px 16px 32px;
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-24);
}

.wlre-lang-sheet__title {
	font-family: var(--wlre-font-heading);
	font-weight: 600;
	font-size: 22px;
	line-height: 1.2;
	color: var(--wlre-color-text-900);
	text-align: center;
	margin: 0;
}

.wlre-lang-sheet__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-8);
}

.wlre-lang-sheet__item {
	display: flex;
	align-items: center;
	gap: var(--wlre-space-8);
	padding: var(--wlre-space-12) 0;
	cursor: pointer;
	border: 0;
	background: none;
	width: 100%;
}

.wlre-lang-sheet__code {
	flex-shrink: 0;
	font-family: var(--wlre-font-body);
	font-weight: 700;
	font-size: 14px;
	line-height: 1.48;
	color: var(--wlre-color-text-900);
	min-width: 28px;
}

.wlre-lang-sheet__flag {
	flex-shrink: 0;
	font-size: 18px;
	line-height: 1;
}

.wlre-lang-sheet__name {
	flex: 1 1 0;
	min-width: 0;
	font-family: var(--wlre-font-body);
	font-weight: 400;
	font-size: 14px;
	line-height: 1.48;
	color: var(--wlre-color-text-900);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wlre-lang-sheet__item.is-active .wlre-lang-sheet__code,
.wlre-lang-sheet__item.is-active .wlre-lang-sheet__name {
	font-weight: 700;
}

.wlre-lang-sheet__check {
	display: none;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	align-items: center;
	justify-content: center;
}

.wlre-lang-sheet__item.is-active .wlre-lang-sheet__check {
	display: flex;
}

.wlre-lang-sheet__footer {
	flex-shrink: 0;
	padding: var(--wlre-space-8) var(--wlre-space-16) calc(var(--wlre-space-32) + env(safe-area-inset-bottom, 0px));
	background: var(--wlre-color-white);
	box-shadow: 0 -4px 7px -1px rgba(99, 99, 99, 0.04);
}

.wlre-lang-sheet__confirm {
	width: 100%;
	height: 56px;
	background: #0f0f0f;
	color: var(--wlre-color-white);
	border: 0;
	border-radius: var(--wlre-radius-sm);
	font-family: var(--wlre-font-body);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.48;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.wlre-lang-sheet__confirm:hover {
	background: var(--wlre-color-text-900);
}

html.wlre-lang-sheet-open {
	overflow: hidden;
}
