/**
 * Header Styles - Bare Biology
 *
 * Layout: promo bar → split header (left nav | logo | right nav + icons)
 */

/* ==========================================================================
   PROMO BAR
   ========================================================================== */

.bb-promo-bar {
	background: #6aaba8;
	color: #fff;
	padding: 10px 0;
	text-align: center;
}

.bb-promo-bar__slider {
	position: relative;
	height: 1.4em;
	overflow: hidden;
}

.bb-promo-bar__text {
	font-family: var(--k-font-body);
	font-size: 0.9rem;
	margin: 0;
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.6s ease;
}

.bb-promo-bar__text.is-active {
	opacity: 1;
}

.bb-promo-bar__text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}


/* ==========================================================================
   MAIN HEADER
   ========================================================================== */

.bb-header {
	background: #fff;
	border-bottom: 1px solid #e8e8e8;
	position: sticky;
	top: 0;
	z-index: 100;
}

.bb-header__inner {
	display: flex;
	align-items: center;
	height: 60px;
	gap: 1rem;
}

/* Mobile menu toggle */
.bb-header__menu-toggle {
	display: none;
	padding: 8px;
	color: var(--bb-text-dark);
}

@media screen and (max-width: 991px) {
	.bb-header__menu-toggle {
		display: flex;
	}

	.bb-header__inner {
		position: relative;
	}

	.bb-header__logo {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}
}


/* ==========================================================================
   LOGO (center)
   ========================================================================== */

.bb-header__logo {
	flex-shrink: 0;
}

.bb-header__logo-link {
	display: block;
	text-decoration: none;
	color: var(--bb-text-dark);
}

img.bb-header__logo-img {
	display: block;
	height: 21px;
	max-height: 21px;
	max-width: 145px;
	width: auto;
}

@media screen and (min-width: 992px) {
	img.bb-header__logo-img {
		height: 25px;
		max-height: 25px;
	}
}

.bb-logo-text {
	font-family: var(--k-font-heading);
	font-size: 1.6rem;
	letter-spacing: 0.12em;
	white-space: nowrap;
}

@media screen and (min-width: 992px) {
	.bb-logo-text {
		font-size: 1.8rem;
	}
}


/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.bb-header__nav {
	display: none;
}

@media screen and (min-width: 992px) {
	.bb-header__nav {
		display: flex;
	}
}

.bb-header__nav--left {
	flex: 1;
	justify-content: flex-end;
	margin-right: 2rem;
}

.bb-header__nav--right {
	justify-content: flex-start;
}

.bb-nav {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.bb-nav > li > a {
	display: block;
	padding: 8px 0;
	font-family: var(--k-font-heading);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bb-text-dark);
	text-decoration: none;
	transition: color 0.2s ease;
	white-space: nowrap;
}

.bb-nav > li > a:hover {
	color: #6aaba8;
}

/* Dropdown */
.bb-nav > li {
	position: relative;
}

.bb-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 200px;
	padding: 8px 0;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	list-style: none;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 101;
}

.bb-nav > li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
}

.bb-nav .sub-menu li a {
	display: block;
	padding: 8px 16px;
	font-family: var(--k-font-body);
	font-size: 0.85rem;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: #666;
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.bb-nav .sub-menu li a:hover {
	color: var(--bb-text-dark);
	background: #f5f0eb;
}


/* ==========================================================================
   MEGA MENU (desktop panel under "Shop Our Products")
   ========================================================================== */

/* Remove relative positioning so mega menu positions against .bb-header */
.bb-has-mega-menu {
	position: static !important;
}

/* Hover bridge — invisible zone prevents mouseleave flicker */
.bb-has-mega-menu > a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -12px;
	height: 12px;
}

.bb-has-mega-menu > a {
	position: relative;
}

.bb-mega-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-top: 1px solid #e8e8e8;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.3s ease 0.15s;
	z-index: 101;
	padding: 2rem 0;
}

.bb-has-mega-menu:hover > .bb-mega-menu {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.2s ease, visibility 0s ease;
}

.bb-mega-menu__columns {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2rem;
}

.bb-mega-menu__heading,
.bb-mega-menu__family-heading {
	display: block;
	font-family: var(--k-font-heading);
	font-size: 1.08rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bb-text-dark);
	margin-bottom: 0.75rem;
	text-decoration: none;
	transition: color 0.15s ease;
}

.bb-mega-menu__family-heading:hover {
	color: var(--bb-teal, #5b9a96);
}

.bb-mega-menu__family {
	margin-bottom: 1.25rem;
}

.bb-mega-menu__family:last-child {
	margin-bottom: 0;
}

.bb-mega-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bb-mega-menu__list li a {
	display: block;
	padding: 0.35rem 0;
	font-family: var(--k-font-body);
	font-size: 0.9rem;
	color: #666;
	text-decoration: none;
	transition: color 0.15s ease;
}

.bb-mega-menu__list li a:hover {
	color: var(--bb-teal, #5b9a96);
}


/* ==========================================================================
   RIGHT SECTION (nav + icons)
   ========================================================================== */

.bb-header__right {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 1.5rem;
	margin-left: 2rem;
}

@media screen and (max-width: 991px) {
	.bb-header__right {
		flex: 0;
		margin-left: auto;
		gap: 0.5rem;
	}

	.bb-header__nav--right {
		display: none;
	}
}


/* ==========================================================================
   HEADER ACTIONS (search, cart)
   ========================================================================== */

.bb-header__action {
	background: none;
	border: none;
	color: var(--bb-text-dark);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	width: 36px;
	height: 36px;
	text-decoration: none;
	border-radius: 4px;
	transition: color 0.2s ease;
}

.bb-header__action:hover {
	background-color: var(--bb-cream, #f5f0eb);
}

/* Cart count */
.bb-header__cart {
	position: relative;
}

.bb-header__cart-count {
	position: absolute;
	top: 0;
	right: 0;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: 600;
	line-height: 16px;
	text-align: center;
	color: #fff;
	background: var(--bb-text-dark);
	border-radius: 999px;
}


/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */

.bb-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 200;
	background: #fff;
	padding: 1.5rem 0;
	border-bottom: 1px solid #e8e8e8;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.bb-search-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.bb-search-overlay__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.bb-search-form {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.bb-search-form__input {
	flex: 1;
	padding: 0.75rem 1rem;
	font-size: 1.1rem;
	border: 1px solid #e8e8e8;
	border-radius: 4px;
}

.bb-search-form__input:focus {
	outline: none;
	border-color: var(--bb-text-dark);
}

.bb-search-form__submit {
	padding: 0.75rem;
	color: var(--bb-text-dark);
}

.bb-search-overlay__close {
	padding: 0.5rem;
	color: #999;
}


/* ==========================================================================
   MOBILE MENU
   ========================================================================== */

.bb-mobile-menu {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 200;
	width: 320px;
	max-width: 85vw;
	background: #fff;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
}

.bb-mobile-menu.is-open {
	transform: translateX(0);
}

.bb-mobile-menu__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-bottom: 1px solid #e8e8e8;
}

.bb-mobile-menu__logo {
	display: block;
	color: var(--bb-text-dark);
	text-decoration: none;
}

.bb-mobile-menu__logo .bb-logo-text {
	font-size: 1.2rem;
}

.bb-mobile-menu__close {
	padding: 0.5rem;
	color: #999;
}

.bb-mobile-menu__nav {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
}

.bb-mobile-nav {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bb-mobile-nav > li {
	border-bottom: 1px solid #f0f0f0;
	position: relative;
}

.bb-mobile-nav > li > a {
	display: block;
	padding: 0.75rem 0;
	padding-right: 2.5rem;
	font-family: var(--k-font-heading);
	font-size: 1.1rem;
	font-style: italic;
	font-weight: 600;
	color: var(--bb-text-dark);
	text-decoration: none;
}

/* Accordion toggle button */
.bb-mobile-nav__toggle {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none !important;
	border: none;
	color: #999;
	cursor: pointer;
}

.bb-mobile-nav__toggle svg {
	transition: transform 0.2s ease;
}

.bb-mobile-nav__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* Submenu — hidden by default */
.bb-mobile-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 0.5rem 1rem;
	display: none;
}

.bb-mobile-nav .sub-menu.is-open {
	display: block;
}

.bb-mobile-nav .sub-menu li {
	position: relative;
}

.bb-mobile-nav .sub-menu li a {
	display: block;
	padding: 0.5rem 0;
	padding-right: 2.5rem;
	font-family: var(--k-font-heading);
	font-size: 0.95rem;
	font-style: italic;
	font-weight: 400;
	color: #666;
	text-decoration: none;
}

.bb-mobile-nav .sub-menu li a:hover {
	color: #6aaba8;
}

/* Nested sub-menu section headers (e.g. "By Health Benefit") */
.bb-mobile-nav .sub-menu .menu-item-has-children > a {
	color: var(--bb-text-dark);
	font-weight: 500;
}

/* Deeper nested sub-menus */
.bb-mobile-nav .sub-menu .sub-menu {
	padding-left: 0.75rem;
}

/* Smaller toggle in sub-menus */
.bb-mobile-nav .sub-menu .bb-mobile-nav__toggle {
	height: 36px;
	width: 36px;
}

.bb-mobile-menu__footer {
	padding: 1rem;
	border-top: 1px solid #e8e8e8;
}

.bb-mobile-menu__link {
	display: block;
	padding: 0.5rem 0;
	font-size: 0.9rem;
	color: #666;
	text-decoration: none;
}

/* Overlay */
.bb-mobile-menu__overlay {
	position: fixed;
	inset: 0;
	z-index: 199;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bb-mobile-menu__overlay.is-open {
	opacity: 1;
	visibility: visible;
}
