/**
 * Ghost Note — brand layer.
 *
 * Site chrome only: top bar, header, browse/search bar, footer, and the
 * WooCommerce touches that carry the palette. Page content is Elementor's
 * territory and is deliberately untouched here.
 *
 * Palette tokens live in main.css :root.
 */

/* -------------------------------------------------------------------------
 * Shared bits
 * ---------------------------------------------------------------------- */

.gn-icon {
	width: 20px;
	height: 20px;
	display: block;
	flex: none;
}

.gn-header a {
	text-decoration: none;
	color: inherit;
}

/* -------------------------------------------------------------------------
 * Top bar
 * ---------------------------------------------------------------------- */

/*
 * The header is taken OUT OF FLOW and its height reserved by a spacer.
 *
 * It was previously `position: sticky`, which keeps it in flow — and because
 * the browse row collapses when pinned, the header's height changed from 227px
 * to 178px mid-scroll. That shortened the document, so the browser clawed the
 * scroll position back (~42px) to compensate, and scrolling visibly fought the
 * user. Out of flow, collapsing the row costs the document nothing.
 *
 * Hiding the top bar is a transform rather than a height change, so it runs on
 * the compositor and never triggers layout.
 */
.gn-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 90;
	padding-bottom: 26px;
	transform: translateY(0);
	transition: transform var(--gn-dur) var(--gn-ease);
	will-change: transform;
}

.gn-header.is-stuck {
	transform: translateY(calc(0px - var(--gn-topbar-h, 42px)));
}

.admin-bar .gn-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .gn-header {
		top: 46px;
	}
}

/*
 * Anchor-link offset.
 *
 * The header is fixed, so an in-page jump would otherwise land its target
 * underneath the bar. scroll-margin-top pads the landing position by the
 * header's PINNED height; animations.js measures that and overwrites the
 * fallback below. Wrapped in :where() so it carries zero specificity and any
 * element can override it, and scoped to [id] because that is what anchors
 * target. scroll-margin has no rendering cost — it only applies when an
 * element is actually scrolled into view.
 */
:where([id]) {
	scroll-margin-top: var(--gn-anchor-offset, 104px);
}

/* Elementor's Menu Anchor widget is the usual source of in-page links. */
:where(.elementor-menu-anchor) {
	scroll-margin-top: var(--gn-anchor-offset, 104px);
}

/*
 * Applied only while JS measures the header. Suppresses transitions on the
 * header AND its children, so the collapsing search row cannot be caught
 * mid-animation and yield a too-tall measurement.
 */
.gn-header.gn-measuring,
.gn-header.gn-measuring * {
	transition: none !important;
}

/* Keeps page content clear of the fixed header. JS sets the exact value. */
.gn-header__spacer {
	height: var(--gn-header-h, 227px);
}

@media (max-width: 900px) {
	.gn-header__spacer {
		height: var(--gn-header-h, 212px);
	}
}

@media (max-width: 680px) {
	.gn-header__spacer {
		height: var(--gn-header-h, 196px);
	}
}

.gn-topbar {
	background: var(--gn-surface);
	border-bottom: 1px solid var(--gn-border);
	font-size: 0.82rem;
}

.gn-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 42px;
}

.gn-topbar__phone {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--gn-secondary);
	font-weight: 600;
}

.gn-topbar__phone .gn-icon {
	width: 15px;
	height: 15px;
	color: var(--gn-accent);
}

.gn-topbar__social {
	display: flex;
	align-items: center;
	gap: 14px;
}

.gn-topbar__social a {
	display: block;
	color: var(--gn-secondary);
	transition: color 0.2s ease;
}

.gn-topbar__social a:hover {
	color: var(--gn-accent);
}

.gn-topbar__social .gn-icon {
	width: 17px;
	height: 17px;
}

/* -------------------------------------------------------------------------
 * Main header row: logo left, nav centre, actions right
 * ---------------------------------------------------------------------- */

/*
 * Floating header bar.
 *
 * The bar detaches from the page edges and rides as a rounded card, sticking
 * to the top of the viewport on scroll. `position: sticky` does the work, so
 * the layout never jumps the way a `position: fixed` header does; the only JS
 * is an IntersectionObserver that adds .is-stuck for the deeper shadow.
 */
.gn-header__main {
	position: relative;
	z-index: 2;
	width: calc(100% - 40px);
	max-width: var(--gn-container-width);
	margin: 14px auto 0;
	border-radius: var(--gn-radius);
	background: var(--gn-bg);
	box-shadow: var(--gn-ring);
	transition: box-shadow var(--gn-dur) var(--gn-ease);
}

.gn-header.is-stuck .gn-header__main {
	box-shadow: var(--gn-ring-hover);
}

/*
 * Collapse the browse/search row once pinned, so the sticky area stays as
 * compact as the reference's single bar instead of eating 126px of viewport.
 */
/*
 * Clip rather than fade. A cross-fade left the half-transparent search bar
 * ghosting over the hero for the length of the transition.
 */
.gn-header__browse {
	/*
	 * MUST stay visible at rest: the Browse Categories dropdown is a descendant
	 * and hangs below this row, so `overflow: hidden` here clips it away
	 * entirely. Clipping is applied only while the row is collapsed.
	 */
	overflow: visible;
	/*
	 * Only a transition endpoint — it must comfortably EXCEED the natural
	 * height or the row is clipped. The stacked mobile layout is ~108px, so a
	 * 90px cap silently cut the search field off.
	 */
	max-height: 140px;
	transition: max-height var(--gn-dur) var(--gn-ease),
		margin-top var(--gn-dur) var(--gn-ease);
}

.gn-header.is-stuck .gn-header__browse {
	overflow: hidden;
	max-height: 0;
	margin-top: 0;
	pointer-events: none;
}

/* The bar provides its own gutter, so the inner container drops its own. */
.gn-header__main .gn-header__inner {
	max-width: none;
	padding-inline: 26px;
}

.gn-header__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 24px;
	min-height: 74px;
}

.gn-header__brand .custom-logo-link img,
.gn-header__brand img {
	max-height: 54px;
	width: auto;
}

.gn-header__brand .site-title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: var(--gn-tracking-tight);
	color: var(--gn-text);
}

.gn-header__brand .site-description {
	display: none;
}

/* Centre nav */
.gn-header__nav {
	justify-self: center;
}

.gn-header__nav ul {
	display: flex;
	align-items: center;
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gn-header__nav a {
	position: relative;
	display: block;
	padding: 6px 0;
	font-family: var(--gn-font);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: var(--gn-tracking-tight);
	color: var(--gn-text);
	transition: color var(--gn-dur-micro) ease-in-out;
}

.gn-header__nav a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background: var(--gn-accent);
	transition: width 0.25s ease;
}

.gn-header__nav a:hover {
	color: var(--gn-accent);
}

.gn-header__nav a:hover::after,
.gn-header__nav .current-menu-item > a::after {
	width: 100%;
}

/* Sub menus */
.gn-header__nav li {
	position: relative;
}

.gn-header__nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 60;
	display: block;
	min-width: 210px;
	flex-direction: column;
	gap: 0;
	padding: 8px 0;
	background: #fff;
	border: 0;
	border-radius: var(--gn-radius);
	box-shadow: var(--gn-ring-hover);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.gn-header__nav li:hover > .sub-menu,
.gn-header__nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.gn-header__nav .sub-menu a {
	padding: 8px 18px;
	font-size: 0.9rem;
}

.gn-header__nav .sub-menu a::after {
	content: none;
}

/* Action icons */
.gn-header__actions {
	display: flex;
	align-items: center;
	gap: 18px;
	justify-self: end;
	/* Never let a long site name squeeze these; they collapse to zero width. */
	flex: 0 0 auto;
}

.gn-action,
.gn-header__toggle {
	flex: 0 0 auto;
}

.gn-action {
	position: relative;
	display: flex;
	align-items: center;
	color: var(--gn-secondary);
	transition: color 0.2s ease;
}

.gn-action:hover {
	color: var(--gn-accent);
}

.gn-action .gn-icon {
	width: 21px;
	height: 21px;
}

.gn-action__count {
	position: absolute;
	top: -7px;
	right: -9px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--gn-accent);
	color: #fff;
	font-size: 0.66rem;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.gn-header__toggle {
	display: none;
	width: 24px;
	height: 24px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--gn-text);
	cursor: pointer;
}

.gn-header__toggle .gn-icon {
	width: 24px;
	height: 24px;
}

/* -------------------------------------------------------------------------
 * Browse + search row
 * ---------------------------------------------------------------------- */

.gn-header__browse {
	width: calc(100% - 40px);
	max-width: var(--gn-container-width);
	margin: 14px auto 0;
	background: var(--gn-bg);
}

.gn-header__browse .gn-browse__inner {
	max-width: none;
	padding-inline: 0;
}

.gn-browse__inner {
	display: flex;
	align-items: stretch;
	gap: 0;
	min-height: 56px;
}

.gn-browse {
	position: relative;
	flex: none;
}

.gn-browse__toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 100%;
	min-height: 52px;
	padding: 0 26px;
	background: var(--gn-secondary);
	border: 0;
	border-radius: var(--gn-btn-radius, 999px) 0 0 var(--gn-btn-radius, 999px);
	color: #fff;
	font-family: var(--gn-font);
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: var(--gn-tracking-tight);
	cursor: pointer;
	white-space: nowrap;
	transition: background var(--gn-dur-micro) ease-in-out;
}

.gn-browse__toggle:hover {
	background: #0d2a4d;
}

.gn-browse__list {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 70;
	min-width: 260px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 0;
	border-radius: var(--gn-radius);
	box-shadow: var(--gn-ring-hover);
}

.gn-browse__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 20px;
	font-size: 0.9rem;
	color: var(--gn-secondary);
	transition: background 0.15s ease, color 0.15s ease;
}

.gn-browse__list a:hover {
	background: var(--gn-surface);
	color: var(--gn-accent);
}

.gn-browse__count {
	color: var(--gn-muted);
	font-size: 0.78rem;
}

/* Search */
.gn-search {
	display: flex;
	align-items: stretch;
	flex: 1;
	min-width: 0;
	border: 1px solid var(--gn-border);
	border-left: 0;
	border-radius: 0 var(--gn-btn-radius, 999px) var(--gn-btn-radius, 999px) 0;
	overflow: hidden;
}

.gn-search__input {
	flex: 1;
	min-width: 0;
	padding: 0 24px;
	border: 0;
	background: transparent;
	font-size: 0.92rem;
	color: var(--gn-secondary);
}

.gn-search__input::placeholder {
	color: var(--gn-muted);
}

.gn-search__input:focus {
	outline: none;
}

.gn-search__cat {
	position: relative;
	display: flex;
	align-items: center;
	border-left: 1px solid var(--gn-border);
}

.gn-search__select {
	appearance: none;
	height: 100%;
	padding: 0 38px 0 18px;
	border: 0;
	background: transparent;
	font-size: 0.88rem;
	color: var(--gn-secondary);
	cursor: pointer;
}

.gn-search__select:focus {
	outline: none;
}

.gn-search__cat .gn-icon {
	position: absolute;
	right: 12px;
	width: 16px;
	height: 16px;
	pointer-events: none;
	color: var(--gn-muted);
}

.gn-search__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	border: 0;
	border-left: 1px solid var(--gn-border);
	background: transparent;
	color: var(--gn-secondary);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.gn-search__submit:hover {
	background: var(--gn-accent);
	color: #fff;
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */

.site-footer {
	margin-top: 72px;
	padding: 0;
	background: var(--gn-secondary);
	color: rgba(255, 255, 255, 0.72);
}

.site-footer a {
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	transition: color 0.2s ease;
}

.site-footer a:hover {
	color: var(--gn-accent);
}

.gn-footer__widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 40px;
	padding: 56px 0 40px;
}

.site-footer .widget-title,
.site-footer h2,
.site-footer h3 {
	margin: 0 0 16px;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
}

.site-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer li + li {
	margin-top: 10px;
}

.gn-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding: 22px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.85rem;
}

.gn-footer__bottom .site-info {
	margin: 0;
	opacity: 1;
}

.footer-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
}

.footer-navigation li + li {
	margin-top: 0;
}

/* -------------------------------------------------------------------------
 * WooCommerce accents
 * ---------------------------------------------------------------------- */

/* Buttons now live in buttons.css so the pill recipe is defined in one
 * place. Only non-button WooCommerce accents remain here. */

.woocommerce ul.products li.product .price,
.woocommerce div.product p.price {
	color: var(--gn-secondary);
	font-weight: 700;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--gn-secondary);
}

.woocommerce span.onsale {
	background: var(--gn-accent);
	border-radius: var(--gn-radius);
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.gn-header__nav ul {
		gap: 20px;
	}

	.gn-browse__toggle {
		padding: 0 20px;
	}
}

/*
 * Only drop the label where the browse button and search genuinely compete for
 * width. Above this it stays labelled — an unlabelled dark block reads as a
 * dead element.
 */
@media (max-width: 560px) and (min-width: 681px) {
	.gn-browse__toggle span {
		display: none;
	}
}

@media (max-width: 900px) {
	.gn-header__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		min-height: 70px;
	}

	.gn-header__toggle {
		display: block;
	}

	.gn-header__nav {
		order: 3;
		grid-column: 1 / -1;
		justify-self: stretch;
		display: none;
		border-top: 1px solid var(--gn-border);
	}

	.gn-header__nav.is-open {
		display: block;
	}

	.gn-header__nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 8px 0;
	}

	.gn-header__nav .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		border: 0;
		box-shadow: none;
		padding-left: 14px;
	}

	.gn-topbar__phone span {
		font-size: 0.78rem;
	}
}

@media (max-width: 680px) {
	.gn-header__main,
	.gn-header__browse {
		width: calc(100% - 24px);
	}

	/*
	 * Reclaim horizontal space so the brand name fits on one line instead of
	 * being ellipsised: tighter gutters, tighter icon spacing, smaller type.
	 * The ellipsis remains only as a last resort for very long names.
	 */
	.gn-header__brand {
		min-width: 0;
	}

	.gn-header__brand .site-title {
		font-size: 0.95rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.gn-header__main .gn-header__inner {
		padding-inline: 16px;
	}

	.gn-header__inner {
		gap: 10px;
		min-height: 62px;
	}

	.gn-header__actions {
		gap: 13px;
	}

	.gn-browse__inner {
		flex-direction: column;
		gap: 10px;
		padding-block: 12px;
	}

	/*
	 * The label is hidden between 1024px and 680px where the bar is tight, but
	 * once the button goes full width an unlabelled dark bar is meaningless —
	 * bring the text back.
	 */
	.gn-browse__toggle {
		width: 100%;
		min-height: 46px;
		justify-content: center;
		border-radius: var(--gn-btn-radius, 999px);
	}

	.gn-browse__toggle span {
		display: inline;
	}

	.gn-browse__list {
		width: 100%;
	}

	/* No longer butted against the browse button, so it closes its own shape. */
	.gn-search {
		border-left: 1px solid var(--gn-border);
		border-radius: var(--gn-btn-radius, 999px);
	}

	.gn-search__cat {
		display: none;
	}

	.gn-search__input {
		padding-inline: 22px;
	}

	.gn-header__browse {
		max-height: 200px;
	}

	.gn-topbar__inner {
		min-height: 38px;
	}
}
