@media (scripting: enabled) {
	.furpsy-site-header:has(.header:not([data-navigation-ready])) {
		visibility: hidden;
	}
}

/* One sticky owner; only the desktop surface floats over the page. */
.furpsy-site-header {
	--furpsy-floating-max-width: 1240px;
	--furpsy-floating-offset: 16px;
	--furpsy-navigation-height: 64px;
	--furpsy-promo-height: 24px;
	--furpsy-promo-shift: 0px;
	--furpsy-header-offset: 0px;
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000;
	height: calc(
		var(--furpsy-header-offset) + var(--furpsy-promo-height) + var(--furpsy-navigation-height)
	);
	padding-top: var(--furpsy-header-offset);
}

.furpsy-header-surface {
	position: relative;
	width: 100%;
	margin-inline: auto;
}

.furpsy-site-header.is-desktop-layout {
	--furpsy-header-offset: var(--furpsy-floating-offset);
}

.furpsy-site-header.is-desktop-layout .furpsy-header-surface {
	max-width: var(--furpsy-floating-max-width);
}

/* Reserve a stable flow footprint. Only an existing hero gets the overlap. */
body:has(> main > .hero-section:first-child) .furpsy-site-header.is-desktop-layout {
	margin-bottom: calc(
		-1 *
			(
				var(--furpsy-header-offset) + var(--furpsy-promo-height) +
					var(--furpsy-navigation-height)
			)
	);
}

.furpsy-site-header.is-promo-hidden {
	--furpsy-promo-shift: var(--furpsy-promo-height);
}

/* Main content */
.header {
	--furpsy-mobile-header-height: 64px;
	--furpsy-navigation-desktop-padding: 32px;
	height: 64px;
	display: flex;
	align-items: center;
	position: relative;
	background: var(--black_white50);
	z-index: 1000;
	transform: translateY(calc(-1 * var(--furpsy-promo-shift)));
}

.furpsy-site-header.is-desktop-layout .header {
	background: var(--furpsy-color-opacity-white-100);
	border-radius: 12px;
	transition: transform 0.3s ease;
}

.header-overlay {
	position: fixed;
	top: calc(
		var(--wp-admin--admin-bar--height, 0px) + var(--furpsy-header-offset) +
			var(--furpsy-navigation-height) + var(--furpsy-promo-height) - var(--furpsy-promo-shift)
	);
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: none;
	z-index: 90;
}

/* Header-local padding follows Figma without changing other theme containers. */
.header > .container {
	padding-inline: var(--furpsy-navigation-desktop-padding);
	transition: none;
}

/* Paint above the negative search panel without creating a new stacking context. */
.furpsy-site-header.is-desktop-layout .header > .container {
	background: var(--furpsy-color-opacity-white-100);
	border-radius: inherit;
}

/* header-desktop */
.header-desktop {
	position: relative;
	display: flex;
	align-items: center;
	height: 64px;
}

.header-logo-wrapper {
	width: 81px;
	height: 24px;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.header-logo-wrapper a {
	height: 100%;
	width: 100%;
}

.header-logo-wrapper img,
.header-logo-wrapper picture {
	height: 100%;
	width: 100%;
}

/* header-left side */
.header-left-side {
	display: flex;
	align-items: center;
	gap: 24px;
	flex: 0 0 auto;
	margin-right: auto;
}

.header-menu {
	display: flex;
	gap: 24px;
}

.header-menu a:not(.furpsy-nav-list-item) {
	color: var(--black_white950);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
	-webkit-text-decoration-color: transparent;
	text-decoration-color: transparent;
	transition:
		color 0.4s ease,
		-webkit-text-decoration-color 0.4s ease;
	transition:
		color 0.4s ease,
		text-decoration-color 0.4s ease;
	transition:
		color 0.4s ease,
		text-decoration-color 0.4s ease,
		-webkit-text-decoration-color 0.4s ease;
}

.header-menu a:not(.furpsy-nav-list-item):hover {
	color: var(--primary500);
	-webkit-text-decoration-color: var(--primary500);
	text-decoration-color: var(--primary500);
}

.header-menu-wrapper {
	display: flex;
	gap: 24px;
}

/* -header-right-side */
.user-specials {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.favorite-btn:not(.furpsy-nav-icon-button) {
	height: 40px;
	width: 40px;
	color: var(--black_white950);
	position: relative;
	background: unset;
	border: unset;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.4s ease;
}

.dropdown-btn {
	color: var(--black_white950);
	position: relative;
	background: unset;
	border: unset;
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: 16px;
	transition: color 0.4s ease;
}

.dropdown-btn svg {
	height: 20px;
	width: 20px;
	transform: rotate(0deg);
	transition: transform 0.4s ease;
}

.favorite-btn:not(.furpsy-nav-icon-button):hover,
.dropdown-btn:hover {
	color: var(--primary500);
	cursor: pointer;
}

.dropdown-btn:hover svg {
	transform: rotate(180deg);
}

.cart-products-count {
	position: absolute;
	top: -4px;
	right: -4px;
	padding: 2px 4px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--primary500);
	color: var(--black_white50);
}

/* Intrinsic widths remain measurable when the desktop layout is inactive. */
.header-desktop .user-specials {
	flex: 0 0 auto;
}

.search-bar {
	position: relative;
	flex: 0 0 337px;
	width: 337px;
	min-width: 0;
	margin-right: 4px;
}

.search-bar ~ * {
	flex-shrink: 0;
}

.search-wrapper {
	position: relative;
}

.search-bar-mobile {
	position: relative;
	max-width: 100%;
}

/* extra categories */
.extra-categories-desktop {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 311px;
}

.extra-categories-desktop a {
	display: flex;
	align-items: center;
	border: 1px solid var(--neutral200);
	border-radius: 8px;
	overflow: hidden;
	transition:
		border-color 0.4s ease,
		color 0.4s ease;
}

.extra-categories-desktop a .h6 {
	padding: 0 16px;
}

.extra-categories-img.discount {
	background: var(--primary500);
}

.extra-categories-img.new-item {
	background: var(--alert500);
}

.extra-categories-img {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 60px;
	width: 60px;
}

.extra-categories-img img {
	height: 34.29px;
	width: 34.29px;
}

.extra-categories-desktop a:hover {
	border-color: var(--primary500);
	color: var(--primary500);
}

/* Optional animation */
@-webkit-keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}
@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.header-mobile {
	display: none;
	height: var(--furpsy-mobile-header-height);
	position: relative;
}

/* Hidden desktop content keeps its intrinsic metrics; no cloned menu is needed. */
.header.is-mobile-layout .header-desktop {
	position: absolute;
	top: 0;
	left: 50%;
	width: min(
		calc(
			100% - 2 * var(--furpsy-navigation-desktop-padding) - 2 * var(--furpsy-floating-offset)
		),
		calc(var(--furpsy-floating-max-width) - 2 * var(--furpsy-navigation-desktop-padding))
	);
	transform: translateX(-50%);
	visibility: hidden;
	pointer-events: none;
	overflow: clip;
}

.header.is-mobile-layout .header-mobile {
	display: flex;
}

.header.is-mobile-layout > .container {
	padding-inline: 16px;
}

/* Logout modal */
/* logout-modal.css */
#logoutModal {
	display: none;
	position: fixed;
	inset: 0;
	padding: 24px;
	background: rgba(0, 0, 0, 0.8);
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

#logoutModal .modal-content {
	background: var(--black_white50);
	padding: 24px;
	border-radius: 8px;
	max-width: 418px;
	width: 100%;
	text-align: center;
	color: var(--black_white950);
}

#logoutModal p {
	margin-bottom: 24px;
}

#logoutModal .modal-buttons {
	display: flex;
	gap: 10px;
}

#logoutModal button {
	border: none;
	border-radius: 8px;
	cursor: pointer;
}

#logoutModal #confirmLogout {
	max-width: 231px;
	width: 100%;
	height: 50px;
}

#logoutModal #cancelLogout {
	background: var(--black_white50);
	padding: 16px 32px;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 50px;
	color: var(--black_white950);
	transition: background-color 0.4s ease;
}

#logoutModal #cancelLogout:hover {
	background: var(--black_white100);
}

/* Promo bar css */
/* Promo bar */
.promo-bar {
	width: 100%;
	min-height: 24px;
	background: #1b6f25;
	color: #fff;
	position: relative;
	z-index: 1001;
}

.promo-bar__icon {
	display: none;
	object-fit: contain;
}

.furpsy-site-header.is-desktop-layout .promo-bar {
	background: transparent;
	z-index: auto;
	color: var(--furpsy-color-grey-100);
	transition:
		opacity 0.3s ease,
		transform 0.3s ease,
		visibility 0s;
}

/* Figma supporting-line extends 22px behind the rounded navigation. */
.furpsy-site-header.is-desktop-layout .promo-bar::before {
	content: '';
	position: absolute;
	inset: 0 0 -22px;
	background: var(--furpsy-color-secondary-50);
	border-radius: 12px 12px 0 0;
	/* Above the page dimmer; the language dropdown remains free to overlap navigation. */
	z-index: 0;
}

.furpsy-site-header.is-desktop-layout .promo-bar__inner {
	justify-content: flex-start;
	padding: 4px 32px;
}

.furpsy-site-header.is-desktop-layout .promo-bar__icon {
	display: block;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
}

.furpsy-site-header.is-desktop-layout .promo-bar__item {
	padding: 0 65px 0 0;
	text-align: left;
	font-family: var(--furpsy-font-body);
	font-size: var(--furpsy-type-body-medium-s-size);
	font-weight: var(--furpsy-type-body-medium-s-weight);
	line-height: var(--furpsy-type-body-medium-s-line-height);
}

.furpsy-site-header.is-desktop-layout .promo-bar > .furpsy-language {
	right: 32px;
	top: 4px;
	transform: none;
}

.promo-bar.is-scroll-hidden {
	visibility: hidden;
	transform: translateY(-100%);
}

.furpsy-site-header.is-desktop-layout .promo-bar.is-scroll-hidden {
	opacity: 0;
	transition:
		opacity 0.3s ease,
		transform 0.3s ease,
		visibility 0s 0.3s;
}

@media (prefers-reduced-motion: reduce) {
	.furpsy-site-header.is-desktop-layout .header,
	.furpsy-site-header.is-desktop-layout .promo-bar,
	.furpsy-site-header.is-desktop-layout .promo-bar.is-scroll-hidden {
		transition: none;
	}
}

.promo-bar__inner {
	position: relative;
	min-height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* All rows share one grid cell and reserve the tallest message at every width.
 * Clip only this viewport, leaving the sibling language disclosure untouched. */
.promo-bar__messages {
	display: grid;
	width: 100%;
	min-width: 0;
	overflow: hidden;
}

.promo-bar__item {
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-100%);
	width: 100%;
	min-width: 0;
	padding: 0 65px;
	overflow-wrap: anywhere;
	text-align: center;
	line-height: 24px;
}

.promo-bar__item.is-active {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.promo-bar__item.is-entering,
.promo-bar__item.is-leaving {
	visibility: visible;
}

.promo-bar__item.is-leaving {
	opacity: 0;
	transform: translateY(100%);
}

.promo-bar__messages.is-animating .promo-bar__item {
	transition: transform 450ms ease, opacity 450ms ease;
}

.promo-bar__text {
	min-width: 0;
}

.furpsy-site-header .promo-bar__item {
	justify-content: flex-start;
}

@media (prefers-reduced-motion: reduce) {
	.promo-bar__messages.is-animating .promo-bar__item {
		transition: none;
	}
}

.promo-bar__item p {
	margin: 0;
}

.promo-bar__item a {
	color: inherit;
	text-decoration: none;
}

.promo-bar__item a:hover {
	text-decoration: underline;
}

@media (max-width: 767px) {
	.promo-bar__inner {
		min-height: 24px;
	}

	.promo-bar__item {
		padding: 0 65px;
		line-height: 24px;
	}
}

/* Promo bar END */

@media (max-width: 768px) {
	#logoutModal .modal-content {
		padding: 16px;
	}
}
