/**
 * Bottom Navigation Bar + Slide-out Drawer
 * WL Custom Theme
 */

/* =====================================================
   BAR BASE
===================================================== */

#bottomnav-bar {
	--bottomnav-h: 62px;       /* overridden by inline style */
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9998;
	background-color: #1a1a1a;
	border-top: 3px solid #fff551;
	box-shadow: none;
	border-bottom: 1px solid rgba(255,255,255,0.08);
	width: 100%;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Scroll-threshold: bar hidden until JS reveals it */
#bottomnav-bar.bottomnav-scroll-hidden {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}
#bottomnav-bar.bottomnav-scroll-visible {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* Body padding so content isn't behind bar */
body.has-bottomnav {
	padding-bottom: var(--bottomnav-h, 62px);
}
body.has-bottomnav-hide-desktop { padding-bottom: 0; }
body.has-bottomnav-hide-mobile  { padding-bottom: 0; }

/* =====================================================
   THREE-BUTTON MENU ROW
===================================================== */

.bottomnav-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
}

.bottomnav-item {
	flex: 1;
	margin: 0;
	display: flex;
}

/* Shared styles for <a> and <button> inside items */
.bottomnav-item > a,
.bottomnav-menu-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	color: #ffffff;
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 4px;           /* no vertical padding — height controls size */
	min-height: var(--bottomnav-h, 48px);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.3px;
	text-transform: var(--bottomnav-text-transform, none);
	transition: color 0.2s ease, background-color 0.2s ease;
	gap: 6px;
	font-family: inherit;
}

/* Hover / active states */
.bottomnav-item > a:hover,
.bottomnav-menu-toggle:hover,
.bottomnav-item.is-active > a {
	color: #fff551;
	background-color: rgba(255,255,255,0.06);
}

/* Icons */
.bottomnav-item > a i,
.bottomnav-menu-toggle i {
	font-size: clamp(14px, calc(var(--bottomnav-h, 48px) * 0.38), 22px);
	line-height: 1;
}

/* Home and PDF SVG icons — sized explicitly; does not affect hamburger or search */
.bottomnav-item-home > a svg,
.bottomnav-item-pdfs > a svg {
	width: 15px;
	height: 15px;
	display: block;
	flex-shrink: 0;
}

/* Labels */
.bottomnav-label {
	display: block;
	font-size: clamp(10px, calc(var(--bottomnav-h, 48px) * 0.26), 15px);
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* No-labels mode */
#bottomnav-bar.bottomnav-no-labels .bottomnav-item > a,
#bottomnav-bar.bottomnav-no-labels .bottomnav-menu-toggle {
	padding: 0 4px;
}
#bottomnav-bar.bottomnav-no-labels .bottomnav-label {
	display: none;
}

/* Separator lines between all four parts */
.bottomnav-item:not(:last-child) {
	border-right: 1px solid rgba(255,255,255,0.08);
}

/* =====================================================
   MENU ITEM — Part 3
===================================================== */
.bottomnav-item-menu {
	flex: 1;
}
.bottomnav-menu-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #ffffff;
	background: none;
	border: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	padding: 0 4px;
	min-height: var(--bottomnav-h, 48px);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.3px;
	text-transform: var(--bottomnav-text-transform, none);
	transition: color 0.2s ease, background-color 0.2s ease;
	gap: 6px;
	font-family: inherit;
}
.bottomnav-menu-toggle:hover,
.bottomnav-item-menu [aria-expanded="true"] {
	color: #fff551;
	background-color: rgba(255,255,255,0.06);
}

/* =====================================================
   SEARCH ITEM — Part 4 (never has a label)
===================================================== */
.bottomnav-item-search {
	flex: 1;
}
.bottomnav-search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #ffffff;
	background: none;
	border: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	padding: 0 4px;
	min-height: var(--bottomnav-h, 48px);
	transition: color 0.2s ease, background-color 0.2s ease;
}
.bottomnav-search-toggle:hover,
.bottomnav-item-search [aria-expanded="true"] {
	color: #fff551;
	background-color: rgba(255,255,255,0.06);
}


/* Hamburger icon — animates to X when menu is open */
.bottomnav-ham-svg {
	display: block;
	overflow: visible;
	width: 21px;
	height: 14px;
	flex-shrink: 0;
}
.bottomnav-ham-line {
	transition: transform 0.25s ease, opacity 0.25s ease;
	transform-origin: center;
	transform-box: fill-box;
}
/* Open state: line 1 and 3 cross to form X, line 2 fades out */
.bottomnav-menu-toggle[aria-expanded="true"] .bottomnav-ham-line-1 {
	transform: translateY(5.5px) rotate(45deg);
}
.bottomnav-menu-toggle[aria-expanded="true"] .bottomnav-ham-line-2 {
	opacity: 0;
	transform: scaleX(0);
}
.bottomnav-menu-toggle[aria-expanded="true"] .bottomnav-ham-line-3 {
	transform: translateY(-5.5px) rotate(-45deg);
}

/* The search button itself — same visual style as other items */
.bottomnav-search-toggle svg {
	display: block;
	flex-shrink: 0;
}


/* =====================================================
   VISIBILITY CONTROLS (#8)
   hide-desktop = hidden on ≥768px (tablet + desktop)
   hide-mobile  = hidden on ≤767px
   hide-both    = display:none everywhere (use both checkboxes)
===================================================== */

@media (min-width: 768px) {
	#bottomnav-bar.bottomnav-hide-desktop { display: none !important; }
	body.has-bottomnav-hide-desktop       { padding-bottom: 0 !important; }
}
@media (max-width: 767px) {
	#bottomnav-bar.bottomnav-hide-mobile  { display: none !important; }
	body.has-bottomnav-hide-mobile        { padding-bottom: 0 !important; }
}

/* =====================================================
   FULL-SCREEN MENU OVERLAY
   Uses opacity/visibility toggle — no translateY,
   no transitionend reliance. Android Chrome safe.
===================================================== */

.bottomnav-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: var(--bottomnav-h, 0px);
	z-index: 99998; /* one below topnav panel so they don't clash */
	/* Hidden state */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}
/* When bottom nav is hidden on desktop, overlays go full height */
@media (min-width: 768px) {
	body.has-bottomnav-hide-desktop .bottomnav-menu-overlay,
	body.has-bottomnav-hide-desktop .topnav-mob-panel { bottom: 0; }
}
.bottomnav-menu-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.22s ease, visibility 0s linear 0s;
}

/* Dimmed backdrop */
.bottomnav-menu-overlay-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.72);
}

/* Scrollable panel — centred card */
.bottomnav-menu-overlay-panel {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	background: #1e1e1e;
	overflow: hidden;
}

/* Header */
.bottomnav-menu-overlay-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 14px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	flex-shrink: 0;
}
.bottomnav-menu-overlay-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.5);
	line-height: 1;
}
.bottomnav-menu-overlay-close {
	background: none;
	border: none;
	color: rgba(255,255,255,0.6);
	cursor: pointer;
	width: 44px; height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: color 0.2s, background 0.2s;
	flex-shrink: 0;
}
.bottomnav-menu-overlay-close:hover {
	color: #ffffff;
	background: rgba(255,255,255,0.1);
}
.bottomnav-menu-overlay-close svg {
	width: 18px;
	height: 18px;
	display: block;
}

/* Scrollable body */
.bottomnav-menu-overlay-body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1;
	padding: 0 0 20px;
}

/* Menu items */
.bottomnav-menu-overlay-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.bottomnav-menu-overlay-menu > li {
	margin: 0;
	list-style: none;
}
.bottomnav-menu-overlay-menu > li > a {
	display: flex;
	align-items: center;
	color: #ffffff;
	text-decoration: none;
	padding: 15px 24px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	transition: background 0.15s, color 0.15s;
}
.bottomnav-menu-overlay-menu > li:last-child > a {
	border-bottom: none;
}
.bottomnav-menu-overlay-menu > li > a:hover,
.bottomnav-menu-overlay-menu > li.current-menu-item > a,
.bottomnav-menu-overlay-menu > li.current_page_item > a {
	background: rgba(255,255,255,0.06);
	color: #fff551;
}

/* Sub-menu items */
.bottomnav-menu-overlay-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.bottomnav-menu-overlay-menu ul li {
	list-style: none;
	margin: 0;
}
.bottomnav-menu-overlay-menu ul li a {
	display: block;
	color: rgba(255,255,255,0.65);
	text-decoration: none;
	padding: 11px 24px 11px 44px;
	font-size: 14px;
	line-height: 1.3;
	border-bottom: 1px solid rgba(255,255,255,0.04);
	transition: background 0.15s, color 0.15s;
}
.bottomnav-menu-overlay-menu ul li a:hover {
	color: #ffffff;
	background: rgba(255,255,255,0.04);
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 479px) {
	.bottomnav-item > a,
	.bottomnav-menu-toggle {
		padding: 0 2px;
		font-size: 10px;
	}
}


