/**
 * HiGuppy mobile header fix
 *
 * Fixes the expanded pill menu on mobile: keeps logo + actions on one row,
 * shows nav links in a compact dropdown panel, and overrides global touch-target
 * rules that were stretching the header.
 *
 * Loaded after hg-shell.css and higuppy-responsive.css.
 *
 * @package HiGuppy
 */

@media (max-width: 900px) {
	/* Blog/About keep a sky top band; do not force navy under the header pill. */
	body.higuppy-site-shell:not(.hg-blog-active):not(.hg-about-active),
	body.woocommerce-shop,
	body.post-type-archive-product,
	body.tax-product_cat,
	body.tax-product_tag,
	body.single-product {
		background: #061f3f !important;
	}

	body.higuppy-site-shell nav.hg-nav,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav,
	body.woocommerce-shop nav.hg-nav,
	body.woocommerce-shop nav#hgSiteNav.hg-nav,
	body.post-type-archive-product nav.hg-nav,
	body.post-type-archive-product nav#hgSiteNav.hg-nav,
	body.tax-product_cat nav.hg-nav,
	body.tax-product_cat nav#hgSiteNav.hg-nav,
	body.tax-product_tag nav.hg-nav,
	body.tax-product_tag nav#hgSiteNav.hg-nav,
	body.single-product nav.hg-nav,
	body.single-product nav#hgSiteNav.hg-nav,
	body.hg-contact-active nav.hg-nav,
	body.hg-contact-active nav#hgSiteNav.hg-nav {
		position: sticky;
		top: 8px;
		z-index: 1001;
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: flex-start !important;
		gap: 6px !important;
		width: min(100% - 20px, 1160px) !important;
		margin: 8px auto 12px !important;
		padding: 8px 10px 8px 12px !important;
		min-height: 56px !important;
		border-radius: 18px !important;
		background: rgba(255, 255, 255, 0.88) !important;
		backdrop-filter: blur(14px) saturate(1.12) !important;
		-webkit-backdrop-filter: blur(14px) saturate(1.12) !important;
		border: 1px solid rgba(255, 255, 255, 0.82) !important;
		box-shadow: 0 10px 28px rgba(8, 39, 71, 0.08) !important;
		color: #082747 !important;
		grid-template-columns: none !important;
	}

	body.hg-homepage-active nav.hg-nav,
	body.hg-homepage-active nav#hgSiteNav.hg-nav,
	body.home.higuppy-site-shell nav.hg-nav,
	body.home.higuppy-site-shell nav#hgSiteNav.hg-nav {
		position: sticky;
		z-index: 1001;
		background: rgba(255, 255, 255, 0.72) !important;
		backdrop-filter: blur(14px) saturate(1.12);
		-webkit-backdrop-filter: blur(14px) saturate(1.12);
		border: 1px solid rgba(255, 255, 255, 0.78) !important;
		box-shadow: 0 10px 28px rgba(8, 39, 71, 0.08) !important;
		margin: 8px auto 0 !important;
	}

	body.higuppy-site-shell nav.hg-nav::before,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav::before,
	body.woocommerce-shop nav.hg-nav::before,
	body.post-type-archive-product nav.hg-nav::before,
	body.tax-product_cat nav.hg-nav::before,
	body.tax-product_tag nav.hg-nav::before,
	body.single-product nav.hg-nav::before,
	body.hg-contact-active nav.hg-nav::before {
		display: none !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-logo,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-logo,
	body.woocommerce-shop nav.hg-nav .hg-logo,
	body.single-product nav.hg-nav .hg-logo,
	body.hg-contact-active nav.hg-nav .hg-logo {
		flex: 0 0 auto;
		min-width: 0;
	}

	body.higuppy-site-shell nav.hg-nav .hg-logo-img,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-logo-img,
	body.woocommerce-shop nav.hg-nav .hg-logo-img,
	body.single-product nav.hg-nav .hg-logo-img,
	body.hg-contact-active nav.hg-nav .hg-logo-img {
		height: 34px !important;
		max-width: 128px !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-actions,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-actions,
	body.woocommerce-shop nav.hg-nav .hg-actions,
	body.single-product nav.hg-nav .hg-actions,
	body.hg-contact-active nav.hg-nav .hg-actions {
		display: flex !important;
		align-items: center !important;
		gap: 2px !important;
		margin-left: auto !important;
		flex: 0 0 auto;
	}

	body.higuppy-site-shell nav.hg-nav .hg-action-btn,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-action-btn,
	body.woocommerce-shop nav.hg-nav .hg-action-btn,
	body.single-product nav.hg-nav .hg-action-btn,
	body.hg-contact-active nav.hg-nav .hg-action-btn {
		width: 40px !important;
		height: 40px !important;
		min-width: 40px !important;
		min-height: 40px !important;
		display: inline-grid !important;
		place-items: center !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu-toggle,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu-toggle,
	body.woocommerce-shop nav.hg-nav .hg-menu-toggle,
	body.single-product nav.hg-nav .hg-menu-toggle,
	body.hg-contact-active nav.hg-nav .hg-menu-toggle {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		width: 40px !important;
		height: 40px !important;
		min-width: 40px !important;
		min-height: 40px !important;
		margin-left: 2px !important;
		flex: 0 0 auto;
		font-size: 0 !important;
		line-height: 0 !important;
		color: #082747 !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu-toggle::before,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu-toggle::before,
	body.woocommerce-shop nav.hg-nav .hg-menu-toggle::before,
	body.single-product nav.hg-nav .hg-menu-toggle::before,
	body.hg-contact-active nav.hg-nav .hg-menu-toggle::before {
		content: "☰";
		font-size: 22px;
		line-height: 1;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu-toggle[aria-expanded="true"]::before,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu-toggle[aria-expanded="true"]::before,
	body.woocommerce-shop nav.hg-nav .hg-menu-toggle[aria-expanded="true"]::before,
	body.single-product nav.hg-nav .hg-menu-toggle[aria-expanded="true"]::before,
	body.hg-contact-active nav.hg-nav .hg-menu-toggle[aria-expanded="true"]::before {
		content: "✕";
		font-size: 18px;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu,
	body.woocommerce-shop nav.hg-nav .hg-menu,
	body.single-product nav.hg-nav .hg-menu,
	body.hg-contact-active nav.hg-nav .hg-menu {
		position: absolute !important;
		top: calc(100% + 8px) !important;
		left: 0 !important;
		right: 0 !important;
		order: unset !important;
		display: none !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 8px !important;
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 2px !important;
		background: #fff !important;
		border: 1px solid rgba(8, 39, 71, 0.08) !important;
		border-radius: 16px !important;
		box-shadow: 0 16px 40px rgba(8, 39, 71, 0.12) !important;
	}

	body.higuppy-site-shell nav.hg-nav.is-open .hg-menu,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav.is-open .hg-menu,
	body.woocommerce-shop nav.hg-nav.is-open .hg-menu,
	body.single-product nav.hg-nav.is-open .hg-menu,
	body.hg-contact-active nav.hg-nav.is-open .hg-menu {
		display: flex !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu a,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu a,
	body.woocommerce-shop nav.hg-nav .hg-menu a,
	body.single-product nav.hg-nav .hg-menu a,
	body.hg-contact-active nav.hg-nav .hg-menu a {
		display: flex !important;
		align-items: center !important;
		justify-content: flex-start !important;
		width: 100% !important;
		min-width: 0 !important;
		min-height: 44px !important;
		padding: 10px 14px !important;
		border-radius: 10px !important;
		font-size: 15px !important;
		font-weight: 700 !important;
		color: #082747 !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu a::after,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu a::after,
	body.woocommerce-shop nav.hg-nav .hg-menu a::after,
	body.single-product nav.hg-nav .hg-menu a::after,
	body.hg-contact-active nav.hg-nav .hg-menu a::after {
		display: none !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-menu a.is-active,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-menu a.is-active,
	body.woocommerce-shop nav.hg-nav .hg-menu a.is-active,
	body.single-product nav.hg-nav .hg-menu a.is-active,
	body.hg-contact-active nav.hg-nav .hg-menu a.is-active {
		color: #ff6b4a !important;
		background: rgba(255, 107, 74, 0.08) !important;
	}

	body.hg-nav-open::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(8, 36, 71, 0.22);
		z-index: 1000;
		pointer-events: none;
	}

	body.hg-nav-open {
		overflow: hidden;
	}
}

@media (max-width: 480px) {
	body.higuppy-site-shell nav.hg-nav,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav {
		width: min(100% - 16px, 1160px) !important;
		padding: 8px !important;
	}

	body.higuppy-site-shell nav.hg-nav .hg-logo-img,
	body.higuppy-site-shell nav#hgSiteNav.hg-nav .hg-logo-img {
		height: 30px !important;
		max-width: 112px !important;
	}
}
