:root {
	--dhux-header-offset: 0px;
	--dhux-admin-offset: 0px;
	--dhux-row-min-width: 720px;
	--dhux-column-width: 420px;
	--dhux-module-width: 360px;
	--dhux-row-gap: 40px;
	--dhux-column-gap: 28px;
	--dhux-module-gap: 24px;
}

html.dhux-horizontal-mode,
html.dhux-horizontal-mode body {
	overscroll-behavior: none;
}

html.dhux-horizontal-mode body {
	overflow: hidden !important;
}

.dhux-horizontal-root {
	box-sizing: border-box !important;
	display: flex !important;
	flex-flow: row nowrap !important;
	align-items: stretch !important;
	width: 100vw !important;
	max-width: none !important;
	height: calc(100vh - var(--dhux-header-offset) - var(--dhux-admin-offset)) !important;
	height: calc(100dvh - var(--dhux-header-offset) - var(--dhux-admin-offset)) !important;
	min-height: 320px;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding: 0 !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
	scroll-behavior: smooth;
}

.dhux-horizontal-root.dhux-direction-ltr {
	direction: ltr;
}

.dhux-horizontal-root.dhux-direction-rtl {
	direction: ltr;
	flex-direction: row-reverse !important;
}

.dhux-horizontal-root.dhux-section-snap {
	scroll-snap-type: x proximity;
}

.dhux-horizontal-root.dhux-hide-scrollbar {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.dhux-horizontal-root.dhux-hide-scrollbar::-webkit-scrollbar {
	display: none;
}

/* Level 1: Sections form the page-level horizontal sequence. */
.dhux-horizontal-root > .dhux-section,
.dhux-horizontal-root .dhux-section.dhux-top-section {
	box-sizing: border-box !important;
	display: flex !important;
	flex: 0 0 auto !important;
	flex-flow: row nowrap !important;
	align-items: stretch !important;
	gap: var(--dhux-row-gap) !important;
	width: max-content !important;
	min-width: 100vw !important;
	max-width: none !important;
	min-height: 100% !important;
	margin: 0 !important;
	scroll-snap-align: start;
}

/* Level 2: Rows line up horizontally inside each Section. */
.dhux-horizontal-root .dhux-row {
	box-sizing: border-box !important;
	display: flex !important;
	flex: 0 0 auto !important;
	flex-flow: row nowrap !important;
	align-items: stretch !important;
	gap: var(--dhux-column-gap) !important;
	width: max-content !important;
	min-width: var(--dhux-row-min-width) !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Level 3: Columns line up horizontally inside each Row. */
.dhux-horizontal-root .dhux-column {
	box-sizing: border-box !important;
	float: none !important;
	display: flex !important;
	flex: 0 0 var(--dhux-column-width) !important;
	flex-flow: row nowrap !important;
	align-items: stretch !important;
	gap: var(--dhux-module-gap) !important;
	width: var(--dhux-column-width) !important;
	min-width: var(--dhux-column-width) !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Level 4: Modules line up horizontally inside each Column. */
.dhux-horizontal-root .dhux-column > .dhux-module,
.dhux-horizontal-root .dhux-column > div > .dhux-module {
	box-sizing: border-box !important;
	flex: 0 0 var(--dhux-module-width) !important;
	width: var(--dhux-module-width) !important;
	min-width: min(100%, var(--dhux-module-width)) !important;
	max-width: var(--dhux-module-width) !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Fullwidth modules and uncommon direct-child structures. */
.dhux-horizontal-root .dhux-section > .dhux-module,
.dhux-horizontal-root .dhux-row > .dhux-module {
	box-sizing: border-box !important;
	flex: 0 0 var(--dhux-module-width) !important;
	width: var(--dhux-module-width) !important;
	min-width: var(--dhux-module-width) !important;
	max-width: var(--dhux-module-width) !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Divi specialty and nested structures. */
.dhux-horizontal-root .et_pb_row_inner.dhux-row,
.dhux-horizontal-root .et_pb_column_inner.dhux-column,
.dhux-horizontal-root .et_pb_specialty_column.dhux-column {
	position: relative;
}

/* Escape hatch: add this class in Divi Advanced > CSS Class. */
.dhux-horizontal-root .dhux-vertical-stack {
	flex-direction: column !important;
	width: auto !important;
	max-width: 100% !important;
}

.dhux-horizontal-root .dhux-column.dhux-vertical-stack {
	flex-basis: var(--dhux-column-width) !important;
	width: var(--dhux-column-width) !important;
	min-width: var(--dhux-column-width) !important;
}

.dhux-horizontal-root .dhux-column.dhux-vertical-stack > .dhux-module,
.dhux-horizontal-root .dhux-column.dhux-vertical-stack > div > .dhux-module {
	flex-basis: auto !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
}

html.dhux-dragging,
html.dhux-dragging body,
html.dhux-dragging body * {
	cursor: grabbing !important;
	user-select: none !important;
}

/* Optional vertical fallback on small screens. */
html.dhux-mobile-vertical body {
	overflow-x: hidden !important;
	overflow-y: auto !important;
}

html.dhux-mobile-vertical .dhux-horizontal-root {
	display: block !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	overflow: visible !important;
	scroll-snap-type: none !important;
}

html.dhux-mobile-vertical .dhux-horizontal-root .dhux-section,
html.dhux-mobile-vertical .dhux-horizontal-root .dhux-row,
html.dhux-mobile-vertical .dhux-horizontal-root .dhux-column {
	display: block !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	min-height: 0 !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

html.dhux-mobile-vertical .dhux-horizontal-root .dhux-module {
	width: auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
}

@media (prefers-reduced-motion: reduce) {
	.dhux-horizontal-root {
		scroll-behavior: auto;
	}
}
