/* Floating Bottom Menu — frontend styles
   All visual values are driven by CSS custom properties generated in PHP
   (see includes/class-fbm-css.php) so the plugin ships almost no CSS itself. */

/*
 * Structure note: the bar's background/border/shadow live on the ::before
 * pseudo-element, painted BEHIND the content, so it can never clip or hide
 * the center button that pokes up through it (see the hump below).
 */
.fbm-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: var(--fbm-bottom, 0);
	margin-inline: auto;
	width: calc(100% - (var(--fbm-side, 0) * 2));
	max-width: var(--fbm-max-width, none);
	height: var(--fbm-height, 64px);
	z-index: var(--fbm-zindex, 9999);
	box-sizing: border-box;
	direction: rtl;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.fbm-bar::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--fbm-bg, #fff);
	border: 1px solid var(--fbm-border, #eee);
	border-radius: var(--fbm-radius, 24px);
	box-shadow: var(--fbm-shadow, none);
	z-index: 0;
	pointer-events: none;
}

.fbm-bar.fbm-stuck::before {
	border-radius: var(--fbm-radius, 0) var(--fbm-radius, 0) 0 0;
	border-bottom: none;
}

.fbm-list {
	position: relative;
	z-index: 1;
	list-style: none;
	margin: 0;
	padding: 0 6px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--fbm-item-gap, 4px);
}

.fbm-item {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	position: relative;
}

.fbm-link {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	text-decoration: none;
	color: var(--fbm-icon, #8a8f98);
	padding: 6px 2px;
	border-radius: 12px;
	transition: color .15s ease, transform .15s ease;
}

.fbm-link:hover,
.fbm-link:focus-visible {
	color: var(--fbm-active, #f5a623);
}

.fbm-item.fbm-active .fbm-link {
	color: var(--fbm-active, #f5a623);
}

.fbm-icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.fbm-icon-wrap .dashicons {
	width: var(--fbm-icon-size, 22px);
	height: var(--fbm-icon-size, 22px);
	font-size: var(--fbm-icon-size, 22px);
}

.fbm-icon-img {
	width: var(--fbm-icon-size, 22px);
	height: var(--fbm-icon-size, 22px);
	object-fit: contain;
}

.fbm-icon-svg svg {
	width: var(--fbm-icon-size, 22px);
	height: var(--fbm-icon-size, 22px);
	display: block;
}

.fbm-label {
	font-size: var(--fbm-font-size, 11px);
	color: var(--fbm-text, #8a8f98);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.fbm-item.fbm-active .fbm-label {
	color: var(--fbm-active, #f5a623);
}

.fbm-no-labels .fbm-label {
	display: none;
}

/* ---------- Center highlighted item ---------- */

.fbm-item-center {
	flex: 0 0 var(--fbm-center-size, 58px);
	justify-content: center;
}

/*
 * The hump: a soft, upward-only mound sitting behind the center button,
 * same color as the bar, that widens the bar's silhouette outward and
 * up (never inward/down) so it reads as one continuous raised platform
 * — not a circular notch cut into the bar. It is a half-ellipse: fully
 * rounded top, flat bottom seam that merges into the bar edge, so the
 * curve is smooth and only ever bulges upward.
 */
.fbm-has-hump .fbm-item-center::before {
	content: "";
	position: absolute;
	top: calc(-1 * var(--fbm-hump-height));
	left: 50%;
	transform: translateX(-50%);
	width: var(--fbm-hump-width);
	height: var(--fbm-hump-height);
	background: var(--fbm-bg, #fff);
	border: 1px solid var(--fbm-border, #eee);
	border-bottom: none;
	border-radius: 50% 50% 0 0 / 100% 100% 0 0;
	z-index: 0;
	pointer-events: none;
}

.fbm-item-center .fbm-link {
	position: absolute;
	top: calc(-1 * var(--fbm-center-raise, 26px));
	left: 50%;
	transform: translateX(-50%);
	width: var(--fbm-center-size, 58px);
	height: var(--fbm-center-size, 58px);
	border-radius: 50%;
	background: var(--fbm-center-bg, #f5a623);
	box-shadow:
		0 0 0 var(--fbm-center-ring-width, 6px) var(--fbm-center-ring, #fff),
		var(--fbm-shadow, none);
	padding: 0;
	z-index: 1;
}

.fbm-item-center .fbm-icon-wrap .dashicons,
.fbm-item-center .fbm-icon-svg svg,
.fbm-item-center .fbm-icon-img {
	color: var(--fbm-center-icon, #fff);
	fill: var(--fbm-center-icon, #fff);
}

.fbm-item-center .dashicons {
	color: var(--fbm-center-icon, #fff);
}

.fbm-item-center .fbm-link:hover,
.fbm-item-center .fbm-link:focus-visible {
	transform: translateX(-50%) translateY(-2px);
}

/* ---------- Style: rectangle ---------- */
.fbm-style-rectangle .fbm-item-center .fbm-link {
	border-radius: 18px;
}

/* Small screens: keep comfortable tap targets */
@media (max-width: 380px) {
	.fbm-label { font-size: calc(var(--fbm-font-size, 11px) - 1px); }
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px,1px,1px,1px);
	white-space: nowrap;
}

/* Prevent theme/Elementor page content from being hidden under the fixed bar */
body.fbm-active-body {
	scroll-padding-bottom: calc(var(--fbm-height, 64px) + var(--fbm-bottom, 0px) + 16px);
}
