.ks-global-layout {
	position: relative;
	z-index: 20;
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.ks-global-layout--header {
	z-index: 999;
}

.ks-global-layout > .elementor,
.ks-global-layout > .elementor > .elementor-element {
	width: 100% !important;
	max-width: none !important;
}

/* Stretch only the template root; each KatanaSteel widget keeps its own inner max-width. */
.ks-global-layout > .elementor > .e-con {
	--width: 100%;
	--content-width: 100%;
	--padding-top: 0px;
	--padding-right: 0px;
	--padding-bottom: 0px;
	--padding-left: 0px;
	--gap: 0px;
	flex-basis: 100%;
}

.ks-global-layout > .elementor > .e-con.e-con-boxed > .e-con-inner,
.ks-global-layout > .elementor > .elementor-section.elementor-section-boxed > .elementor-container {
	width: 100%;
	max-width: none;
}

/* Elementor 4 Atomic widgets are content-sized unless their flex width is explicit. */
.ks-global-layout .elementor-widget-cloudsofts_katanasteel_navigation,
.ks-global-layout .elementor-widget-cloudsofts_katanasteel_footer {
	width: 100% !important;
	max-width: none !important;
	flex: 1 1 100% !important;
	align-self: stretch !important;
}

.ks-global-layout .elementor-widget-cloudsofts_katanasteel_navigation > .elementor-widget-container,
.ks-global-layout .elementor-widget-cloudsofts_katanasteel_footer > .elementor-widget-container {
	width: 100%;
}

@supports (width: 100dvw) {
	.ks-global-layout {
		width: 100dvw;
		max-width: 100dvw;
		margin-inline: calc(50% - 50dvw);
	}
}

/*
 * Compatibility fallback for themes without dedicated header/footer hooks.
 * Selectors deliberately exclude the KatanaSteel wrapper.
 */
body.ks-global-layout-mode-generic.ks-global-header-active #masthead:not(.ks-global-layout),
body.ks-global-layout-mode-generic.ks-global-header-active #site-header:not(.ks-global-layout),
body.ks-global-layout-mode-generic.ks-global-header-active header.site-header:not(.ks-global-layout),
body.ks-global-layout-mode-generic.ks-global-header-active .site > header.wp-block-template-part {
	display: none !important;
}

body.ks-global-layout-mode-generic.ks-global-footer-active #colophon:not(.ks-global-layout),
body.ks-global-layout-mode-generic.ks-global-footer-active #site-footer:not(.ks-global-layout),
body.ks-global-layout-mode-generic.ks-global-footer-active footer.site-footer:not(.ks-global-layout),
body.ks-global-layout-mode-generic.ks-global-footer-active .site > footer.wp-block-template-part {
	display: none !important;
}

@media print {
	.ks-global-layout--header,
	.ks-global-layout--footer {
		position: static !important;
	}
}
