/* ==========================================================================
   KSWX Header (child theme override layer)
   ========================================================================== */

:root {
	--kswx-primary: #131a2e;
	--kswx-accent: hsl(42, 80%, 55%);
	--kswx-header-h: 80px;
	--kswx-header-h-mobile: 64px;
}

body {
	padding-top: var(--kswx-header-h);
}

/* Hero overlaps header so background reads edge to edge */
.kswx-hero {
	margin-top: calc(-1 * var(--kswx-header-h));
}

/* ===== Header shell ===== */
.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	background: rgba(19, 26, 46, 0.95);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header .container {
	max-width: 1280px;
	margin: 0 auto;
	padding-left: 24px;
	padding-right: 24px;
}

.header .header-inner > .flex-element {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	height: var(--kswx-header-h);
}

.header .header-top {
	display: none !important;
}

/* ===== Logo (kill Driftor's white framed box) ===== */
.header .header-left,
.header .logo,
.header .logo a {
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
}

.header .header-left {
	flex: 0 0 auto;
}

.header .logo a {
	display: flex !important;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}

.header .logo img {
	display: block;
	width: 40px !important;
	height: 40px !important;
	max-width: 40px !important;
	object-fit: contain;
	border-radius: 0 !important;
	background: transparent !important;
}

.kswx-logo__text {
	font-family: 'Lexend', sans-serif;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1;
	color: #fff;
	white-space: nowrap;
}

.kswx-logo__accent {
	color: var(--kswx-accent);
}

/* ===== Nav ===== */
.header .header-bottom {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
}

.header .sitenav .menu {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.header .sitenav .menu li {
	margin: 0;
	padding: 0;
}

.header .sitenav .menu li a {
	display: inline-block;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: color 0.3s ease;
}

.header .sitenav .menu li a:hover,
.header .sitenav .menu li.current-menu-item > a,
.header .sitenav .menu li.current-menu-ancestor > a {
	color: var(--kswx-accent);
}

/* Never highlight "Onze diensten" (hash link) as current. */
.header .sitenav .menu li.menu-item-137.current-menu-item > a,
.header .sitenav .menu li.menu-item-137.current-menu-ancestor > a,
.header .sitenav .menu li.menu-item-137.current_page_item > a,
.sitenav ul li.menu-item-137.current_page_item > a {
	color: rgba(255, 255, 255, 0.7);
}
.header .sitenav .menu li.menu-item-137:hover > a,
.header .sitenav .menu li.menu-item-137 > a:hover {
	color: var(--kswx-accent);
}

/* ===== Hamburger toggle ===== */
.kswx-nav-toggle {
	display: none;
	order: 3;
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	color: #fff;
}

.kswx-nav-toggle svg {
	width: 24px;
	height: 24px;
	display: block;
	margin: 0 auto;
}

/* ===== Mobile / tablet (<= 960px) ===== */
@media (max-width: 960px) {
	body {
		padding-top: var(--kswx-header-h-mobile);
	}

	.header .header-inner > .flex-element {
		height: var(--kswx-header-h-mobile);
	}

	.kswx-hero {
		margin-top: calc(-1 * var(--kswx-header-h-mobile));
	}

	.kswx-nav-toggle {
		display: block;
	}

	/* Slide-down panel */
	.header .header-bottom {
		position: static;
	}

	.header .sitenav {
		position: fixed;
		top: var(--kswx-header-h-mobile);
		left: 0;
		right: 0;
		background: var(--kswx-primary);
		border-bottom: 1px solid rgba(255, 255, 255, 0.06);
		box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
		transform: translateY(-14px);
		opacity: 0;
		visibility: hidden;
		transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
		max-height: calc(100vh - var(--kswx-header-h-mobile));
		overflow-y: auto;
	}

	.header.kswx-nav-open .sitenav {
		transform: translateY(0);
		opacity: 1;
		visibility: visible;
	}

	.header .sitenav .menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.header .sitenav .menu li a {
		display: block;
		padding: 15px 24px;
		font-size: 15px;
		border-top: 1px solid rgba(255, 255, 255, 0.05);
	}

	.header .sitenav .menu li:first-child a {
		border-top: 0;
	}

	.kswx-logo__text {
		font-size: 18px;
	}
}

/* Tighter on phones */
@media (max-width: 480px) {
	.header .container {
		padding-left: 16px;
		padding-right: 16px;
	}

	.kswx-logo__text {
		font-size: 16px;
	}
}

/* ==========================================================================
   Override parent theme: keep our .header at every breakpoint.
   Parent hides .header-main (which wraps .header) at <=990px and shows
   .header-responsive instead. We do not want that — we want one consistent
   header that our JS hamburger drives.
   ========================================================================== */
.header-responsive {
	display: none !important;
}

@media (max-width: 990px) {
	.header-main {
		display: block !important;
		margin-bottom: 0 !important;
	}
	.header-responsive {
		display: none !important;
	}
}

/* Shift our mobile breakpoint from 960px to 990px to match the parent. */
@media (min-width: 961px) and (max-width: 990px) {
	body {
		padding-top: var(--kswx-header-h-mobile);
	}
	.header .header-inner > .flex-element {
		height: var(--kswx-header-h-mobile);
	}
	.kswx-hero {
		margin-top: calc(-1 * var(--kswx-header-h-mobile));
	}
	.kswx-nav-toggle {
		display: block;
	}
	.header .header-bottom {
		position: static;
	}
	.header .sitenav {
		position: fixed;
		top: var(--kswx-header-h-mobile);
		left: 0;
		right: 0;
		background: var(--kswx-primary);
		border-bottom: 1px solid rgba(255, 255, 255, 0.06);
		box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
		transform: translateY(-14px);
		opacity: 0;
		visibility: hidden;
		transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
		max-height: calc(100vh - var(--kswx-header-h-mobile));
		overflow-y: auto;
	}
	.header.kswx-nav-open .sitenav {
		transform: translateY(0);
		opacity: 1;
		visibility: visible;
	}
	.header .sitenav .menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}
	.header .sitenav .menu li a {
		display: block;
		padding: 15px 24px;
		font-size: 15px;
		border-top: 1px solid rgba(255, 255, 255, 0.05);
	}
}

/* Defensive: parent theme styles the .sitenav with float/width — neutralise
   so our flex layout works inside .header at every width. */
.header .sitenav {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	top: auto !important;
	position: relative;
}

@media (max-width: 990px) {
	.header .sitenav {
		position: fixed !important;
		top: var(--kswx-header-h-mobile) !important;
	}
}

/* Neutralise parent's .toggle wrapper inside our .header (it injects a
   separate toggleMenu link that we do not use). */
.header .toggle,
.header .toggleMenu {
	display: none !important;
}

/* ==========================================================================
   Responsiveness fixes (appended 2026-05-23)
   ========================================================================== */

/* 1. Beat parent JS adjustMenu() inline display:none on .sitenav */
.header .sitenav { display: block !important; }

@media (max-width: 990px) {
    .header .sitenav { display: none !important; }
    .header.kswx-nav-open .sitenav { display: block !important; }
}

/* 2. Neutralise parent's 991-1169 header padding/width hacks */
@media (min-width: 991px) and (max-width: 1169px) {
    .header .header-inner { padding-left: 0 !important; }
    .header .header-left { width: auto !important; }
}

/* 3. Container should be max-width, not fixed 1200 */
.container {
    width: 100% !important;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* 4. Global overflow + image safeguard */
html, body { overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }

/* 5. WP admin bar offset for logged-in users */
.admin-bar .header { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .header { top: 46px; }
    .admin-bar .header .sitenav { top: calc(var(--kswx-header-h-mobile) + 46px) !important; }
}

/* 6. Header-bottom flex on desktop */
@media (min-width: 991px) {
    .header .header-bottom { padding-left: 0 !important; flex: 0 0 auto; }
}

/* ==========================================================================
   Grid stacking - parent only stacks col-6 abt-*. Stack all col-N on small.
   ========================================================================== */

/* Tablet (<=990): 4-col -> 2-col, 3-col -> 2-col */
@media (max-width: 990px) {
    .flex-element.row > .col-3,
    .flex-element.row > .col-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 24px;
    }
}

/* Services boxes (Portfolio section) - stack inner blocks <=768 */
@media (max-width: 768px) {
    .ser-block-item {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center;
    }
    .ser-block-item > .ser-left-box,
    .ser-block-item > .ser-center-box,
    .ser-block-item > .ser-right-box {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .ser-block-item .ser-thumb img { margin: 0 auto; }
}

/* Phones (<=600): single column for everything */
@media (max-width: 600px) {
    .flex-element.row > .col-3,
    .flex-element.row > .col-4,
    .flex-element.row > .col-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Footer menu wrap better on small screens */
@media (max-width: 600px) {
    #footer-wrapper ul.kswx-footer-menu { flex-direction: column; gap: 8px; }
    #footer-wrapper ul.kswx-footer-menu li:not(:last-child)::after { display: none; }
}

/* Header-left vertical centering on tablet/mobile (parent has position:absolute, breaks flex centering) */
@media (max-width: 1169px) {
    .header .header-inner {
        padding-left: 0 !important;
        position: relative;
    }
    .header .header-left {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }
}

/* Mobile nav slide-in panel background */
@media (max-width: 990px) {
    .header .sitenav { background: #151a2d !important; }
}

/* Override parent's .sitenav ul mobile background */
@media screen and (max-width: 990px) {
    .sitenav ul { background-color: #151a2d !important; }
}

/* ---- KSWX cart icon + badge in primary nav ---- */
.menu .kswx-cart-menu-item {
    display: flex;
    align-items: center;
    margin-left: 16px;
}
.kswx-cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    padding: 6px;
    line-height: 0;
    transition: color .2s ease;
}
.kswx-cart-link:hover { color: hsl(42, 80%, 55%); }
.kswx-cart-ico { display: inline-flex; }
.kswx-cart-count {
    position: absolute;
    top: -3px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: hsl(42, 80%, 55%);
    color: #15192a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .2);
}
.kswx-cart-count.is-empty { display: none; }

/* cart badge fix: anchor to the icon, not the padded link */
.kswx-cart-link { padding: 4px 0; }
.kswx-cart-ico { position: relative; display: inline-flex; line-height: 0; }
.kswx-cart-count {
    top: -9px;
    right: -11px;
    box-shadow: 0 0 0 2px #1b2232;
}

/* cart badge: force link to wrap the icon tightly (beats theme #menu id rule) */
.kswx-cart-menu-item a.kswx-cart-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
    line-height: 0 !important;
    height: auto !important;
}
.kswx-cart-menu-item .kswx-cart-ico {
    position: relative;
    display: inline-flex;
    line-height: 0;
}
.kswx-cart-menu-item .kswx-cart-count {
    top: -7px;
    right: -9px;
}

/* center the digit inside the badge (beats theme #menu span id rule) */
.kswx-cart-menu-item .kswx-cart-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 5px !important;
    box-sizing: border-box;
    text-align: center;
}
