/* Custom fixed header with angled bottom edge, replacing Divi's #main-header.
   Matches the previous design: teal bar, clip-path angle, hide-on-scroll
   (js/header.js), Neutra2Display nav. Breakpoints follow Divi's 980px mobile
   switch, not the usual Forcefield set, so page layouts behave as before. */

html {
	scroll-padding-top: 200px;
}

#ff-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	height: 180px;
	font-family: Neutra2Display, 'Montserrat', sans-serif;
	font-weight: 900;
	transition: transform 0.4s ease-in-out;
	will-change: transform;
}

#ff-header.ff-hidden {
	transform: translateY(-102%);
}

body.admin-bar #ff-header {
	top: 32px;
}

/* Background layer carries the clip so the mobile panel below isn't clipped */
.ff-header-bg {
	position: absolute;
	inset: 0;
	background-color: #04475C;
	clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);
}

.ff-header-inner {
	position: relative;
	width: 90%;
	max-width: 1920px;
	margin: 0 auto;
	height: 150px; /* solid area above the angle */
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
}

.ff-logo {
	flex: none;
	display: block;
}

.ff-logo img {
	display: block;
	width: auto;
	height: 110px;
}

.ff-nav {
	display: flex;
	align-items: center;
}

.ff-menu {
	display: flex;
	align-items: center;
	gap: 34px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ff-menu li {
	margin: 0;
	padding: 0;
}

/* !important required: Divi custom CSS has #page-container a{color:#F8AB3B!important}
   and the header lives inside #page-container. Drop it when that rule dies with Divi. */
#ff-header .ff-menu a {
	display: block;
	color: #fff !important;
	text-decoration: none;
	text-transform: uppercase;
	font-size: 20px;
	line-height: 1.2;
	transition: opacity 0.3s ease-in-out;
}

.ff-menu a:hover {
	opacity: 0.7;
}

#ff-header .ff-cart {
	position: relative;
	display: flex;
	align-items: center;
	margin-left: 30px;
	color: #fff !important;
	transition: opacity 0.3s ease-in-out;
}

.ff-cart:hover {
	opacity: 0.7;
}

.ff-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background-color: #fff;
	color: #04475C;
	font-size: 11px;
	line-height: 17px;
	text-align: center;
}

.ff-nav-toggle {
	display: none;
	flex: none;
	background: none;
	border: 0;
	padding: 10px;
	margin: 0;
	cursor: pointer;
}

.ff-nav-toggle-bar {
	display: block;
	width: 26px;
	height: 3px;
	margin: 5px 0;
	border-radius: 2px;
	background-color: #fff;
	transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

#ff-header.ff-open .ff-nav-toggle-bar:nth-child(2) {
	transform: translateY(8px) rotate(45deg);
}

#ff-header.ff-open .ff-nav-toggle-bar:nth-child(3) {
	opacity: 0;
}

#ff-header.ff-open .ff-nav-toggle-bar:nth-child(4) {
	transform: translateY(-8px) rotate(-45deg);
}

.ff-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Push all content below the fixed header (Divi's JS used to do this off
   #main-header's height) */
#et-main-area {
	padding-top: 140px;
}

/* Hero pages: first builder section has a background image — let it tuck all
   the way up under the angled header like the original design. Scoped to
   #main-content so the Theme Builder footer's background sections don't
   false-positive every page. */
#et-main-area:has(#main-content .et_pb_section.et_pb_with_background:first-child) {
	padding-top: 0;
}

/* Homepage hero: Divi's JS used to inject this padding after measuring
   #main-header, shoving the whole page down post-load (the old CLS). Static
   now: background image still reaches the top, text clears the header. */
#home-hero-image {
	padding-top: 260px;
}

/* Hero headline is the page's H1 (SEO) — neutralize Divi's default h1 sizing
   so it renders exactly like the original p tag, inheriting the module's
   5vw/Montserrat/uppercase styling */
#home-hero-image .et_pb_text_0 h1 {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	color: inherit;
	text-shadow: inherit;
	margin: 0;
	padding: 0;
}

/* The torn-edge slice SVGs ship with no width/height, so the browser reserves
   no space and the page jumps when they load. Lock their aspect ratios. */
img[src$="slice1.svg"] {
	width: 100%;
	height: auto;
	aspect-ratio: 1920 / 381;
}

img[src$="slice2.svg"] {
	width: 100%;
	height: auto;
	aspect-ratio: 1920 / 239;
}

@media (max-width: 1265px) {
	.ff-logo img {
		height: 95px;
	}

	.ff-menu {
		gap: 22px;
	}

	.ff-menu a {
		font-size: 16px;
	}
}

@media (max-width: 980px) {
	html {
		scroll-padding-top: 130px;
	}

	#ff-header {
		height: 110px;
	}

	.ff-header-inner {
		height: 88px;
	}

	.ff-logo img {
		height: 64px;
	}

	#et-main-area {
		padding-top: 110px;
	}

	#home-hero-image {
		padding-top: 130px;
	}

	.ff-nav-toggle {
		display: block;
	}

	.ff-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		padding: 10px 5% 25px;
		background-color: #04475C;
		box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
	}

	#ff-header.ff-open .ff-nav {
		display: flex;
	}

	.ff-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.ff-menu a {
		padding: 14px 0;
		font-size: 18px;
		border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	}

	.ff-cart {
		margin: 16px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	#ff-header,
	.ff-menu a,
	.ff-cart,
	.ff-nav-toggle-bar {
		transition: none;
	}
}
