/**
 * Homepage layout alignment.
 * Keep every Gutenberg/dynamic section on the same horizontal grid as the
 * shared HiGuppy header. The homepage plugin's Gutenberg reset must not turn
 * these containers into full-viewport blocks.
 */
body.hg-homepage-active .higuppy-home .hg-container,
body.hg-homepage-active .higuppy-home .wp-block-group.hg-container,
body.hg-homepage-active .higuppy-home .hg-section.hg-container,
body.hg-homepage-active .higuppy-home .hg-trust-panel,
body.hg-homepage-active .higuppy-home .hg-stats {
	box-sizing: border-box !important;
	width: min(1160px, calc(100% - 40px)) !important;
	max-width: 1160px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

body.hg-homepage-active .higuppy-home .hg-trust-panel,
body.hg-homepage-active .higuppy-home .hg-stats {
	margin-top: 28px;
}

/* Stats: separate cards (visual rules live in hg-shell-fixes). */
body.hg-homepage-active .higuppy-home .hg-stats {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 16px !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	overflow: visible !important;
	padding: 8px 0 4px !important;
}

/* Trust cards: stack icon → title → copy. Gutenberg uses <p> for the emoji
 * icon (not <span>), so the old 2-column hero-form grid put icon + body text
 * in the same cell and they overlapped. */
body.hg-homepage-active .higuppy-home .hg-trust-panel,
body.home .higuppy-home .hg-trust-panel {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 16px !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	overflow: visible !important;
}

@media (max-width: 900px) {
	body.hg-homepage-active .higuppy-home .hg-trust-panel,
	body.home .higuppy-home .hg-trust-panel {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 12px !important;
	}

	body.hg-homepage-active .higuppy-home .hg-trust-panel > article,
	body.home .higuppy-home .hg-trust-panel > article {
		padding: 18px 14px !important;
	}
}

@media (max-width: 520px) {
	body.hg-homepage-active .higuppy-home .hg-trust-panel,
	body.home .higuppy-home .hg-trust-panel {
		grid-template-columns: 1fr !important;
		gap: 10px !important;
	}
}

body.hg-homepage-active .higuppy-home .hg-trust-panel > article,
body.home .higuppy-home .hg-trust-panel > article {
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	text-align: center !important;
	gap: 8px !important;
	grid-template-columns: none !important;
	grid-template-rows: none !important;
	border: 1px solid rgba(31, 58, 95, 0.12) !important;
	border-radius: 18px !important;
	background: #fff !important;
	box-shadow: 0 12px 28px rgba(8, 39, 71, 0.07) !important;
	padding: 22px 18px !important;
}

body.hg-homepage-active .higuppy-home .hg-trust-panel > article > p:first-child,
body.home .higuppy-home .hg-trust-panel > article > p:first-child,
body.hg-homepage-active .higuppy-home .hg-trust-panel > article > span,
body.home .higuppy-home .hg-trust-panel > article > span {
	display: grid !important;
	place-items: center !important;
	grid-area: auto !important;
	width: 52px !important;
	height: 52px !important;
	margin: 0 auto 4px !important;
	padding: 0 !important;
	border-radius: 999px !important;
	background: #ecfbff !important;
	font-size: 22px;
	line-height: 1;
}

body.hg-homepage-active .higuppy-home .hg-trust-panel > article > h3,
body.home .higuppy-home .hg-trust-panel > article > h3 {
	grid-area: auto !important;
	margin: 0 !important;
}

body.hg-homepage-active .higuppy-home .hg-trust-panel > article > p:not(:first-child),
body.home .higuppy-home .hg-trust-panel > article > p:not(:first-child) {
	grid-area: auto !important;
	margin: 0 !important;
}

@media (max-width: 900px) {
	body.hg-homepage-active .higuppy-home .hg-trust-panel {
		gap: 12px !important;
	}
}

/* Compact Featured Guppies cards to match the Best Sellers card density. */
@media (min-width: 992px) {
	body.hg-homepage-active .higuppy-home .hg-products {
		/* Match the Best Sellers rail instead of stretching across the viewport. */
		width: min(1160px, calc(100% - 72px)) !important;
		max-width: 1160px !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	body.hg-homepage-active .higuppy-home .hg-products .hg-product-grid {
		width: min(1104px, 100%) !important;
		max-width: 1104px !important;
		margin-left: auto !important;
		margin-right: auto !important;
		gap: 20px !important;
	}

	body.hg-homepage-active .higuppy-home .hg-products .hg-product-card {
		flex: 0 0 calc((100% - 80px) / 5) !important;
		width: calc((100% - 80px) / 5) !important;
	}
}

body.hg-homepage-active .higuppy-home .hg-products .hg-product-image .hg-media,
body.hg-homepage-active .higuppy-home .hg-products .hg-product-card img {
	aspect-ratio: 1 / 0.68 !important;
	height: auto !important;
	min-height: 0 !important;
}

body.hg-homepage-active .higuppy-home .hg-products .hg-product-info {
	padding: 10px 12px 12px !important;
}

body.hg-homepage-active .higuppy-home .hg-products .hg-product-card h3 {
	min-height: 38px !important;
	font-size: var(--hg-font-size-body);
	line-height: 1.2;
}

body.hg-homepage-active .higuppy-home .hg-products .hg-price {
	font-size: 16px;
	margin-bottom: 6px !important;
}

body.hg-homepage-active .higuppy-home .hg-products .hg-add-cart,
body.hg-homepage-active .higuppy-home .hg-products .hg-buy-now {
	min-height: 34px !important;
	font-size: var(--hg-font-size-body);
}

@media (max-width: 900px) {
	body.hg-homepage-active .higuppy-home .hg-container,
	body.hg-homepage-active .higuppy-home .wp-block-group.hg-container,
	body.hg-homepage-active .higuppy-home .hg-section.hg-container,
	body.hg-homepage-active .higuppy-home .hg-trust-panel,
	body.hg-homepage-active .higuppy-home .hg-stats {
		width: calc(100% - 24px) !important;
	}
}
