/* One compact outer gap between the page content and the footer. */
body {
	--ekv-footer-gap: clamp(20px, 2.5vw, 36px);
}
body #main {
	margin-bottom: var(--ekv-footer-gap) !important;
}

/* These wrappers previously added a second, larger bottom gap. */
body:is(.page-id-4461, .page-id-4153, .page-id-3, .page-id-4508)
	#main .entry-content.is-layout-constrained {
	margin-bottom: 0 !important;
}
body:is(.page-id-4153, .page-id-3) #main {
	padding-bottom: 0 !important;
	margin-bottom: clamp(16px, 2vw, 28px) !important;
}
body:is(.page-id-4153, .page-id-3) #main > .ct-container-full,
body:is(.page-id-4153, .page-id-3) #main > .ct-container-full > article {
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
}
body.page-id-4508 #main .ekvinta-wishlist-page {
	margin-bottom: 0 !important;
}
body:is(.woocommerce-cart, .page-id-1765) #main .entry-content {
	padding-bottom: 0 !important;
}

/* Product and checkout pages also contain bottom padding inside #main. */
body.single-product #main {
	padding-bottom: clamp(20px, 2.5vw, 40px) !important;
}
body.page-id-1766 #main {
	padding-bottom: clamp(12px, 1.5vw, 24px) !important;
}

/* The homepage's final section uses its own outer margin. */
body.home #main > .elementor.elementor-38 > .elementor-element:last-child {
	margin-bottom: 0 !important;
}

/* The legal pages should use the same outer width as footer.ct-container.
 * Blocksy's normal 1120px content width and an older footer-injected WPCode
 * rule otherwise leave a narrow card and a large gap above the footer. */
body:is(.page-id-3, .page-id-4153) #main-container > #main {
	flex-grow: 0 !important;
	margin-bottom: clamp(44px, 4vw, 56px) !important;
}
body:is(.page-id-3, .page-id-4153) #main > .ct-container-full {
	box-sizing: border-box;
	width: min(1600px, calc(100% - 32px)) !important;
	max-width: none !important;
	margin-inline: auto !important;
	padding-bottom: 0 !important;
}
body:is(.page-id-3, .page-id-4153) #main > .ct-container-full > article,
body:is(.page-id-3, .page-id-4153) #main > .ct-container-full > article > .entry-content.is-layout-constrained,
body:is(.page-id-3, .page-id-4153) #main > .ct-container-full > article > .entry-content.is-layout-constrained > .ekvinta-legal-layout {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin-bottom: 0 !important;
}
/* The old WPCode rule pads the entry-content by about 50px per side, making
 * the visible card narrower even when all three wrapper widths are 100%. */
body:is(.page-id-3, .page-id-4153) #main > .ct-container-full > article > .entry-content.is-layout-constrained {
	padding: 0 !important;
}
@media (max-width: 767px) {
	body:is(.page-id-3, .page-id-4153) #main > .ct-container-full {
		width: calc(100% - 24px) !important;
	}
	body:is(.page-id-3, .page-id-4153) #main-container > #main {
		margin-bottom: 32px !important;
	}
}
