/*
 * Header (2026 redesign) - templates/site-header.php
 *
 * Plain CSS, loaded on every page after style.css. The desktop header starts at
 * 1200px (the breakpoint the existing mega menu and mobile drawer already use).
 * The old header rules in style.css still style the panels this header reuses
 * (search, wishlist, mini cart, mobile drawer); this file only adjusts them.
 */

:root {
	--bhd-plum: #2D1640;
	--bhd-purple: #6B2A8C;
	--bhd-lilac: #F3F0F5;
	--bhd-line: #EEE7F2;
	--bhd-top-h: 60px;
	--bhd-bar-h: 0px;
	--bhd-admin: 0px;
}
.admin-bar { --bhd-admin: 46px; }
@media (min-width: 783px) { .admin-bar { --bhd-admin: 32px; } }
@media (max-width: 600px) { .admin-bar { --bhd-admin: 0px; } }

/* position: sticky needs a non-scrolling ancestor; "clip" hides overflow like "hidden" did. */
#wrapper { overflow: clip; }
/* Browsers without overflow: clip (Safari 15 and older) keep the old overflow: hidden,
   which stops sticky. Let the page clip horizontally instead. */
@supports not (overflow: clip) {
	#wrapper { overflow: visible; }
	/* body only: its overflow moves to the viewport, so it creates no scroll box. */
	body { overflow-x: hidden; }
}

.bhd-announce,
#header.bhd { font-family: 'Noto Sans Hebrew', 'Arial Hebrew', Arial, sans-serif; font-weight: 300; direction: rtl; }
#header.bhd *,
.bhd-announce * { box-sizing: border-box; }

/* ---------- Announcement bar ---------- */
.bhd-announce {
	position: relative;
	height: 36px;
	overflow: hidden;
	background: var(--bhd-plum);
	color: #fff;
	font-size: 14px;
}
.bhd-announce__item {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 16px;
	text-align: center;
	opacity: 0;
	transform: translateY(100%);
	pointer-events: none;
	transition: opacity .5s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}
.bhd-announce__item.is-on { opacity: 1; transform: translateY(0); pointer-events: auto; }
.bhd-announce__item.is-out { transform: translateY(-100%); }
.bhd-announce a,
.bhd-announce a:hover { color: #fff; text-decoration: none; }

/* ---------- Header shell ---------- */
#header.bhd {
	position: sticky;
	top: var(--bhd-admin);
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid var(--bhd-line);
	padding: 0;
}
.bhd-wrap { width: 100%; max-width: 1760px; margin: 0 auto; }

#header.bhd a { text-decoration: none; }
#header.bhd .bhd-icon {
	position: relative;
	min-width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #000;
	background: none;
	border: 0;
	padding: 0;
	font-size: 16px;
	transition: color .25s ease;
}
#header.bhd .bhd-icon:hover { color: var(--bhd-purple); }
#header.bhd .bhd-icon svg { width: 22px; height: 22px; stroke-width: 1.6; }
#header.bhd .cart-count {
	position: absolute;
	top: 6px;
	left: 5px;
	min-width: 16px;
	width: auto;
	height: 16px;
	padding: 0 4px;
	border: 0;
	border-radius: 8px;
	background: var(--bhd-purple);
	color: #fff;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
	display: block;
}
#header.bhd .cart-count.d-none { display: none; }

/* ---------- Logo row ---------- */
.bhd-top__grid {
	height: var(--bhd-top-h);
	padding: 0 10px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
}
.bhd-top__start { justify-self: start; display: flex; align-items: center; }
.bhd-top__end { justify-self: end; display: flex; align-items: center; }
.bhd-logo { display: flex; justify-self: center; }
.bhd-logo img { width: 150px; height: auto; display: block; }

#header.bhd .bhd-burger {
	width: 44px;
	height: 48px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	background: none;
	border: 0;
	padding: 0;
	color: #000;
	font-family: inherit;
	cursor: pointer;
	order: 0;
	margin: 0;
	position: static;
}
#header.bhd .bhd-burger::before,
#header.bhd .bhd-burger::after { display: none; }
.bhd-burger svg { width: 24px; height: 24px; }
.bhd-burger__close,
.nav-active .bhd-burger__open { display: none; }
.nav-active .bhd-burger__close { display: block; }
.bhd-burger__label { font-size: 10px; line-height: 1; }

/* Mobile row: menu + search | logo | wishlist + cart */
.bhd-top .bhd-icon--branches,
.bhd-top .bhd-icon--account { display: none !important; }

/* The category bar is the desktop menu; on mobile it only hosts the drawer (fixed). */
.bhd-bar,
.bhd-bar__inner { height: 0; }
.bhd-bar__icons { display: none; }
#header.bhd .bhd-nav { margin: 0; padding: 0; width: auto; order: 0; }

/* ---------- Search panel: no shadow over the header, dark overlay behind it ---------- */
#header.bhd .search-suggest-wrap-main { box-shadow: none; }
.header_search_active #wrapper::after,
.mini_cart_active #wrapper::after,
.wishlist_active #wrapper::after {
	content: "";
	position: fixed;
	top: var(--bhd-bottom, 96px);
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 98;
	background: rgba(26, 13, 37, .5);
}
.header_search_active #main.section-active::after,
.mini_cart_active #main.section-active::after,
.wishlist_active #main.section-active::after { display: none; }
/* Keep the header above the panel overlays at all times. */
#header.bhd { z-index: 100; }

/* ---------- Mobile drawers: menu from the right, wishlist and cart from the left,
   all under the header, with a dark overlay and the page behind them locked ---------- */
@media (max-width: 1199.98px) {
	#header.bhd #nav {
		top: var(--bhd-bottom, 96px);
		left: auto;
		right: 0;
		transform: translateX(100%);
		font-family: inherit;
		border: 0;
		border-left: 1px solid var(--bhd-line);
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.nav-active #header.bhd #nav { transform: translateX(0); }


	.nav-active #wrapper::after,
	.mini_cart_active #wrapper::after,
	.wishlist_active #wrapper::after {
		content: "";
		position: fixed;
		top: var(--bhd-bottom, 96px);
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 98;
		background: rgba(26, 13, 37, .5);
	}
	/* The page behind is locked in header.js (not with overflow: hidden, which on
	   iPhone scrolls the sticky header out of view). */
}

@media (max-width: 1199.98px) {
	#header.bhd #nav .mobile-menu > li { border-bottom: 1px solid var(--bhd-line); }
	#header.bhd #nav .mobile-menu > li a {
		font-family: inherit;
		font-size: 16px;
		font-weight: 300;
		color: #000;
		padding: 13px 18px;
	}
	#header.bhd #nav .mobile-menu > li:last-child a { text-decoration: none; font-weight: 300; }
	#header.bhd #nav .mobile-menu .active > a { font-weight: 400; color: var(--bhd-purple); }
	#header.bhd #nav .mobile-menu > li.menu-item-has-children > a::before { color: inherit; }
	#header.bhd #nav .mobile-menu .sub-menu { background: var(--bhd-lilac); padding: 8px 26px; }
	#header.bhd #nav .mobile-menu .sub-menu a {
		font-size: 15px;
		font-weight: 300;
		color: #000;
		padding: 8px 0;
	}
	/* Deeper levels line up with their parent level (no extra indent). */
	#header.bhd #nav .mobile-menu .sub-menu .sub-menu { padding: 0; margin: 0; }
	#header.bhd #nav .mobile-menu .menu-sale > a,
	#header.bhd #nav .mobile-menu .menu-sale > a font { color: var(--bhd-purple) !important; }
	#header.bhd #nav .mobile-account-nav::before { background: var(--bhd-line); }
	#header.bhd #nav .mobile-account-nav > li > a,
	#header.bhd #nav .mobile-footer-nav a { font-family: inherit; font-weight: 300; font-size: 15px; color: #000; }
	#header.bhd #nav .mobile-footer-nav .social-networks li a { color: var(--bhd-purple); }
}

/* ---------- Desktop (from 1200px) ---------- */
@media (min-width: 1200px) {
	:root { --bhd-top-h: 100px; --bhd-bar-h: 56px; }

	.bhd-announce { height: 40px; font-size: 16px; }

	/* Only the category bar stays: the logo row scrolls up out of view. */
	#header.bhd { top: calc(var(--bhd-admin) - var(--bhd-top-h)); border-bottom: 0; }

	.bhd-top__grid { padding: 0 clamp(32px, 4vw, 80px); }
	.bhd-top__start,
	.bhd-top__end { gap: 4px; }
	.bhd-logo img { width: 264px; }
	#header.bhd .bhd-top .bhd-icon svg { width: 26px; height: 26px; stroke-width: 1.4; }
	#header.bhd .bhd-top .bhd-icon { min-width: 48px; height: 48px; }
	.bhd-top .bhd-icon--branches,
	.bhd-top .bhd-icon--account { display: inline-flex !important; }
	.bhd-top .bhd-icon--branches { padding: 0 8px; }
	#header.bhd .bhd-burger { display: none; }

	.bhd-bar {
		position: relative;
		height: var(--bhd-bar-h);
		background: #fff;
		border-top: 1px solid var(--bhd-line);
		border-bottom: 1px solid var(--bhd-line);
	}
	.bhd-bar__inner {
		height: 100%;
		padding: 0 clamp(32px, 4vw, 80px);
		display: flex;
		align-items: center;
		gap: 16px;
	}
	.bhd-bar__icons {
		display: flex;
		align-items: center;
		gap: 4px;
		overflow: hidden;
		max-width: 0;
		opacity: 0;
		visibility: hidden;
		transition: max-width .45s ease, opacity .45s ease, visibility .45s;
	}
	#header.bhd.is-stuck .bhd-bar__icons { max-width: 200px; opacity: 1; visibility: visible; }
	.bhd-bar__icons .bhd-icon--branches span { display: none; }

	#header.bhd .bhd-nav { flex: 1; min-width: 0; position: static; order: 0; width: auto; margin: 0; height: 100%; }
	#header.bhd #nav { height: 100%; margin: 0; padding: 0; }
	#header.bhd #nav { position: static; font-family: inherit; }

	/* Top level links */
	#header.bhd #nav .primary-menu {
		justify-content: center;
		flex-wrap: nowrap;
		gap: clamp(14px, 1.4vw, 28px);
		white-space: nowrap;
	}
	#header.bhd #nav .primary-menu > li { margin: 0; position: static; }
	#header.bhd #nav .primary-menu > li > a {
		font-family: inherit;
		font-size: 16px;
		font-weight: 300;
		line-height: var(--bhd-bar-h);
		color: #000;
		padding: 0;
		transition: color .25s ease;
	}
	#header.bhd #nav .primary-menu > li > a::after { bottom: 14px; background: var(--bhd-purple); }
	#header.bhd #nav .primary-menu > li:hover > a,
	#header.bhd #nav .primary-menu > li.hover > a,
	#header.bhd #nav .primary-menu > li.current-menu-item > a { color: var(--bhd-purple); }
	#header.bhd #nav .primary-menu > li.menu-sale > a,
	#header.bhd #nav .primary-menu > li.menu-sale > a font { color: var(--bhd-purple) !important; }

	/* Mega menu panel: full width under the bar, same idea as the mobile accordion -
	   each column is a category with its sub-categories under it. */
	#header.bhd #nav .submenu-holder {
		top: 100%;
		padding: 36px max(clamp(32px, 4vw, 80px), calc((100% - 1760px) / 2 + clamp(32px, 4vw, 80px))) 40px;
		background: #fff;
		border-top: 1px solid var(--bhd-line);
		border-bottom: 1px solid var(--bhd-line);
		box-shadow: 0 18px 30px -24px rgba(45, 22, 64, .35);
		gap: 40px;
	}
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu { gap: 28px 40px; }
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu > li { line-height: 1.4; }
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu > li > a {
		font-family: inherit;
		font-size: 17px;
		font-weight: 400;
		color: #000;
		margin-bottom: 14px;
		padding-bottom: 8px;
		display: block;
		border-bottom: 1px solid var(--bhd-line);
	}
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu > li > a::after { display: none; }
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu > li > a:hover { color: var(--bhd-purple); font-weight: 400; }
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu .sub-menu > li { width: 100%; }
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu .sub-menu > li > a {
		font-family: inherit;
		font-size: 15px;
		font-weight: 300;
		line-height: 2;
		color: #000;
		transition: color .25s ease;
	}
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu .sub-menu > li > a:hover { color: var(--bhd-purple); font-weight: 300; }
	#header.bhd #nav .primary-menu .submenu-holder > .sub-menu .sub-menu > li > a::after { background: var(--bhd-purple); }
	/* Third level (e.g. under "שרשראות מגן דוד") lines up with the second (no indent). */
	#header.bhd #nav .primary-menu .submenu-holder .sub-menu .sub-menu .sub-menu { padding: 0; margin: 0; }
	#header.bhd #nav .primary-menu .submenu-holder .sub-menu .sub-menu .sub-menu > li { width: 100%; padding: 0; margin: 0; }

	/* Image banners (menu items with an image) */
	#header.bhd #nav .menu-banner-row .banner-text { font-family: inherit; font-size: 17px; font-weight: 400; color: #000; }
	#header.bhd #nav .menu-banner-row .menu-banner .shop-text { font-family: inherit; font-size: 15px; font-weight: 300; color: #000; }
	#header.bhd #nav .menu-banner-row .menu-banner .shop-text:hover { color: var(--bhd-purple); }
}

@media (prefers-reduced-motion: reduce) {
	.bhd-announce__item,
	.bhd-bar__icons { transition: none; }
}

/* ---------- Under the header on every screen size ---------- */
/* Wishlist and mini cart, every screen size: slide in from the left, under the header
   (the old 40px offset matched the old header). The !important pair beats the old
   product-page rules that force these panels to the right. */
#header.bhd .header-mini-cart,
#header.bhd .header-wishlist-box {
	top: var(--bhd-bottom, 96px);
	margin-top: 0;
	left: 0;
	right: auto;
	transform: translateX(-100%) !important;
	border: 0;
	border-right: 1px solid var(--bhd-line);
	overscroll-behavior: contain;
}
.mini_cart_active #header.bhd .header-mini-cart,
.wishlist_active #header.bhd .header-wishlist-box { transform: translateX(0) !important; opacity: 1; visibility: visible; }

/* Product page "add to cart" bar (tablet and desktop) and the category filter bar:
   stick right under the header. (The filter bar's script sets its top to the full
   header height; the new header is shorter once scrolled.) On phones the product bar
   stays at the bottom of the screen. */
@media (min-width: 768px) {
	/* margin-top: the old rule adds the admin-bar height, already inside --bhd-bottom. */
	body:has(#header.bhd) .single-product-sticky-wrap { top: var(--bhd-bottom, 0px); margin-top: 0; }
}
body:has(#header.bhd) .filter-container.fix-category { top: var(--bhd-bottom, 0px) !important; margin-top: 0 !important; }

/* Search, menu, wishlist and cart open above everything: hide the product bar meanwhile. */
.header_search_active .single-product-sticky-wrap,
.nav-active .single-product-sticky-wrap,
.wishlist_active .single-product-sticky-wrap,
.mini_cart_active .single-product-sticky-wrap { visibility: hidden !important; opacity: 0 !important; }
