/**
 * Nagłówek — Mądra Sówka (Customizer logo, menu WP, ACF: Poradnia / CTA / telefon).
 */

.site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	width: 100%;
	background: rgba(247, 243, 235, 0.96);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1.5px solid rgba(91, 140, 122, 0.13);
	transition: box-shadow 0.3s;
	isolation: isolate;
}

.site-header.scrolled {
	box-shadow: 0 4px 24px rgba(44, 58, 53, 0.07);
}

/* Szerszy niż treść strony (.ms-hero__inner ≈ 1160px, .ms-container 1120px) */
.header-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: min(1420px, 100% - 2rem);
	margin: 0 auto;
	padding: 0 clamp(1.25rem, 4vw, 3rem);
	height: 70px;
	min-height: 70px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1rem, 2.2vw, 2.25rem);
	overflow: visible;
	position: relative;
	z-index: 3;
}

/* ── Branding / logo ── */
.site-branding {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.site-branding .custom-logo-link {
	display: flex;
	align-items: center;
	text-decoration: none;
}

.site-branding .custom-logo {
	max-height: 50px;
	max-width: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.site-logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.logo-fallback {
	display: flex;
	align-items: center;
	gap: 11px;
}

.logo-owl-svg {
	width: 46px;
	height: 46px;
	flex-shrink: 0;
}

.logo-fallback-text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.logo-name {
	font-family: var(--ms-font-heading);
	font-weight: 900;
	font-size: 1.15rem;
	color: var(--ms-ink);
	letter-spacing: -0.015em;
	text-transform: lowercase;
}

.logo-tagline {
	font-family: var(--ms-font-body);
	font-size: 0.67rem;
	color: var(--ms-sage);
	letter-spacing: 0.025em;
}

/* ── Nawigacja ── */
.header-nav {
	margin: 0 auto;
}

.nav-main {
	display: flex;
	align-items: center;
	gap: 0.2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-main li a {
	display: block;
	padding: 6px 12px;
	border-radius: 8px;
	font-family: var(--ms-font-heading);
	font-size: 0.87rem;
	font-weight: 700;
	color: var(--ms-muted);
	text-decoration: none;
	transition: color 0.2s, background 0.2s;
	white-space: nowrap;
}

.nav-main li a:hover,
.nav-main li.current-menu-item > a,
.nav-main li.current-page-ancestor > a {
	color: var(--ms-sage);
	background: var(--ms-sage-light);
}

/* ── Akcje ── */
.header-actions {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

.sec-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 13px;
	border-radius: 999px;
	font-family: var(--ms-font-heading);
	font-size: 0.76rem;
	font-weight: 800;
	text-decoration: none;
	border: 1.5px solid;
	transition: all 0.2s;
	white-space: nowrap;
}

.pill-blue {
	border-color: rgba(111, 163, 192, 0.5);
	color: var(--ms-blue);
	background: transparent;
}

.pill-blue:hover {
	background: var(--ms-blue-light);
	border-color: var(--ms-blue);
}

/* ── Dropdown: wybór placówki ── */
.ms-facilities {
	position: relative;
}

.ms-facilities__summary {
	list-style: none;
	cursor: pointer;
}

/* hide default marker */
.ms-facilities__summary::-webkit-details-marker {
	display: none;
}

.ms-facilities__menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 220px;
	padding: 8px;
	border-radius: 14px;
	border: 1.5px solid rgba(111, 163, 192, 0.35);
	background: rgba(247, 243, 235, 0.98);
	box-shadow: 0 18px 42px rgba(44, 58, 53, 0.12);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 20;
}

.ms-facilities__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-family: var(--ms-font-heading);
	font-size: 0.86rem;
	font-weight: 800;
	color: var(--ms-ink);
	text-decoration: none;
	transition: background 0.18s, color 0.18s;
	white-space: nowrap;
}

.ms-facilities__item:hover {
	background: var(--ms-blue-light);
	color: var(--ms-blue);
}

.ms-facilities[open] .ms-facilities__summary {
	background: var(--ms-blue-light);
	border-color: rgba(111, 163, 192, 0.75);
}

.ms-facilities--mobile .ms-facilities__menu {
	position: static;
	margin-top: 8px;
	min-width: 0;
	width: 100%;
}

.ms-facilities--mobile .ms-facilities__item {
	justify-content: center;
	white-space: normal;
	text-align: center;
	line-height: 1.25;
}

.ms-facilities--mobile .ms-facilities__menu {
	padding: 10px;
}

@media (max-width: 480px) {
	.ms-facilities--mobile .ms-facilities__item {
		font-size: 0.82rem;
		padding: 10px 10px;
	}
}

.header-sep {
	width: 1px;
	height: 22px;
	background: rgba(91, 140, 122, 0.13);
	margin: 0 4px;
}

.header-phone {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--ms-font-heading);
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--ms-muted);
	text-decoration: none;
	padding: 6px 8px;
	border-radius: 8px;
	transition: color 0.2s, background 0.2s;
	white-space: nowrap;
}

.header-phone:hover {
	color: var(--ms-sage);
	background: var(--ms-sage-light);
}

.btn-cta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--ms-sage);
	color: #fff;
	padding: 10px 20px;
	border-radius: 999px;
	font-family: var(--ms-font-heading);
	font-size: 0.84rem;
	font-weight: 800;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(91, 140, 122, 0.25);
	transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-cta:hover {
	background: #4a7a6a;
	transform: translateY(-1px);
	box-shadow: 0 7px 20px rgba(91, 140, 122, 0.3);
	color: #fff;
}

.btn-cta .btn-cta__icon {
	flex-shrink: 0;
}

/* ── Hamburger ── */
/* Uwaga: bez color-mix() — na iOS / starszym Safari nieobsługiwany mix = przezroczyste tło. */
.hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	min-width: 44px;
	min-height: 44px;
	width: 44px;
	height: 44px;
	padding: 0;
	box-sizing: border-box;
	border-radius: var(--radius-sm, 10px);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	color: inherit;
	border: 1.5px solid rgba(91, 140, 122, 0.5);
	background-color: #e2edea;
	box-shadow: 0 1px 0 rgba(44, 58, 53, 0.08);
	transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
	flex-shrink: 0;
	position: relative;
	z-index: 3;
	-webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
	.hamburger:hover {
		background-color: #fbf0d5;
		border-color: rgba(217, 168, 76, 0.75);
	}
}

.hamburger:focus {
	outline: none;
}

.hamburger:focus-visible {
	outline: 3px solid var(--ms-focus);
	outline-offset: 2px;
}

.hamburger span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--olive, var(--ms-sage));
	border-radius: 99px;
	transition: transform 0.25s, opacity 0.25s, background 0.2s;
}

.hamburger.open span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
	opacity: 0;
}

.hamburger.open span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.hamburger.open span {
	background: var(--ms-ink);
}

/* ── Menu mobilne ── */
.mobile-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--ms-white);
	border-bottom: 1.5px solid rgba(91, 140, 122, 0.13);
	box-shadow: 0 12px 32px rgba(44, 58, 53, 0.08);
	padding: 1.25rem 1.5rem 1.5rem;
	z-index: 2;
}

.mobile-menu.open {
	display: block;
}

.mobile-nav {
	list-style: none;
	margin-bottom: 1.2rem;
	padding: 0;
}

.mobile-nav li a {
	display: block;
	padding: 10px 0;
	font-family: var(--ms-font-heading);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ms-ink);
	text-decoration: none;
	border-bottom: 1px solid rgba(91, 140, 122, 0.09);
	transition: color 0.2s;
}

.mobile-nav li:last-child a {
	border-bottom: none;
}

.mobile-nav li a:hover {
	color: var(--ms-sage);
}

.mobile-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mobile-actions .sec-pill,
.mobile-actions .btn-cta {
	justify-content: center;
}

.mobile-phone-btn {
	justify-content: center;
	border: 1.5px solid rgba(91, 140, 122, 0.13);
	border-radius: 999px;
	padding: 10px;
}

/* ── Responsywne ── */
@media (max-width: 1024px) {
	.nav-main li a {
		padding: 6px 9px;
		font-size: 0.82rem;
	}

	.header-phone {
		display: none;
	}

	.header-sep--phone-gap {
		display: none;
	}
}

@media (max-width: 860px) {
	.header-wrap {
		gap: 0.65rem;
	}

	/* Logo może się kurczyć; rezerwa na przycisk 44px — hamburger zostaje w viewport */
	.site-branding {
		flex: 1 1 auto;
		min-width: 0;
		max-width: calc(100% - 3.75rem);
	}

	.header-nav {
		display: none;
	}

	.header-sep {
		display: none;
	}

	.header-actions .sec-pill,
	.header-actions .header-phone,
	.header-actions .btn-cta {
		display: none;
	}

	.hamburger {
		display: flex;
	}
}

/* Mniejsze logo i niższy pasek — więcej miejsca na hero „above the fold” */
@media (max-width: 767.98px) {
	.header-wrap {
		height: 56px;
		min-height: 56px;
		padding-top: 0;
		padding-bottom: 0;
	}

	.site-branding .custom-logo {
		max-height: 36px;
	}

	.logo-owl-svg {
		width: 36px;
		height: 36px;
	}

	.logo-name {
		font-size: 1rem;
		letter-spacing: -0.02em;
	}

	.logo-tagline {
		font-size: 0.62rem;
	}
}

@media (max-width: 480px) {
	.logo-tagline {
		display: none;
	}

	.logo-name {
		font-size: 1.05rem;
	}

	.header-wrap {
		padding: 0 1.25rem;
	}
}
