/*
 * Homepage: product grid section.
 * Enqueued only on the front page (see rittal_india_enqueue_assets()).
 */

.product-grid-section {
	background-color: #000000;
	/* Figma's top pad is 80px; trimmed with the card image so the first
	   row clears the fold. */
	padding: 48px 0 29px;
}

.product-grid-section__header {
	margin-bottom: 40px;
}

.product-grid-section__title {
	margin: 0 0 12px;
	color: #fff;
	font-size: 1.75rem;
	font-weight: 600;
}

.product-grid-section__description {
	margin: 0;
	color: #d0d0d0;
	font-size: 1rem;
	max-width: 60ch;
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;
	row-gap: 100px;
}

.product-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	container-type: inline-size;
}

/*
 * Figma is 680x425. Shortened so the first row of cards — button
 * included — lands inside one viewport: at ~670px wide the 425 ratio
 * put the buttons just past the fold. object-fit: cover on the img
 * crops rather than distorts.
 */
.product-card__image {
	width: 100%;
	aspect-ratio: 680 / 360;
	overflow: hidden;
	background-color: #0a0a0a;
}

.product-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * The title and description are fixed at their Figma values (30/31.9
 * and 18/24) so they stay readable when the card narrows. The content
 * offset still scales with the card width (cqw = 1% of the card),
 * matching the 680px design at full size.
 * Below that everything shrinks proportionally, so the card keeps the
 * same proportions instead of the text wrapping.
 */
.product-card__content {
	margin-top: 3.529cqw; /* 24px at 680 */
}

.product-card__title {
	margin: 0 0 8px;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	/* Fixed, not cqw: the card narrows to 344px on tablet, where a
	   scaled title fell to ~15px. */
	font-size: 30px;
	font-weight: 400;
	line-height: 31.9px;
	letter-spacing: 0;
}

.product-card__description {
	margin: 0 0 20px;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	/* Fixed: the scaled size dropped to ~9px at 768px wide. */
	font-size: 18px;
	line-height: 24px;
	letter-spacing: 0;
	text-align: left;
}

.product-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Figma 230x40, fixed: the card narrows to 344px on tablet, where a
	   scaled button fell to 116x20 with 8px text. */
	width: 230px;
	max-width: 100%;
	height: 40px;
	background-color: #e50043;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 17.9px;
	letter-spacing: 0;
	text-align: center;
	text-decoration: none;
	border-radius: 4px;
	box-sizing: border-box;
	transition: background-color .3s;
}

.product-card__button:hover,
.product-card__button:focus {
	background-color: #c8003a;
}

/*
 * Never scale past the 680px design value on very wide screens. Type
 * and the button are fixed above, so only the content offset scales.
 */


@media(max-width: 1024px){
	.product-grid{
		row-gap: 60px;
	}
}

@container (min-width: 680px) {
	.product-card__content { margin-top: 24px; }
}

@media (max-width: 900px) {
	.product-grid {
		row-gap: 56px;
	}
}

@media (max-width: 767px) {
	/*
	 * Horizontal inset comes from the inner .site-container only.
	 * Adding it here too would double it to 40px a side.
	 */
	.product-grid-section {
		padding: 48px 0;
	}

	.product-grid {
		grid-template-columns: 1fr;
		row-gap: 40px;
	}

	/*
	 * Keeps the Figma 230x40 on mobile too. max-width:100% in the base
	 * rule still shrinks it if a card is ever narrower than 230px.
	 */
	.product-card__button {
		width: 230px;
	}
	.product-card__description {
    text-align: center;
}
	.product-card {
    align-items: center;
    text-align: center;
}
}
