/* Carte categorie (accueil + mega-menu grid) */
.category-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.7rem;
	padding: 2rem 1.25rem 1.75rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	background: var(--color-white);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: border-color var(--transition-base), transform var(--transition-slow), box-shadow var(--transition-base);
}

.category-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, var(--color-orange-light) 0%, transparent 65%);
	opacity: 0;
	transition: opacity var(--transition-base);
}

.category-card:hover {
	border-color: transparent;
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
	opacity: 0.35;
}

.category-card__image {
	position: relative;
	width: 92px;
	height: 92px;
	border-radius: var(--radius-pill);
	background: var(--color-grey-100);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-shadow: 0 0 0 1px var(--color-border);
	transition: transform var(--transition-slow), box-shadow var(--transition-base);
}

.category-card:hover .category-card__image {
	transform: scale(1.06);
	box-shadow: 0 0 0 4px var(--color-orange-light);
}

.category-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	position: relative;
}

.category-card__name {
	position: relative;
	font-weight: 700;
	font-family: var(--font-heading);
	letter-spacing: -0.005em;
}

.category-card__count {
	position: relative;
	font-size: 0.8rem;
	color: var(--color-text-muted);
}

.category-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
}

/*
 * Carte produit. Le selecteur cible specifiquement <ul class="products">
 * (liste de produits WooCommerce) et non ".products" seul : WooCommerce
 * reutilise aussi la classe "products" sur des conteneurs englobants
 * (ex. <section class="related products">, <section class="upsells
 * products">) qui ne doivent surtout pas devenir des grilles.
 */
.product-grid,
ul.products {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 1.75rem;
	margin: 0 !important;
}

/*
 * WooCommerce ajoute un clearfix (content:" "; display:table) en
 * ::before/::after sur ul.products pour son ancien systeme en float.
 * Une fois la liste transformee en grille, ces pseudo-elements
 * deviennent eux-memes des cellules de la grille et decalent les vraies
 * cartes : on les neutralise completement.
 */
.product-grid::before,
.product-grid::after,
ul.products::before,
ul.products::after {
	content: none !important;
	display: none !important;
}

.product-card {
	/*
	 * WooCommerce applique width:22%/48% + float:left a "li.product" pour
	 * son propre systeme de colonnes ; on neutralise explicitement pour
	 * que la carte occupe toute sa cellule de grille.
	 */
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	position: relative;
	/*
	 * Sous-grille : les 5 rangees de la carte (image, categorie, titre, prix,
	 * bouton) sont partagees avec les cartes voisines de la meme ligne, donc
	 * toujours alignees quel que soit le nombre de lignes de texte.
	 */
	display: grid;
	grid-row: span 5;
	grid-template-rows: subgrid;
	row-gap: 0;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--color-white);
	box-shadow: var(--shadow-sm);
	transition: border-color var(--transition-base), transform var(--transition-slow), box-shadow var(--transition-base);
}

.product-card:hover {
	border-color: transparent;
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
}

.product-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: var(--color-grey-100);
	overflow: hidden;
}

.product-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 60%, rgba(36, 39, 43, 0.05) 100%);
	pointer-events: none;
}

.product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-base);
}

.product-card:hover .product-card__media img {
	transform: scale(1.05);
}

.product-card__link,
.product-card__body {
	display: contents;
}

.product-card__category {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-orange);
	font-weight: 700;
	padding: 1.1rem 1.1rem 0.35rem;
}

.product-card__title {
	font-size: 1rem;
	margin: 0;
	padding: 0 1.1rem 0.4rem;
}

.product-card__price {
	padding: 0 1.1rem 0.5rem;
}

.product-card__title a {
	color: var(--color-charcoal);
}

.product-card .price {
	font-family: var(--font-heading);
	font-weight: 700;
	color: var(--color-charcoal);
}

.product-card__footer {
	padding: 0.75rem 1.1rem 1.1rem;
	align-self: end;
}

/*
 * Les trois boutons (Ajouter au panier, Choix des options, Demander un
 * devis du plugin YITH) ont exactement le meme gabarit.
 */
.product-card__footer .yith-ywraq-add-to-quote,
.product-card__footer .yith-ywraq-add-button {
	margin: 0;
	padding: 0;
}

.product-card__footer .button,
.product-card__footer .add-request-quote-button {
	display: flex;
	width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	margin: 0;
	padding: 0.65rem 1rem;
	font-size: 0.9rem;
	line-height: 1.2;
	white-space: nowrap;
	text-align: center;
}

.product-card__footer .yith-ywraq-add-button a.add-request-quote-button.button {
	font-family: var(--font-heading) !important;
	font-size: 1rem !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	padding: 0.65rem 1rem !important;
	min-height: 44px !important;
	width: 100% !important;
	margin: 0 !important;
}

.product-card__footer .ajax-loading,
.product-card__footer .clear {
	display: none;
}

/* Carte temoignage */
.testimonials__grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 1.25rem;
}

.testimonial-card {
	padding: 1.75rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	background: var(--color-white);
}

.testimonial-card__rating {
	display: flex;
	gap: 0.2rem;
	color: var(--color-orange);
	margin-bottom: 0.75rem;
}

.testimonial-card__rating .icon {
	width: 1rem;
	height: 1rem;
}

.testimonial-card__text {
	color: var(--color-text);
	font-style: italic;
}

.testimonial-card__author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.testimonial-card__avatar {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-pill);
	object-fit: cover;
}

.testimonial-card__name {
	display: block;
	font-weight: 700;
}

.testimonial-card__role {
	display: block;
	font-size: 0.82rem;
	color: var(--color-text-muted);
}

/* Carte article de blog */
.post-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.75rem;
}

.post-card {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	background: var(--color-white);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.post-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
}

.post-card__thumb {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--color-grey-100);
	overflow: hidden;
}

.post-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-card__body {
	padding: 1.25rem;
}

@media (max-width: 960px) {
	.category-grid,
	.product-grid,
	ul.products,
	.testimonials__grid,
	.post-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 560px) {
	.category-grid,
	.product-grid,
	ul.products,
	.testimonials__grid,
	.post-grid {
		grid-template-columns: 1fr !important;
	}
}
