/**
 * Starline Shop - Header Behavior v4.7
 * - Restores the three-line hamburger and responsive one-line text inside the mobile Categories button.
 * - Hides the full phone + marquee announcement strip while scrolling down.
 * - Reveals the announcement strip while scrolling up.
 * - Smart top-strip behavior applies to mobile, tablet, laptop and desktop.
 */

/* =========================================================
   Smart announcement strip - ALL DEVICES
========================================================= */
/* Keep the strip's normal-flow height in both states. Collapsing it changes
 * scrollY via scroll anchoring and can reverse the direction detector. */
.starline-top-strip {
    overflow: hidden !important;
    transition: transform .24s cubic-bezier(.22, .61, .36, 1),
                opacity .16s ease !important;
    will-change: transform, opacity;
}
.site-header {
    transition: top .24s cubic-bezier(.22, .61, .36, 1) !important;
}
body.starline-mobile-top-strip-hidden .starline-top-strip {
    opacity: 0 !important;
    transform: translate3d(0, -100%, 0) !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
/* Sticky offsets change without removing any document-flow space. */
body.starline-mobile-top-strip-hidden .site-header {
    top: 0 !important;
}

/* WordPress admin-bar offsets: 32px desktop/tablet, 46px narrow screens. */
body.admin-bar.starline-mobile-top-strip-hidden .site-header {
	top: 32px !important;
}

@media (max-width: 782px) {
	body.admin-bar.starline-mobile-top-strip-hidden .site-header {
		top: 46px !important;
	}
}

/* =========================================================
   Mobile Categories button hamburger - PHONE ONLY
========================================================= */
@media (max-width: 767px) {
	.header-main .header-search {
		max-height: 80px !important;
		overflow: hidden !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: translateY(0) !important;
		transition: max-height .22s ease, opacity .16s ease, transform .22s ease, margin .22s ease !important;
	}

	body.starline-mobile-search-hidden .header-main .header-search {
		max-height: 0 !important;
		margin-top: -16px !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		transform: translateY(-8px) !important;
	}

	body.starline-mobile-search-hidden .header-main {
		row-gap: 0 !important;
	}

	/*
	 * Exact color/size/display values are injected from Header > Category Button.
	 * This selector wins over the older mobile drawer reset that hid ::before
	 * while the category drawer was closed.
	 */
	#starline-category-menu.header-category-menu:not([open]) > .category-menu-button {
		position: relative !important;
		align-items: center !important;
		justify-content: flex-start !important;
	}

	#starline-category-menu.header-category-menu:not([open]) > .category-menu-button::after {
		display: none !important;
		content: none !important;
	}

	#starline-category-menu > .category-menu-button .category-title {
		min-width: 0 !important;
		flex: 1 1 auto !important;
		white-space: nowrap !important;
		word-break: normal !important;
		overflow-wrap: normal !important;
		line-height: 1.08 !important;
	}

	#starline-category-menu > .category-menu-button .category-arrow {
		margin-left: auto !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.starline-top-strip,
	.site-header {
		transition: none !important;
	}
}
