/* Design tokens pulled from the Figma card (node 2076:359). */
.rp-product-grid {
	--rp-color-primary: #005487;
	--rp-color-border: #cdcdcd;

	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

/* Tablet: vertical cards get 2 columns; horizontal cards stay full-width
   (an image-left/text-right card needs the width, so it doesn't split into
   columns until desktop). */
/* @media (min-width: 600px) {
	.rp-product-grid--vertical {
		grid-template-columns: repeat(2, 1fr);
	}
} */
.rp-product-grid--vertical, .rp-product-grid--vertical-full-image {
		grid-template-columns: repeat(3, 1fr);
}

.rp-product-grid--horizontal {
	grid-template-columns: repeat(2, 1fr);
}

/* Desktop: vertical cards fix at 3 columns; horizontal cards get 2. */
@media (max-width: 1024px) {
	.rp-product-grid--vertical, .rp-product-grid--vertical-full-image {
		grid-template-columns: repeat(2, 1fr);
	}

	.rp-product-grid--horizontal {
		grid-template-columns: repeat(1, 1fr);
	}
}

/* Image on top, content centered below — the default for every card, and
   the only layout on mobile even for a "horizontal" grid (an image-left
   layout needs width a phone screen doesn't have). */

.rp-product-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 15px;
	background: #fff;
	border: 1px solid var(--rp-color-border);
	border-radius: 20px;
	padding: 25px 15px;
	text-align: center;
}

.rp-product-card__media {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 20px;
	overflow: hidden;
	position: relative;
}

/* From tablet up, a horizontal card switches to image-left, text-right. */
@media (min-width: 600px) {
	.rp-product-grid--horizontal .rp-product-card {
		flex-direction: row;
		padding: 15px;
		text-align: left;
	}

	.rp-product-grid--horizontal .rp-product-card__body {
		align-items: normal;
	}

	.rp-product-grid--horizontal .rp-product-card__media {
		flex: 0 0 160px;
		width: 160px;
		aspect-ratio: auto;
		align-self: stretch;
	}
}

.rp-product-card__image,
.rp-product-card__image--placeholder {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #fff;
}

.rp-product-card__image--placeholder {
	background: #f2f2f2;
}

.rp-product-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	min-width: 0;
}

.rp-product-card__name {
	margin: 0;
	font-weight: 600;
	font-size: 24px;
	line-height: 32px;
	color: #000;
}

.rp-product-card__description {
	margin: 0;
	font-weight: 400;
	font-size: 20px;
	line-height: 23px;
	color: #000;
}

/* Always two rows: the product-page button alone on top, brochure/manual
   sharing the row below. Flex + flex:1 on the buttons means a lone secondary
   button naturally fills the same width the row above uses. */
.rp-product-card__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}

.rp-product-card__buttons-row {
	display: flex;
	gap: 10px;
	width: 100%;
}

.rp-product-card__button {
	flex: 1 1 0;
	display: inline-block;
	padding: 12px 24px;
	border-radius: 100px;
	font-weight: 600;
	font-size: 18px;
	line-height: 24px;
	text-decoration: none;
	text-align: center;
	white-space: nowrap;
}

.rp-product-card__button--primary, .rp-product-card__button--secondary:hover {
	background: var(--rp-color-primary);
	color: #fff;
	border: 1px solid var(--rp-color-primary);
}

.rp-product-card__button--secondary,.rp-product-card__button--primary:hover {
	background: transparent;
	color: var(--rp-color-primary);
	border: 1px solid var(--rp-color-primary);
}

/* Specific for Horizontal Layout */

.rp-product-grid--vertical .rp-product-card__buttons-row, .rp-product-grid--vertical-full-image .rp-product-card__buttons-row {
	flex-direction: column;
}

.rp-product-grid--vertical .rp-product-card__body, .rp-product-grid--vertical-full-image .rp-product-card__body {
	width: 100%;
}

/* Specific for Vertical Full Image Layout */

.rp-product-grid--vertical-full-image .rp-product-card {
	padding: 0;
}

.rp-product-grid--vertical-full-image .rp-product-card:hover .rp-product-card__image {
	background: #ECF3FB;
}

.rp-product-grid--vertical-full-image .rp-product-card__body {
	padding: 25px 15px;
}

.rp-product-grid--vertical-full-image .rp-product-card__image, .rp-product-card__image--placeholder {
	object-fit: contain;
	background: #f7f7f7;
}