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

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

#bottomnav-bar {
	--bottomnav-h: 62px;       /* overridden by inline style */
	--bottomnav-drawer-h: 75vh; /* overridden by inline style */
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9998;
	background-color: #1a1a1a;
	border-top: 3px solid #d22254;
	box-shadow: 0 -2px 14px rgba(0,0,0,0.28);
	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-drawer-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: 3px;
	font-family: inherit;
}

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

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

/* Labels */
.bottomnav-label {
	display: block;
	font-size: clamp(8px, calc(var(--bottomnav-h, 48px) * 0.19), 11px);
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 90px;
}

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

/* Active dot under home */
.bottomnav-item-home.is-active > a::after {
	content: '';
	display: block;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background-color: #d22254;
	margin: 2px auto 0;
}

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

/* =====================================================
   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; }
}

/* =====================================================
   SLIDE-OUT DRAWER
===================================================== */

.bottomnav-drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-end;
	justify-content: center; /* default; overridden by inline CSS from drawer_position setting */
	pointer-events: none;
}
.bottomnav-drawer:not([hidden]) {
	pointer-events: auto;
}

/* Semi-transparent overlay */
.bottomnav-drawer-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
	backdrop-filter: blur(2px);
}
.bottomnav-drawer.is-open .bottomnav-drawer-overlay {
	opacity: 1;
}

/* Sliding panel — IDENTICAL to .topnav-mob-panel-inner */
.bottomnav-drawer-panel {
	position: relative;
	background: #1e1e1e;
	/* width / min-width / max-width controlled entirely by inline CSS (drawer_width setting) */
	max-height: var(--bottomnav-drawer-h, 75vh);
	border-radius: 16px 16px 0 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
	box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.bottomnav-drawer.is-open .bottomnav-drawer-panel {
	transform: translateY(0);
}

/* Drag handle pill */
.bottomnav-drawer-panel::before {
	content: '';
	display: block;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: rgba(255,255,255,0.25);
	margin: 10px auto 0;
	flex-shrink: 0;
}

/* Header row */
.bottomnav-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px 10px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	flex-shrink: 0;
}
.bottomnav-drawer-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.5);
}
.bottomnav-drawer-close {
	background: none;
	border: none;
	color: rgba(255,255,255,0.5);
	font-size: 18px;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
	transition: color 0.2s, background 0.2s;
	line-height: 1;
}
.bottomnav-drawer-close:hover {
	color: #ffffff;
	background: rgba(255,255,255,0.1);
}

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

/* Menu inside drawer — thin list style */
.bottomnav-drawer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.bottomnav-drawer-menu > li {
	margin: 0;
}
.bottomnav-drawer-menu > li > a {
	display: flex;
	align-items: center;
	gap: 14px;
	color: #ffffff;
	text-decoration: none;
	padding: 13px 22px;
	font-size: 15px;
	font-weight: 500;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	transition: background 0.15s, color 0.15s;
}
.bottomnav-drawer-menu > li:last-child > a {
	border-bottom: none;
}
.bottomnav-drawer-menu > li > a:hover,
.bottomnav-drawer-menu > li.current-menu-item > a,
.bottomnav-drawer-menu > li.current_page_item > a {
	background: rgba(255,255,255,0.06);
	color: #d22254;
}

/* Sub-menu items — indented */
.bottomnav-drawer-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.bottomnav-drawer-menu ul li a {
	display: block;
	color: rgba(255,255,255,0.65);
	text-decoration: none;
	padding: 10px 22px 10px 40px;
	font-size: 13px;
	border-bottom: 1px solid rgba(255,255,255,0.04);
	transition: background 0.15s, color 0.15s;
}
.bottomnav-drawer-menu ul li a:hover {
	color: #ffffff;
	background: rgba(255,255,255,0.04);
}

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

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

/* =====================================================
   UNIFIED DRAWER STYLES
   Targets BOTH the top-nav panel and bottom-nav drawer
   so they look pixel-identical. Menu items are still
   separate (different nav menus assigned in WP admin).
===================================================== */

/* ---- Container: bottomnav drawer keeps max-height; topnav panel is full height ---- */
.bottomnav-drawer-panel {
	max-height: 75vh;
}

/* ---- Header row ---- */
.topnav-mob-panel-header,
.bottomnav-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px 10px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	flex-shrink: 0;
}

/* ---- Title ---- */
.topnav-mob-panel-title,
.bottomnav-drawer-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.5);
	line-height: 1;
}

/* ---- Close button ---- */
.topnav-mob-panel-close,
.bottomnav-drawer-close {
	background: none;
	border: none;
	color: rgba(255,255,255,0.5);
	font-size: 18px;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
	transition: color 0.2s, background 0.2s;
	line-height: 1;
}
.topnav-mob-panel-close:hover,
.bottomnav-drawer-close:hover {
	color: #ffffff;
	background: rgba(255,255,255,0.1);
}

/* ---- Drag handle pill (bottomnav drawer only) ---- */
.bottomnav-drawer-panel::before {
	content: '';
	display: block;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: rgba(255,255,255,0.25);
	margin: 10px auto 0;
	flex-shrink: 0;
}

/* ---- Scrollable body ---- */
.topnav-mob-panel-body,
.bottomnav-drawer-body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1;
	padding: 0;
}

/* ---- Menu list reset ---- */
.topnav-mob-panel-menu,
.bottomnav-drawer-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 16px;  /* 16px bottom gives breathing room without making first/last items appear unequal */
}
.topnav-mob-panel-menu > li,
.bottomnav-drawer-menu > li {
	margin: 0;
	list-style: none;
}

/* ---- Top-level items ---- */
.topnav-mob-panel-menu > li > a,
.bottomnav-drawer-menu > li > a {
	display: flex;
	align-items: center;
	gap: 14px;
	color: #ffffff;
	text-decoration: none;
	padding: 13px 22px !important;
	font-size: 15px !important;
	font-weight: 500;
	line-height: 1.3 !important;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	transition: background 0.15s, color 0.15s;
}
.topnav-mob-panel-menu > li:last-child > a,
.bottomnav-drawer-menu > li:last-child > a {
	border-bottom: none;
}

/* ---- Hover & active state ---- */
.topnav-mob-panel-menu > li > a:hover,
.topnav-mob-panel-menu > li.current-menu-item > a {
	background: rgba(255,255,255,0.08);
	color: #ffdd00;
}
.bottomnav-drawer-menu > li > a:hover,
.bottomnav-drawer-menu > li.current-menu-item > a,
.bottomnav-drawer-menu > li.current_page_item > a {
	background: rgba(255,255,255,0.06);
	color: #d22254;
}

/* ---- Sub-menu items ---- */
.topnav-mob-panel-menu ul,
.bottomnav-drawer-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.topnav-mob-panel-menu ul li,
.bottomnav-drawer-menu ul li {
	list-style: none;
	margin: 0;
}
.topnav-mob-panel-menu ul li a,
.bottomnav-drawer-menu ul li a {
	display: block;
	color: rgba(255,255,255,0.65);
	text-decoration: none;
	padding: 10px 22px 10px 40px !important;
	font-size: 13px !important;
	line-height: 1.3 !important;
	border-bottom: 1px solid rgba(255,255,255,0.04);
	transition: background 0.15s, color 0.15s;
}
.topnav-mob-panel-menu ul li a:hover,
.bottomnav-drawer-menu ul li a:hover {
	color: #ffffff;
	background: rgba(255,255,255,0.04);
}
