/*
 * Boutique — grille produits — Défi 66
 * BEM : .shop-products, .shop-products__card, .shop-products__price
 * Cartes claires, badge prix or, bouton d'action noir. Zéro !important.
 * Contraste badge prix : or #F2C107 + noir #1A1A1A → 10.5:1 ✓
 * Contraste bouton : noir #1A1A1A + blanc #FFF → 16.8:1 ✓
 */

.shop-products {
	padding: var(--wp--preset--spacing--70) 0;
}

.shop-products__title {
	text-align: center;
	margin-bottom: var(--wp--preset--spacing--30);
}

.shop-products__intro {
	max-width: 46rem;
	margin-inline: auto;
	margin-bottom: var(--wp--preset--spacing--60);
	text-align: center;
	color: var(--wp--preset--color--gray-600);
	font-size: var(--wp--preset--font-size--medium);
}

/* Grille : 1 col mobile, 2 cols tablette, 3 cols desktop */
.shop-products__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--50);
}

@media (min-width: 36em) {
	.shop-products__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 64.0625em) {
	.shop-products__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.shop-products__item {
	display: flex;
}

.shop-products__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--gray-200);
	border-radius: var(--wp--custom--border-radius--card);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;

	&:hover,
	&:focus-within {
		transform: translateY(-4px);
		box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	}
}

/* Zone média : photo produit ou aplat avec icône + badge prix */
.shop-products__media {
	position: relative;
	aspect-ratio: 4 / 3;
	background-color: var(--wp--preset--color--gray-100);

	& img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}
}

.shop-products__media--empty {
	display: flex;
	align-items: center;
	justify-content: center;
}

.shop-products__placeholder {
	display: flex;
	color: var(--wp--preset--color--gray-400);

	& svg {
		width: 64px;
		height: 64px;
	}
}

.shop-products__price {
	position: absolute;
	top: var(--wp--preset--spacing--30);
	right: var(--wp--preset--spacing--30);
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--dark);
	font-family: var(--wp--preset--font-family--headings);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-radius: 999px;
}

.shop-products__body {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--50);
	flex: 1;
}

.shop-products__name {
	font-family: var(--wp--preset--font-family--headings);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.2;
}

.shop-products__desc {
	color: var(--wp--preset--color--gray-600);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}

.shop-products__buy {
	display: block;
	margin: 0 var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--dark);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--headings);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: none;
	border-radius: var(--wp--custom--border-radius--button);
	transition: background-color 0.2s ease, color 0.2s ease;

	&:hover,
	&:focus-visible {
		background-color: var(--wp--preset--color--primary);
		color: var(--wp--preset--color--dark);
	}
}

/* Texte lecteur d'écran : nom du produit ajouté au libellé « Commander » */
.shop-products__buy-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.shop-products__card,
	.shop-products__buy {
		transition: none;
	}
}
