/*
 * Header. Figma: Nav (node 60:512), desktop: white bar, 1px bottom line, 20px vertical padding,
 * logo 156x52, menu gap 36, actions gap 24. Dropdown panel and mobile menu are not in Figma.
 */
.sm-header {
	position: relative;
	z-index: 50; /* dropdowns fall over the hero, whose z-index is 2 */
	box-sizing: border-box;
	background-color: var(--wp--preset--color--neutral-white);
	border-bottom: 1px solid var(--wp--preset--color--neutral-line);
	font-family: var(--wp--preset--font-family--dm-sans);
}

.sm-header *,
.sm-header *::before,
.sm-header *::after {
	box-sizing: border-box;
}

.sm-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--32);
	max-width: calc(1320px + 2 * var(--sm-page-padding));
	margin: 0 auto;
	padding: 20px var(--sm-page-padding);
}

/* Larger logo (client feedback, 23 Oct 2026): 156 x 52 -> 204 x 68 */
.sm-header__logo {
	display: block;
	flex: none;
	width: 204px;
	height: 68px;
}

.sm-header__logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sm-header__panel {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--32);
}

/* Menu: centred between logo and actions like in Figma */
.sm-header__nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
}

.sm-header__menu {
	display: flex;
	align-items: flex-start;
	gap: 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sm-header__item {
	position: relative;
	margin: 0;
	padding: 0;
}

.sm-header__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 500;
	line-height: 26px;
	color: var(--wp--preset--color--brand-navy);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s ease;
}

.sm-header__link:hover {
	color: var(--wp--preset--color--brand-red);
	text-decoration: none;
}

.sm-header__link img {
	flex: none;
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.sm-header__item--sub.is-open > .sm-header__link img {
	transform: rotate(180deg);
}

/* Dropdown */
.sm-header__sub {
	position: absolute;
	top: 100%;
	left: -16px;
	z-index: 1;
	min-width: 240px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background-color: var(--wp--preset--color--neutral-white);
	border: 1px solid var(--wp--preset--color--neutral-line);
	border-radius: var(--wp--preset--border-radius--md);
	box-shadow: var(--wp--preset--shadow--card);
	visibility: hidden;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

/* The item stays hovered while the pointer crosses the 12px gap above the panel */
.sm-header__item--sub::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 12px;
}

.sm-header__item--sub {
	padding-bottom: 0;
}

.sm-header__sub {
	margin-top: 12px;
}

.sm-header__sub li {
	margin: 0;
	padding: 0;
}

.sm-header__sub a {
	display: block;
	padding: 10px 16px;
	border-radius: var(--wp--preset--border-radius--sm);
	font-size: var(--wp--preset--font-size--link);
	font-weight: 500;
	line-height: 22px;
	color: var(--wp--preset--color--brand-navy);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.sm-header__sub a:hover,
.sm-header__sub a:focus-visible {
	background-color: var(--wp--preset--color--neutral-pale);
	color: var(--wp--preset--color--brand-red);
	text-decoration: none;
}

.sm-header__item--sub.is-open > .sm-header__sub {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

@media (hover: hover) {
	.sm-header__item--sub:hover > .sm-header__sub {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
	}

	.sm-header__item--sub:hover > .sm-header__link img {
		transform: rotate(180deg);
	}
}

/* Actions */
.sm-header__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 24px;
}

.sm-header__phone {
	font-size: var(--wp--preset--font-size--link);
	font-weight: 600;
	line-height: 22px;
	color: var(--wp--preset--color--brand-navy);
	text-decoration: none;
	white-space: nowrap;
}

.sm-header__phone:hover {
	color: var(--wp--preset--color--brand-red);
	text-decoration: none;
}

/* Call button first (main action), booking second. On desktop booking is a text link so the bar stays on one line. */
.sm-header__call {
	white-space: nowrap;
}

@media (min-width: 1321px) {
	.sm-header__actions .sm-header__book {
		min-width: 0;
		min-height: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		font-size: var(--wp--preset--font-size--link);
		line-height: 22px;
		color: var(--wp--preset--color--brand-navy);
		white-space: nowrap;
	}

	.sm-header__actions .sm-header__book:hover {
		background: none;
		color: var(--wp--preset--color--brand-red);
	}
}

.sm-header__link:focus-visible,
.sm-header__phone:focus-visible,
.sm-header__call:focus-visible,
.sm-header__book:focus-visible,
.sm-header__toggle:focus-visible,
.sm-header__logo:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-blue);
	outline-offset: 4px;
	border-radius: var(--wp--preset--border-radius--sm);
}

/* Hamburger (hidden on desktop) */
.sm-header__toggle {
	display: none;
	position: relative;
	flex: none;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--wp--preset--color--neutral-line);
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--wp--preset--color--neutral-white);
	cursor: pointer;
}

.sm-header__bars,
.sm-header__bars::before,
.sm-header__bars::after {
	position: absolute;
	left: 50%;
	width: 20px;
	height: 2px;
	margin-left: -10px;
	border-radius: 2px;
	background-color: var(--wp--preset--color--brand-navy);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.sm-header__bars {
	top: 50%;
	margin-top: -1px;
}

.sm-header__bars::before,
.sm-header__bars::after {
	content: "";
	left: 0;
	margin-left: 0;
}

.sm-header__bars::before {
	top: -6px;
}

.sm-header__bars::after {
	top: 6px;
}

.sm-header.is-open .sm-header__bars {
	background-color: transparent;
}

.sm-header.is-open .sm-header__bars::before {
	transform: translateY(6px) rotate(45deg);
}

.sm-header.is-open .sm-header__bars::after {
	transform: translateY(-6px) rotate(-45deg);
}

/* Tablet + mobile: the full menu with the call button does not fit below ~1320px */
@media (max-width: 1320px) {
	.sm-header__inner {
		flex-wrap: wrap;
		gap: 0;
		padding-top: 16px;
		padding-bottom: 16px;
	}

	.sm-header__toggle {
		display: block;
	}

	.sm-header__panel {
		display: none;
		flex: 0 0 100%;
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--24);
		padding-top: var(--wp--preset--spacing--24);
	}

	.sm-header.is-open .sm-header__panel {
		display: flex;
	}

	.sm-header__nav {
		display: block;
	}

	.sm-header__menu {
		flex-direction: column;
		gap: 0;
	}

	.sm-header__item {
		border-top: 1px solid var(--wp--preset--color--neutral-line);
	}

	.sm-header__link {
		width: 100%;
		justify-content: space-between;
		padding: 14px 0;
	}

	.sm-header__item--sub::after {
		display: none;
	}

	.sm-header__sub {
		position: static;
		display: none;
		min-width: 0;
		margin: 0 0 12px;
		padding: 0 0 0 16px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: none;
	}

	.sm-header__item--sub.is-open > .sm-header__sub {
		display: block;
	}

	/* No hover-open on touch-sized layouts: only the button toggles */
	.sm-header__item--sub:hover:not(.is-open) > .sm-header__sub {
		display: none;
	}

	.sm-header__item--sub:hover:not(.is-open) > .sm-header__link img {
		transform: none;
	}

	.sm-header__actions {
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--16);
		padding-bottom: var(--wp--preset--spacing--8);
		text-align: center;
	}

	/* Every element of the open menu spans the full width */
	.sm-header__panel,
	.sm-header__nav,
	.sm-header__menu,
	.sm-header__item,
	.sm-header__sub,
	.sm-header__sub a,
	.sm-header__actions,
	.sm-header__phone,
	.sm-header__actions .sm-btn {
		width: 100%;
	}

	.sm-header__phone {
		display: block;
	}
}

@media (max-width: 767px) {
	.sm-header__logo {
		width: 150px;
		height: 50px;
	}
}

/* Five menu items since "Despre noi" (25 Oct 2026): tighter menu gap on narrow desktops so the bar stays on one line */
@media (min-width: 1321px) and (max-width: 1439px) {
	.sm-header__menu {
		gap: 24px;
	}
}
