/**
 * SLINKOR B2B shared product card.
 *
 * Blocksy keeps ownership of the WooCommerce loop and native product links.
 */

body.post-type-archive-product #main > .ct-container,
body.tax-product_cat #main > .ct-container {
	width: calc(100% - (2 * var(--slinkor-outer-padding-desktop)));
	max-width: var(--slinkor-content-width);
	margin-inline: auto;
}

:is([data-products], ul.products) {
	grid-template-columns: repeat(4, minmax(0, 276px));
	column-gap: 22px;
	row-gap: 30px;
	align-items: stretch;
	justify-content: center;
}

@media (min-width: 1280px) {
	body.post-type-archive-product #main :is([data-products], ul.products),
	body.tax-product_cat #main :is([data-products], ul.products) {
		width: 100%;
		max-width: var(--slinkor-content-width);
		margin-inline: auto;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		column-gap: 18px;
	}

	body.post-type-archive-product #main .slinkor-product-card__content,
	body.tax-product_cat #main .slinkor-product-card__content {
		padding-bottom: 14px;
	}
}

:is([data-products], ul.products) > .product {
	min-width: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--slinkor-color-background);
	border: 1px solid #e6e9ed;
	border-radius: var(--slinkor-radius-card);
	box-shadow: none;
	transition:
		transform 0.22s ease,
		border-color 0.22s ease,
		box-shadow 0.22s ease;
}

:is([data-products], ul.products) > .product > figure {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	margin: 0;
	overflow: hidden;
	background: var(--slinkor-color-background);
}

:is([data-products], ul.products) > .product > figure .ct-media-container {
	width: 100%;
	height: 100%;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border-radius: 0;
}

:is([data-products], ul.products) > .product > figure img {
	width: 100%;
	height: 100%;
	max-height: 100%;
	display: block;
	object-fit: contain;
	object-position: center;
	aspect-ratio: auto;
	border-radius: 0;
	transform: none;
	transition: transform 0.28s ease;
}

.slinkor-product-card__content {
	min-width: 0;
	flex: 1;
	padding: 10px 16px 18px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.slinkor-product-card__badge {
	margin-bottom: 6px;
	color: var(--slinkor-color-text-secondary);
	font-family: var(--slinkor-font-heading);
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1.333;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
}

.slinkor-product-card__badge:hover {
	color: var(--slinkor-color-brand-hover);
}

.slinkor-product-card__content .woocommerce-loop-product__title {
	width: 100%;
	margin: 0;
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--slinkor-color-heading);
	font-family: var(--slinkor-font-heading);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0;
}

.slinkor-product-card__content .woocommerce-loop-product__title a {
	color: inherit;
	text-decoration: none;
}

.slinkor-product-card__content .woocommerce-loop-product__title a:hover {
	color: var(--slinkor-color-brand-hover);
}

.slinkor-product-card__quote {
	margin-top: auto;
	padding-top: 14px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--slinkor-color-brand);
	font-family: var(--slinkor-font-button);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
}

.slinkor-product-card__quote svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: var(--slinkor-color-brand);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform var(--slinkor-transition-standard);
}

.slinkor-product-card__quote:hover {
	color: var(--slinkor-color-brand-hover);
}

@media (hover: hover) and (min-width: 1024px) {
	:is([data-products], ul.products) > .product:hover {
		transform: translateY(-2px);
		border-color: rgba(0, 174, 239, 0.26);
		box-shadow: 0 10px 26px rgba(20, 30, 40, 0.055);
	}

	:is([data-products], ul.products) > .product:hover > figure img {
		transform: none;
	}

	.slinkor-product-card__quote:hover svg {
		transform: translateX(3px);
	}
}

@media (min-width: 1024px) and (max-width: 1279.98px) {
	:is([data-products], ul.products) {
		grid-template-columns: repeat(3, minmax(0, 276px));
	}
}

@media (min-width: 768px) and (max-width: 1023.98px) {
	:is([data-products], ul.products) {
		grid-template-columns: repeat(2, minmax(0, 276px));
	}
}

@media (max-width: 767.98px) {
	body.post-type-archive-product #main > .ct-container,
	body.tax-product_cat #main > .ct-container {
		width: calc(100% - (2 * var(--slinkor-outer-padding-mobile)));
	}

	:is([data-products], ul.products) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 10px;
		row-gap: 20px;
	}

	.slinkor-product-card__content {
		padding: 4px 14px 16px;
	}

	:is([data-products], ul.products) > .product {
		border-radius: var(--slinkor-radius-medium);
	}

	.slinkor-product-card__content .woocommerce-loop-product__title {
		font-size: 14px;
		line-height: 1.4;
	}

	.slinkor-product-card__quote {
		padding-top: 10px;
		gap: 5px;
		font-size: 12.5px;
	}

	.slinkor-product-card__quote svg {
		width: 14px;
		height: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	:is([data-products], ul.products) > .product:hover,
	:is([data-products], ul.products) > .product:hover > figure img,
	.slinkor-product-card__quote:hover svg {
		transform: none;
	}
}
