/* ==== Custom Header Builder — Frontend Styles ==== */

/* --- Sticky Header --- */
.chb-sticky-header {
	transition: all .3s ease;
	width: 100%;
	z-index: 999;
}
.chb-sticky-header.chb-is-fixed {
	position: fixed !important;
	top: 0;
	left: 0;
}
.chb-sticky-header.chb-is-stuck {
	transition: all .3s ease;
}
.chb-sticky-header.chb-shadow-on {
	box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.chb-sticky-header.chb-hide-header {
	transform: translateY(-100%);
}
.chb-sticky-placeholder { display: none; }
.chb-sticky-header.chb-is-fixed + .chb-sticky-placeholder { display: block; }

/* --- Mega Menu --- */
.chb-mega-menu-wrap { position: relative; }
.chb-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.chb-menu-vertical .chb-menu { flex-direction: column; align-items: flex-start; }
.chb-menu-item { position: relative; }
.chb-menu-item > a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; padding: 10px 0; }
.chb-caret { font-size: 10px; }

.chb-submenu {
	list-style: none; margin: 0; padding: 8px 0;
	position: absolute; top: 100%; left: 0; min-width: 220px;
	background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: all .25s ease; z-index: 50;
}
.chb-menu-item.chb-has-dropdown:hover > .chb-submenu {
	opacity: 1; visibility: visible; transform: translateY(0);
}
.chb-submenu li a { display: block; padding: 8px 18px; text-decoration: none; }
.chb-submenu-sub { position: absolute; top: 0; left: 100%; min-width: 200px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); list-style: none; margin: 0; padding: 8px 0; opacity: 0; visibility: hidden; }
.chb-submenu li:hover > .chb-submenu-sub { opacity: 1; visibility: visible; }

.chb-mega-panel {
	position: absolute; top: 100%; left: 0; width: 100vw;
	max-width: 1200px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.14);
	padding: 30px; opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: all .25s ease; z-index: 60;
}
.chb-has-mega:hover > .chb-mega-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.chb-mega-placeholder { color: #888; font-style: italic; }

.chb-anim-fade .chb-submenu, .chb-anim-fade .chb-mega-panel { transform: none; }
.chb-anim-none .chb-submenu, .chb-anim-none .chb-mega-panel { transition: none; }

/* --- Mini Cart --- */
.chb-cart-widget { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.chb-cart-icon { position: relative; display: inline-flex; }
.chb-cart-count {
	position: absolute; top: -8px; right: -10px; min-width: 16px; height: 16px;
	border-radius: 50%; background: #e63946; color: #fff; font-size: 10px;
	line-height: 16px; text-align: center; padding: 0 3px;
}
.chb-cart-dropdown {
	position: absolute; top: 100%; right: 0; width: 320px; background: #fff;
	box-shadow: 0 12px 30px rgba(0,0,0,.14); padding: 16px; z-index: 70;
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s ease;
}
.chb-hover-dropdown:hover .chb-cart-dropdown,
.chb-cart-widget.chb-open .chb-cart-dropdown {
	opacity: 1; visibility: visible; transform: translateY(0);
}

/* --- Off-canvas Mobile Menu --- */
.chb-hamburger { width: 26px; height: 20px; position: relative; background: none; border: 0; cursor: pointer; padding: 0; }
.chb-hamburger span { position: absolute; left: 0; width: 100%; height: 2px; background: #222; transition: all .25s ease; }
.chb-hamburger span:nth-child(1) { top: 0; }
.chb-hamburger span:nth-child(2) { top: 9px; }
.chb-hamburger span:nth-child(3) { top: 18px; }

.chb-offcanvas-panel {
	position: fixed; top: 0; width: 320px; max-width: 85vw; height: 100vh;
	background: #fff; z-index: 9999; padding: 24px; overflow-y: auto;
	transition: transform .3s ease; box-shadow: 0 0 30px rgba(0,0,0,.2);
}
.chb-side-left { left: 0; transform: translateX(-100%); }
.chb-side-right { right: 0; transform: translateX(100%); }
.chb-offcanvas-panel.chb-open { transform: translateX(0); }
.chb-offcanvas-close { position: absolute; top: 16px; right: 16px; background: none; border: 0; font-size: 26px; cursor: pointer; }
.chb-offcanvas-menu { list-style: none; margin: 40px 0 0; padding: 0; }
.chb-offcanvas-menu li a { display: block; padding: 12px 0; border-bottom: 1px solid #eee; text-decoration: none; }
.chb-offcanvas-overlay {
	position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9998;
	opacity: 0; visibility: hidden; transition: all .25s ease;
}
.chb-offcanvas-overlay.chb-open { opacity: 1; visibility: visible; }
.chb-offcanvas-cart { display: inline-block; margin-top: 20px; padding: 10px 18px; background: #222; color: #fff; text-decoration: none; }

/* --- Search --- */
.chb-search-icon { background: none; border: 0; cursor: pointer; display: inline-flex; }
.chb-search-toggle .chb-search-panel {
	position: absolute; top: 100%; right: 0; width: 320px; background: #fff;
	box-shadow: 0 12px 30px rgba(0,0,0,.14); padding: 14px; z-index: 70;
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s ease;
}
.chb-search-toggle .chb-search-panel.chb-open { opacity: 1; visibility: visible; transform: translateY(0); }
.chb-search-form { display: flex; gap: 6px; }
.chb-search-input { flex: 1; padding: 8px 10px; border: 1px solid #ddd; }
.chb-search-submit { padding: 8px 14px; border: 0; background: #222; color: #fff; cursor: pointer; }
.chb-search-results { margin-top: 10px; max-height: 320px; overflow-y: auto; }
.chb-search-result-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: inherit; }
.chb-search-result-item img { width: 40px; height: 40px; object-fit: cover; }

@media (max-width: 768px) {
	.chb-mega-panel { position: static; width: 100%; box-shadow: none; padding: 12px; }
	.chb-menu-item.chb-has-dropdown:hover > .chb-submenu { position: static; box-shadow: none; }
}
