/**
 * GamiGadgets header components.
 * All selectors are scoped to the plugin namespace.
 */

.gghf-header,
.gghf-mobile-panel,
.gghf-search-overlay {
	box-sizing: border-box;
	font-family: var(--gghf-font);
	line-height: var(--gghf-line-height);
}

.gghf-header *,
.gghf-header *::before,
.gghf-header *::after,
.gghf-mobile-panel *,
.gghf-mobile-panel *::before,
.gghf-mobile-panel *::after,
.gghf-search-overlay *,
.gghf-search-overlay *::before,
.gghf-search-overlay *::after {
	box-sizing: inherit;
}

.gghf-header {
	position: relative;
	z-index: 999;
	inline-size: 100%;
	color: var(--gghf-text);
	transition: background-color var(--gghf-transition) ease, box-shadow var(--gghf-transition) ease, transform var(--gghf-transition) ease;
}

.gghf-header__inner {
	display: flex;
	align-items: center;
	inline-size: min(100%, var(--gghf-header-max));
	min-block-size: var(--gghf-header-height);
	margin-inline: auto;
	gap: clamp(14px, 2vw, 30px);
}

.gghf-header--full .gghf-header__inner,
.gghf-header--full .gghf-header__mobile {
	max-inline-size: none;
}

.gghf-header__inner--single .gghf-navigation {
	flex: 1 1 auto;
}

.gghf-header__row--nav {
	border-block-start: 1px solid color-mix(in srgb, var(--gghf-primary) 12%, transparent);
}

.gghf-header__row--nav .gghf-header__inner {
	min-block-size: 46px;
}

.gghf-header__end,
.gghf-actions,
.gghf-mobile-actions {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: var(--gghf-icon-gap);
}

.gghf-actions > .gghf-social {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.gghf-actions > .gghf-social .gghf-social__link {
	display: inline-grid;
	place-items: center;
	inline-size: 38px;
	block-size: 38px;
	border-radius: 9px;
	color: var(--gghf-icon-color);
}

.gghf-actions > .gghf-social .gghf-social__link:hover,
.gghf-actions > .gghf-social .gghf-social__link:focus-visible {
	background: color-mix(in srgb, var(--gghf-accent) 10%, transparent);
	color: var(--gghf-icon-hover);
}

.gghf-actions > .gghf-social .gghf-icon {
	inline-size: 18px;
	block-size: 18px;
}

.gghf-header__accent {
	display: block;
	block-size: 2px;
	inline-size: 100%;
	background: linear-gradient(90deg, var(--gghf-red), var(--gghf-red) 72%, transparent);
}

.gghf-branding {
	display: flex;
	flex: 0 1 auto;
	flex-direction: column;
	min-inline-size: 0;
}

.gghf-branding__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--gghf-title-color);
	text-decoration: none;
}

.gghf-branding__link:hover {
	color: var(--gghf-title-hover);
}

.gghf-logo__image {
	display: block;
	inline-size: min(var(--gghf-logo-width), 100%);
	max-inline-size: none;
	max-block-size: var(--gghf-logo-max-height);
	block-size: auto;
	object-fit: contain;
}

.gghf-site-title {
	font-family: var(--gghf-title-font);
	font-size: var(--gghf-title-size);
	font-weight: var(--gghf-title-weight);
	line-height: 1.1;
}

.gghf-site-tagline {
	margin-block-start: 3px;
	color: var(--gghf-muted);
	font-size: 12px;
}

.gghf-navigation {
	display: flex;
	align-items: center;
	justify-content: var(--gghf-menu-align);
	min-inline-size: 0;
}

.gghf-menu,
.gghf-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gghf-menu {
	display: flex;
	align-items: center;
	justify-content: inherit;
	gap: var(--gghf-menu-gap);
	inline-size: 100%;
}

.gghf-menu__item {
	position: relative;
	margin: 0;
}

.gghf-menu__link {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	color: var(--gghf-menu-color);
	font-family: var(--gghf-menu-font);
	font-size: var(--gghf-menu-size);
	font-weight: var(--gghf-menu-weight);
	letter-spacing: var(--gghf-menu-spacing);
	line-height: 1.3;
	text-decoration: none;
	text-transform: var(--gghf-menu-transform);
	transition: color 160ms ease;
}

.gghf-menu__link:hover,
.gghf-menu__link:focus-visible,
.gghf-menu__item.is-open > .gghf-menu__link {
	color: var(--gghf-menu-hover);
}

.gghf-menu__item.current-menu-item > .gghf-menu__link,
.gghf-menu__item.current-menu-ancestor > .gghf-menu__link,
.gghf-menu__link[aria-current="page"] {
	color: var(--gghf-menu-active);
}

.gghf-submenu-toggle {
	display: inline-grid;
	place-items: center;
	inline-size: 30px;
	block-size: 38px;
	margin-inline-start: -8px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gghf-menu-color);
	cursor: pointer;
}

.gghf-submenu-toggle .gghf-icon {
	inline-size: 14px;
	block-size: 14px;
	transition: transform 160ms ease;
}

.gghf-menu__item.is-open > .gghf-submenu-toggle .gghf-icon,
.gghf-submenu-toggle[aria-expanded="true"] .gghf-icon {
	transform: rotate(90deg);
}

.gghf-sub-menu {
	position: absolute;
	inset-block-start: calc(100% + 4px);
	inset-inline-start: 0;
	z-index: 10;
	min-inline-size: 230px;
	padding: 8px;
	border: var(--gghf-dropdown-border);
	border-radius: var(--gghf-dropdown-radius);
	background: var(--gghf-dropdown-bg);
	box-shadow: var(--gghf-dropdown-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.gghf-sub-menu .gghf-sub-menu {
	inset-block-start: -8px;
	inset-inline-start: calc(100% + 8px);
}

.gghf-menu__item:hover > .gghf-sub-menu,
.gghf-menu__item:focus-within > .gghf-sub-menu,
.gghf-menu__item.is-open > .gghf-sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.gghf-sub-menu .gghf-menu__link {
	display: flex;
	min-block-size: 42px;
	padding-inline: 12px;
	border-radius: max(4px, calc(var(--gghf-dropdown-radius) - 4px));
	color: var(--gghf-dropdown-color);
	white-space: nowrap;
}

.gghf-sub-menu .gghf-menu__link:hover,
.gghf-sub-menu .gghf-menu__link:focus-visible {
	background: var(--gghf-dropdown-hover);
	color: var(--gghf-menu-hover);
}

.gghf-menu__item.gghf-wide-dropdown > .gghf-sub-menu {
	display: grid;
	grid-template-columns: repeat(2, minmax(180px, 1fr));
	inline-size: min(520px, 80vw);
}

.gghf-search {
	display: flex;
	flex: 0 1 var(--gghf-search-width);
	inline-size: min(100%, var(--gghf-search-width));
	block-size: var(--gghf-search-height);
	border: var(--gghf-search-border);
	border-radius: var(--gghf-search-radius);
	background: var(--gghf-search-bg);
	overflow: clip;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.gghf-search:focus-within {
	border-color: var(--gghf-search-focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--gghf-search-focus) 20%, transparent);
}

.gghf-search__input {
	min-inline-size: 0;
	inline-size: 100%;
	block-size: 100%;
	padding: 0 14px;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	color: var(--gghf-search-color);
	font: inherit;
	font-size: 14px;
}

.gghf-search__input::placeholder {
	color: var(--gghf-search-placeholder);
	opacity: 1;
}

.gghf-search__submit {
	display: grid;
	place-items: center;
	flex: 0 0 var(--gghf-search-height);
	inline-size: var(--gghf-search-height);
	block-size: 100%;
	padding: 0;
	border: 0;
	background: var(--gghf-search-button);
	color: #fff;
	cursor: pointer;
	transition: background-color 160ms ease;
}

.gghf-search__submit:hover,
.gghf-search__submit:focus-visible {
	background: var(--gghf-search-button-hover);
}

.gghf-icon-button {
	position: relative;
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	inline-size: 44px;
	block-size: 44px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--gghf-icon-color);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.gghf-icon-button:hover,
.gghf-icon-button:focus-visible {
	background: color-mix(in srgb, var(--gghf-accent) 10%, transparent);
	color: var(--gghf-icon-hover);
}

.gghf-icon {
	display: block;
	inline-size: var(--gghf-icon-size);
	block-size: var(--gghf-icon-size);
}

.gghf-cart-count {
	position: absolute;
	inset-block-start: 2px;
	inset-inline-end: 1px;
	display: grid;
	place-items: center;
	min-inline-size: 18px;
	block-size: 18px;
	padding-inline: 4px;
	border: 2px solid #fff;
	border-radius: 999px;
	background: var(--gghf-red);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
}

.gghf-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-block-size: 44px;
	padding: var(--gghf-cta-py) var(--gghf-cta-px);
	border: var(--gghf-cta-border);
	border-radius: var(--gghf-cta-radius);
	background: var(--gghf-cta-bg);
	color: var(--gghf-cta-color);
	font-size: var(--gghf-cta-size);
	font-weight: var(--gghf-cta-weight);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.gghf-cta:hover,
.gghf-cta:focus-visible {
	background: var(--gghf-cta-hover-bg);
	color: var(--gghf-cta-hover-color);
	transform: translateY(-1px);
}

.gghf-header__mobile {
	display: none;
	align-items: center;
	justify-content: space-between;
	inline-size: min(100%, var(--gghf-header-max));
	min-block-size: var(--gghf-header-height);
	margin-inline: auto;
	gap: 10px;
}

.gghf-header__mobile .gghf-branding {
	align-items: center;
	flex: 1 1 auto;
}

.gghf-mobile-overlay,
.gghf-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.gghf-mobile-overlay {
	background: var(--gghf-mobile-overlay);
	opacity: 0;
	transition: opacity var(--gghf-mobile-duration) ease;
}

.gghf-mobile-overlay.is-open {
	opacity: 1;
}

.gghf-mobile-overlay[hidden],
.gghf-search-overlay[hidden] {
	display: none;
}

.gghf-mobile-panel {
	position: fixed;
	inset-block: 0;
	inset-inline-start: 0;
	z-index: 100001;
	inline-size: min(88vw, var(--gghf-mobile-width));
	max-inline-size: 100%;
	background: var(--gghf-mobile-bg);
	color: var(--gghf-mobile-color);
	box-shadow: 20px 0 60px rgba(0, 0, 0, .2);
	overflow: auto;
	overscroll-behavior: contain;
	transform: translateX(-105%);
	transition: transform var(--gghf-mobile-duration) cubic-bezier(.2,.8,.2,1);
}

.gghf-mobile-panel.is-open {
	transform: translateX(0);
}

.gghf-mobile-from-right ~ .gghf-mobile-panel,
body:has(.gghf-mobile-from-right) .gghf-mobile-panel {
	inset-inline: auto 0;
	transform: translateX(105%);
	box-shadow: -20px 0 60px rgba(0, 0, 0, .2);
}

body:has(.gghf-mobile-from-right) .gghf-mobile-panel.is-open {
	transform: translateX(0);
}

.gghf-mobile-panel__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-block-size: 72px;
	padding: 14px 18px;
	border-block-end: 1px solid var(--gghf-mobile-separator);
}

.gghf-mobile-panel__top .gghf-logo__image {
	inline-size: min(180px, 58vw);
}

.gghf-mobile-panel__content {
	display: grid;
	gap: 22px;
	padding: 20px 18px 32px;
}

.gghf-mobile-panel .gghf-social {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
}

.gghf-mobile-panel .gghf-social__link {
	display: inline-grid;
	place-items: center;
	inline-size: 42px;
	block-size: 42px;
	border: 1px solid var(--gghf-mobile-separator);
	border-radius: 10px;
	color: var(--gghf-mobile-color);
}

.gghf-mobile-panel .gghf-social__link:hover,
.gghf-mobile-panel .gghf-social__link:focus-visible {
	border-color: var(--gghf-mobile-active);
	color: var(--gghf-mobile-active);
}

.gghf-menu--mobile {
	display: block;
}

.gghf-menu--mobile > .gghf-menu__item {
	border-block-end: 1px solid var(--gghf-mobile-separator);
}

.gghf-menu--mobile .gghf-menu__link {
	min-block-size: 50px;
	color: var(--gghf-mobile-color);
}

.gghf-menu--mobile .gghf-submenu-toggle {
	position: absolute;
	inset-block-start: 5px;
	inset-inline-end: 0;
	color: var(--gghf-mobile-color);
}

.gghf-menu--mobile .gghf-sub-menu {
	position: static;
	display: none;
	min-inline-size: 0;
	padding: 0 0 10px 16px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
}

.gghf-menu--mobile .gghf-menu__item.is-open > .gghf-sub-menu {
	display: block;
}

.gghf-menu--mobile .gghf-sub-menu .gghf-menu__link {
	min-block-size: 44px;
	padding-inline: 8px;
	white-space: normal;
}

.gghf-cta--mobile {
	inline-size: 100%;
}

.gghf-search-overlay {
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(6, 23, 53, .96);
	color: #fff;
	opacity: 0;
	transition: opacity 180ms ease;
}

.gghf-search-overlay.is-open {
	opacity: 1;
}

.gghf-search-overlay__inner {
	inline-size: min(760px, 100%);
}

.gghf-search-overlay__title {
	margin: 0 0 18px;
	color: #fff;
	font-size: clamp(22px, 4vw, 38px);
	font-weight: 800;
	text-align: center;
}

.gghf-search-overlay .gghf-search {
	inline-size: 100%;
	max-inline-size: none;
	block-size: 58px;
	margin-inline: auto;
	background: #fff;
}

.gghf-search-close {
	position: absolute;
	inset-block-start: 24px;
	inset-inline-end: 24px;
	color: #fff;
}

.gghf-scroll-lock {
	position: fixed;
	inline-size: 100%;
	overflow: hidden;
}

.gghf-header.is-scrolled {
	background: var(--gghf-sticky-bg);
}

.gghf-header--shrink.is-scrolled .gghf-header__inner,
.gghf-header--shrink.is-scrolled .gghf-header__mobile {
	min-block-size: var(--gghf-sticky-height);
}

.gghf-header--shrink.is-scrolled .gghf-logo__image {
	inline-size: min(var(--gghf-sticky-logo), 100%);
}

.gghf-header--hide-down.is-hidden {
	transform: translateY(-110%);
}

.gghf-header a:focus-visible,
.gghf-header button:focus-visible,
.gghf-mobile-panel a:focus-visible,
.gghf-mobile-panel button:focus-visible,
.gghf-search-overlay button:focus-visible,
.gghf-search-overlay input:focus-visible {
	outline: 3px solid var(--gghf-accent);
	outline-offset: 3px;
}

.gghf-skip-link:focus {
	position: absolute;
	inset-block-start: 8px;
	inset-inline-start: 8px;
	z-index: 5;
	clip: auto;
	inline-size: auto;
	block-size: auto;
	padding: 10px 14px;
	background: #fff;
	color: var(--gghf-primary);
}

@media (prefers-reduced-motion: reduce) {
	.gghf-header,
	.gghf-header *,
	.gghf-mobile-panel,
	.gghf-mobile-overlay,
	.gghf-search-overlay {
		scroll-behavior: auto;
		transition-duration: .01ms;
		animation-duration: .01ms;
		animation-iteration-count: 1;
	}
}
