/* ==========================================================================
   UnoDock — Frontend bottom nav bar
   ========================================================================== */

.udock-bottom-nav {
	display: none; /* shown only on mobile via media query */
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--udock-height, 60px);
	background: var(--udock-bg, #ffffff);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	z-index: var(--udock-zindex, 9999);
	align-items: stretch;
	justify-content: space-around;
	box-sizing: border-box;
	border-top-left-radius: var(--udock-top-radius, 0px);
	border-top-right-radius: var(--udock-top-radius, 0px);
	/* Intentionally no overflow:hidden here — it would clip the featured
	   button's icon background as it pops up above the bar. */
}

.udock-bottom-nav.udock-sticky {
	position: fixed;
}
.udock-bottom-nav.udock-static {
	position: relative;
}

.udock-bottom-nav.udock-safe-area {
	height: calc(var(--udock-height, 60px) + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 782px) {
	.udock-bottom-nav {
		display: flex;
	}
	/* Prevents the site content from being hidden behind the fixed bar */
	body {
		padding-bottom: var(--udock-height, 60px);
	}
}

.udock-nav-item {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	text-decoration: none !important;
	position: relative;
	padding: 4px 2px;
	-webkit-tap-highlight-color: transparent;
	background: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

/* Label below the icon (default): icon first, label after, in normal order */
.udock-nav-item.udock-label-bottom {
	flex-direction: column;
}
/* Label above the icon: the label is already output before the icon in the
   markup, so normal (non-reversed) column order already places it on top */
.udock-nav-item.udock-label-top {
	flex-direction: column;
}

.udock-nav-icon-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.udock-nav-item i {
	font-size: var(--udock-icon-size, 22px);
	color: var(--udock-icon, #808080);
	transition: color .15s ease;
}

.udock-nav-label {
	font-size: var(--udock-font-size, 11px);
	color: var(--udock-text, #808080);
	line-height: 1.2;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-transform: none !important;
	letter-spacing: normal !important;
	font-weight: normal;
	position: relative;
	padding-bottom: 3px;
}

.udock-nav-item.udock-active i {
	color: var(--udock-icon-active, #16E2F5);
}

/* Active button: text color never changes — instead, an underline animates
   in from left to right beneath the label. */
.udock-bottom-nav:not(.udock-underline-off) .udock-nav-item.udock-active .udock-nav-label::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--udock-underline, #16E2F5);
	border-radius: 2px;
	transform-origin: left;
	animation: udock-underline-grow 0.4s ease forwards;
}

@keyframes udock-underline-grow {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

/* Featured button (larger icon) — size is configurable via --udock-featured-scale */
.udock-icon-featured i {
	font-size: calc(var(--udock-icon-size, 22px) * var(--udock-featured-scale, 1.5)) !important;
}

/* Icon background (any button: solid color or gradient) */
.udock-icon-bg {
	width: calc(var(--udock-icon-size, 22px) * 1.9);
	height: calc(var(--udock-icon-size, 22px) * 1.9);
	border-radius: 50%;
	box-sizing: border-box;
}
.udock-icon-featured.udock-icon-bg {
	width: calc(var(--udock-icon-size, 22px) * (var(--udock-featured-scale, 1.5) + 0.7));
	height: calc(var(--udock-icon-size, 22px) * (var(--udock-featured-scale, 1.5) + 0.7));
	margin-top: -18px;
}

.udock-icon-filled {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.udock-icon-filled i {
	color: #ffffff !important;
}
.udock-icon-featured.udock-icon-filled i {
	font-size: calc(var(--udock-icon-size, 22px) * var(--udock-featured-scale, 1.5) * 0.867) !important;
}

/* ---------------------------------------------------------
 * WooCommerce cart count badge
 * ------------------------------------------------------- */
.udock-cart-count-badge {
	position: absolute;
	top: -4px;
	right: -8px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: #ef4444;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	border-radius: 20px;
	box-shadow: 0 0 0 2px var(--udock-bg, #ffffff);
}
.udock-cart-count-badge:empty {
	display: none;
}

/* ---------------------------------------------------------
 * Search overlay
 * ------------------------------------------------------- */
.udock-search-overlay {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--udock-bg, #ffffff);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
	z-index: calc(var(--udock-zindex, 9999) + 1);
	padding: 14px;
	transform: translateY(100%);
	transition: transform .25s ease;
	box-sizing: border-box;
	border-top-left-radius: 18px;
	border-top-right-radius: 18px;
}
.udock-search-overlay.udock-open {
	transform: translateY(0);
}
.udock-search-form {
	display: flex;
	align-items: center;
	gap: 10px;
}
.udock-search-input {
	flex: 1;
	padding: 10px 14px;
	border-radius: 24px;
	border: 1px solid #d1d5db;
	font-size: 14px;
	outline: none;
}
.udock-search-input:focus {
	border-color: var(--udock-icon-active, #16E2F5);
}
.udock-search-close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	color: var(--udock-text, #808080);
	cursor: pointer;
	padding: 4px 8px;
}

/* ---------------------------------------------------------
 * Click animations
 * ------------------------------------------------------- */
@keyframes udock-anim-shrink {
	0%   { transform: scale(1); }
	50%  { transform: scale(0.82); }
	100% { transform: scale(1); }
}
@keyframes udock-anim-zoom {
	0%   { transform: scale(1); }
	50%  { transform: scale(1.28); }
	100% { transform: scale(1); }
}

.udock-nav-icon-wrap.udock-play-shrink {
	animation: udock-anim-shrink 0.3s ease;
}
.udock-nav-icon-wrap.udock-play-zoom {
	animation: udock-anim-zoom 0.35s ease;
}
