/**
 * Header navigation drawer (site-wide).
 *
 * WHY THIS EXISTS
 * Agrimo's header needs ~1541px to lay out its contents (logo 150 + nav 796 +
 * phone 164 + search 78 + CTA 241 + padding 80). Its own burger only appears
 * at <=1200px, so between roughly 1200px and 1590px the nav wrapped onto a
 * second line and the CTA collided with the search button. Below --mfs-nav-bp
 * the phone, search and CTA now move into the drawer instead, which leaves the
 * bar with just logo + nav + burger (~1102px) and it fits comfortably.
 *
 * The nav LINKS stay in the bar down to Agrimo's own 1200px switch, so laptop
 * users keep their navigation; only the right-hand controls collapse early.
 */

:root {
	/* Documentation only. CSS media queries cannot read a custom property, so
	   the real breakpoint is the `1599.98px` in the queries below and THIS FILE
	   is its single authority. mobile-nav.js never hard-codes a number; it asks
	   whether .mfs-nav-toggle is visible. Change the queries and this comment
	   together and nothing else needs touching.
	   BREAKPOINT: 1600px */

	--mfs-drawer-w: min(400px, 88vw);
	--mfs-drawer-ms: 240ms;
	--mfs-red: #dc1f01;
	--mfs-ink: #16170f;
	--mfs-rule: #e3e0d4;
	--mfs-cream: #f8f7f0;
	--mfs-head: Signika, "Signika Negative", "Trebuchet MS", sans-serif;
}

/* =========================================================================
   TOGGLE BUTTON
   ====================================================================== */
/*
 * Agrimo ships this at @media (max-width: 575px):
 *
 *   button:not(.pbmit-nav-menu-toggle):not(.wp-element-button):not(.nav-menu-toggle)
 *     { padding: 15px 30px; }
 *
 * Three :not(.class) selectors put it at specificity (0,3,1), which beats any
 * plain single-class rule here. On phones it therefore forced 15px/30px padding
 * onto every icon button in the header and drawer and collapsed their contents,
 * which is why the hamburger and the close icon rendered as nothing. Every
 * icon button below has to restate its padding with !important to win, and
 * box-sizing so a future padding surprise cannot resize the box either.
 */
.mfs-nav-toggle,
.mfs-drawer__close,
.mfs-drawer__disclosure,
.mfs-drawer__search .search-submit {
	padding: 0 !important;
	box-sizing: border-box;
	flex: none;
}

.mfs-nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	/* Sized to sit alongside Agrimo's legacy burger, which was an icon font at
	   font-size:35px in a 40px box (agrimo/css/core.css, max-width:1200 block). */
	width: 52px;
	height: 52px;
	margin-left: 10px;
	border: 0;
	border-radius: 50%;
	/*
	 * A dark disc rather than a corner gradient: the header sits over video on
	 * the homepage, over title-bar photography on interior pages, and over
	 * solid white if the sticky header is ever enabled. A disc gives the white
	 * bars the same backing in all three, and matches the hero's pause control,
	 * which already uses this treatment.
	 */
	background: rgba(0, 0, 0, .42);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	color: #fff;
	cursor: pointer;
	transition: background-color .15s ease;
}
.mfs-nav-toggle:hover { background: rgba(0, 0, 0, .62); }
.mfs-nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.mfs-nav-toggle__bars {
	display: block;
	width: 26px;
}
.mfs-nav-toggle__bars i {
	display: block;
	height: 3px;
	border-radius: 3px;
	background: currentColor;
}
.mfs-nav-toggle__bars i + i { margin-top: 6px; }
/* White on every page and every header state; the corner wash below is what
   makes that legible rather than switching the icon to ink per context. */

@media (max-width: 1599.98px) {
	.mfs-nav-toggle { display: inline-flex; }

	/* The three pieces that no longer fit. They live in the drawer now.
	   Agrimo already hides .pbmit-button-box at <=1400px and
	   .pbmit-button-box-second at <=1200px; this pulls both forward and adds
	   the search button so the bar stops overflowing at ~1590px. */
	.pbmit-header-style-3 .pbmit-button-box,
	.pbmit-header-style-3 .pbmit-search-cart-box,
	.site-header.pbmit-header-style-3 .pbmit-right-box .pbmit-button-box-second {
		display: none;
	}
}

/* Agrimo's own burger is replaced entirely; leaving it would give the header
   two toggles driving two different panels. */
.pbmit-burger-menu-wrapper { display: none !important; }

/* Its off-canvas panel used position:fixed + opacity:0 and stayed in the tab
   order while invisible. Take it out properly. */
@media (max-width: 1200px) {
	.pbmit-header-style-3 .pbmit-menuarea { display: none; }
	.pbmit-navbar > div { display: none !important; }
}

/* =========================================================================
   DRAWER
   ====================================================================== */
.mfs-drawer[hidden] { display: none; }
.mfs-drawer {
	position: fixed;
	inset: 0;
	z-index: 9999;
}

.mfs-drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity var(--mfs-drawer-ms) ease;
}

.mfs-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	width: var(--mfs-drawer-w);
	height: 100%;
	height: 100dvh;
	background: #fff;
	box-shadow: -8px 0 40px rgba(0, 0, 0, .18);
	transform: translateX(100%);
	/* Delay ONLY visibility so the slide-out finishes painting before the
	   panel leaves the accessibility tree. */
	transition: transform var(--mfs-drawer-ms) cubic-bezier(.22, .61, .36, 1),
	            visibility 0s linear var(--mfs-drawer-ms);
	visibility: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* aria-expanded is the single source of truth; the CSS reads it directly. */
.mfs-nav-toggle[aria-expanded="true"] ~ .mfs-drawer .mfs-drawer__panel,
.mfs-drawer-open .mfs-drawer__panel {
	transform: translateX(0);
	visibility: visible;
	transition-delay: 0s;
}
.mfs-drawer-open .mfs-drawer__scrim { opacity: 1; }

/* Scroll lock. */
.mfs-drawer-open,
.mfs-drawer-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.mfs-drawer__panel,
	.mfs-drawer__scrim { transition-duration: 1ms; }
}

/* ------------------------------------------------------------------ head */
.mfs-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .65rem 1.25rem;
	border-bottom: 1px solid var(--mfs-rule);
}
.mfs-drawer__brand {
	display: block;
	line-height: 1;
	max-width: 62%;
}
.mfs-drawer__logo {
	display: block;
	width: auto;
	height: 46px;
	max-width: 100%;
}
/* The fallback asset is the white knockout wordmark; flip it to solid ink for
   the drawer's white paper. A custom logo set in Site Identity is used as-is. */
.mfs-drawer__logo--knockout { filter: brightness(0); }

.mfs-drawer__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1px solid var(--mfs-rule);
	border-radius: 50%;
	background: #fff;
	color: var(--mfs-ink);
	cursor: pointer;
}
.mfs-drawer__close svg { width: 24px; height: 24px; }
.mfs-drawer__close:hover { background: var(--mfs-cream); }
.mfs-drawer__close:focus-visible { outline: 2px solid var(--mfs-red); outline-offset: 2px; }

/* ---------------------------------------------------------------- search */
.mfs-drawer__search { padding: 1rem 1.25rem 0; }
.mfs-drawer__search .search-form {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .35rem .35rem .9rem;
	border: 1px solid var(--mfs-rule);
	border-radius: 999px;
	background: var(--mfs-cream);
}
.mfs-drawer__search .search-field {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	font-size: .9375rem;
	color: var(--mfs-ink);
}
.mfs-drawer__search .search-field:focus { outline: none; }
.mfs-drawer__search .search-form:focus-within {
	border-color: var(--mfs-red);
	box-shadow: 0 0 0 3px rgba(220, 31, 1, .12);
}
.mfs-drawer__search .search-submit {
	flex: none;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--mfs-red);
	cursor: pointer;
	position: relative;
}
.mfs-drawer__search .search-submit::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	color: #fff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9 3a6 6 0 104.2 10.2l3.3 3.3 1.4-1.4-3.3-3.3A6 6 0 009 3zm0 2a4 4 0 110 8 4 4 0 010-8z'/%3E%3C/svg%3E") center / 18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9 3a6 6 0 104.2 10.2l3.3 3.3 1.4-1.4-3.3-3.3A6 6 0 009 3zm0 2a4 4 0 110 8 4 4 0 010-8z'/%3E%3C/svg%3E") center / 18px no-repeat;
}

/* ------------------------------------------------------------------- nav */
.mfs-drawer__nav { flex: 1 1 auto; padding: .5rem 0 1rem; }
.mfs-drawer__menu,
.mfs-drawer__submenu { margin: 0; padding: 0; list-style: none; }
.mfs-drawer__submenu[hidden] { display: none; }

.mfs-drawer__row {
	display: flex;
	align-items: stretch;
	border-bottom: 1px solid var(--mfs-rule);
}
.mfs-drawer__item--depth-0 > .mfs-drawer__row > .mfs-drawer__link {
	font-family: var(--mfs-head);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: .01em;
	text-transform: uppercase;
}
.mfs-drawer__link {
	flex: 1 1 auto;
	padding: .95rem 1.25rem;
	color: var(--mfs-ink);
	text-decoration: none;
	font-size: .9375rem;
	line-height: 1.3;
}
.mfs-drawer__link:hover,
.mfs-drawer__link:focus-visible { color: var(--mfs-red); }
.mfs-drawer__item.is-current > .mfs-drawer__row > .mfs-drawer__link { color: var(--mfs-red); }

.mfs-drawer__disclosure {
	flex: none;
	width: 56px;
	border: 0;
	border-left: 1px solid var(--mfs-rule);
	background: transparent;
	color: var(--mfs-ink);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.mfs-drawer__disclosure svg { width: 18px; height: 18px; transition: transform 160ms ease; }
.mfs-drawer__disclosure[aria-expanded="true"] svg { transform: rotate(180deg); }
.mfs-drawer__disclosure:hover { background: var(--mfs-cream); color: var(--mfs-red); }
.mfs-drawer__disclosure:focus-visible { outline: 2px solid var(--mfs-red); outline-offset: -2px; }

.mfs-drawer__submenu { background: var(--mfs-cream); }
.mfs-drawer__submenu .mfs-drawer__link { padding-left: 2.25rem; }
.mfs-drawer__submenu .mfs-drawer__row { border-bottom-color: #ece9dd; }

/* ------------------------------------------------------------------ foot */
.mfs-drawer__foot {
	flex: none;
	display: grid;
	gap: .75rem;
	padding: 1.25rem;
	border-top: 1px solid var(--mfs-rule);
	background: var(--mfs-cream);
	position: sticky;
	bottom: 0;
}
.mfs-drawer__cta {
	display: block;
	padding: .95rem 1.25rem;
	border-radius: 999px;
	background: var(--mfs-red);
	color: #fff !important;   /* Agrimo forces link colours theme-wide. */
	font-family: var(--mfs-head);
	font-weight: 600;
	font-size: .9375rem;
	text-align: center;
	text-decoration: none;
}
.mfs-drawer__cta:hover { background: #911300; }
.mfs-drawer__cta:focus-visible { outline: 2px solid var(--mfs-ink); outline-offset: 2px; }

.mfs-drawer__tel {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .1rem;
	padding: .5rem;
	color: var(--mfs-ink);
	text-decoration: none;
}
.mfs-drawer__tel-label {
	font-size: .6875rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #5c5c55;
}
.mfs-drawer__tel-num {
	font-family: var(--mfs-head);
	font-weight: 700;
	font-size: 1.125rem;
	color: var(--mfs-red);
}

/* =========================================================================
   NO-JS FALLBACK
   Without the script the drawer can never open, so the bar must keep
   everything it needs. Restore the right-hand controls and hide the toggle.
   ====================================================================== */
html:not(.mfs-js) .mfs-nav-toggle { display: none !important; }
html:not(.mfs-js) .mfs-drawer { display: none !important; }
@media (max-width: 1599.98px) {
	html:not(.mfs-js) .pbmit-header-style-3 .pbmit-search-cart-box,
	html:not(.mfs-js) .site-header.pbmit-header-style-3 .pbmit-right-box .pbmit-button-box-second {
		display: block;
	}
}

/* =========================================================================
   BAR TIGHTENING between Agrimo's 1200px switch and the drawer breakpoint,
   so six top-level items sit on one line without wrapping.
   ====================================================================== */
@media (min-width: 1201px) and (max-width: 1599.98px) {
	body:not(.mega-menu-pbminfotech-top) .pbmit-header-style-3 .pbmit-navbar div > ul > li {
		padding: 0 16px;
	}
	.pbmit-header-style-3 .pbmit-menuarea { padding-left: 12px; }
}
