/**
 * Jaliz Mobile Nav — base layout.
 * All values are driven by CSS custom properties printed by PHP.
 */

.jmn-bar,
.jmn-bar *,
.jmn-sheet,
.jmn-sheet *,
.jmn-modal,
.jmn-modal * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- Bar */
.jmn-bar {
	--jmn-height: 64px;
	--jmn-radius: 22px;
	--jmn-blur: 18px;
	--jmn-margin: 12px;
	--jmn-gap: 10px;
	--jmn-max: 460px;
	--jmn-icon-size: 22px;
	--jmn-font-size: 10px;
	--jmn-pad: 6px;
	--jmn-border-w: 1px;
	--jmn-elevation: 24px;
	--jmn-duration: 320ms;
	--jmn-ease: cubic-bezier(.22, 1, .36, 1);
	--jmn-sheet-speed: 320ms;
	--jmn-z: 9990;
	--jmn-bg: rgba(255, 255, 255, .94);
	--jmn-bg-2: rgba(244, 246, 250, .94);
	--jmn-icon: #8b93a7;
	--jmn-icon-active: #111827;
	--jmn-active-bg: #eef2f7;
	--jmn-label: #8b93a7;
	--jmn-label-active: #111827;
	--jmn-indicator: #111827;
	--jmn-border: rgba(17, 24, 39, .08);
	--jmn-shadow: rgba(17, 24, 39, .18);
	--jmn-badge: #e11d48;
	--jmn-badge-text: #fff;

	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: var(--jmn-z);
	display: block;
	padding-inline: var(--jmn-margin);
	padding-bottom: calc(var(--jmn-gap) + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	direction: inherit;
	color: var(--jmn-icon);
	opacity: 0;
	transform: translate3d(0, calc(100% + 48px), 0);
	transition: transform var(--jmn-duration) var(--jmn-ease), opacity .22s ease;
	will-change: transform;
	-webkit-tap-highlight-color: transparent;
}

.jmn-bar.jmn-in {
	opacity: 1;
	transform: translate3d(0, 0, 0);
}

.jmn-bar.jmn-hide {
	opacity: 0;
	transform: translate3d(0, calc(100% + 48px), 0);
}

.jmn-inner {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: var(--jmn-max);
	height: var(--jmn-height);
	margin-inline: auto;
	background-color: var(--jmn-bg);
	background-image: linear-gradient(135deg, var(--jmn-bg) 0%, var(--jmn-bg-2) 100%);
	border: var(--jmn-border-w) solid var(--jmn-border);
	border-radius: var(--jmn-radius);
	box-shadow:
		0 calc(var(--jmn-elevation) * .5) calc(var(--jmn-elevation) * 1.25) calc(var(--jmn-elevation) * -.5) var(--jmn-shadow);
	-webkit-backdrop-filter: blur(var(--jmn-blur)) saturate(170%);
	backdrop-filter: blur(var(--jmn-blur)) saturate(170%);
	pointer-events: auto;
	transition: background-color var(--jmn-duration) var(--jmn-ease), border-radius var(--jmn-duration) var(--jmn-ease);
}

.jmn-items {
	position: relative;
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	gap: 2px;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: var(--jmn-pad);
	list-style: none;
}

.jmn-item {
	position: relative;
	display: flex;
	flex: 1 1 0;
	min-width: 0;
	z-index: 1;
}

.jmn-link {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	width: 100%;
	height: 100%;
	min-height: 40px;
	padding: 4px 3px;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--jmn-item-color, var(--jmn-icon));
	font-family: inherit;
	font-size: var(--jmn-font-size);
	font-weight: 500;
	text-decoration: none;
	border-radius: calc(var(--jmn-radius) - var(--jmn-pad));
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	transition:
		color var(--jmn-duration) var(--jmn-ease),
		background-color var(--jmn-duration) var(--jmn-ease),
		transform var(--jmn-duration) var(--jmn-ease),
		box-shadow var(--jmn-duration) var(--jmn-ease);
	-webkit-tap-highlight-color: transparent;
}

.jmn-link:hover,
.jmn-link:focus-visible {
	text-decoration: none;
}

.jmn-bar .jmn-link:focus-visible,
.jmn-sheet .jmn-sheet__link:focus-visible,
.jmn-sheet .jmn-sheet__close:focus-visible,
.jmn-modal button:focus-visible,
.jmn-modal input:focus-visible {
	outline: 2px solid var(--jmn-indicator, #111827);
	outline-offset: 2px;
}

.jmn-item.is-active .jmn-link {
	color: var(--jmn-item-active, var(--jmn-icon-active));
}

.jmn-icon-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--jmn-icon-size) + 10px);
	height: calc(var(--jmn-icon-size) + 10px);
	flex: none;
	z-index: 1;
}

.jmn-ic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--jmn-icon-size);
	height: var(--jmn-icon-size);
	flex: none;
}

.jmn-ic svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.jmn-ic--dash {
	font-size: var(--jmn-icon-size);
	width: var(--jmn-icon-size);
	height: var(--jmn-icon-size);
	line-height: 1;
}

.jmn-ic--emoji {
	font-size: calc(var(--jmn-icon-size) - 2px);
	line-height: 1;
}

.jmn-ic--custom svg {
	width: 100%;
	height: 100%;
}

.jmn-label {
	display: block;
	max-width: 100%;
	position: relative;
	z-index: 1;
	font-size: var(--jmn-font-size);
	font-weight: 600;
	line-height: 1.15;
	color: var(--jmn-label);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -.2px;
	transition: color var(--jmn-duration) var(--jmn-ease);
}

.jmn-item.is-active .jmn-label {
	color: var(--jmn-label-active);
}

.jmn-labels-off .jmn-label {
	display: none;
}

.jmn-labels-off .jmn-link {
	gap: 0;
}

/* Badges ---------------------------------------------------------- */
.jmn-badge {
	position: absolute;
	top: -2px;
	inset-inline-end: -5px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: var(--jmn-badge);
	color: var(--jmn-badge-text);
	font-family: inherit;
	font-size: 9px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	border-radius: 999px;
	border: 2px solid var(--jmn-bg);
	box-shadow: 0 2px 6px -2px rgba(15, 23, 42, .4);
	pointer-events: none;
}

.jmn-badge--dot {
	top: 1px;
	inset-inline-end: 0;
	width: 8px;
	height: 8px;
	min-width: 0;
	padding: 0;
	border-width: 1px;
}

.jmn-badge--text {
	top: -4px;
	inset-inline-end: -10px;
	height: 15px;
	padding: 0 5px;
	font-size: 8px;
	letter-spacing: .1px;
}

.jmn-badge.is-empty {
	display: none;
}

/* Moving indicator ------------------------------------------------ */
.jmn-indicator {
	position: absolute;
	top: var(--jmn-pad);
	bottom: var(--jmn-pad);
	left: 0;
	z-index: 0;
	width: 0;
	background: var(--jmn-indicator);
	border-radius: calc(var(--jmn-radius) - 2px);
	opacity: 0;
	pointer-events: none;
	transform: translate3d(0, 0, 0);
	transition:
		transform var(--jmn-duration) var(--jmn-ease),
		width var(--jmn-duration) var(--jmn-ease),
		opacity .2s ease,
		border-radius var(--jmn-duration) var(--jmn-ease);
	will-change: transform, width;
}

.jmn-bar.jmn-has-indicator .jmn-indicator {
	opacity: 1;
}

.jmn-ind-fade .jmn-indicator {
	transition: transform var(--jmn-duration) var(--jmn-ease), width var(--jmn-duration) var(--jmn-ease), opacity .18s ease;
}

.jmn-ind-none .jmn-indicator {
	transition: none;
}

/* Ripple ---------------------------------------------------------- */
.jmn-ripple {
	position: absolute;
	z-index: 0;
	border-radius: 50%;
	background: currentColor;
	opacity: .2;
	pointer-events: none;
	transform: scale(0);
	animation: jmn-ripple-anim 520ms ease-out forwards;
}

@keyframes jmn-ripple-anim {
	to {
		transform: scale(1);
		opacity: 0;
	}
}

/* Active bounce --------------------------------------------------- */
.jmn-active-bounce .jmn-item.is-active .jmn-icon-wrap {
	animation: jmn-pop var(--jmn-duration) var(--jmn-ease);
}

@keyframes jmn-pop {
	0% {
		transform: scale(.86);
	}
	55% {
		transform: scale(1.08);
	}
	100% {
		transform: scale(1);
	}
}

/* ------------------------------------------------------------- Sheet */
.jmn-sheet {
	--jmn-sheet-bg: #fff;
	--jmn-sheet-text: #111827;
	--jmn-sheet-muted: #6b7280;
	--jmn-sheet-surface: rgba(17, 24, 39, .05);
	--jmn-sheet-line: rgba(17, 24, 39, .08);
	--jmn-sheet-radius: 26px;
	--jmn-sheet-speed: 320ms;

	position: fixed;
	inset: 0;
	z-index: calc(var(--jmn-z, 9990) + 10);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	direction: inherit;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.jmn-sheet[hidden],
.jmn-modal[hidden] {
	display: none !important;
}

.jmn-sheet__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 12, 20, .52);
	opacity: 0;
	transition: opacity var(--jmn-sheet-speed) ease;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.jmn-sheet.is-open .jmn-sheet__backdrop {
	opacity: 1;
}

.jmn-sheet__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 86vh;
	padding: 8px 20px calc(22px + env(safe-area-inset-bottom, 0px));
	background: var(--jmn-sheet-bg);
	color: var(--jmn-sheet-text);
	border-radius: var(--jmn-sheet-radius) var(--jmn-sheet-radius) 0 0;
	box-shadow: 0 -20px 60px -20px rgba(8, 12, 20, .5);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translate3d(0, 100%, 0);
	transition: transform var(--jmn-sheet-speed) cubic-bezier(.22, 1, .36, 1);
}

.jmn-sheet.is-open .jmn-sheet__panel {
	transform: translate3d(0, 0, 0);
}

.jmn-sheet__handle {
	width: 44px;
	height: 5px;
	margin: 4px auto 14px;
	background: var(--jmn-sheet-line);
	border-radius: 999px;
}

.jmn-sheet__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.jmn-sheet__title {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.4;
	color: var(--jmn-sheet-text);
}

.jmn-sheet__subtitle {
	margin: 4px 0 0;
	font-size: 12px;
	line-height: 1.7;
	color: var(--jmn-sheet-muted);
}

.jmn-sheet__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: none;
	padding: 0;
	background: var(--jmn-sheet-surface);
	color: var(--jmn-sheet-muted);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease;
}

.jmn-sheet__close svg {
	width: 18px;
	height: 18px;
}

.jmn-sheet__close:hover {
	background: var(--jmn-sheet-line);
	color: var(--jmn-sheet-text);
}

.jmn-sheet__grid {
	display: grid;
	grid-template-columns: repeat(var(--jmn-cols, 3), minmax(0, 1fr));
	gap: 10px;
}

.jmn-sheet__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 8px;
	background: var(--jmn-sheet-surface);
	color: var(--jmn-sheet-text);
	text-decoration: none;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	transition: background-color .2s ease, transform .2s ease;
	-webkit-tap-highlight-color: transparent;
}

.jmn-sheet__link:hover,
.jmn-sheet__link:focus-visible {
	background: var(--jmn-sheet-line);
	text-decoration: none;
	transform: translateY(-1px);
}

.jmn-sheet__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: var(--jmn-sheet-text);
}

.jmn-sheet__icon .jmn-ic {
	width: 24px;
	height: 24px;
}

.jmn-sheet__label {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.jmn-no-scroll {
	overflow: hidden !important;
}

/* ------------------------------------------------------- Search modal */
.jmn-modal {
	--jmn-sheet-bg: #fff;
	--jmn-sheet-text: #111827;
	--jmn-sheet-muted: #6b7280;
	--jmn-sheet-surface: rgba(17, 24, 39, .05);
	--jmn-sheet-line: rgba(17, 24, 39, .1);

	position: fixed;
	inset: 0;
	z-index: calc(var(--jmn-z, 9990) + 20);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 16px 16px;
	direction: inherit;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.jmn-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 12, 20, .55);
	opacity: 0;
	transition: opacity .25s ease;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.jmn-modal.is-open .jmn-modal__backdrop {
	opacity: 1;
}

.jmn-modal__panel {
	position: relative;
	width: 100%;
	max-width: 520px;
	padding: 16px;
	background: var(--jmn-sheet-bg);
	color: var(--jmn-sheet-text);
	border-radius: 22px;
	box-shadow: 0 24px 60px -20px rgba(8, 12, 20, .55);
	transform: translate3d(0, -14px, 0) scale(.98);
	opacity: 0;
	transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
}

.jmn-modal.is-open .jmn-modal__panel {
	transform: none;
	opacity: 1;
}

.jmn-search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 14px;
	background: var(--jmn-sheet-surface);
	border: 1px solid var(--jmn-sheet-line);
	border-radius: 16px;
}

.jmn-search__icon {
	display: inline-flex;
	width: 20px;
	height: 20px;
	flex: none;
	color: var(--jmn-sheet-muted);
}

.jmn-search__icon svg {
	width: 100%;
	height: 100%;
}

.jmn-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	padding: 0;
	background: transparent;
	border: 0;
	outline: 0;
	color: var(--jmn-sheet-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 42px;
	box-shadow: none;
	-webkit-appearance: none;
}

.jmn-search__input::placeholder {
	color: var(--jmn-sheet-muted);
	opacity: .8;
}

.jmn-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.jmn-search__submit {
	flex: none;
	height: 38px;
	padding: 0 16px;
	background: var(--jmn-icon-active, #111827);
	color: #fff;
	border: 0;
	border-radius: 12px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: none;
	transition: opacity .18s ease, transform .18s ease;
}

.jmn-search__submit:hover {
	opacity: .9;
}

.jmn-search__submit:active {
	transform: scale(.97);
}

.jmn-modal__close {
	position: absolute;
	top: -12px;
	inset-inline-end: -6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	background: var(--jmn-sheet-bg);
	color: var(--jmn-sheet-text);
	border: 1px solid var(--jmn-sheet-line);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 8px 18px -8px rgba(8, 12, 20, .4);
}

.jmn-modal__close svg {
	width: 16px;
	height: 16px;
}

/* Utilities ------------------------------------------------------- */
.jmn-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.jmn-bar,
	.jmn-inner,
	.jmn-link,
	.jmn-indicator,
	.jmn-sheet__panel,
	.jmn-sheet__backdrop,
	.jmn-modal__panel,
	.jmn-modal__backdrop {
		transition-duration: .01ms !important;
	}

	.jmn-active-bounce .jmn-item.is-active .jmn-icon-wrap,
	.jmn-preset-aurora .jmn-inner,
	.jmn-preset-gradient-border .jmn-inner::before {
		animation: none !important;
	}

	.jmn-ripple {
		display: none !important;
	}
}

@media (max-width: 380px) {
	.jmn-label {
		font-size: calc(var(--jmn-font-size) - 1px);
	}
}
