/**
 * Products Section — "Choose Your Marketing Toolkit"
 *
 * Stylesheet for the .dgp-products component inside page-home1.php.
 * Every selector is scoped under a "dgp-" class, so nothing here can
 * affect any other section of the homepage, and nothing else on the
 * site can affect this component. The parent theme's ".container"
 * class is used in the markup for width but is intentionally left
 * unstyled here.
 *
 * Colours, radii and fonts fall back to the parent theme's own custom
 * properties where available, with a hardcoded fallback for each, so
 * the section still renders correctly if the parent stylesheet is
 * absent.
 *
 * Contents:
 *   1. Section scope, tokens and spacing
 *   2. Section header
 *   3. Cards grid
 *   4. Card surface and hover
 *   5. Featured card
 *   6. Card content
 *   7. Button
 *   8. Breakpoint: tablet ( 768px )
 *   9. Breakpoint: desktop ( 1064px )
 *  10. Reduced motion
 */

/* -----------------------------------------------------------------------
 * 1. Section scope, tokens and spacing
 *
 * Hero -> Products gap is the section's own top padding ( ~90px ).
 * Products -> Services gap is the section's own bottom padding ( ~120px ).
 * Both are set here only; no other section's spacing is touched.
 * -------------------------------------------------------------------- */

.dgp-products {
	/* Palette. */
	--dgp-accent: var( --main-color, #2f6fed );
	--dgp-accent-deep: var( --thrd-color, #0b1f4d );
	--dgp-positive: var( --second-color, #16a34a );
	--dgp-ink: var( --sw-text-color, #0f172a );
	--dgp-muted: var( --sw-text-color2, #5b6b82 );
	--dgp-surface: var( --sw-bg-color, #ffffff );
	--dgp-surface-alt: var( --sw-bg-color2, #f4f7fc );
	--dgp-border: var( --border-color2, #e6eaf2 );

	/* Shape. */
	--dgp-radius: var( --cortics-radius-md, 16px );
	--dgp-radius-lg: var( --cortics-radius-lg, 28px );
	--dgp-radius-pill: 999px;

	/* Elevation. Soft at rest, clearly stepped on hover. */
	--dgp-shadow-sm:
		0 1px 2px rgba( 15, 23, 42, 0.04 ),
		0 1px 3px -1px rgba( 15, 23, 42, 0.03 );
	--dgp-shadow-md: 0 16px 36px -16px rgba( 15, 23, 42, 0.22 );
	--dgp-shadow-lg: 0 32px 64px -20px rgba( 15, 23, 42, 0.28 );
	--dgp-shadow-accent:
		0 14px 30px -10px color-mix( in srgb, var( --dgp-accent ) 45%, transparent );

	/* One easing curve for every transition in this component. */
	--dgp-ease: cubic-bezier( 0.22, 0.61, 0.36, 1 );

	/* Layout. */
	--dgp-gap: 20px;
	--dgp-card-pad: clamp( 26px, 3vw, 36px );

	display: block;
	padding-block: 90px 120px;
	background-color: var( --dgp-surface-alt );
	font-family: var( --main-font, "Google Sans", sans-serif );
	color: var( --dgp-ink );
}

.dgp-products-inner {
	display: flow-root;
}

/* -----------------------------------------------------------------------
 * 2. Section header
 * -------------------------------------------------------------------- */

.dgp-products-title {
	max-width: 40ch;
	margin: 0 auto 16px;
	color: var( --dgp-ink );
	font-size: clamp( 1.875rem, 1.4rem + 2vw, 2.875rem );
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.024em;
	text-align: center;
	text-wrap: balance;
}

.dgp-products-text {
	max-width: 46ch;
	margin: 0 auto 56px;
	color: var( --dgp-muted );
	font-size: 1.0625rem;
	line-height: 1.6;
	text-align: center;
	text-wrap: pretty;
}

/* -----------------------------------------------------------------------
 * 3. Cards grid
 *
 * align-items: stretch fills every card in a row to the same height;
 * combined with the flex column layout in section 4 and flex-grow on
 * the feature list in section 6, this is what keeps every button
 * aligned along the bottom edge with no JavaScript.
 * -------------------------------------------------------------------- */

.dgp-products-grid {
	display: grid;
	grid-template-columns: 1fr;
	align-items: stretch;
	gap: var( --dgp-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

/* -----------------------------------------------------------------------
 * 4. Card surface and hover
 * -------------------------------------------------------------------- */

.dgp-product-card {
	display: flex;
	flex-direction: column;
	position: relative;
	min-width: 0;
	padding: var( --dgp-card-pad );
	border: 1px solid var( --dgp-border );
	border-radius: var( --dgp-radius-lg );
	background-color: var( --dgp-surface );
	box-shadow: var( --dgp-shadow-sm );
	transition:
		transform 0.32s var( --dgp-ease ),
		box-shadow 0.32s var( --dgp-ease ),
		border-color 0.32s var( --dgp-ease );
}

.dgp-product-card:hover {
	border-color: color-mix( in srgb, var( --dgp-accent ) 30%, var( --dgp-border ) );
	box-shadow: var( --dgp-shadow-md );
	transform: translateY( -6px );
}

/* -----------------------------------------------------------------------
 * 5. Featured card
 *
 * Made larger with a vertical offset rather than a scale transform,
 * which would blur its text and thicken its border along with it.
 * -------------------------------------------------------------------- */

.dgp-product-card-featured {
	z-index: 1;
	border-color: var( --dgp-accent );
	background-image: linear-gradient(
		to bottom,
		color-mix( in srgb, var( --dgp-accent ) 6%, transparent ),
		transparent 220px
	);
	box-shadow: var( --dgp-shadow-lg );
}

.dgp-product-card-featured:hover {
	box-shadow: var( --dgp-shadow-lg ), var( --dgp-shadow-accent );
	transform: translateY( -8px );
}

.dgp-product-badge {
	position: absolute;
	inset-block-start: -15px;
	inset-inline-start: 50%;
	transform: translateX( -50% );
	padding: 7px 18px;
	border-radius: var( --dgp-radius-pill );
	background-color: var( --dgp-accent );
	box-shadow: var( --dgp-shadow-sm );
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* -----------------------------------------------------------------------
 * 6. Card content
 * -------------------------------------------------------------------- */

.dgp-product-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 4px auto 22px;
	border-radius: var( --dgp-radius );
	background-color: var( --dgp-surface-alt );
	overflow: hidden;
}

.dgp-product-icon img {
	width: 26px;
	height: 26px;
	object-fit: contain;
}

.dgp-product-name {
	margin: 0 0 6px;
	color: var( --dgp-muted );
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
}

.dgp-product-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
	margin: 0 0 28px;
	padding-block-end: 24px;
	border-block-end: 1px solid var( --dgp-border );
}

.dgp-product-amount {
	color: var( --dgp-ink );
	font-size: clamp( 2.25rem, 1.85rem + 1.6vw, 2.875rem );
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.dgp-product-period {
	color: var( --dgp-muted );
	font-size: 0.875rem;
	line-height: 1.4;
}

.dgp-product-features {
	flex-grow: 1;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}

.dgp-product-feature {
	position: relative;
	padding: 7px 0 7px 28px;
	color: var( --dgp-muted );
	font-size: 0.9375rem;
	line-height: 1.55;
}

.dgp-product-feature::before {
	content: "";
	position: absolute;
	inset-block-start: 14px;
	inset-inline-start: 2px;
	width: 10px;
	height: 6px;
	border-inline-start: 2px solid var( --dgp-positive );
	border-block-end: 2px solid var( --dgp-positive );
	transform: rotate( -45deg );
}

.dgp-product-actions {
	margin-block-start: auto;
}

/* -----------------------------------------------------------------------
 * 7. Button
 * -------------------------------------------------------------------- */

.dgp-product-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	padding: 14px 20px;
	border: 1px solid transparent;
	border-radius: var( --dgp-radius );
	background-color: var( --dgp-accent );
	box-shadow: var( --dgp-shadow-sm );
	color: #ffffff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 650;
	letter-spacing: -0.005em;
	text-align: center;
	text-decoration: none;
	transition:
		background-color 0.24s var( --dgp-ease ),
		box-shadow 0.24s var( --dgp-ease ),
		transform 0.24s var( --dgp-ease );
}

.dgp-product-button:hover,
.dgp-product-button:focus {
	background-color: var( --dgp-accent-deep );
	box-shadow: var( --dgp-shadow-accent );
	color: #ffffff;
	text-decoration: none;
	transform: translateY( -2px );
}

.dgp-product-button:active {
	box-shadow: var( --dgp-shadow-sm );
	transform: translateY( 0 );
}

.dgp-product-button:focus-visible {
	outline: 3px solid var( --dgp-accent-deep );
	outline-offset: 3px;
}

/* -----------------------------------------------------------------------
 * 8. Breakpoint: tablet ( 768px )
 * -------------------------------------------------------------------- */

@media ( min-width: 768px ) {

	.dgp-products {
		padding-block: 90px 120px;
		--dgp-gap: 24px;
	}

	.dgp-products-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* -----------------------------------------------------------------------
 * 9. Breakpoint: desktop ( 1064px )
 * -------------------------------------------------------------------- */

@media ( min-width: 1064px ) {

	.dgp-products {
		--dgp-gap: 24px;
	}

	.dgp-products-grid {
		grid-template-columns: repeat( 4, 1fr );
	}

	/* Lift the featured card clear of its neighbours and give it extra
	   height, without scaling it. */
	.dgp-product-card-featured {
		margin-block: -20px;
		padding-block: calc( var( --dgp-card-pad ) + 20px );
	}

	.dgp-product-card-featured .dgp-product-amount {
		font-size: 3.125rem;
	}
}

/* -----------------------------------------------------------------------
 * 10. Reduced motion
 * -------------------------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.dgp-product-card,
	.dgp-product-card-featured,
	.dgp-product-button {
		transition: none;
	}

	.dgp-product-card:hover,
	.dgp-product-card-featured:hover,
	.dgp-product-button:hover,
	.dgp-product-button:active {
		transform: none;
	}
}