/* New header layout for Computer Shop theme */

/* Reset legacy header/menu specifics that could conflict */
#branding {
	border-top: 0;
	padding: 0;
	position: relative;
}

#branding hgroup,
#access div {
	margin: 0;
}

#site-title,
#site-description {
	display: none;
}

#branding #searchform {
	position: static;
	top: auto;
	right: auto;
}

/* Rows */
.csh-header {
	background: #fff;
	border-bottom: 1px solid #e6e6e6;
}

.csh-header__row--top {
	display: grid;
	grid-template-columns: 220px 1fr 200px;
	align-items: center;
	gap: 16px;
	padding: 12px 20px;
	max-width: 1250px;
	margin-left: auto;
	margin-right: auto;
	height: 66px;
}

.csh-header__logo {
	height: 36px;
}

.csh-header__logo a {
	display: inline-flex;
	align-items: center;
}

.csh-header__logo img {
	max-height: 36px;
	width: auto;
	display: block;
}

/* Search */
.csh-search {
	max-width: 780px;
	margin: 0 auto;
}

.csh-search form {
	display: flex;
	align-items: center;
	background: #fff;
	border: 2px solid #62b2e8;
	border-radius: 15px;
	padding: 0px 12px 0px 16px;
	min-width: 400px;
}

.csh-search .csh-search__input,
#csh-search-input {
	flex: 1 1 auto;
	border: 0;
	outline: none;
	background: transparent;
	box-shadow: none;
	font-size: 14px;
	color: #1a1a1a;
	padding: 0px 8px;
}

.csh-search .csh-search__submit {
	appearance: none;
	border: 0;
	background: transparent;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.csh-search .csh-search__icon {
	width: 20px;
	height: 20px;
}

/* Remove pseudo-drawn icon now that SVG is inline */
.csh-search .csh-search__submit:before,
.csh-search .csh-search__submit:after { display: none; }

/* Subtle hover effect */
.csh-search .csh-search__submit:hover { background: rgba(25,130,209,0.08); }

/* Language switcher */
.csh-lang {
	justify-self: end;
	position: relative;
}

.csh-lang__btn {
	background: #fff;
	border: 1px solid #dbe9f7;
	border-radius: 20px;
	padding: 6px 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.csh-lang__btn img {
	width: 18px;
	height: 12px;
	object-fit: cover;
}

.csh-lang__list {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	background: #fff;
	border: 1px solid #e6eef8;
	border-radius: 8px;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
	padding: 0;
	display: none;
	z-index: 50;
}

.csh-lang__list[aria-hidden="false"] {
	display: block;
}

.csh-lang__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	text-decoration: none;
	color: #222;
}

.csh-lang__item:hover {
	background: #f2f8ff;
}

.csh-lang__item img {
	width: 18px;
	height: 12px;
	object-fit: cover;
}

/* Bottom row (menu) */
.csh-header__row--bottom {
	background: linear-gradient(90deg, #3bb0f0 0%, #1c7ad6 100%);
	padding: 0 20px;
	height: 44px;
}

.csh-header__bottom-inner {
	max-width: 1250px;
	margin-left: auto;
	margin-right: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 44px;
}

.csh-header__bottom-left { display: inline-block; }

.csh-header__bottom-right { display: inline-block; }

.csh-cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #fff;
	background: transparent;
	border: none;
	text-decoration: none;
	padding: 12px 8px;
	transition: opacity 0.2s ease;
}

.csh-cta:hover,
.csh-cta:focus {
	opacity: 0.85;
}

.csh-cta svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.csh-menu {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Hide mobile-only overlay elements by default (desktop and large screens) */
.csh-menu__backdrop,
.csh-menu__panel,
#csh-primary-menu-mobile { display: none; }

	.csh-search__toggle {
		display: none;
		background: transparent;
		border: 0;
		color: #fff;
		padding: 12px 8px;
		cursor: pointer;
		transition: opacity 0.2s ease;
	}

	.csh-search__toggle:hover {
		opacity: 0.85;
	}

	.csh-search__toggle-icon {
		width: 20px;
		height: 20px;
	}

	.csh-menu__toggle {
		display: none;
		background: transparent;
		border: 0;
		color: #fff;
		font-size: 16px;
		padding: 12px 8px;
		cursor: pointer;
	}

/* Use WordPress menu output but restyle */
#csh-primary-menu {
	display: block;
}

/* Stronger targeting to ensure horizontal UL/LI and no bullets */
#csh-primary-menu ul,
#csh-primary-menu .menu {
	display: flex;
	flex-direction: row;
	gap: var(--csh-menu-gap, 16px);
	margin: 0;
	padding: 0;
	list-style: none;
}

#csh-primary-menu li {
	list-style: none;
	margin: 0;
	padding: 0;
}

#csh-primary-menu .menu>li>a,
#csh-primary-menu ul>li>a {
	color: #fff;
	display: block;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

#csh-primary-menu .menu>li>a:hover,
#csh-primary-menu .menu>li>a:focus,
#csh-primary-menu ul>li>a:hover,
#csh-primary-menu ul>li>a:focus {
	opacity: 0.85;
	text-decoration: none;
}

#csh-primary-menu .menu>li>a:visited,
#csh-primary-menu .menu>li>a:active,
#csh-primary-menu ul>li>a:visited,
#csh-primary-menu ul>li>a:active {
	color: #fff;
}

/* Responsive */
@media (max-width: 1023px) {
	.csh-header__row--top {
		grid-template-columns: 160px 1fr 160px;
		gap: 10px;
	}

	.csh-header__logo img {
		max-height: 36px;
	}
}

@media (max-width: 768px) {
	.csh-header {
		position: sticky;
		top: 0;
		z-index: 1000;
	}

	.csh-header__row--top {
		grid-template-columns: 140px 1fr 120px;
		padding: 10px 12px;
	}

	.csh-search form {
		padding: 4px 8px 4px 12px;
	}

	.csh-search .csh-search__input {
		font-size: 13px;
	}

	/* Hide header search on mobile */
	.csh-search { display: none; }

	.csh-search__toggle {
		display: inline-block;
	}

	.csh-menu__toggle {
		display: inline-block;
	}

	#csh-primary-menu {
		display: none;
		width: 100%;
	}

	#csh-primary-menu.is-open {
		display: block;
	}

	#csh-primary-menu .menu,
	#csh-primary-menu ul {
		flex-direction: column;
	}

	#csh-primary-menu .menu>li>a,
	#csh-primary-menu ul>li>a {
		border-top: 1px solid rgba(255, 255, 255, 0.25);
	}
}

/* Mobile layout change at 900px: CTA left, menu/hamburger right */
@media (max-width: 900px) {
	.csh-header__bottom-inner {
		flex-direction: row-reverse;
	}

	/* Ensure language switcher is placed in the third column at <=900px */
	.csh-lang { grid-column: 3; }

	/* Show hamburger toggle up to 900px */
	.csh-menu__toggle { display: inline-block; }

	/* Fullscreen mobile menu overlay */
	body.no-scroll { overflow: hidden; }

	/* Hide legacy inline mobile menu */
	#csh-primary-menu { display: none !important; }
	#csh-primary-menu.is-open { display: none !important; }

	.csh-menu__backdrop {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		background: rgba(0,0,0,0.5);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
		z-index: 9998;
	}

	.csh-menu__backdrop.is-open {
		opacity: 1;
		pointer-events: auto;
	}

	.csh-menu__panel {
		display: block;
		position: fixed;
		top: 0;
		right: 0;
		height: 100vh;
		width: 80vw;
		max-width: 360px;
		background: #111;
		color: #fff;
		transform: translateX(100%);
		transition: transform 0.28s ease;
		z-index: 9999;
		padding: 20px 16px 32px;
		box-shadow: none;
	}

	.csh-menu__panel.is-open {
		transform: translateX(0);
		box-shadow: -8px 0 24px rgba(0,0,0,0.35);
	}

	.csh-menu__close {
		position: absolute;
		top: 8px;
		right: 8px;
		appearance: none;
		background: transparent;
		border: 0;
		color: #fff;
		font-size: 28px;
		line-height: 1;
		padding: 8px;
		cursor: pointer;
	}

	/* Mobile Search Form */
	.csh-mobile-search {
		margin: 20px 0 24px 0;
		padding: 0 8px;
	}

	.csh-mobile-search__wrapper {
		display: flex;
		align-items: center;
		background: #fff;
		border: 2px solid #e0e0e0;
		border-radius: 8px;
		padding: 0 8px 0 12px;
		transition: border-color 0.2s ease;
		margin-top: 40px;
	}

	.csh-mobile-search__wrapper:focus-within {
		border-color: #62b2e8;
	}

	.csh-mobile-search__input {
		flex: 1;
		border: 0;
		outline: none;
		background: transparent;
		font-size: 16px;
		color: #1a1a1a;
		padding: 12px 8px 12px 0;
		-webkit-appearance: none;
		appearance: none;
	}

	.csh-mobile-search__input::placeholder {
		color: #888;
	}

	.csh-mobile-search__submit {
		appearance: none;
		border: 0;
		background: transparent;
		width: 36px;
		height: 36px;
		border-radius: 50%;
		cursor: pointer;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		transition: background-color 0.2s ease;
		margin-left: 4px;
	}

	.csh-mobile-search__submit:hover {
		background: rgba(98, 178, 232, 0.1);
	}

	.csh-mobile-search__icon {
		width: 20px;
		height: 20px;
	}

	/* Mobile vertical menu list */
	#csh-primary-menu-mobile { display: block; }

	#csh-primary-menu-mobile ul,
	#csh-primary-menu-mobile .menu {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	#csh-primary-menu-mobile li { list-style: none; }

	#csh-primary-menu-mobile a {
		display: block;
		padding: 12px 8px;
		color: #fff;
		text-decoration: none;
		border-radius: 6px;
	}

	#csh-primary-menu-mobile a:hover,
	#csh-primary-menu-mobile a:focus {
		background: rgba(255,255,255,0.08);
		outline: none;
	}
}

/* Current-language flag exact sizing */
.csh-lang__btn .csh-lang__flag {
	width: 16px!important;
	height: 11px!important;
	object-fit: cover;
}