/* Nagłówek i menu główne (header.php). Klasy rs-* nie wpływają na resztę serwisu. */
:root {
	--rs-ink: #2e3c40;
	--rs-dark: #172124;
	--rs-orange: #e16521;
	--rs-yellow: #f7c948;
	--rs-soft: #f2f3f2;
	--rs-line: #e2e5e4;
	--rs-muted: #5b6a6c;
	--rs-header-h: 64px;
}

/* overflow-x: hidden na #page (dist/style.css) blokuje position: sticky. Clip przycina tak samo, ale nie tworzy kontenera przewijania. */
#page {
	overflow-x: clip;
}

.rs-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1020;
	height: var(--rs-header-h);
	/* Stary nagłówek zajmował 97,6 px; margines utrzymuje treść strony w tym samym miejscu. */
	margin-bottom: calc(97.6px - var(--rs-header-h));
	background: #fff;
	border-bottom: 1px solid var(--rs-line);
	color: var(--rs-ink);
	transition: box-shadow .2s ease;
}

.rs-header.is-stuck {
	box-shadow: 0 4px 14px rgb(23 33 36 / 12%);
}

.rs-header a {
	text-decoration: none;
}

.rs-header :focus-visible {
	outline: 3px solid var(--rs-dark);
	outline-offset: 2px;
}

.rs-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 100%;
	transition: transform .2s ease;
}

.rs-header__logo {
	display: block;
	flex: none;
	transform-origin: left center;
	transition: transform .2s ease;
}

.rs-header__logo img {
	display: block;
	width: 62px;
	height: auto;
}

.rs-header__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

/* Przycisk zapisów */
.rs-header .rs-cta {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 8px 12px;
	border-radius: 5px;
	background: var(--rs-orange);
	color: var(--rs-dark);
	font: 400 18px/1 'Bangers', 'Arial Narrow', sans-serif;
	letter-spacing: .05em;
	white-space: nowrap;
	transform: skewX(-5deg);
	transition: background-color .15s ease;
}

.rs-header .rs-cta:hover,
.rs-header .rs-cta:focus-visible {
	background: var(--rs-yellow);
	color: var(--rs-dark);
}

.rs-cta__long {
	display: none;
}

/* Konto i hamburger */
.rs-header .rs-account,
.rs-burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rs-ink);
	cursor: pointer;
}

.rs-header .rs-account:hover {
	color: var(--rs-orange);
}

.rs-account svg {
	width: 26px;
	height: 26px;
}

.rs-burger {
	flex-direction: column;
	gap: 5px;
}

.rs-burger span {
	display: block;
	width: 24px;
	height: 3px;
	border-radius: 2px;
	background: var(--rs-ink);
	transition: transform .2s ease, opacity .2s ease;
}

.rs-burger[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.rs-burger[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.rs-burger[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

html:not(.rs-js) .rs-burger {
	display: none;
}

/* Menu: wspólne */
.rs-menu,
.rs-menu .sub-menu,
.rs-nav__contact {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rs-menu a {
	color: var(--rs-ink);
}

.rs-external::after {
	content: " ↗";
	color: var(--rs-muted);
	font-size: .85em;
}

.rs-sub-toggle {
	display: none;
}

/* Telefon i tablet */
@media (max-width: 1099.98px) {
	/* Blokada na body: overflow na html przenosi przewijanie na body i psuje sticky. */
	html.rs-menu-open body {
		overflow: hidden;
	}

	html.rs-menu-open .xoo-wsc-basket {
		display: none;
	}

	.rs-js .rs-nav {
		/* Absolute w pasku, nie fixed: szersza treść strony nie może poszerzyć panelu. */
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		height: calc(100vh - var(--rs-panel-top, var(--rs-header-h)));
		height: calc(100dvh - var(--rs-panel-top, var(--rs-header-h)));
		overflow-y: auto;
		overscroll-behavior: contain;
		visibility: hidden;
		padding: 14px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
		background: #fff;
		transform: translateY(-12px);
		opacity: 0;
		transition: transform .2s ease, opacity .2s ease, visibility .2s;
	}

	.rs-js .rs-nav.is-open {
		visibility: visible;
		transform: none;
		opacity: 1;
	}

	/* Bez JavaScriptu menu leży pod paskiem, zamiast być niedostępne. */
	html:not(.rs-js) .rs-header {
		position: static;
		height: auto;
	}

	html:not(.rs-js) .rs-header__bar {
		flex-wrap: wrap;
		padding-block: 10px;
	}

	html:not(.rs-js) .rs-nav {
		order: 3;
		width: 100%;
	}

	.rs-menu > li {
		border-bottom: 1px solid var(--rs-line);
	}

	.rs-menu > li > a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 48px;
		font-size: 16px;
	}

	.rs-menu > .current-menu-item > a,
	.rs-menu > li > a:hover {
		color: #b84a12;
	}

	.rs-menu .sub-menu {
		display: flex !important;
		flex-wrap: wrap;
		gap: 8px;
		padding-bottom: 12px;
	}

	.rs-menu .sub-menu li {
		flex: 1 1 calc(50% - 4px);
	}

	.rs-menu .sub-menu a {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
		min-height: 56px;
		padding: 10px;
		border-radius: 6px;
		background: var(--rs-orange);
		color: var(--rs-dark);
		font: 400 21px/1 'Bangers', 'Arial Narrow', sans-serif;
		letter-spacing: .03em;
		text-align: center;
	}

	.rs-menu .sub-menu li:nth-child(even) a {
		background: var(--rs-yellow);
	}

	.rs-nav__contact {
		margin-top: 16px;
		padding: 8px 12px;
		background: var(--rs-soft);
		font-size: 14px;
	}

	.rs-nav__contact li {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 44px;
	}

	.rs-header .rs-nav__contact a {
		display: flex;
		align-items: center;
		min-height: 44px;
		color: var(--rs-ink);
		font-weight: 400;
		white-space: nowrap;
	}
}

/* Na telefonach pasek administratora WordPressa przewija się razem ze stroną. */
@media (max-width: 600px) {
	.rs-header {
		top: 0;
	}
}

/* Komputer */
@media (min-width: 1100px) {
	.rs-header {
		--rs-header-h: 76px;
	}

	/* Po przewinięciu część paska chowa się nad ekranem, bez przesuwania treści. */
	.rs-header.is-stuck {
		top: calc(var(--wp-admin--admin-bar--height, 0px) - 12px);
	}

	.rs-header.is-stuck .rs-header__bar {
		transform: translateY(6px);
	}

	.rs-header.is-stuck .rs-header__logo {
		transform: scale(.78);
	}

	.rs-header__logo img {
		width: 84px;
	}

	.rs-nav {
		flex: 1 1 auto;
		min-width: 0;
	}

	.rs-menu {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: clamp(12px, 1.5vw, 24px);
	}

	.rs-menu > li {
		display: flex;
		position: relative;
		align-items: center;
	}

	.rs-menu > li > a {
		display: inline-block;
		padding: 12px 2px;
		border-bottom: 2px solid transparent;
		font-size: 15px;
		line-height: 1.3;
		white-space: nowrap;
	}

	.rs-menu > li > a:hover,
	.rs-menu > .current-menu-item > a,
	.rs-menu > .current-menu-ancestor > a {
		border-bottom-color: var(--rs-orange);
		color: var(--rs-ink);
	}

	.rs-sub-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 24px;
		height: 24px;
		margin-left: 2px;
		padding: 0;
		border: 0;
		background: none;
		color: var(--rs-ink);
		cursor: pointer;
	}

	.rs-sub-toggle::before {
		content: "";
		width: 7px;
		height: 7px;
		border-right: 2px solid;
		border-bottom: 2px solid;
		transform: translateY(-2px) rotate(45deg);
		transition: transform .15s ease;
	}

	.rs-sub-toggle[aria-expanded="true"]::before {
		transform: translateY(2px) rotate(225deg);
	}

	.rs-menu .sub-menu {
		display: none;
		position: absolute;
		top: 100%;
		left: -12px;
		flex-direction: column;
		min-width: 210px;
		padding: 6px;
		border: 1px solid var(--rs-line);
		background: #fff;
		box-shadow: 0 8px 20px rgb(23 33 36 / 14%);
	}

	.rs-menu .is-open > .sub-menu,
	html:not(.rs-js) .rs-menu li:focus-within > .sub-menu {
		display: flex;
	}

	.rs-menu .sub-menu a {
		display: block;
		padding: 10px 12px;
		font-size: 15px;
	}

	.rs-menu .sub-menu a:hover,
	.rs-menu .sub-menu .current-menu-item > a {
		background: var(--rs-soft);
		color: var(--rs-ink);
	}

	.rs-cta__long {
		display: inline;
	}

	.rs-cta__short {
		display: none;
	}

	.rs-header .rs-cta {
		padding: 11px 16px;
		font-size: 19px;
	}

	.rs-burger,
	.rs-nav__contact {
		display: none;
	}
}

/* Kontener Bootstrapa ma tu tylko 960 px, a menu potrzebuje więcej miejsca. */
@media (min-width: 1100px) and (max-width: 1199.98px) {
	.rs-header__bar {
		max-width: 100%;
	}
}

/* Na dotyku najechanie nie może zostawiać otwartego podmenu. */
@media (min-width: 1100px) and (hover: none) {
	.rs-menu .menu-item-has-children:not(.is-open):hover > .sub-menu {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rs-header,
	.rs-header *,
	.rs-header *::before {
		transition: none !important;
	}
}
