/* =========================================================================
   Packgens — site header.
   Figma: 40px announcement bar, then a 1320px white card floating over the
   hero. Utility row 69px, nav row 90px, both pill-rounded and overlapping to
   read as a single card.
   ========================================================================= */

:root {
	--pg-header-h: 176px;
	--pg-topbar-h: 40px;
}

@media (max-width: 991.98px) {
	:root {
		--pg-header-h: 118px;
	}
}

/* The header floats above the page hero, which supplies the blue backdrop. */
.pg-header {
	position: absolute;
	inset-inline: 0;
	top: 0;
	z-index: var(--pg-z-header);
	padding-bottom: var(--pg-space-xs);
}

/* Templates without a coloured hero paint the band themselves. */
.pg-has-plain-header .pg-header {
	background: var(--pg-blue);
}

.pg-header.is-stuck {
	position: fixed;
	background: var(--pg-blue);
	box-shadow: var(--pg-shadow-header);
	animation: pg-header-drop 260ms var(--pg-ease);
}

.pg-header.is-stuck .pg-topbar {
	display: none;
}

@keyframes pg-header-drop {
	from { transform: translateY(-100%); }
	to { transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   Announcement bar
   ------------------------------------------------------------------------- */

.pg-topbar {
	color: var(--pg-white);
	font-size: var(--pg-text-xs);
	line-height: 1.5;
}

.pg-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--pg-space-sm);
	min-height: var(--pg-topbar-h);
	padding-block: var(--pg-space-xs);
	/* The design insets the strip a little from the 1320px column. */
	padding-inline: calc(var(--pg-gutter) + clamp(0rem, 2vw, 2.5rem));
}

.pg-topbar__message {
	font-weight: var(--pg-weight-semibold);
	margin: 0;
}

.pg-topbar__promo {
	display: inline-flex;
	align-items: center;
	gap: var(--pg-space-xs);
	margin: 0;
}

.pg-topbar__code {
	font-weight: var(--pg-weight-medium);
	letter-spacing: 0.01em;
}

.pg-topbar__grab {
	display: inline-flex;
	align-items: center;
	min-height: 1.5625rem;
	padding: 0.1875rem 0.75rem;
	border-radius: var(--pg-radius-pill);
	background: rgba(255, 255, 255, 0.22);
	color: var(--pg-white);
	font-weight: var(--pg-weight-regular);
	font-size: var(--pg-text-xs);
}

.pg-topbar__grab:hover {
	background: var(--pg-white);
	color: var(--pg-blue);
}

.pg-topbar__chat {
	margin: 0;
}

.pg-topbar__chat a {
	display: inline-flex;
	align-items: center;
	gap: var(--pg-space-xs);
	color: var(--pg-white);
	font-size: var(--pg-text-base);
	font-weight: var(--pg-weight-semibold);
}

.pg-topbar__chat svg {
	width: 1.125rem;
	height: 1.125rem;
}

@media (max-width: 991.98px) {
	.pg-topbar__promo,
	.pg-topbar__chat {
		display: none;
	}

	.pg-topbar__inner {
		justify-content: center;
		min-height: 34px;
	}

	.pg-topbar__message {
		font-size: var(--pg-text-2xs);
		text-align: center;
	}
}

/* -------------------------------------------------------------------------
   Header card
   ------------------------------------------------------------------------- */

.pg-header__card {
	position: relative;
	background: var(--pg-white);
	border-radius: var(--pg-radius-md);
	box-shadow: var(--pg-shadow-sm);
	padding: 0 var(--pg-space-lg);
}

.pg-header__utility {
	display: flex;
	align-items: center;
	gap: var(--pg-space-md);
	min-height: 69px;
}

/* Brand ------------------------------------------------------------------ */

.pg-header__brand {
	flex-shrink: 0;
}

.pg-header__brand .custom-logo-link,
.pg-drawer__brand .custom-logo-link {
	display: block;
}

.pg-header__brand img,
.pg-drawer__brand img {
	width: auto;
	max-height: 42px;
}

.pg-brand {
	display: block;
	line-height: 0;
}

.pg-brand__mark {
	display: block;
	width: auto;
	height: 42px;
	max-width: 100%;
}

.pg-brand-text {
	font-family: var(--pg-font-display);
	font-size: 1.5rem;
	font-weight: var(--pg-weight-extrabold);
	letter-spacing: -0.02em;
}

.pg-brand-text a {
	color: var(--pg-blue);
}

/* Search ----------------------------------------------------------------- */

.pg-header__search {
	flex: 1 1 auto;
	max-width: 22rem;
	margin-inline: auto;
}

.pg-search {
	position: relative;
	display: flex;
	align-items: center;
}

.pg-search__input {
	width: 100%;
	min-height: 2.5rem;
	padding: 0.5rem 3rem 0.5rem 1.125rem;
	border: 1px solid var(--pg-blue);
	border-radius: var(--pg-radius-pill);
	font-size: var(--pg-text-xs);
	background: var(--pg-white);
}

.pg-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.pg-search__submit {
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var(--pg-radius-circle);
	background: var(--pg-blue);
	color: var(--pg-white);
	transition: background-color var(--pg-duration) var(--pg-ease);
}

.pg-search__submit:hover {
	background: var(--pg-blue-deep);
}

.pg-search__submit svg {
	width: 1rem;
	height: 1rem;
}

/* Predictive results panel */
.pg-search__panel {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	z-index: var(--pg-z-dropdown);
	max-height: 26rem;
	overflow-y: auto;
	padding: var(--pg-space-xs);
	border-radius: var(--pg-radius-md);
	background: var(--pg-white);
	box-shadow: var(--pg-shadow-lg);
}

.pg-search__panel[hidden] {
	display: none;
}

.pg-search__result {
	display: flex;
	align-items: center;
	gap: var(--pg-space-sm);
	padding: var(--pg-space-xs);
	border-radius: var(--pg-radius-sm);
	color: var(--pg-color-heading);
	transition: background-color var(--pg-duration) var(--pg-ease);
}

.pg-search__result:hover,
.pg-search__result.is-active {
	background: var(--pg-gray-150);
}

.pg-search__result img {
	width: 44px;
	height: 44px;
	border-radius: var(--pg-radius-xs);
	object-fit: cover;
	flex-shrink: 0;
}

.pg-search__result-title {
	font-size: var(--pg-text-xs);
	font-weight: var(--pg-weight-medium);
	line-height: 1.35;
}

.pg-search__result-meta {
	font-size: var(--pg-text-2xs);
	color: var(--pg-color-muted);
}

.pg-search__status {
	padding: var(--pg-space-sm);
	font-size: var(--pg-text-xs);
	color: var(--pg-color-muted);
	text-align: center;
}

.pg-search__all {
	display: block;
	margin-top: var(--pg-space-2xs);
	padding: var(--pg-space-xs);
	border-top: 1px solid var(--pg-color-border);
	font-size: var(--pg-text-xs);
	font-weight: var(--pg-weight-semibold);
	text-align: center;
}

/* Contact blocks --------------------------------------------------------- */

.pg-header__contact {
	display: flex;
	align-items: center;
	gap: var(--pg-space-xs);
	flex-shrink: 0;
}

.pg-header__contact-icon {
	color: var(--pg-ink);
}

.pg-header__contact-icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

.pg-header__contact-copy {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.pg-header__contact-title {
	font-size: var(--pg-text-xs);
	font-weight: var(--pg-weight-semibold);
	color: var(--pg-color-heading);
}

.pg-header__contact-note {
	font-size: var(--pg-text-2xs);
	color: var(--pg-color-muted);
}

@media (max-width: 1279.98px) {
	.pg-header__contact--shipping {
		display: none;
	}
}

/* Actions ---------------------------------------------------------------- */

.pg-header__actions {
	display: flex;
	align-items: center;
	gap: var(--pg-space-xs);
	margin-left: auto;
	flex-shrink: 0;
}

.pg-header__action,
.pg-header__burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--pg-radius-circle);
	color: var(--pg-ink);
	transition: background-color var(--pg-duration) var(--pg-ease), color var(--pg-duration) var(--pg-ease);
}

.pg-header__action:hover,
.pg-header__burger:hover {
	background: var(--pg-gray-150);
	color: var(--pg-blue);
}

.pg-header__action svg,
.pg-header__burger svg {
	width: 1.375rem;
	height: 1.375rem;
}

.pg-header__cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.625rem;
	height: 2.625rem;
	border-radius: var(--pg-radius-circle);
	background: var(--pg-blue);
	color: var(--pg-white);
	transition: background-color var(--pg-duration) var(--pg-ease);
}

.pg-header__cart:hover {
	background: var(--pg-blue-deep);
	color: var(--pg-white);
}

.pg-header__cart svg {
	width: 1.25rem;
	height: 1.25rem;
}

.pg-header__cart-count {
	position: absolute;
	top: -0.25rem;
	right: -0.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.25rem;
	border-radius: var(--pg-radius-pill);
	background: var(--pg-white);
	color: var(--pg-blue);
	font-size: 0.6875rem;
	font-weight: var(--pg-weight-bold);
	line-height: 1;
}

/* Mobile search drop-down ------------------------------------------------- */

.pg-header__mobile-search {
	padding: 0 0 var(--pg-space-sm);
}

.pg-header__mobile-search[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
   Navigation row
   ------------------------------------------------------------------------- */

.pg-header__nav-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--pg-space-md);
	min-height: 68px;
	border-top: 1px solid var(--pg-gray-200);
}

.pg-header__cta {
	flex-shrink: 0;
	min-height: 2.5625rem;
	padding-block: 0.625rem;
}

.pg-nav {
	flex: 1 1 auto;
	min-width: 0;
}

.pg-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pg-nav__item {
	position: relative;
}

.pg-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.5rem 0;
	color: var(--pg-color-heading);
	font-size: var(--pg-text-base);
	font-weight: var(--pg-weight-medium);
	white-space: nowrap;
}

.pg-nav__link:hover,
.pg-nav__link.is-current {
	color: var(--pg-blue);
}

.pg-nav__caret svg {
	width: 0.875rem;
	height: 0.875rem;
	transition: transform var(--pg-duration) var(--pg-ease);
}

.pg-nav__item--has-children:hover .pg-nav__caret svg,
.pg-nav__item.is-open .pg-nav__caret svg {
	transform: rotate(180deg);
}

/* The dedicated toggle only exists for keyboard and touch users. */
.pg-nav__toggle {
	position: absolute;
	inset: 0;
	opacity: 0;
	width: 100%;
	pointer-events: none;
}

.pg-nav__empty a {
	font-size: var(--pg-text-xs);
	color: var(--pg-red);
}

/* Standard dropdown ------------------------------------------------------ */

.pg-nav__submenu {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: -1rem;
	z-index: var(--pg-z-dropdown);
	min-width: 15rem;
	padding: var(--pg-space-xs);
	border-radius: var(--pg-radius-md);
	background: var(--pg-white);
	box-shadow: var(--pg-shadow-lg);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--pg-duration) var(--pg-ease), transform var(--pg-duration) var(--pg-ease), visibility var(--pg-duration);
}

.pg-nav__item--has-children:hover > .pg-nav__submenu,
.pg-nav__item--has-children:focus-within > .pg-nav__submenu,
.pg-nav__item.is-open > .pg-nav__submenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.pg-mega__link {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding: 0.625rem 0.875rem;
	border-radius: var(--pg-radius-sm);
	color: var(--pg-color-heading);
	font-size: var(--pg-text-xs);
	font-weight: var(--pg-weight-medium);
	line-height: 1.35;
	transition: background-color var(--pg-duration) var(--pg-ease), color var(--pg-duration) var(--pg-ease);
}

.pg-mega__link:hover {
	background: var(--pg-gray-150);
	color: var(--pg-blue);
}

.pg-mega__desc {
	font-size: var(--pg-text-2xs);
	font-weight: var(--pg-weight-regular);
	color: var(--pg-color-muted);
}

/* Mega panel ------------------------------------------------------------- */

/* The panel spans the header card rather than the menu item it belongs to, so
   it stays inside the 1320px column instead of overflowing the viewport. */
.pg-nav__item--mega {
	position: static;
}

.pg-mega {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: var(--pg-z-dropdown);
	margin-top: 0.75rem;
	transform: translateY(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--pg-duration) var(--pg-ease), transform var(--pg-duration) var(--pg-ease), visibility var(--pg-duration);
}

.pg-nav__item--mega:hover > .pg-mega,
.pg-nav__item--mega:focus-within > .pg-mega,
.pg-nav__item--mega.is-open > .pg-mega {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.pg-mega__inner {
	max-height: min(70vh, 34rem);
	overflow-y: auto;
	padding: var(--pg-space-lg);
	border-radius: var(--pg-radius-md);
	background: var(--pg-white);
	box-shadow: var(--pg-shadow-lg);
}

.pg-mega__grid {
	display: grid;
	gap: var(--pg-space-xs) var(--pg-space-lg);
	grid-template-columns: repeat(var(--pg-mega-cols, 4), minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.pg-mega__grid--cards {
	gap: var(--pg-space-md);
}

.pg-mega__item--card > .pg-mega__link {
	flex-direction: row;
	align-items: center;
	gap: var(--pg-space-sm);
	padding: var(--pg-space-xs);
	background: var(--pg-gray-100);
}

.pg-mega__item--card > .pg-mega__link:hover {
	background: var(--pg-gray-200);
}

.pg-mega__card-media {
	flex-shrink: 0;
	width: 3rem;
	height: 3rem;
	border-radius: var(--pg-radius-xs);
	overflow: hidden;
	background: var(--pg-white);
}

.pg-mega__card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Third level inside a mega column reads as a plain list. */
.pg-mega__sublist {
	list-style: none;
	margin: 0 0 var(--pg-space-sm);
	padding: 0;
}

.pg-mega__sublist .pg-mega__link {
	padding: 0.3125rem 0.875rem;
	font-weight: var(--pg-weight-regular);
	color: var(--pg-color-muted);
}

.pg-mega__sublist .pg-mega__link:hover {
	color: var(--pg-blue);
	background: transparent;
}

@media (max-width: 1199.98px) {
	.pg-nav__list {
		gap: 0.25rem 1rem;
	}

	.pg-nav__link {
		font-size: var(--pg-text-xs);
	}
}

/* -------------------------------------------------------------------------
   Mobile drawer
   ------------------------------------------------------------------------- */

.pg-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: calc(var(--pg-z-drawer) - 1);
	background: rgba(1, 32, 47, 0.55);
	opacity: 0;
	transition: opacity var(--pg-duration) var(--pg-ease);
}

.pg-drawer-backdrop.is-open {
	opacity: 1;
}

.pg-drawer-backdrop[hidden] {
	display: none;
}

.pg-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: var(--pg-z-drawer);
	width: min(24rem, 88vw);
	display: flex;
	flex-direction: column;
	background: var(--pg-white);
	box-shadow: var(--pg-shadow-lg);
	transform: translateX(100%);
	transition: transform 280ms var(--pg-ease);
}

.pg-drawer[hidden] {
	display: none;
}

.pg-drawer.is-open {
	transform: translateX(0);
}

.pg-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--pg-space-md);
	padding: var(--pg-space-md) var(--pg-space-lg);
	border-bottom: 1px solid var(--pg-color-border);
}

.pg-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--pg-radius-circle);
	background: var(--pg-gray-150);
	color: var(--pg-ink);
}

.pg-drawer__close svg {
	width: 1.25rem;
	height: 1.25rem;
}

.pg-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--pg-space-lg);
	display: flex;
	flex-direction: column;
	gap: var(--pg-space-lg);
}

.pg-mnav__list,
.pg-mnav__sublist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pg-mnav__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--pg-space-xs);
	border-bottom: 1px solid var(--pg-gray-200);
}

.pg-mnav__link {
	flex: 1 1 auto;
	padding: 0.875rem 0;
	color: var(--pg-color-heading);
	font-size: var(--pg-text-base);
	font-weight: var(--pg-weight-medium);
}

.pg-mnav__link.is-current {
	color: var(--pg-blue);
}

.pg-mnav__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--pg-radius-circle);
	color: var(--pg-ink);
	transition: background-color var(--pg-duration) var(--pg-ease);
}

.pg-mnav__toggle svg {
	width: 1.125rem;
	height: 1.125rem;
	transition: transform var(--pg-duration) var(--pg-ease);
}

.pg-mnav__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

.pg-mnav__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--pg-duration) var(--pg-ease);
}

.pg-mnav__panel > div {
	overflow: hidden;
}

.pg-mnav__item.is-open > .pg-mnav__panel {
	grid-template-rows: 1fr;
}

.pg-mnav__sublist {
	padding-left: var(--pg-space-md);
}

.pg-mnav__sublist .pg-mnav__link {
	padding-block: 0.625rem;
	font-size: var(--pg-text-xs);
	font-weight: var(--pg-weight-regular);
	color: var(--pg-color-muted);
}

.pg-drawer__links {
	display: grid;
	gap: var(--pg-space-2xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.pg-drawer__links a,
.pg-drawer__contact a {
	display: flex;
	align-items: center;
	gap: var(--pg-space-xs);
	padding: 0.5rem 0;
	color: var(--pg-color-heading);
	font-size: var(--pg-text-xs);
}

.pg-drawer__links svg,
.pg-drawer__contact svg {
	width: 1.125rem;
	height: 1.125rem;
	color: var(--pg-blue);
}

.pg-drawer__contact {
	display: grid;
	gap: var(--pg-space-2xs);
	padding-top: var(--pg-space-md);
	border-top: 1px solid var(--pg-color-border);
}

.pg-social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pg-space-xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.pg-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--pg-radius-circle);
	border: 1px solid var(--pg-color-border);
	color: var(--pg-ink);
	transition: background-color var(--pg-duration) var(--pg-ease), color var(--pg-duration) var(--pg-ease), border-color var(--pg-duration) var(--pg-ease);
}

.pg-social a:hover {
	background: var(--pg-blue);
	border-color: var(--pg-blue);
	color: var(--pg-white);
}

.pg-social svg {
	width: 1.125rem;
	height: 1.125rem;
}

/* -------------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
	.pg-header__card {
		padding-inline: var(--pg-space-md);
	}

	.pg-header__utility {
		min-height: 60px;
	}

	.pg-header__brand img,
	.pg-header__brand .pg-brand__mark {
		max-height: 32px;
		height: 32px;
	}
}
