/* ==========================================================================
   Homepage section layout + responsive gaps
   Flex-basis accounts for parent gap so cards wrap without leftover whitespace.
   ========================================================================== */

.ps-home-hero {
	position: relative;
	overflow: hidden;
}

/* Flag-type grid: 4 across desktop, 2 tablet, 1 mobile (gap 16px) */
.ps-home-flag-grid > .e-con,
.ps-home-flag-grid > .elementor-element {
	flex: 1 1 calc((100% - 48px) / 4);
	min-width: 0;
	max-width: 100%;
}

/* Shop-by-need: ~3 across on desktop (gap 16px) */
.ps-home-need-grid > .e-con,
.ps-home-need-grid > .elementor-element {
	flex: 1 1 calc((100% - 32px) / 3);
	min-width: 0;
	max-width: 100%;
}

.ps-home-card {
	height: 100%;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.ps-home-card:hover {
	border-color: #cfcbd0 !important;
	box-shadow: 0 8px 24px rgba(35, 31, 32, 0.1);
	transform: translateY(-3px);
}
.ps-home-card__media img,
.ps-home-card .elementor-widget-image img {
	aspect-ratio: 4 / 3;
	height: auto !important;
	max-height: none !important;
	min-height: 0 !important;
	object-fit: contain;
	object-position: center;
	background: #f8f7f8;
	width: 100%;
	display: block;
	border-radius: 8px;
}

/* Kill default Elementor widget bottom margins that inflate card gaps */
.ps-home-card .elementor-widget:not(:last-child) {
	margin-bottom: 0 !important;
}
.ps-home-card .elementor-widget-text-editor p,
.ps-home-trust .elementor-widget-text-editor p,
.ps-home-step .elementor-widget-text-editor p {
	margin: 0;
}
.ps-home-card .elementor-heading-title,
.ps-home-trust .elementor-heading-title,
.ps-home-step .elementor-heading-title {
	margin: 0;
}

.ps-home-trust,
.ps-home-step {
	flex: 1 1 calc((100% - 36px) / 4);
	min-width: 0;
	max-width: 100%;
	height: 100%;
}

.ps-home-step:hover,
.ps-home-trust:hover {
	border-color: #cfcbd0 !important;
}

/* Loop grids: keep rhythm with card grids */
.home .ps-popular-loop,
.home .ps-more-loop {
	margin: 0;
	padding: 0;
}
.home .ps-popular-loop .elementor-grid,
.home .ps-more-loop .elementor-grid,
.home .ps-popular-loop .elementor-loop-container,
.home .ps-more-loop .elementor-loop-container {
	gap: var(--grid-row-gap, 20px) var(--grid-column-gap, 16px);
}

.home .ps-popular-loop .ps-loop-card,
.home .ps-more-loop .ps-loop-card {
	height: 100%;
}
.home .ps-popular-loop .ps-loop-card__image img,
.home .ps-more-loop .ps-loop-card__image img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto !important;
	min-height: 0 !important;
	object-fit: contain;
	object-position: center;
	padding: 0.75rem;
	box-sizing: border-box;
	background: #f8f7f8;
	border-radius: 8px;
}
.home .ps-popular-loop .ps-loop-card__cta .elementor-button,
.home .ps-more-loop .ps-loop-card__cta .elementor-button {
	width: 100%;
	justify-content: center;
}

/* Compact “View all” after loop */
.home .ps-popular-loop + .e-con,
.home .elementor-widget-loop-grid + .e-con {
	padding-block: 0 !important;
	margin-top: 4px;
	justify-content: center !important;
	align-items: center !important;
}
.home .ps-popular-loop + .e-con .elementor-widget-button,
.home .elementor-widget-loop-grid + .e-con .elementor-widget-button {
	width: auto !important;
	max-width: max-content;
	margin-inline: auto;
}
.home .ps-popular-loop + .e-con .elementor-button,
.home .elementor-widget-loop-grid + .e-con .elementor-button {
	width: auto !important;
	min-width: 180px;
	min-height: 44px;
	justify-content: center;
}

/* Contact band: stack cleanly, no leftover side gap */
.home .elementor-element-56b06d5 {
	align-items: center;
}

@media (max-width: 1024px) {
	.ps-home-flag-grid > .e-con,
	.ps-home-flag-grid > .elementor-element {
		flex-basis: calc((100% - 14px) / 2);
	}
	.ps-home-need-grid > .e-con,
	.ps-home-need-grid > .elementor-element {
		flex-basis: calc((100% - 14px) / 2);
	}
	.ps-home-trust,
	.ps-home-step {
		flex-basis: calc((100% - 12px) / 2);
	}
}

@media (max-width: 767px) {
	.ps-home-flag-grid > .e-con,
	.ps-home-flag-grid > .elementor-element,
	.ps-home-need-grid > .e-con,
	.ps-home-need-grid > .elementor-element,
	.ps-home-trust,
	.ps-home-step {
		flex-basis: 100%;
		min-width: 0;
	}

	/* Stack hero CTA / contact CTA full width; keep View-all compact */
	.ps-home-hero .elementor-widget-button,
	.home .elementor-element-d6412c9 .elementor-widget-button,
	.home .elementor-element-882c999 .elementor-widget-button,
	.home .elementor-element-4279d24 .elementor-widget-button {
		width: 100% !important;
	}
	.ps-home-hero .elementor-button,
	.home .elementor-element-d6412c9 .elementor-button,
	.home .elementor-element-882c999 .elementor-button,
	.home .elementor-element-4279d24 .elementor-button {
		width: 100% !important;
		justify-content: center;
	}

	.home .ps-popular-loop + .e-con .elementor-widget-button,
	.home .elementor-widget-loop-grid + .e-con .elementor-widget-button {
		width: auto !important;
	}
	.home .ps-popular-loop + .e-con .elementor-button,
	.home .elementor-widget-loop-grid + .e-con .elementor-button {
		width: auto !important;
		min-width: 180px;
	}

	.home .elementor-element-56b06d5,
	.home .elementor-element-d6412c9 {
		flex-direction: column !important;
		align-items: stretch !important;
	}
}
