/* ======================================================================
   Posao.eu — mobile bottom navigation (inc/mobile-nav.php)
   Shown below 48em, the breakpoint where HivePress switches to phones.
   ====================================================================== */

:root {
	--posao-bnav-bg: rgba(29, 27, 32, 0.96);   /* site ink #1d1b20 */
	--posao-bnav-border: rgba(255, 255, 255, 0.08);
	--posao-bnav-text: rgba(255, 255, 255, 0.62);
	--posao-bnav-active: #F28C0F;              /* site orange */
	--posao-bnav-bubble: #F28C0F;
	--posao-bnav-bubble-icon: #fff;
	--posao-bnav-panel-bg: #2a2730;
	--posao-bnav-overlay: rgba(15, 12, 24, 0.55);
	--posao-bnav-height: 64px;
}

/* ListingHive's own mobile bar is replaced by this one */
.hp-mobile-nav {
	display: none !important;
}

/* Hidden on tablets and desktop */
.posao-bnav,
.posao-bnav-overlay,
.posao-bnav-panel {
	display: none;
}

@media (max-width: 47.99em) {

	/* ---------- Bar ---------- */
	.posao-bnav {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9999; /* the PWA install message (9990) sits above the bar, below this layer */
		padding-bottom: env(safe-area-inset-bottom, 0);
		background: var(--posao-bnav-bg);
		-webkit-backdrop-filter: blur(12px);
		backdrop-filter: blur(12px);
		border-top: 1px solid var(--posao-bnav-border);
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.28);
	}

	/* Keep page content and the footer clear of the bar */
	body.has-posao-bnav {
		padding-bottom: calc(var(--posao-bnav-height) + env(safe-area-inset-bottom, 0px));
	}

	/* The theme's "back to top" button would sit under the bar */
	#scroll-top {
		display: none !important;
	}

	.posao-bnav__items {
		display: flex;
		align-items: stretch;
		max-width: 560px;
		margin: 0 auto;
		padding: 0;
		list-style: none;
	}

	/* Two classes: the theme gives list items (except the last) an 8px bottom margin */
	.posao-bnav .posao-bnav__item {
		position: relative;
		flex: 1 1 0;
		min-width: 0;
		margin: 0;
		padding: 0;
	}

	/* Links and the "Više" button share one look */
	.posao-bnav .posao-bnav__item > a,
	.posao-bnav .posao-bnav__more {
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
		width: 100%;
		min-height: var(--posao-bnav-height);
		padding: 10px 2px 9px;
		margin: 0;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		color: var(--posao-bnav-text);
		font-family: 'Nunito', system-ui, sans-serif;
		font-size: 11px;
		font-weight: 700;
		line-height: 1.1;
		letter-spacing: 0.2px;
		text-transform: none;
		text-decoration: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: color 0.2s ease;
	}

	.posao-bnav .posao-bnav__icon {
		width: 22px;
		height: 22px;
		flex: none;
	}

	.posao-bnav__label {
		max-width: 100%;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.posao-bnav .posao-bnav__item > a:hover,
	.posao-bnav .posao-bnav__more:hover,
	.posao-bnav .posao-bnav__more:focus,
	.posao-bnav .posao-bnav__item.is-active > a,
	.posao-bnav .posao-bnav__more[aria-expanded="true"] {
		background: none;
		color: var(--posao-bnav-active);
	}

	.posao-bnav .posao-bnav__item > a:focus-visible,
	.posao-bnav .posao-bnav__more:focus-visible {
		outline: 2px solid var(--posao-bnav-active);
		outline-offset: -4px;
		border-radius: 12px;
	}

	/* Active indicator line */
	.posao-bnav__item.is-active::before {
		content: "";
		position: absolute;
		top: 0;
		left: 50%;
		width: 22px;
		height: 3px;
		border-radius: 0 0 3px 3px;
		background: var(--posao-bnav-active);
		transform: translateX(-50%);
	}

	/* ---------- Centre "Profil" / "Prijava" bubble ---------- */
	.posao-bnav .posao-bnav__item--center > a,
	.posao-bnav .posao-bnav__item--center.is-active > a {
		color: rgba(255, 255, 255, 0.85);
	}

	.posao-bnav__item--center.is-active::before {
		display: none;
	}

	.posao-bnav__bubble {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 50px;
		height: 50px;
		margin-top: -26px;
		border-radius: 50%;
		background: var(--posao-bnav-bubble);
		color: var(--posao-bnav-bubble-icon);
		box-shadow: 0 0 0 4px var(--posao-bnav-bg), 0 6px 18px rgba(242, 140, 15, 0.38);
		transition: transform 0.2s ease;
	}

	.posao-bnav__item--center > a:hover .posao-bnav__bubble,
	.posao-bnav__item--center.is-active .posao-bnav__bubble {
		transform: scale(1.06);
	}

	/* ---------- Overlay + slide-up "Više" panel ---------- */
	.posao-bnav-overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 10000;
		background: var(--posao-bnav-overlay);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0s linear 0.3s;
	}

	.posao-bnav-panel {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 10001;
		max-height: 75vh;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-bottom: max(16px, env(safe-area-inset-bottom));
		border-radius: 22px 22px 0 0;
		background: var(--posao-bnav-panel-bg);
		box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
		transform: translateY(100%);
		visibility: hidden;
		transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
	}

	.posao-bnav-open .posao-bnav-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.3s ease;
	}

	.posao-bnav-open .posao-bnav-panel {
		transform: translateY(0);
		visibility: visible;
		transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
	}

	html.posao-bnav-open,
	html.posao-bnav-open body {
		overflow: hidden;
	}

	.posao-bnav-panel__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 18px 20px 14px;
		border-bottom: 1px solid var(--posao-bnav-border);
	}

	.posao-bnav-panel__title {
		color: #fff;
		font-family: 'Quicksand', system-ui, sans-serif;
		font-size: 20px;
		font-weight: 800;
	}

	.posao-bnav-panel .posao-bnav-panel__close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		min-height: 0;
		padding: 0;
		margin: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.1);
		box-shadow: none;
		color: var(--posao-bnav-active);
		cursor: pointer;
		transition: background 0.2s ease;
	}

	.posao-bnav-panel .posao-bnav-panel__close:hover,
	.posao-bnav-panel .posao-bnav-panel__close:focus {
		background: rgba(255, 255, 255, 0.2);
		color: var(--posao-bnav-active);
	}

	.posao-bnav-panel__close .posao-bnav__icon {
		width: 20px;
		height: 20px;
	}

	.posao-bnav-panel__links {
		margin: 0;
		padding: 8px 0;
		list-style: none;
	}

	.posao-bnav-panel .posao-bnav-panel__links li {
		margin: 0;
		padding: 0;
	}

	.posao-bnav-panel .posao-bnav-panel__links a {
		display: flex;
		align-items: center;
		gap: 16px;
		padding: 15px 22px;
		color: rgba(255, 255, 255, 0.88);
		font-family: 'Nunito', system-ui, sans-serif;
		font-size: 16px;
		font-weight: 700;
		text-decoration: none;
		transition: background 0.2s ease, color 0.2s ease;
	}

	/* The PWA script hides the install link inside the installed app */
	.posao-bnav-panel .posao-bnav-panel__links a[hidden] {
		display: none;
	}

	.posao-bnav-panel .posao-bnav-panel__links a:hover,
	.posao-bnav-panel .posao-bnav-panel__links a:focus-visible {
		background: rgba(255, 255, 255, 0.06);
		color: var(--posao-bnav-active);
		outline: none;
	}

	.posao-bnav-panel__links .posao-bnav__icon {
		width: 22px;
		height: 22px;
		flex: none;
		color: var(--posao-bnav-active);
	}
}

/* Very narrow phones */
@media (max-width: 360px) {
	.posao-bnav .posao-bnav__item > a,
	.posao-bnav .posao-bnav__more {
		font-size: 10px;
	}

	.posao-bnav__bubble {
		width: 44px;
		height: 44px;
		margin-top: -22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.posao-bnav-panel,
	.posao-bnav-overlay,
	.posao-bnav__bubble {
		transition: none !important;
	}
}
