/*
 * Archives produits WooCommerce (/shop/, catégories, marques) — cartes
 * alignées sur la Boutique (page 12, assets/css/shop.css) :
 * filet #e2e2e2, visuel centré, étiquette de marque seule, titre sur deux
 * lignes, prix en bas de carte et cœur favori dans l'angle haut droit.
 *
 * Balisage du thème sur ces pages : li.product > .qodef-e-inner >
 * .qodef-e-content > (content-top | content-middle | content-bottom), puis le
 * bouton Qode Wishlist (remplacé par le cœur, voir shop-archive.js).
 */

body.clecod-shop-archive {
	--shop-ink: #000;
	--shop-muted: #6f6f6f;
	--shop-line: #e2e2e2;
	--shop-red: var(--qode-main-color, #e20100);
	--shop-body: "Archivo", sans-serif;
	--shop-display: "Archivo", sans-serif;
}

/* ======================================================================
   Carte
   ====================================================================== */

body.clecod-shop-archive .qodef-woo-product-list ul.products > li.product {
	display: flex;
	min-width: 0;
}

body.clecod-shop-archive .qodef-woo-product-list li.product > .qodef-e-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	font-family: var(--shop-body);
	transition: box-shadow 0.25s ease-out;
}

/* Filet posé au-dessus des fonds blancs des blocs internes. */
body.clecod-shop-archive .qodef-woo-product-list li.product > .qodef-e-inner::after {
	position: absolute;
	inset: 0;
	z-index: 5;
	content: "";
	border: 1px solid var(--shop-line);
	pointer-events: none;
	transition: border-color 0.25s ease-out;
}

body.clecod-shop-archive .qodef-woo-product-list li.product > .qodef-e-inner:hover {
	box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.3);
}

body.clecod-shop-archive .qodef-woo-product-list li.product > .qodef-e-inner:hover::after {
	border-color: #cdcdcd;
}

body.clecod-shop-archive .qodef-woo-product-list li.product .qodef-e-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* Rangée d'icônes du thème (comparateur / wishlist) : vide ici. */
body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-content-top {
	display: none;
}

/* Bouton Qode Wishlist (exige un compte, posé en bas à gauche) : remplacé par
   le cœur de la Boutique, qui fonctionne sans connexion. */
body.clecod-shop-archive .qodef-woo-product-list .qwfw-add-to-wishlist-wrapper.qwfw--loop {
	display: none !important;
}

/* --- Visuel ---------------------------------------------------------------- */

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-content-middle {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 0.86;
	margin: 0;
	padding: 34px 24px 10px;
	background: #fff;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-e-media-inner,
body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-image {
	width: 100%;
	height: 100%;
	margin: 0;
}

/* Les rendus produits ont un fond presque blanc : un léger éclaircissement
   efface le cadre gris qu'ils dessinaient sur la carte blanche. */
body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: brightness(1.02) contrast(1.02);
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

body.clecod-shop-archive .qodef-woo-product-list li.product:hover .qodef-woo-product-image img {
	transform: scale(1.05);
}

/* --- Textes ---------------------------------------------------------------- */

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-content-bottom {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 6px 20px 20px;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-info-wrapper {
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* Une seule étiquette au-dessus du titre, comme la Boutique : la marque.
   La sous-catégorie (« Commandes et accessoires »…) n'est plus affichée ;
   la hauteur est gardée pour aligner les titres d'une rangée. */
body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-category {
	min-height: 16px;
	margin: 0 0 6px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-categories {
	display: block;
	margin: 0;
	line-height: 16px;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-categories a {
	display: none;
	color: var(--shop-ink);
	font-family: var(--shop-body);
	font-size: 11px;
	font-weight: 500;
	line-height: 16px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-categories a[href*="/marques/"]:not([href$="/marques/"]) {
	display: inline;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-categories .qodef-info-separator-single,
body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-category .qodef-info-separator-end {
	display: none;
}

/* Titre : deux lignes au plus, coupées par « … ». */
body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-title {
	display: -webkit-box;
	min-height: 2.5em;
	margin: 0;
	overflow: hidden;
	color: var(--shop-ink);
	font-family: var(--shop-body);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	overflow-wrap: anywhere;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-title a {
	color: inherit;
	font: inherit;
	transition: color 0.2s ease-out;
}

body.clecod-shop-archive .qodef-woo-product-list li.product:hover .qodef-woo-product-title a,
body.clecod-shop-archive .qodef-woo-product-list li.product:focus-within .qodef-woo-product-title a {
	color: var(--shop-red);
}

/* --- Prix ------------------------------------------------------------------ */

/* En bas de carte, sur toute la largeur. Une fourchette (« 19,50 € – 69,99 € »)
   passe à la ligne d'un bloc quand elle ne tient pas, sans couper un montant. */
body.clecod-shop-archive .qodef-woo-product-list li.product .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	margin: auto 0 0;
	padding: 14px 0 0;
	column-gap: 6px;
	row-gap: 2px;
	color: var(--shop-ink);
	font-family: var(--shop-body);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}

body.clecod-shop-archive .qodef-woo-product-list li.product .price > span,
body.clecod-shop-archive .qodef-woo-product-list li.product .price > del,
body.clecod-shop-archive .qodef-woo-product-list li.product .price > ins {
	margin: 0 !important;
}

body.clecod-shop-archive .qodef-woo-product-list li.product .price .woocommerce-Price-amount {
	white-space: nowrap;
}

/* Le « – » est un <span> entre les deux montants : on le retire du flux et on
   le redessine dans le second montant, pour qu'il parte avec lui à la ligne. */
body.clecod-shop-archive .qodef-woo-product-list li.product .price > span[aria-hidden="true"]:not(.woocommerce-Price-amount) {
	display: none;
}

body.clecod-shop-archive .qodef-woo-product-list li.product .price > .woocommerce-Price-amount ~ .woocommerce-Price-amount::before {
	content: "–\00a0";
}

/* Promotion : ancien prix barré, plus petit et gris, devant le nouveau. */
body.clecod-shop-archive .qodef-woo-product-list li.product .price del {
	color: var(--shop-muted);
	font-size: 0.68em;
	font-weight: 400;
	opacity: 1;
}

body.clecod-shop-archive .qodef-woo-product-list li.product .price ins {
	background: none;
	color: var(--shop-red);
	text-decoration: none;
}

/* ======================================================================
   Cœur favori (même rendu et même stockage que la Boutique)
   ====================================================================== */

body.clecod-shop-archive .clecod-fav {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--shop-ink);
	cursor: pointer;
	transition: color 0.2s ease-out;
}

body.clecod-shop-archive .clecod-fav svg {
	width: 21px;
	height: 21px;
	fill: transparent;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linejoin: round;
	transition: fill 0.2s ease-out, transform 0.2s ease-out;
}

body.clecod-shop-archive .clecod-fav:hover svg {
	transform: scale(1.1);
}

body.clecod-shop-archive .clecod-fav:hover,
body.clecod-shop-archive .clecod-fav:focus-visible,
body.clecod-shop-archive .clecod-fav.is-active {
	color: var(--shop-red);
}

body.clecod-shop-archive .clecod-fav.is-active svg {
	fill: var(--shop-red);
}

body.clecod-shop-archive .clecod-fav:focus-visible {
	outline: 2px solid var(--shop-red);
	outline-offset: -4px;
}

/* Neutralise l'infobulle globale [data-tip] du flux TikTok sur ce bouton. */
body.clecod-shop-archive .clecod-fav::after {
	content: none !important;
}

/* Infobulle noire du thème, à gauche du cœur. */
body.clecod-shop-archive .clecod-fav::before {
	position: absolute;
	top: 50%;
	right: calc(100% - 2px);
	padding: 7px 10px;
	content: attr(data-tip);
	background: #000;
	color: #fff;
	font-family: var(--shop-display);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translate(6px, -50%);
	transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

body.clecod-shop-archive .clecod-fav:hover::before,
body.clecod-shop-archive .clecod-fav:focus-visible::before {
	opacity: 1;
	transform: translate(0, -50%);
}

@media (hover: none) {
	body.clecod-shop-archive .clecod-fav::before {
		display: none;
	}
}

body.clecod-shop-archive .clecod-fav.is-popping svg {
	animation: clecod-shop-archive-pop 0.4s cubic-bezier(0.2, 0.7, 0.2, 1.4);
}

@keyframes clecod-shop-archive-pop {
	40% { transform: scale(1.35); }
}

/* ======================================================================
   Toast « Ajouté à vos favoris · Voir mes favoris »
   ====================================================================== */

.clecod-shop-toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	z-index: 160;
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: calc(100vw - 32px);
	padding: 0 0 0 20px;
	background: #000;
	color: #fff;
	font-family: var(--clecod-font-display, "Archivo", sans-serif);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 16px);
	transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.clecod-shop-toast.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.clecod-shop-toast__text {
	padding: 17px 0;
	white-space: nowrap;
}

.clecod-shop-toast__text::before {
	margin-right: 10px;
	color: var(--qode-main-color, #e20100);
	content: "✓";
}

.clecod-shop-toast a {
	align-self: stretch;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0 18px;
	background: var(--qode-main-color, #e20100);
	color: #fff;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	white-space: nowrap;
	transition: background-color 0.2s ease-out;
}

.clecod-shop-toast a:hover,
.clecod-shop-toast a:focus-visible {
	background: #000;
	color: #fff;
	box-shadow: inset 0 0 0 1px var(--qode-main-color, #e20100);
}

/* ======================================================================
   Téléphone : cartes sur deux colonnes
   ====================================================================== */

@media (max-width: 680px) {
	body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-content-middle {
		padding: 30px 14px 6px;
	}

	body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-content-bottom {
		padding: 4px 14px 16px;
	}

	body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-categories a {
		font-size: 10px;
	}

	body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-title {
		min-height: 2.6em;
		font-size: 14px;
		line-height: 1.3;
	}

	body.clecod-shop-archive .qodef-woo-product-list li.product .price {
		padding-top: 12px;
		font-size: 19px;
	}

	body.clecod-shop-archive .clecod-fav {
		margin: 2px 2px 0 0;
	}

	body.clecod-shop-archive .clecod-fav svg {
		width: 18px;
		height: 18px;
	}

	/* Au-dessus de la barre d'onglets de l'application. */
	.clecod-shop-toast {
		bottom: calc(86px + env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	body.clecod-shop-archive .qodef-woo-product-list li.product > .qodef-e-inner,
	body.clecod-shop-archive .qodef-woo-product-list .qodef-woo-product-image img,
	body.clecod-shop-archive .clecod-fav,
	body.clecod-shop-archive .clecod-fav svg,
	.clecod-shop-toast {
		transition: none;
	}

	body.clecod-shop-archive .qodef-woo-product-list li.product:hover .qodef-woo-product-image img {
		transform: none;
	}

	body.clecod-shop-archive .clecod-fav.is-popping svg {
		animation: none;
	}
}
