/*
 * Header top row: account links (Home / Blog / Log In) + search bar (KPS)
 * Loaded after stylesheet.css / stylesheet_responsive.css (alphabetical),
 * so these rules override the older #account-nav / #topSearchDiv rules.
 *
 * Both pills are drawn in CSS (dark translucent box, thin olive border) so
 * they no longer depend on boxes painted into the header image.
 *
 * Desktop: one row across the top-left of the header banner.
 * Tweak #header-toprow top/left/max-width if the new header art needs it.
 */

/* ---------- shared pill look ---------- */
#header #account-nav,
#header #toprightDiv,
.header-search {
	border: 1px solid rgba(160, 150, 70, 0.75);
	border-radius: 8px;
	background: rgba(20, 20, 10, 0.7);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
	box-sizing: border-box;
}

/* ---------- desktop row ---------- */
#header-toprow {
	position: absolute;
	top: 10px;
	left: 12px;
	max-width: 790px; /* stays clear of the cart/checkout pill at the right */
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 5;
}

/* account links: sized/weighted like the "Gardens & Orchards" banner text */
#header #account-nav {
	position: static;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	width: auto;
	height: 30px;
	margin: 0;
	padding: 0 18px;
	top: auto;
	left: auto;
}

#header #account-nav li {
	float: none;
	width: auto;
	margin: 0 0 0 20px;
	padding: 0;
	list-style: none;
}

#header #account-nav li:first-child {
	margin-left: 0;
}

#header #account-nav a {
	display: block;
	height: auto;
	padding: 0;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 17px;
	font-weight: bold;
	line-height: 28px;
	white-space: nowrap;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
	text-decoration: none;
}

#header #account-nav a:hover,
#header #account-nav a:focus-visible {
	color: #f2df7a;
}

/* Shopping Cart / Checkout: same pill and text as the account links */
#header #toprightDiv {
	position: absolute;
	top: 15px;  /* lines up with the account-links pill */
	right: 15px; /* keeps the pill inside the banner's gold border */
	left: auto;
	display: flex;
	align-items: center;
	width: auto;
	height: 30px;
	margin: 0;
	padding: 0 18px;
	font-size: 0; /* hides the raw "&nbsp;|&nbsp;" separator text */
	z-index: 5;
	transition: none;
}

#header #toprightDiv a {
	display: block;
	position: static;
	margin-left: 20px;
	padding: 0;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 17px;
	font-weight: bold;
	line-height: 28px;
	white-space: nowrap;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
	text-decoration: none;
}

#header #toprightDiv a:first-child {
	margin-left: 0;
}

#header #toprightDiv a:hover,
#header #toprightDiv a:focus-visible {
	color: #f2df7a;
}

/* search bar */
#topSearchDiv {
	position: static;
	flex: 1 1 460px;
	min-width: 260px;
	width: 460px;
	height: auto;
	margin: 5px;
	text-align: left;
}

.header-search {
	display: flex;
	align-items: stretch;
	width: 100%;
	height: 30px;
	margin: 0;
	overflow: hidden;
}

.header-search:focus-within {
	border-color: rgba(217, 196, 99, 0.95);
	background: rgba(20, 20, 10, 0.8);
}

.header-search__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

#topSearchDiv .header-search__input,
#topSearchDiv .header-search__input:focus {
	flex: 1 1 auto;
	min-width: 0;
	width: auto !important;
	height: 100%;
	margin: 0;
	padding: 0 14px 0 20px;
	border: none !important;
	border-radius: 0;
	outline: none !important;
	background: transparent;
	color: #f0f0f0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	font-weight: bold;
	font-style: italic;
	line-height: normal;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
}

#topSearchDiv .header-search__input::placeholder {
	color: #e4e4e4;
	text-transform: lowercase;
	opacity: 1;
}

#topSearchDiv .header-search__input::-webkit-search-cancel-button {
	cursor: pointer;
	filter: invert(1);
}

/* Button kept in the markup for accessibility; hidden to match the original look (Enter submits) */
.header-search__button {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- tablet / mobile: header collapses to the 59px black bar ---------- */
@media only screen and (max-width: 1038px) {
	#header-toprow {
		position: static;
		display: block;
		max-width: none;
	}

	/* account links live in the mobile slide-out menu; cart uses the mobile cart icon */
	#header #account-nav,
	#header #toprightDiv {
		display: none;
	}

	#topSearchDiv {
		position: absolute;
		top: 12px;
		left: 60px;
		right: 60px;
		width: auto;
		min-width: 0;
		margin: 0;
		z-index: 5;
	}

	.header-search {
		height: 36px;
	}

	#topSearchDiv .header-search__input,
	#topSearchDiv .header-search__input:focus {
		padding-left: 14px;
		font-size: 16px; /* 16px stops iOS zooming on focus */
	}
}

@media only screen and (max-width: 480px) {
	#topSearchDiv {
		left: 52px;
		right: 52px;
	}
}
