/**
 * .smart-header：向下滚动不固顶；离开顶部后向上滚动时再 fixed 显示。
 */
/* 覆盖 Elementor/主题里对头部的 sticky/fixed，由本脚本接管 */
.smart-header {
	position: relative !important;
	z-index: 10050;
	width: 100%;
	box-sizing: border-box;
	transition: transform 0.32s ease, box-shadow 0.32s ease;
}

/*
 * fixed 时必须 top:0 贴视口顶。勿在基础 .smart-header 上写 top:auto !important，
 * 否则会压过本条的 top:0（fixed + top:auto 会按静态位置排版，看起来像「离顶一个头部高度」）。
 */
.smart-header.smart-header--fixed {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100%;
	box-sizing: border-box;
}

.smart-header.smart-header--fixed.smart-header--hidden {
	transform: translate3d(0, -100%, 0);
	pointer-events: none;
}

.smart-header.smart-header--fixed:not(.smart-header--hidden) {
	transform: translate3d(0, 0, 0);
	box-shadow: 0 4px 24px rgba(15, 17, 20, 0.08);
}

/* fixed 且可见时给 body 垫高，避免内容跳到标题下面 */
body.smart-header-pad {
	padding-top: var(--smart-header-h, 0px);
	transition: padding-top 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
	.smart-header,
	body.smart-header-pad {
		transition-duration: 0.01ms;
	}
}
