/* Krokpol desktop header — Figma 1920 */
:root {
	--kp-h-sage: #8aa498;
	--kp-h-dark: #393839;
	--kp-h-cats: #3a3a3a;
	--kp-h-top-bg: #fbfafa;
	--kp-h-muted: #6b6b6b;
	--kp-h-line: #e4e4e4;
}

/* Desktop: custom header / Mobile: WHB */
.kp-header {
	display: none;
}

@media (min-width: 1025px) {
	/* Custom top+main; keep original dark category row from Woodmart */
	body.kp-has-custom-header .whb-general-header {
		display: none !important;
	}

	body.kp-has-custom-header .whb-main-header {
		display: block !important;
	}

	body.kp-has-custom-header .whb-header-bottom {
		display: block !important;
	}

	/*
	 * Full sticky header (top + logo/search + categories).
	 * Disable Woodmart sticky-prepared (it parks only .whb-main-header at top).
	 */
	body.kp-has-custom-header header.whb-header {
		position: sticky !important;
		top: 0 !important;
		z-index: 450 !important;
		padding-top: 0 !important;
		background: #fff;
		width: 100%;
	}

	body.admin-bar.kp-has-custom-header header.whb-header {
		top: 32px !important;
	}

	@media (max-width: 782px) {
		body.admin-bar.kp-has-custom-header header.whb-header {
			top: 46px !important;
		}
	}

	body.kp-has-custom-header header.whb-header.whb-sticky-prepared {
		padding-top: 0 !important;
	}

	body.kp-has-custom-header header.whb-header .whb-main-header,
	body.kp-has-custom-header header.whb-header.whb-sticky-prepared .whb-main-header,
	body.kp-has-custom-header header.whb-header.whb-sticked .whb-main-header {
		position: relative !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		transform: none !important;
	}

	/* Hide Woodmart sticky clone — we stick the real full header */
	body.kp-has-custom-header .whb-clone {
		display: none !important;
	}

	body.kp-has-custom-header header.whb-header.kp-header-is-stuck {
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	}

	body.kp-has-custom-header .whb-header-bottom .whb-flex-row,
	body.kp-has-custom-header .whb-header-bottom .whb-header-bottom-inner,
	body.kp-has-custom-header .whb-header-bottom .whb-column {
		display: flex !important;
		justify-content: center;
		width: 100%;
	}

	body.kp-has-custom-header .whb-header-bottom .wd-header-nav,
	body.kp-has-custom-header .whb-header-bottom .menu {
		margin-left: auto;
		margin-right: auto;
	}

	body.kp-has-custom-header .kp-header {
		display: block;
		position: relative;
		z-index: 200;
		background: #fff;
		font-family: inherit;
		color: var(--kp-h-dark);
	}

	body.kp-has-custom-header .kp-header__cats {
		display: none !important;
	}
}

/* Match Woodmart .container / site content grid (15px sides) */
.kp-header__container {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 0 15px;
	box-sizing: border-box;
}

/* ——— Top bar ——— */
.kp-header__top {
	background: var(--kp-h-top-bg);
	border-bottom: 1px solid var(--kp-h-line);
}

.kp-header__top-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	gap: 24px;
}

.kp-header__top-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.kp-header__top-menu > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kp-header__top-menu a {
	display: inline-block;
	padding: 12px 0 10px;
	font-size: 14px;
	line-height: 1.2;
	color: var(--kp-h-dark);
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.kp-header__top-menu .current-menu-item > a,
.kp-header__top-menu a:hover {
	border-bottom-color: var(--kp-h-sage);
	color: var(--kp-h-dark);
}

.kp-header__tools {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-shrink: 0;
}

.kp-header__tool {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	position: relative;
	color: var(--kp-h-dark);
	text-decoration: none;
	font-size: 14px;
	line-height: 1;
	padding: 8px 0;
}

.kp-header__tool:hover {
	color: var(--kp-h-dark);
}

.kp-header__tool:hover .kp-header__tool-icon {
	color: var(--kp-h-sage);
}

.kp-header__tool-icon {
	display: inline-flex;
	width: 20px;
	height: 20px;
	color: var(--kp-h-sage);
	flex-shrink: 0;
}

.kp-header__tool-icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

.kp-header__tool-text {
	color: var(--kp-h-dark);
}

/* Black circle count — inline after label (Figma) */
.kp-header__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: static;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	margin-left: 2px;
	border-radius: 50%;
	background: #111;
	color: #fff !important;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	text-align: center;
	box-sizing: border-box;
	vertical-align: middle;
}

.kp-header__badge:empty,
.kp-header__badge[data-count="0"] {
	display: none !important;
}

/* ——— Main row ——— */
.kp-header__main {
	background: #fff;
	border-bottom: 1px solid var(--kp-h-line);
}

.kp-header__main-inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 24px;
	min-height: 92px;
	padding-top: 16px;
	padding-bottom: 16px;
}

.kp-header__search {
	justify-self: start;
	width: 100%;
	max-width: 340px;
}

.kp-header__search .wd-search-form,
.kp-header__search .searchform,
.kp-header__search form {
	margin: 0;
	width: 100%;
}

.kp-header__search .searchform {
	display: flex;
	align-items: center;
	background: #fbfafa;
	border-radius: 12px;
	overflow: hidden;
	border: none;
	height: 48px;
	padding: 0 6px 0 18px;
}

.kp-header__search input[type="text"],
.kp-header__search input[type="search"] {
	flex: 1;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	height: 48px !important;
	padding: 0 8px 0 0 !important;
	font-size: 15px;
	color: var(--kp-h-dark);
}

.kp-header__search input::placeholder {
	color: #9a9a9a;
}

.kp-header__search .searchsubmit,
.kp-header__search button[type="submit"] {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--kp-h-dark);
}

.kp-header__search .wd-clear-search {
	display: none !important;
}

.kp-header__logo {
	justify-self: center;
	display: block;
	line-height: 0;
}

.kp-header__logo img {
	display: block;
	height: 44px;
	width: auto;
	max-width: 260px;
}

.kp-header__contacts {
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 18px;
}

.kp-header__email {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--kp-h-dark);
	text-decoration: none;
	font-size: 15px;
	white-space: nowrap;
}

.kp-header__email:hover {
	color: var(--kp-h-sage);
}

.kp-header__email-icon {
	color: var(--kp-h-sage);
	display: inline-flex;
}

.kp-header__divider {
	width: 1px;
	height: 36px;
	background: #d5d5d5;
	flex-shrink: 0;
}

.kp-header__phone {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--kp-h-sage);
	color: #fff !important;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	padding: 14px 22px;
	border-radius: 12px;
	white-space: nowrap;
	transition: background .2s ease, color .2s ease;
}

.kp-header__phone:hover {
	background: var(--kp-h-dark);
	color: #fff !important;
}

.kp-header__phone-icon {
	display: inline-flex;
	color: inherit;
}

/* ——— Category bar ——— */
.kp-header__cats {
	background: var(--kp-h-cats);
}

.kp-header__cats-nav {
	display: flex;
	justify-content: center;
}

.kp-header__cats-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: 8px 36px;
	list-style: none;
	margin: 0;
	padding: 0;
	min-height: 64px;
}

.kp-header__cats-menu > li {
	margin: 0;
	list-style: none;
	position: relative;
}

.kp-header__cats-menu > li > a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 64px;
	padding: 8px 0;
	color: #fff !important;
	text-decoration: none;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-weight: 500;
}

.kp-header__cats-menu > li > a:hover,
.kp-header__cats-menu > li.current-menu-item > a {
	color: var(--kp-h-sage) !important;
}

.kp-header__cat-icon-wrap {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}

.kp-header__cat-icon,
.kp-header__cats-menu .wd-nav-img {
	width: 22px !important;
	height: 22px !important;
	object-fit: contain;
	display: block;
	filter: brightness(0) invert(1);
}

.kp-header__cat-chevron,
.kp-header__cats-menu .krokpol-cerata-nav-chevron {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid rgba(255, 255, 255, 0.85);
	margin-left: 2px;
}

/* Mega dropdown inside custom header */
.kp-header__cats-menu .krokpol-cerata-mega-dropdown {
	left: 50%;
	transform: translateX(-50%);
	min-width: min(1100px, 92vw);
}

.kp-header__cats-menu .krokpol-cerata-mega-item.krokpol-cerata-open > .krokpol-cerata-mega-dropdown,
.kp-header__cats-menu .krokpol-cerata-mega-item.wd-opened > .krokpol-cerata-mega-dropdown {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

/* Search dropdown positioning */
.kp-header__search .wd-dropdown-results {
	z-index: 220;
}

@media (max-width: 1200px) {
	.kp-header__cats-menu {
		gap: 8px 20px;
	}
}

/* Force-center original category bar on same grid as content */
@media (min-width: 1025px) {
	body.kp-has-custom-header .whb-header-bottom > .container {
		display: flex !important;
		justify-content: center !important;
		width: 100% !important;
		max-width: 100% !important;
		padding-left: 15px !important;
		padding-right: 15px !important;
		box-sizing: border-box;
	}

	body.kp-has-custom-header .whb-header-bottom .whb-header-bottom-inner,
	body.kp-has-custom-header .whb-header-bottom .whb-flex-row {
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 auto !important;
	}

	body.kp-has-custom-header .whb-header-bottom .whb-column,
	body.kp-has-custom-header .whb-header-bottom .whb-col-left,
	body.kp-has-custom-header .whb-header-bottom .whb-column11 {
		float: none !important;
		width: auto !important;
		max-width: 100% !important;
		flex: 0 1 auto !important;
		margin: 0 auto !important;
		display: flex !important;
		justify-content: center !important;
	}

	body.kp-has-custom-header .whb-header-bottom .wd-header-nav,
	body.kp-has-custom-header .whb-header-bottom .menu {
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		flex-wrap: wrap;
		width: auto !important;
		margin: 0 auto !important;
		float: none !important;
		text-align: center !important;
	}

	body.kp-has-custom-header .whb-header-bottom .whb-empty-column {
		display: none !important;
		width: 0 !important;
		flex: 0 0 0 !important;
	}

	body.kp-has-custom-header .whb-header-bottom .whb-col-left,
	body.kp-has-custom-header .whb-header-bottom .whb-column11 {
		flex: 1 1 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		justify-content: center !important;
		margin: 0 !important;
	}
}

/* ——— Mobile ≤767: full sticky WHB header ——— */
@media (max-width: 767px) {
	body.kp-has-custom-header .kp-header {
		display: none !important;
	}

	body.kp-has-custom-header header.whb-header {
		position: sticky !important;
		top: 0 !important;
		z-index: 450 !important;
		padding-top: 0 !important;
		background: #fff;
		width: 100%;
	}

	body.admin-bar.kp-has-custom-header header.whb-header {
		top: 46px !important;
	}

	body.kp-has-custom-header header.whb-header.whb-sticky-prepared {
		padding-top: 0 !important;
	}

	body.kp-has-custom-header header.whb-header .whb-main-header,
	body.kp-has-custom-header header.whb-header.whb-sticky-prepared .whb-main-header,
	body.kp-has-custom-header header.whb-header.whb-sticked .whb-main-header {
		position: relative !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		transform: none !important;
	}

	body.kp-has-custom-header .whb-clone {
		display: none !important;
	}

	body.kp-has-custom-header header.whb-header.kp-header-is-stuck {
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	}

	/* New logo proportions on mobile WHB */
	body.kp-has-custom-header .whb-general-header .site-logo img,
	body.kp-has-custom-header .whb-mobile-left .site-logo img,
	body.kp-has-custom-header .whb-general-header .wd-logo img {
		height: 32px !important;
		width: auto !important;
		max-width: 160px !important;
	}

	/* Elementor mobile menu (popup 79): slide in from left */
	#elementor-popup-modal-79 {
		justify-content: flex-start !important;
		align-items: stretch !important;
	}

	#elementor-popup-modal-79 .dialog-widget-content {
		margin: 0 !important;
		left: 0 !important;
		right: auto !important;
		top: 0 !important;
		bottom: 0 !important;
		height: 100% !important;
		max-height: 100vh !important;
		width: min(340px, 88vw) !important;
		max-width: 88vw !important;
		border-radius: 0 18px 18px 0 !important;
		box-shadow: 12px 0 40px rgba(0, 0, 0, 0.18) !important;
		overflow: hidden !important;
		transform: translate3d(-105%, 0, 0);
		animation: kp-mob-menu-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
	}

	#elementor-popup-modal-79.dialog-visible-hide .dialog-widget-content,
	#elementor-popup-modal-79 .dialog-widget-content.animated.slideOutLeft {
		animation: kp-mob-menu-out 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
	}

	#elementor-popup-modal-79 .dialog-lightbox-message,
	#elementor-popup-modal-79 .dialog-message {
		height: 100%;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	#elementor-popup-modal-79 .elementor-79 img[src*="Krokpol"],
	#elementor-popup-modal-79 .elementor-79 img[src*="logokrokpol"] {
		height: 36px !important;
		width: auto !important;
		max-width: 180px !important;
	}
}

@keyframes kp-mob-menu-in {
	from {
		transform: translate3d(-105%, 0, 0);
		opacity: 0.85;
	}
	to {
		transform: translate3d(0, 0, 0);
		opacity: 1;
	}
}

@keyframes kp-mob-menu-out {
	from {
		transform: translate3d(0, 0, 0);
		opacity: 1;
	}
	to {
		transform: translate3d(-105%, 0, 0);
		opacity: 0.85;
	}
}
