/*
 * Floating header, matched to nosolowebs.es.
 *
 * Values taken from the live site rather than guessed: translucent black bar at
 * 39% over a 12px blur, 15px radius, 30px away from the top and the sides,
 * uppercase Inter at 18px/600 with 1px of tracking. Sticky rather than fixed —
 * the visual result is the same because the 30px gap lives inside the sticky
 * element, and nothing has to compensate for a header taken out of the flow.
 */

/*
 * Sticky lives on the partial wrapper, not on .site-header.
 *
 * A sticky element only sticks inside its own parent's box, and the wrapper the
 * header is injected into is exactly as tall as the header — so sticking it
 * there meant it scrolled away immediately. The wrapper is a direct child of
 * body, which is the whole page.
 */
body > [data-partial="header"] {
	position: sticky;
	top: 0;
	z-index: 99;
}

.site-header {
	--nav-size: 18px;
	--nav-tracking: 1px;
	padding: 30px 30px 0;
}

.site-header > .container {
	max-width: none;
	padding: 0;
}

.header-inner {
	align-items: center;
	background: rgba(0, 0, 0, 0.39);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-radius: 15px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	display: flex;
	gap: 32px;
	justify-content: space-between;
	min-height: 88px;
	padding: 15px 28px 15px 15px;
}

.site-header .brand {
	align-items: center;
	color: var(--color-white);
	display: flex;
	flex-shrink: 0;
	font-family: var(--font-display);
	font-size: 26px;
	font-weight: 700;
	gap: 10px;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.site-header .brand img {
	border-radius: 8px;
}

.main-nav {
	align-items: center;
	display: flex;
	flex: 1;
	font-family: var(--font-body);
	font-size: var(--nav-size);
	font-weight: 600;
	gap: 34px;
	justify-content: flex-end;
	letter-spacing: var(--nav-tracking);
	min-width: 0;
	text-transform: uppercase;
	white-space: nowrap;
}

.main-nav a,
.nav-dropdown summary {
	color: var(--color-white);
	text-decoration: none;
	transition: color 160ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.nav-dropdown summary:hover {
	color: var(--color-accent);
}

.nav-dropdown {
	position: relative;
}

.nav-dropdown summary {
	cursor: pointer;
	list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
	display: none;
}

.nav-dropdown summary::after {
	content: " ▾";
	font-size: 11px;
}

.nav-dropdown[open] summary::after {
	content: " ▴";
}

.nav-dropdown-menu {
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
	display: grid;
	gap: 4px;
	left: -16px;
	min-width: 200px;
	padding: 12px;
	position: absolute;
	top: calc(100% + 20px);
}

.nav-dropdown-menu a {
	border-radius: 8px;
	font-size: 15px;
	letter-spacing: 0.05em;
	padding: 8px 12px;
}

.header-actions {
	align-items: center;
	display: flex;
	flex-shrink: 0;
	gap: 14px;
}

/* Product controls stay Talk2Web's own: the chrome is the agency's, the
   buttons are the product's. */
.header-actions .button {
	white-space: nowrap;
}

.header-login {
	align-items: center;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 10px;
	color: var(--color-white);
	display: inline-flex;
	flex-shrink: 0;
	height: 42px;
	justify-content: center;
	transition: border-color 150ms ease, color 150ms ease;
	width: 42px;
}

.header-login:hover,
.header-login:focus-visible {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

.language-select {
	appearance: none;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-position: right 0 center;
	background-repeat: no-repeat;
	border: 0;
	color: var(--color-white);
	cursor: pointer;
	font-family: var(--font-body);
	font-size: var(--nav-size);
	font-weight: 600;
	letter-spacing: var(--nav-tracking);
	padding: 4px 18px 4px 0;
	text-transform: uppercase;
}

.language-select option {
	color: var(--color-ink);
}

.language-select:hover {
	color: var(--color-accent);
}

/* Flags replace the select inside the burger panel: three targets you can hit
   with a thumb, instead of a native picker sheet. */
.nav-langs {
	display: none;
	gap: 18px;
	justify-content: center;
	padding-top: 4px;
}

.nav-langs button {
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--color-white);
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	opacity: 0.5;
	padding: 6px;
	transition: opacity 150ms ease;
}

.nav-langs button[aria-current="true"] {
	opacity: 1;
}

/* Burger. Hidden on desktop, and the only way to reach the menu on a phone. */
.nav-toggle {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 10px;
	cursor: pointer;
	display: none;
	height: 42px;
	justify-content: center;
	width: 42px;
}

.nav-toggle span {
	background: var(--color-white);
	border-radius: 2px;
	display: block;
	height: 2px;
	position: relative;
	transition: background 160ms ease;
	width: 18px;
}

.nav-toggle span::before,
.nav-toggle span::after {
	background: var(--color-white);
	border-radius: 2px;
	content: "";
	height: 2px;
	left: 0;
	position: absolute;
	transition: transform 160ms ease;
	width: 18px;
}

.nav-toggle span::before {
	top: -6px;
}

.nav-toggle span::after {
	top: 6px;
}

.nav-toggle[aria-expanded="true"] span {
	background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
	transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
	transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1400px) {
	.site-header {
		--nav-size: 16px;
		--nav-tracking: 0.6px;
	}

	.main-nav {
		gap: 24px;
	}
}

@media (max-width: 1180px) {
	.site-header {
		--nav-size: 15px;
	}

	.main-nav {
		gap: 18px;
	}

	.site-header .brand span {
		display: none;
	}
}

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

	/* Only the logo and the burger survive here. Everything else moves inside
	   the panel, where there is room for it. */
	.header-actions {
		display: none;
	}

	.nav-langs {
		display: flex;
	}

	.main-nav {
		background: rgba(0, 0, 0, 0.82);
		backdrop-filter: blur(12px);
		-webkit-backdrop-filter: blur(12px);
		border-radius: 15px;
		display: none;
		flex-direction: column;
		gap: 18px;
		left: 0;
		padding: 24px;
		position: absolute;
		right: 0;
		top: calc(100% + 12px);
	}

	.header-inner {
		position: relative;
	}

	.site-header[data-nav-open="true"] .main-nav {
		display: flex;
	}

	.nav-dropdown-menu {
		position: static;
		background: transparent;
		box-shadow: none;
		padding: 8px 0 0 12px;
	}
}

@media (max-width: 680px) {
	.site-header {
		padding: 14px 14px 0;
	}

	.header-inner {
		min-height: 64px;
		padding: 10px 14px;
	}

	.site-header .brand {
		font-size: 21px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.main-nav a,
	.header-login,
	.nav-toggle span,
	.nav-toggle span::before,
	.nav-toggle span::after {
		transition: none;
	}
}
