/* BestBay header: layout, dropdowns and Liquid Glass layers. */

/* BestBay Header — menu desktop: solo icone, centrate */
.buddyx-desktop-menu .menu-text {
	display: none;
}


@media (min-width: 768px) {
.main-navigation {
 flex: 1;
	}
}

.buddyx-desktop-menu {
	flex: 1;
}

.buddyx-desktop-menu #primary-menu {
	justify-content: center;
}

.buddyx-desktop-menu #primary-menu > li.menu-item > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.buddyx-desktop-menu #primary-menu > li.menu-item > a i {
	font-size: 1.3rem;
	line-height: 1;
}

/* Nasconde l'icona Font Awesome del form di ricerca */
.menu-icons-wrapper #searchform::before {
	display: none;
}

/* Icona BuddyBoss al suo posto */
.menu-icons-wrapper #searchform .search-form-icon {
	position: absolute;
	right: 15px;
	top: 0;
	bottom: 0;
	margin: auto;
	height: 22px;
	color: var(--bx-color-fg-muted, #aaa);
	font-size: 14px;
	z-index: 2;
	pointer-events: none;
}

/* header sticky*/
/* Header fisso in tutto il sito — CSS puro, nessun JS */
.bestbay-header-wrapper {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 999;
	margin: 0;
	padding-top: 5px;
	padding-bottom: 5px;
	background: transparent;
	min-height: 51px;
}

/* Compensazione immediata: il body lascia spazio all'header */
body {
	padding-top: var(--bestbay-header-offset);
}

/* Con admin bar WordPress (loggato) */
body.admin-bar .bestbay-header-wrapper {
	top: 32px;
}


@media (max-width: 782px) {
	body.admin-bar .bestbay-header-wrapper {
 top: 46px;
	}}

/* Do not force .buddypress-icons-wrapper display: BuddyX renders mobile + desktop copies. */

/* Unified header tooltips. */
.bestbay-header-wrapper [data-bestbay-tooltip] { position: relative; }
.bestbay-header-wrapper [data-bestbay-tooltip]::before,
.bestbay-header-wrapper [data-bestbay-tooltip]::after {
	position: absolute;
	left: 50%;
	z-index: 10020;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.bestbay-header-wrapper [data-bestbay-tooltip]::after {
	content: attr(data-bestbay-tooltip);
	top: calc(100% + 10px);
	transform: translate(-50%, -5px);
	padding: 6px 9px;
	border-radius: 6px;
	background: #1f2937;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 6px 18px rgba(15, 23, 42, .16);
}
.bestbay-header-wrapper [data-bestbay-tooltip]::before {
	content: "";
	top: calc(100% + 5px);
	transform: translate(-50%, -5px);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-bottom: 6px solid #1f2937;
}
.bestbay-header-wrapper [data-bestbay-tooltip]:hover::before,
.bestbay-header-wrapper [data-bestbay-tooltip]:hover::after,
.bestbay-header-wrapper [data-bestbay-tooltip]:focus-visible::before,
.bestbay-header-wrapper [data-bestbay-tooltip]:focus-visible::after {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

/* Messages reuse BuddyX's notification dropdown mechanics. */
.bestbay-header-wrapper .bp-msg,
.bestbay-header-wrapper .user-notifications {
	position: relative;
}
.bestbay-header-wrapper .bp-msg .bp-header-submenu { display: none; }
.bestbay-header-wrapper .bp-msg.active .bp-header-submenu { display: block; }

/* One visual contract for both dropdowns. */
.bestbay-header-wrapper .bp-msg .bestbay-header-dropdown,
.bestbay-header-wrapper .user-notifications .bestbay-header-dropdown,
.bestbay-header-wrapper #bp-messages.bestbay-header-dropdown,
.bestbay-header-wrapper #bp-notify.bestbay-header-dropdown {
	box-sizing: border-box;
	width: 400px;
	max-width: min(400px, calc(100vw - 32px));
	min-width: 320px;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--bx-color-border, #e5e7eb);
	border-radius: 12px;
	background: var(--bx-color-surface, #fff);
	box-shadow: 0 12px 34px rgba(18, 43, 70, .14);
}

.bestbay-header-wrapper .bestbay-dropdown-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 48px;
	padding: 0 14px;
	border-bottom: 1px solid var(--bx-color-border, #e5e7eb);
}
.bestbay-header-wrapper .bestbay-dropdown-head > strong {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}
.bestbay-header-wrapper .bestbay-mark-all-read {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: transparent;
	color: var(--bx-color-primary, #0075ea);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}
.bestbay-header-wrapper .bestbay-mark-all-read:hover,
.bestbay-header-wrapper .bestbay-mark-all-read:focus-visible { text-decoration: underline; }

.bestbay-header-wrapper .bestbay-header-dropdown .bp-dropdown-inner {
	width: 100%;
	max-height: 360px;
	overflow-y: auto;
	overflow-x: hidden;
}
.bestbay-header-wrapper #bp-notify .bp-dropdown-inner {
	padding: 0 10px;
}
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-item {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	border-bottom: 1px solid var(--bx-color-border, #e5e7eb);
}
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-item:last-child { border-bottom: 0; }

/* BuddyBoss notification affordance: unread dot becomes the eye on hover. */
.bestbay-header-wrapper #bp-notify .dropdown-item.unread { position: relative; }
.bestbay-header-wrapper #bp-notify .dropdown-item.unread::before {
	content: "";
	position: absolute;
	right: 22px;
	top: 50%;
	width: 10px;
	height: 10px;
	margin-top: -5px;
	border-radius: 50%;
	background: var(--bx-color-primary, #0075ea);
	transform: translateX(-50%) !important;
}
.bestbay-header-wrapper #bp-notify .dropdown-item.unread:hover::before { display: none; }
.bestbay-header-wrapper #bp-notify .notification-avatar {
	display: flex;
	flex: 0 0 36px;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0 10px 0 0;
}
.bestbay-header-wrapper #bp-notify .notification-avatar img {
	display: block;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}
.bestbay-header-wrapper #bp-notify .dropdown-item {
	display: flex;
	align-items: center;
	min-height: 0;
	padding: 15px 22px;
	position: relative;
}
.bestbay-header-wrapper #bp-notify .bp-dropdown-inner .dropdown-item {
	padding: 12px 10px;
}
.bestbay-header-wrapper #bp-notify .bp-dropdown-inner .dropdown-item:hover {
	background: var(--bx-color-bg-elevated, rgba(0, 0, 0, .02));
	border-radius: 0;
}
.bestbay-header-wrapper #bp-notify .notification-content {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	color: var(--bx-color-fg-muted, #939597);
	font-size: 14px;
	letter-spacing: -.24px;
	line-height: 1.3;
}
.bestbay-header-wrapper #bp-notify .notification-content .notification {
	display: block;
	color: var(--bx-color-fg, #122b46);
}
.bestbay-header-wrapper #bp-notify .notification-content .posted {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	line-height: 19px;
}
.bestbay-header-wrapper #bp-notify .actions {
	display: flex;
	align-items: center;
	align-self: center;
	min-width: 40px;
	padding-left: 5px;
	position: relative;
	opacity: 0;
	visibility: hidden;
}
.bestbay-header-wrapper #bp-notify .dropdown-item:hover .actions,
.bestbay-header-wrapper #bp-notify .actions:focus-within {
	opacity: 1;
	visibility: visible;
}
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin-left: 6px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bx-color-fg-muted, #939597);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, color .2s ease, visibility .2s ease;
}
.bestbay-header-wrapper #bp-notify .dropdown-item:hover .bestbay-notification-mark-read,
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read:focus-visible {
	opacity: 1;
	visibility: visible;
}
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read:hover { color: var(--bx-color-primary, #0075ea); }
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read [class*="bb-icon-"] { font-size: 20px; line-height: 1; }

/* BuddyBoss tooltip placement: left of the eye, vertically centered. */
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read::after {
	top: 50%;
	left: auto;
	right: calc(100% + 10px);
	transform: translate(5px, -50%);
}
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read::before {
	top: 50%;
	left: auto;
	right: calc(100% + 5px);
	transform: translate(5px, -50%);
	border-top: 5px solid transparent;
	border-right: 0;
	border-bottom: 5px solid transparent;
	border-left: 6px solid #1f2937;
}
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read:hover::before,
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read:hover::after,
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read:focus-visible::before,
.bestbay-header-wrapper #bp-notify .bestbay-notification-mark-read:focus-visible::after {
	transform: translate(0, -50%);
}

.bestbay-header-wrapper .bestbay-message-link {
	display: flex;
	align-items: center;
	gap: 11px;
	width: 100%;
	min-width: 0;
	padding: 11px 14px;
	box-sizing: border-box;
	text-decoration: none;
}

.buddypress-icons-wrapper .user-link-wrap img.avatar, .buddypress-icons-wrapper .user-link-wrap img {
        border: 2px solid rgba(255, 255, 255, 0.5);
}

.bestbay-header-wrapper .bestbay-message-avatar { flex: 0 0 40px; }
.bestbay-header-wrapper .bestbay-message-avatar img {
	display: block;
	width: 40px;
	height: 40px;
	margin: 0;
	border-radius: 50%;
	object-fit: cover;
}
.bestbay-header-wrapper .bestbay-message-copy {
	display: flex;
	min-width: 0;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 3px;
}
.bestbay-header-wrapper .bestbay-message-copy strong {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
}
.bestbay-header-wrapper .bestbay-message-copy .mute {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px;
}

/* Normalize BuddyX notification rows inside our shared dropdown shell. */
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-item-title,
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-item > .notification {
	min-width: 0;
}
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-item > .dropdown-item-title,
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-item > p {
	padding-left: 14px;
	padding-right: 14px;
}

.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 14px;
	border-top: 1px solid var(--bx-color-border, #e5e7eb);
}
.bestbay-header-wrapper .bestbay-header-dropdown .dropdown-footer .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bx-color-primary, #0075ea);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.bestbay-header-wrapper .bestbay-header-dropdown .alert-message {
	padding: 18px 14px;
}
.bestbay-header-wrapper .bestbay-header-dropdown .alert { margin: 0; }

@media (max-width: 767px) {
	.bestbay-header-wrapper [data-bestbay-tooltip]::before,
	.bestbay-header-wrapper [data-bestbay-tooltip]::after { display: none; }
	.bestbay-header-wrapper .bestbay-header-dropdown {
		min-width: 0;
		max-width: calc(100vw - 24px);
	}
}
/* BuddyBoss utility spacing: 24px icons, 8px padding and a 1x24px separator. */
@media (min-width: 768px) {
	/* Utility cluster: BuddyBoss uses 24px icons and 8px horizontal padding
	 * around each action, giving a 40px center-to-center rhythm. */
	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) {
		gap: 0;
	}

	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .desktop-icons {
		display: flex;
		align-items: center;
		padding: 0;
	}

	.bestbay-header-wrapper .desktop-icons .menu-icons-wrapper,
	.bestbay-header-wrapper .desktop-icons .search {
		display: flex;
		align-items: center;
	}

	.bestbay-header-wrapper .desktop-icons .search {
		padding: 0 8px;
	}

	.bestbay-header-wrapper .desktop-icons .search-icon,
	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .bp-msg > .bp-icon-wrap,
	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .user-notifications > .bp-icon-wrap {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 24px;
		height: 40px;
		padding: 0;
		line-height: 1;
	}

	.bestbay-header-wrapper .desktop-icons .search-icon > i,
	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .bp-msg > .bp-icon-wrap > [class*="bb-icon-"],
	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .user-notifications > .bp-icon-wrap > [class*="bb-icon-"] {
		font-size: 24px;
		line-height: 1;
	}

	/* BuddyBoss places the separator after Search and before Messages.
	 * BuddyX nests Search inside .desktop-icons, so that sibling boundary is
	 * the equivalent structural point in our header. */
	.bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .desktop-icons::after {
		content: "";
		display: inline-block;
		flex: 0 0 1px;
		width: 1px;
		height: 24px;
		max-height: 24px;
		margin: 0 8px;
		padding: 0;
		background: var(--bx-color-header-link, currentColor);
		opacity: .2;
		vertical-align: middle;
		pointer-events: none;
	}

	.bestbay-header-wrapper .buddyx-desktop-menu #primary-menu > li.menu-item > a > i {
		font-size: 24px;
		line-height: 1;
	}
}

/* Header content sits above the optical layers. */
.bestbay-header-wrapper > .container,
.bestbay-header-wrapper .site-header { background: transparent !important; }
.bestbay-header-wrapper > .container { position: relative; z-index: 2; }
.bestbay-menu-lens[hidden] { display: none; }
.bestbay-header-wrapper .bestbay-message-preview {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	line-height: 1.4;
}
.bestbay-header-wrapper .bestbay-multiple-avatar {
	position: relative;
	height: 40px;
}
.bestbay-header-wrapper .bestbay-multiple-avatar img {
	position: absolute;
	width: 28px;
	height: 28px;
	border: 2px solid var(--bx-color-surface, #fff);
	box-sizing: border-box;
}
.bestbay-header-wrapper .bestbay-multiple-avatar img:first-child { top: 0; left: 0; }
.bestbay-header-wrapper .bestbay-multiple-avatar img:last-child { bottom: 0; right: 0; }

/* The BuddyX mobile panel lives inside the fixed header wrapper. backdrop-filter
 * creates a stacking context, so keep the opened panel explicitly above the
 * glass surface instead of disabling blur on mobile. */
body.mobile-menu-opened .bestbay-header-wrapper .buddyx-mobile-menu {
	z-index: 10030;
}

/* Header selection is the glass lens; remove BuddyX's curved accent shadow. */
.bestbay-header-wrapper .main-navigation ul li.current-menu-item > a,
.bestbay-header-wrapper .main-navigation ul li.current_page_item > a,
.bestbay-header-wrapper .main-navigation ul li.current-menu-ancestor > a {
 box-shadow: none !important;
 border-bottom: 0;
 text-decoration: none;
}

/* Full-width optical material and subtle moving selection. */
.bestbay-header-wrapper::before {
 content: ""; position: absolute; inset: 0; pointer-events: none;
 border-radius: 0;
 -webkit-backdrop-filter: blur(8px) saturate(150%);
 backdrop-filter: blur(8px) saturate(150%);
 /*background: rgba(187,187,188,var(--bestbay-glass-opacity, .12));
 box-shadow: inset 0 1px 0 rgba(255,255,255,.65),
 inset 0 -1px 0 rgba(255,255,255,.5),
 inset 0 -3px 4px -3px rgba(0,0,0,.22),
 0 3px 12px rgba(0,0,0,.08);*/
}
.bestbay-header-wrapper.bestbay-optics-ready::before {
 backdrop-filter: url(#bestbay-header-optics) saturate(150%);
}
.bestbay-header-wrapper::after {
 content: ""; position: absolute; inset: 0; pointer-events: none;
 border-radius: 0;
 background: var(--bestbay-header-glint, transparent);
}
.bestbay-menu-lens {
 position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1;
 -webkit-backdrop-filter: blur(3px) saturate(150%);
 backdrop-filter: blur(3px) saturate(150%);
 transition: transform .42s cubic-bezier(.22,1,.36,1), width .42s cubic-bezier(.22,1,.36,1), opacity .2s;
 background: rgba(187,187,188,.18);
 border-radius: 25px;
 box-shadow: inset 0 0 0 1px rgba(255,255,255,.12),
 inset 2px 1px 0 -1px rgba(255,255,255,.85),
 inset -1.5px -1px 0 -1px rgba(255,255,255,.7),
 inset 0 -4px 1px -2px rgba(0,0,0,.1), 0 3px 6px rgba(0,0,0,.08);
}

/* Logo width comes from the Customizer theme setting. */
.bestbay-header-wrapper .site-branding img.custom-logo {
 width: var(--bestbay-logo-width);
 max-width: 100%;
 height: auto;
 max-height: none;
}

/* BuddyBoss template v2 spacing, with BestBay's narrower 60px anchor. */
@media (min-width: 768px) {
 .bestbay-header-wrapper .buddyx-desktop-menu #primary-menu { gap: 0; }
 .bestbay-header-wrapper .buddyx-desktop-menu #primary-menu > li.menu-item {
  padding: 0 5px;
  margin: 0;
 }
 .bestbay-header-wrapper .buddyx-desktop-menu #primary-menu > li.menu-item > a {
  box-sizing: border-box;
  min-width: 60px;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 25px;
  transition: background-color .16s ease, color .16s ease;
 }
}

/* The moving lens supplies the hover background, preserving tooltip pseudos. */
.bestbay-header-wrapper .buddyx-desktop-menu #primary-menu > li.menu-item > a:hover,
.bestbay-header-wrapper .buddyx-desktop-menu #primary-menu > li.menu-item > a:focus-visible {
 background-color: transparent;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
 .bestbay-header-wrapper::before { background: var(--bx-color-header-background, #fff); }
}
@media (prefers-reduced-motion: reduce) {
 .bestbay-menu-lens,
 .bestbay-header-wrapper [data-bestbay-tooltip]::before,
 .bestbay-header-wrapper [data-bestbay-tooltip]::after,
 .bestbay-header-wrapper .buddyx-desktop-menu #primary-menu > li.menu-item > a,
 .bestbay-header-wrapper .desktop-icons .search-icon,
 .bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .bp-msg > .bp-icon-wrap,
 .bestbay-header-wrapper .buddypress-icons-wrapper:not(.buddyx-mobile-icon) > .user-notifications > .bp-icon-wrap {
  transition: none;
 }
}
