/* ==========================================================================
   Omega Oils — global site header (design v2)
   Announcement bar + cream main bar + mobile drawer. Mobile first; the
   desktop layout (nav in the bar, language in the announcement bar) starts
   at 1024px. Uses only tokens and components from omega-base.css.
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(251, 246, 236, 0.95);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	box-shadow: 0 4px 18px rgba(47, 33, 24, 0.06);
}

/* Logged-in admins: keep the header below the WordPress toolbar. */
body.admin-bar .site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	body.admin-bar .site-header {
		top: 0;
	}
}

/* --------------------------------------------------------------------------
   Announcement bar (forest on phones, espresso on desktop)
   -------------------------------------------------------------------------- */

.site-header__top {
	background: var(--o-forest);
	color: var(--o-white);
}

.site-header__top-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--o-space-md);
	min-height: 30px;
	padding-block: 6px;
}

.site-header__top-claim {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--o-space-xs);
	min-width: 0;
	font-family: var(--o-font-body);
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.site-header__top-claim .o-icon {
	display: none;
	font-size: 14px;
	color: var(--o-gold);
}

.site-header__top-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.site-header__top-end {
	display: none;
	align-items: center;
	gap: var(--o-space-md);
}

.site-header__top-shipping {
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	white-space: nowrap;
}

@media (min-width: 768px) {
	.site-header__top {
		background: var(--o-espresso);
	}

	.site-header__top-inner {
		justify-content: space-between;
		padding-block: 4px;
	}

	.site-header__top-claim .o-icon {
		display: inline-block;
	}

	.site-header__top-end {
		display: flex;
	}
}

/* --------------------------------------------------------------------------
   Language switch (pill in the bar on phones, gold text in the top bar)
   -------------------------------------------------------------------------- */

.site-header__lang {
	display: inline-flex;
	align-items: center;
	font-family: var(--o-font-label);
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.site-header__lang-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	min-height: 24px;
	transition: color var(--o-ease);
}

.site-header__lang-sep {
	margin-inline: 2px;
	opacity: 0.5;
	font-weight: 500;
}

/* In the main bar, left of the cart (all widths): a toggle with a sliding
   thumb under the current language (client request 2026-10-09). The thumb
   sits at --lang-i of --lang-n equal columns; omega-header.js moves it to the
   clicked language before the page changes. */
.site-header__lang--bar {
	position: relative;
	display: inline-grid;
	grid-template-columns: repeat(var(--lang-n, 2), minmax(0, 1fr));
	padding: 4px;
	border-radius: var(--o-radius-full);
	background: var(--o-surface-cream-alt);
	box-shadow: inset 0 1px 2px rgba(47, 33, 24, 0.08);
	font-size: 13px;
	line-height: 16px;
}

.site-header__lang-thumb {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 4px;
	width: calc((100% - 8px) / var(--lang-n, 2));
	border-radius: var(--o-radius-full);
	background: var(--o-forest);
	box-shadow: 0 2px 6px rgba(22, 91, 67, 0.35);
	transform: translateX(calc(100% * var(--lang-i, 0)));
	transition: transform 260ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.site-header__lang--bar .site-header__lang-item {
	position: relative;
	z-index: 1;
	min-width: 36px;
	min-height: 30px;
	padding: 0 8px;
	border-radius: var(--o-radius-full);
	color: var(--o-text-muted);
	transition: color 200ms ease;
}

.site-header__lang--bar .site-header__lang-item.is-current {
	color: var(--o-white);
}

.site-header__lang--bar a.site-header__lang-item:hover {
	color: var(--o-forest);
}

/* While switching: the thumb has moved to the clicked language */
.site-header__lang--bar.is-switching .site-header__lang-item.is-current {
	color: var(--o-text-muted);
}

.site-header__lang--bar.is-switching .site-header__lang-item.is-target {
	color: var(--o-white);
}

@media (min-width: 1024px) {
	.site-header__lang--bar {
		font-size: 14px;
	}

	.site-header__lang--bar .site-header__lang-item {
		min-width: 42px;
		min-height: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header__lang-thumb {
		transition: none;
	}
}

/* --------------------------------------------------------------------------
   Main bar
   -------------------------------------------------------------------------- */

.site-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--o-space-sm);
	height: 72px;
}

@media (min-width: 768px) {
	.site-header__inner {
		height: 80px;
	}
}

.site-header__start {
	display: flex;
	align-items: center;
	gap: var(--o-space-xs);
	justify-self: start;
}

.site-header__menu-toggle {
	margin-left: -8px;
	color: var(--o-on-surface);
}

.site-header__menu-toggle .o-icon {
	font-size: 24px;
}

/* Logo: the gold Omega Oils logo image */
.site-header__logo {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-self: center;
	text-align: center;
	min-width: 0;
}

.site-header__nav {
	display: none;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--o-space-sm);
	justify-self: end;
}

/* Cart */
.site-header__cart {
	color: var(--o-on-surface);
}

.site-header__cart-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: var(--o-radius-full);
	background: var(--o-gold);
	color: var(--o-espresso);
	font-family: var(--o-font-label);
	font-size: 10px;
	line-height: 1;
	font-weight: 700;
	box-shadow: 0 1px 2px rgba(47, 33, 24, 0.15);
}

/* Very narrow phones: slimmer language buttons so nothing overflows */
@media (max-width: 374px) {
	.site-header__lang--bar .site-header__lang-item {
		min-width: 30px;
		padding: 0 5px;
	}
}

/* --------------------------------------------------------------------------
   Desktop (1024px+): logo left, nav, actions right
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
	.site-header__inner {
		display: flex;
		justify-content: space-between;
		gap: var(--o-space-lg);
	}

	.site-header__start {
		display: none;
	}

	.site-header__logo {
		flex-direction: row;
		align-items: center;
		gap: var(--o-space-sm);
		text-align: left;
	}

	.site-header__nav {
		display: block;
	}

	.site-header__bar-list {
		display: flex;
		align-items: center;
		gap: 4px;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.site-header__bar-link {
		display: inline-flex;
		align-items: center;
		padding: 6px 16px;
		border-radius: var(--o-radius-full);
		font-family: var(--o-font-body);
		font-size: 17px;
		line-height: 24px;
		font-weight: 600;
		letter-spacing: 0.01em;
		color: var(--o-on-surface-variant);
		white-space: nowrap;
		transition: background-color var(--o-ease), color var(--o-ease);
	}

	.site-header__bar-link:hover {
		background: var(--o-surface-cream-alt);
		color: var(--o-on-surface);
	}

	.site-header__bar-link.is-current {
		background: var(--o-forest);
		color: var(--o-white);
		font-weight: 700;
	}

	.site-header__drawer {
		display: none !important;
	}
}

@media (min-width: 1024px) and (max-width: 1199px) {
	.site-header__bar-list {
		gap: 0;
	}

	.site-header__bar-link {
		padding-inline: 10px;
		font-size: 16px;
	}
}

/* --------------------------------------------------------------------------
   Mobile drawer (below 1024px)
   -------------------------------------------------------------------------- */

/* The header's backdrop-filter makes it the containing block, so the drawer
   is positioned from the header's bottom edge and sized to the viewport. */
.site-header__drawer {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: calc(100vh - var(--site-header-bottom, 102px));
	height: calc(100dvh - var(--site-header-bottom, 102px));
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--o-surface-cream);
	border-top: var(--o-hairline);
}

.site-header__drawer[hidden] {
	display: none;
}

.site-header__drawer-inner {
	display: flex;
	flex-direction: column;
	gap: var(--o-space-lg);
	padding-block: var(--o-space-lg) var(--o-space-xl);
}

.site-header__drawer-list,
.site-header__drawer-extras {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__drawer-list {
	gap: var(--o-space-xs);
}

.site-header__drawer-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--o-space-sm);
	min-height: 56px;
	padding: var(--o-space-sm) var(--o-space-md) var(--o-space-sm) var(--o-space-lg);
	border-radius: var(--o-radius-lg);
	background: var(--o-white);
	box-shadow: var(--o-shadow-card);
	color: var(--o-espresso);
	font-family: var(--o-font-heading);
	font-size: 20px;
	line-height: 28px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	transition: background-color var(--o-ease), color var(--o-ease);
}

.site-header__drawer-link .o-icon {
	color: var(--o-text-muted);
}

.site-header__drawer-link:hover {
	background: var(--o-surface-cream-alt);
}

.site-header__drawer-link.is-current {
	background: var(--o-forest);
	color: var(--o-white);
}

.site-header__drawer-link.is-current .o-icon {
	color: var(--o-gold);
}

.site-header__drawer-extras {
	padding: var(--o-space-xs) 0;
	border-top: var(--o-hairline);
}

.site-header__drawer-extra {
	display: flex;
	align-items: center;
	gap: var(--o-space-sm);
	min-height: 48px;
	padding-inline: var(--o-space-sm);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	color: var(--o-espresso);
}

.site-header__drawer-extra .o-icon {
	color: var(--o-gold);
}

.site-header__drawer-extra:hover {
	color: var(--o-forest);
}

.site-header__drawer-note {
	display: flex;
	align-items: center;
	gap: var(--o-space-sm);
	padding: var(--o-space-sm) var(--o-space-md);
	border-radius: var(--o-radius-md);
	background: var(--o-surface-cream-alt);
	font-size: 14px;
	line-height: 20px;
	color: var(--o-text-muted);
}

.site-header__drawer-note .o-icon {
	color: var(--o-forest);
}

/* Scroll lock while the drawer is open.
   Only on <html>: hiding body overflow too would make body a scroll container and break position: sticky. */
html.site-header-locked {
	overflow: hidden;
}

/* Logo image (gold Omega Oils logo, 512×360) */
.site-header__logo {
	display: block;
	line-height: 0;
	border-radius: var(--o-radius);
	overflow: hidden;
}

.site-header__logo-img {
	display: block;
	height: 44px;
	width: auto;
}

@media (min-width: 1024px) {
	.site-header__logo-img {
		height: 56px;
	}
}

/* --------------------------------------------------------------------------
   Phones and tablets (below 1024px), client request 2026-10-09: logo far
   left; on the right, from right to left: menu, cart, language.
   -------------------------------------------------------------------------- */

@media (max-width: 1023px) {
	.site-header__inner {
		display: flex;
		align-items: center;
		gap: 4px;
	}

	.site-header__logo {
		order: 0;
		margin-right: auto;
	}

	.site-header__start {
		display: contents;
	}

	.site-header__actions {
		order: 2;
	}

	.site-header__menu-toggle {
		order: 3;
		margin-left: 0;
		margin-right: -8px;
	}
}

/* Social links: announcement bar (desktop) and mobile drawer */
.site-header__social {
	display: none;
	gap: 2px;
	color: rgba(255, 255, 255, 0.75);
}

.site-header__social .o-social__link {
	min-width: 28px;
	min-height: 28px;
}

.site-header__social .o-social__icon {
	width: 16px;
	height: 16px;
}

.site-header__social .o-social__link:hover {
	color: var(--o-gold);
}

@media (min-width: 1024px) {
	.site-header__social {
		display: flex;
	}
}

.site-header__drawer-social {
	gap: var(--o-space-sm);
	margin-top: var(--o-space-md);
}

.site-header__drawer-social .o-social__link {
	padding: 8px 16px 8px 12px;
	background: var(--o-white);
	color: var(--o-espresso);
	font-weight: 600;
	box-shadow: var(--o-shadow-soft);
}

.site-header__drawer-social .o-social__link:hover {
	color: var(--o-forest);
}
