/**
 * Header shell styles.
 *
 * Location: /assets/css/frontend/header/header.css
 *
 * @package SunTechPortal
 */

/* SunTech Portal owns the site header; hide common theme headers on frontend only. */
body.suntech-portal-has-header .wp-site-blocks > header,
body.suntech-portal-has-header .site-header,
body.suntech-portal-has-header #masthead,
body.suntech-portal-has-header header.site-header,
body.suntech-portal-has-header .wp-block-template-part header,
body.suntech-portal-has-header .wp-block-template-part[area="header"] {
	display: none !important;
}

/* Store route content title is theme output; the plugin template provides its own title. */
body.suntech-portal-route-store .entry-header,
body.suntech-portal-route-store .page-header,
body.suntech-portal-route-store .wp-block-post-title,
body.suntech-portal-route-store .entry-title {
	display: none !important;
}

body.suntech-portal-has-header {
	margin: 0;
}

body.suntech-portal-has-header .wp-site-blocks,
body.suntech-portal-has-header .site,
body.suntech-portal-has-header #page {
	padding-top: 0 !important;
}

.suntech-portal-header {
	--stp-header-orange: #ff7900;
	--stp-header-orange-dark: #d85e00;
	--stp-header-green: #13a538;
	--stp-header-text: #050711;
	--stp-header-muted: #4b5563;
	--stp-header-border: #e5e7eb;
	--stp-header-soft: #f8fafc;
	--stp-header-bg: #ffffff;
	--stp-header-max: 1180px;

	position: relative;
	z-index: 999;
	width: 100%;
	color: var(--stp-header-text);
	background: var(--stp-header-bg);
	border-bottom: 1px solid var(--stp-header-border);
	box-sizing: border-box;
	font-size: 14px;
	line-height: 1.4;
}

.suntech-portal-header *,
.suntech-portal-header *::before,
.suntech-portal-header *::after {
	box-sizing: border-box;
}

.suntech-portal-header a {
	color: inherit;
	text-decoration: none;
}

.suntech-portal-header a:hover,
.suntech-portal-header a:focus {
	color: inherit;
	background: transparent;
	text-decoration: underline;
	text-underline-offset: 4px;
	outline: none;
}

.stp-header-container {
	width: 100%;
	max-width: var(--stp-header-max);
	margin: 0 auto;
	padding: 0 16px;
}

/* Top row. */
.stp-header-top {
	background: #ffffff;
	border-bottom: 1px solid var(--stp-header-border);
}

.stp-header-top__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	min-height: 40px;
}

.stp-header-top__left,
.stp-header-top__right {
	display: flex;
	align-items: center;
	min-width: 0;
}

.stp-header-top__right {
	justify-content: flex-end;
}

/* Main row. */
.stp-header-main {
	background: #ffffff;
	border-bottom: 1px solid var(--stp-header-border);
}

.stp-header-main__inner {
	display: grid;
	grid-template-columns: auto minmax(320px, 1fr) auto;
	gap: 24px;
	align-items: center;
	min-height: 88px;
}

.stp-header-main__left,
.stp-header-main__actions {
	display: flex;
	align-items: center;
	min-width: 0;
}

.stp-header-main__left {
	gap: 12px;
}

.stp-header-main__actions {
	justify-content: flex-end;
	gap: 10px;
}

.stp-header-main__search {
	min-width: 0;
}

/* Nav row. */
.stp-header-nav-row {
	background: #ffffff;
	border-bottom: 1px solid var(--stp-header-border);
}

.stp-header-nav-row__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
}

/* Top menus from Appearance > Menus. */
.stp-header-top-menu,
.stp-header-top-menu__list {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stp-header-top-menu__list li,
.stp-header-primary-nav__list li {
	margin: 0;
	padding: 0;
}

.stp-header-top-menu--right .stp-header-top-menu__list {
	justify-content: flex-end;
}

.stp-header-top-menu a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	color: var(--stp-header-text);
	background: transparent;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	text-decoration: none;
}

/* Header brand. */
.stp-header-brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	max-width: 250px;
	color: var(--stp-header-text);
	text-decoration: none;
}

.stp-header-brand:hover,
.stp-header-brand:focus {
	background: transparent;
	text-decoration: none;
}

.stp-header-brand:hover .stp-header-brand__name,
.stp-header-brand:focus .stp-header-brand__name {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.stp-header-brand__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	overflow: hidden;
	background: transparent;
	border: 0;
	border-radius: 50%;
}

.stp-header-brand__logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.stp-header-brand__fallback-mark {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(135deg, var(--stp-header-orange) 0 5px, transparent 5px 9px);
	border-radius: 50%;
}

.stp-header-brand__text {
	display: grid;
	min-width: 0;
	gap: 0;
	line-height: 1;
	text-transform: uppercase;
}

.stp-header-brand__kicker {
	justify-self: end;
	margin: 0 1px -1px 0;
	color: var(--stp-header-text);
	font-size: 9px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0.02em;
}

.stp-header-brand__name {
	display: block;
	min-width: 0;
	color: var(--stp-header-text);
	font-size: 25px;
	font-weight: 900;
	line-height: 0.95;
	letter-spacing: -0.055em;
	white-space: nowrap;
}

/* Legacy logo fallback support. */
.stp-header-logo {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	max-width: 190px;
	color: var(--stp-header-text);
	text-decoration: none;
}

.stp-header-logo:hover,
.stp-header-logo:focus {
	background: transparent;
	text-decoration: none;
}

.stp-header-logo__mark {
	display: inline-block;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	background:
		repeating-linear-gradient(135deg, var(--stp-header-orange) 0 5px, transparent 5px 9px),
		linear-gradient(135deg, rgba(255, 121, 0, 0.12), rgba(255, 121, 0, 0));
	border-radius: 50%;
}

.stp-header-logo__text {
	display: grid;
	gap: 0;
	line-height: 1;
	text-transform: uppercase;
}

.stp-header-logo__kicker {
	justify-self: end;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.stp-header-logo__name {
	font-size: 25px;
	font-weight: 900;
	letter-spacing: -0.05em;
}

/* Social icons. */
.stp-header-social {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.stp-header-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: var(--stp-header-text);
	background: transparent;
	border: 0;
	border-radius: 50%;
}

.stp-header-social__link:hover,
.stp-header-social__link:focus {
	background: transparent;
	text-decoration: none;
}

.stp-header-social__link img,
.stp-header-action__icon {
	display: block;
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.stp-header-action__icon {
	pointer-events: none;
}

/* Offcanvas button. */
.stp-header-offcanvas-toggle {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	color: var(--stp-header-text);
	background: var(--stp-header-bg);
	border: 1px solid var(--stp-header-border);
	border-radius: 9px;
	box-shadow: none;
	cursor: pointer;
}

.stp-header-offcanvas-toggle span {
	display: block;
	width: 16px;
	height: 2px;
	background: currentColor;
	border-radius: 999px;
}

.stp-header-offcanvas-toggle:hover,
.stp-header-offcanvas-toggle:focus {
	background: #ffffff;
	border-color: var(--stp-header-orange);
}

/* Search shell. */
.stp-header-search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 188px 54px;
	align-items: stretch;
	width: 100%;
	min-height: 44px;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid var(--stp-header-orange);
	border-radius: 999px;
}

.stp-header-search__input,
.stp-header-search__category,
.stp-header-search__button {
	min-width: 0;
	min-height: 44px;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: 0;
}

.stp-header-search__input {
	width: 100%;
	padding: 0 16px;
	color: var(--stp-header-text);
	background: #ffffff;
	font-size: 14px;
	line-height: 44px;
}

.stp-header-search__input::placeholder {
	color: #6b7280;
	opacity: 1;
}

.stp-header-search__category {
	width: 100%;
	padding: 0 34px 0 12px;
	color: var(--stp-header-text);
	background: #ffffff;
	border-left: 1px solid var(--stp-header-border);
	font-size: 13px;
	cursor: pointer;
}

.stp-header-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	padding: 0;
	color: #ffffff;
	background: var(--stp-header-orange);
	cursor: pointer;
}

.stp-header-search__button:hover,
.stp-header-search__button:focus {
	background: var(--stp-header-orange-dark);
}

/* Actions. */
.stp-header-action,
.stp-header-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: var(--stp-header-text);
	background: #ffffff;
	border: 1px solid var(--stp-header-border);
	text-decoration: none;
	cursor: pointer;
}

.stp-header-action {
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 9px;
}

.stp-header-cart {
	gap: 6px;
	min-width: 94px;
	height: 34px;
	padding: 0 11px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 900;
	line-height: 1;
}

.stp-header-action:hover,
.stp-header-action:focus,
.stp-header-cart:hover,
.stp-header-cart:focus {
	color: var(--stp-header-text);
	background: #ffffff;
	border-color: var(--stp-header-orange);
	text-decoration: none;
}

.stp-header-cart__icon {
	position: relative;
	display: inline-flex;
}

.stp-header-cart__amount {
	font-weight: 900;
	white-space: nowrap;
}

.stp-header-action__badge {
	position: absolute;
	top: -8px;
	right: -7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	color: #ffffff;
	background: var(--stp-header-green);
	border: 2px solid #ffffff;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 900;
	line-height: 1;
}

/* Primary menu from Appearance > Menus. */
.stp-header-primary-nav {
	width: 100%;
}

.stp-header-primary-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stp-header-primary-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	color: #000000;
	background: transparent;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
	text-decoration: none;
}

.stp-header-primary-nav a:hover,
.stp-header-primary-nav a:focus,
.stp-header-primary-nav .current-menu-item > a {
	color: #000000;
	background: transparent;
	text-decoration: underline;
	text-underline-offset: 5px;
}

/* Offcanvas panel. */
.stp-header-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(17, 24, 39, 0.36);
}

.stp-header-offcanvas[hidden] {
	display: none;
}

.stp-header-offcanvas__panel {
	width: min(320px, 88vw);
	height: 100%;
	padding: 18px;
	background: #ffffff;
	box-shadow: 18px 0 45px rgba(17, 24, 39, 0.16);
}

.stp-header-offcanvas__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0 0 14px;
	padding: 0;
	color: var(--stp-header-text);
	background: var(--stp-header-soft);
	border: 1px solid var(--stp-header-border);
	border-radius: 9px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.stp-header-offcanvas__title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 900;
}

.stp-header-offcanvas__menu {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stp-header-offcanvas__menu a {
	display: flex;
	padding: 12px 0;
	color: var(--stp-header-text);
	border-bottom: 1px solid var(--stp-header-border);
	font-size: 13px;
	font-weight: 800;
	line-height: 1.4;
	text-decoration: none;
}

@media (max-width: 960px) {
	.stp-header-container {
		padding-right: 8px;
		padding-left: 8px;
	}

	.stp-header-top {
		display: none;
	}

	.stp-header-main__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 10px 12px;
		min-height: 96px;
		padding-top: 10px;
		padding-bottom: 8px;
	}

	.stp-header-main__left {
		grid-column: 1;
		gap: 10px;
	}

	.stp-header-main__actions {
		grid-column: 2;
		gap: 7px;
	}

	.stp-header-main__search {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.stp-header-offcanvas-toggle {
		order: 1;
	}

	.stp-header-brand,
	.stp-header-logo {
		order: 2;
	}

	.stp-header-brand {
		max-width: 190px;
		gap: 7px;
	}

	.stp-header-brand__logo {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
	}

	.stp-header-brand__kicker {
		font-size: 7px;
	}

	.stp-header-brand__name {
		font-size: 18px;
	}

	.stp-header-logo {
		max-width: 145px;
	}

	.stp-header-logo__mark {
		flex-basis: 32px;
		width: 32px;
		height: 32px;
	}

	.stp-header-logo__kicker {
		font-size: 7px;
	}

	.stp-header-logo__name {
		font-size: 18px;
	}

	.stp-header-search {
		grid-template-columns: minmax(0, 1fr) 42px;
		min-height: 38px;
		border-radius: 999px;
	}

	.stp-header-search__category {
		display: none;
	}

	.stp-header-search__input,
	.stp-header-search__button {
		min-height: 38px;
		font-size: 12px;
		line-height: 38px;
	}

	.stp-header-search__button {
		width: 42px;
	}

	.stp-header-nav-row__inner {
		justify-content: center;
		min-height: 40px;
		overflow: visible;
	}

	.stp-header-primary-nav {
		display: flex;
		justify-content: center;
		width: 100%;
	}

	.stp-header-primary-nav__list {
		flex-wrap: wrap;
		justify-content: center;
		gap: 18px 22px;
		width: 100%;
		min-width: 0;
		padding: 0 8px;
		text-align: center;
	}

	.stp-header-primary-nav a {
		min-height: 38px;
		font-size: 11px;
	}
}

@media (max-width: 640px) {
	.suntech-portal-header {
		font-size: 12px;
	}

	.stp-header-main__inner {
		gap: 8px;
		min-height: 92px;
	}

	.stp-header-main__left {
		gap: 8px;
	}

	.stp-header-main__actions {
		gap: 5px;
	}

	.stp-header-brand {
		max-width: 142px;
		gap: 6px;
	}

	.stp-header-brand__logo {
		flex-basis: 22px;
		width: 22px;
		height: 22px;
	}

	.stp-header-brand__kicker {
		font-size: 6px;
	}

	.stp-header-brand__name {
		max-width: 96px;
		overflow: hidden;
		font-size: 12px;
		text-overflow: ellipsis;
	}

	.stp-header-logo {
		max-width: 108px;
	}

	.stp-header-logo__mark {
		flex-basis: 20px;
		width: 20px;
		height: 20px;
	}

	.stp-header-logo__kicker {
		font-size: 6px;
	}

	.stp-header-logo__name {
		font-size: 11px;
	}

	.stp-header-offcanvas-toggle,
	.stp-header-action {
		flex-basis: 28px;
		width: 28px;
		height: 28px;
		padding: 0;
		border-radius: 7px;
	}

	.stp-header-offcanvas-toggle {
		border: 0;
		border-radius: 0;
	}

	.stp-header-action__icon,
	.stp-header-social__link img {
		width: 18px;
		height: 18px;
	}

	.stp-header-action svg,
	.stp-header-cart svg {
		width: 18px;
		height: 18px;
	}

	.stp-header-cart {
		min-width: 28px;
		width: 28px;
		height: 28px;
		padding: 0;
		border-radius: 7px;
	}

	.stp-header-cart__amount {
		display: none;
	}

	.stp-header-action__badge {
		top: -7px;
		right: -6px;
		min-width: 15px;
		height: 15px;
		padding: 0 4px;
		font-size: 9px;
	}

	.stp-header-search__input {
		font-size: 11px;
	}

	.stp-header-primary-nav__list {
		gap: 14px 18px;
		padding-right: 6px;
		padding-left: 6px;
	}

	.stp-header-primary-nav a {
		font-size: 10px;
	}
}