/*
 * Homepage layout fixes. First block: all screen sizes; the rest: mobile
 * (Elementor mobile breakpoint: max-width 767px).
 * Selectors use Elementor element IDs from the Home page (post 2).
 * If an element is deleted/recreated in Elementor its ID changes and the rule
 * must be updated here.
 */

/* ---------- "Specialized Access Solutions": all 5 service cards the same size ----------
 * Cards with a two-line title (e.g. "Lighting & Electrical") were taller than
 * the rest. Every card now fills its cell and the title sits at the bottom. */
.home .elementor-element-eadb7b5 {
	align-items: stretch !important;
}
.home .elementor-element-eadb7b5 > .elementor-element,
.home .elementor-element-eadb7b5 > .elementor-element > .elementor-element,
.home .elementor-element-eadb7b5 .elementor-widget-elementskit-icon-box,
.home .elementor-element-eadb7b5 .elementor-widget-elementskit-icon-box > .elementor-widget-container,
.home .elementor-element-eadb7b5 .ekit-wid-con,
.home .elementor-element-eadb7b5 .ekit_global_links {
	display: flex !important;
	flex-direction: column;
	flex: 1 1 auto;
	height: auto !important;
}
.home .elementor-element-eadb7b5 .elementskit-infobox {
	display: flex !important;
	flex-direction: column;
	justify-content: flex-end;
	flex: 1 1 auto;
	height: auto !important;
	box-sizing: border-box;
}

/* Tablet: 5 cards in one row were only ~135px wide; use 3 + 2 instead */
@media (min-width: 768px) and (max-width: 1024px) {
	.home .elementor-element-eadb7b5 {
		display: grid !important;
		grid-template-columns: repeat(6, 1fr);
		grid-auto-rows: 1fr; /* both rows the same height */
		gap: 16px !important;
	}
	.home .elementor-element-eadb7b5 > .elementor-element {
		grid-column: span 2;
		width: auto !important;
		max-width: none !important;
	}
	.home .elementor-element-eadb7b5 > .elementor-element-e610f7e,
	.home .elementor-element-eadb7b5 > .elementor-element-ad22c9e {
		grid-column: span 3;
	}
	.home .elementor-element-eadb7b5 .elementskit-infobox {
		padding-top: 190px !important;
	}
}

@media (max-width: 767px) {

	:root {
		--cra-gutter: 20px;
	}

	/* ---------- Side gutters: content was touching the screen edges ---------- */
	.home .elementor-element-c6d4bc4 > .e-con-inner,
	.home .elementor-element-b1677c5 > .e-con-inner,
	.home .elementor-element-be947cf > .e-con-inner,
	.home .elementor-element-5866fb1 > .e-con-inner {
		padding-left: var(--cra-gutter) !important;
		padding-right: var(--cra-gutter) !important;
	}

	/* ---------- Hero slider ----------
	 * The slide images have the headline baked in (16:9). With a fixed 500px
	 * height and background-size: cover the text was cropped. Match the image
	 * ratio so the whole slide is visible.
	 */
	.home .elementor-element-d4b828f .swiper,
	.home .elementor-element-d4b828f .swiper-slide {
		height: calc(100vw * 9 / 16) !important;
	}
	.home .elementor-element-d4b828f .swiper-slide-bg {
		background-size: cover !important;
		background-position: center center !important;
	}
	.home .elementor-element-d4b828f .swiper-slide-inner {
		padding: 0 !important;
	}
	.home .elementor-element-d4b828f .elementor-swiper-button {
		font-size: 18px;
	}
	.home .elementor-element-d4b828f .elementor-swiper-button-prev {
		left: 6px !important;
	}
	.home .elementor-element-d4b828f .elementor-swiper-button-next {
		right: 6px !important;
	}

	/* ---------- Stats: 2 × 2 grid instead of 4 tall rows ---------- */
	.home .elementor-element-ff7a5b0 {
		padding: 10px 0 !important;
	}
	.home .elementor-element-ff7a5b0 > .elementor-element {
		width: 50% !important;
		max-width: 50% !important;
		flex: 0 0 50% !important;
		padding: 18px 8px !important;
		border-bottom: 0 !important;
	}
	.home .elementor-element-e30dd5d,
	.home .elementor-element-2b4c62f {
		border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
	}
	.home .elementor-element-e30dd5d,
	.home .elementor-element-3e480d2 {
		border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
	}
	.home .elementor-element-ff7a5b0 .elementor-counter-number-wrapper {
		font-size: 34px;
		line-height: 1.2;
	}
	.home .elementor-element-ff7a5b0 .elementor-heading-title {
		font-size: 12px !important;
		letter-spacing: 0.5px;
	}

	/* ---------- Services: 2-column cards, shorter ---------- */
	.home .elementor-element-eadb7b5 {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: 1fr; /* every row the same height */
		gap: 12px !important;
	}
	.home .elementor-element-eadb7b5 > .elementor-element {
		width: auto !important;
		max-width: none !important;
	}
	/* 5th card spans the full row */
	.home .elementor-element-ad22c9e {
		grid-column: 1 / -1;
	}
	.home .elementor-element-eadb7b5 .elementskit-infobox {
		padding: 120px 14px 14px !important;
		height: 100% !important;
		background-position: center center !important;
	}
	.home .elementor-element-eadb7b5 .elementskit-info-box-title {
		font-size: 14px !important;
		line-height: 1.25;
	}
	.home .elementor-element-bc138f2 {
		margin-bottom: 8px;
	}

	/* ---------- "About us" / "Learn more" links: text then arrow on one line ---------- */
	.home .elementor-element-515112c .elementor-icon-box-wrapper,
	.home .elementor-element-a59cf6e .elementor-icon-box-wrapper {
		display: inline-flex !important;
		flex-direction: row-reverse !important;
		align-items: center;
		gap: 8px;
		text-align: left !important;
	}
	.home .elementor-element-515112c .elementor-icon-box-icon,
	.home .elementor-element-a59cf6e .elementor-icon-box-icon {
		margin: 0 !important;
	}
	.home .elementor-element-515112c {
		width: auto !important;
		margin-top: 4px;
	}

	/* Space between the "Why choose us" block and "Our process" */
	.home .elementor-element-6c726fa {
		margin-top: 40px;
	}

	/* ---------- Process steps: 3 × 2 grid instead of 6 stacked rows ---------- */
	.home .elementor-element-d0f58da {
		display: grid !important;
		grid-template-columns: repeat(3, 1fr);
		gap: 18px 8px !important;
		margin: 10px 0 24px;
	}
	.home .elementor-element-d0f58da > .elementor-element {
		width: auto !important;
		max-width: none !important;
		min-height: 0 !important;
		padding: 0 !important;
	}
}
/* Floating cart/contact buttons: see global.css (same on every page). */
