/**
 * [Trésor] Cartes Produits — listing boutique (maquette : sélecteur option + quantité).
 * Charte : vert #4eac52, encre #291D1C, Montserrat.
 * Les contrôles internes du formulaire partagent les classes tresor-loop-*
 * avec le thème lettery-child (même UX).
 */

.ct-product-cards {
	display: grid;
	grid-template-columns: repeat(var(--ct-cols, 3), minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
}

.ct-card {
	background: #fff;
	border: 1px solid var(--e-global-color-b4fa749, #e9e4de);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ct-card__media {
	display: block;
}

.ct-card__media img {
	width: 100%;
	height: auto;
	max-height: 220px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.ct-card__title {
	font-size: 20px;
	font-weight: 700;
	color: #291D1C;
	margin: 18px 0 0;
	padding: 0 20px;
}

.ct-card__title a {
	color: inherit;
	text-decoration: none;
}

/* Libellé de l'option retenue (mode « produits uniques »). */
.ct-card__variant {
	margin: 6px 0 0;
	padding: 0 20px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: #4eac52;
}

.ct-card__excerpt {
	padding: 0 20px;
}

.tresor-loop-excerpt {
	color: #291D1C;
	font-size: 16px;
	line-height: 1.45;
	margin: 10px 0 0;
}

.tresor-loop-excerpt p {
	margin: 0 0 8px;
}

.tresor-loop-excerpt p:last-child {
	margin-bottom: 0;
}

.tresor-loop-form {
	margin-top: auto;
	padding: 14px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tresor-loop-option select.tresor-loop-variation {
	width: 100%;
	height: 50px;
	padding: 0 40px 0 16px;
	font-size: 16px;
	font-family: Montserrat, sans-serif;
	text-align: center;
	text-align-last: center;
	color: #291D1C;
	background-color: #fff;
	border: 1px solid #4eac52;
	border-radius: 6px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	cursor: pointer;
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23291D1C' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}

.tresor-loop-option select.tresor-loop-variation:focus {
	outline: 2px solid #4eac52;
	outline-offset: 1px;
}

.tresor-loop-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tresor-qty {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tresor-qty-btn,
.tresor-qty-input {
	width: 52px;
	height: 48px;
	border: 1px solid #4eac52;
	border-radius: 4px;
	background: #fff;
	color: #291D1C;
	font-family: Montserrat, sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

button.tresor-qty-btn {
	cursor: pointer;
}

button.tresor-qty-btn:hover {
	background: #4eac52;
	color: #fff;
}

.tresor-qty-input {
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.tresor-qty-input::-webkit-outer-spin-button,
.tresor-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tresor-live-price {
	margin-left: auto;
	font-size: 22px;
	font-weight: 700;
	color: #291D1C;
	white-space: nowrap;
}

.button.tresor-loop-add {
	height: 50px;
	padding: 0 30px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-transform: none;
	color: #291d1c;
	background-color: #4eac52;
	font-weight: 600;
	font-size: 16px;
	font-family: Montserrat, sans-serif;
	border: none;
	border-radius: 6px;
	cursor: pointer;
}

.button.tresor-loop-add:hover {
	filter: brightness(0.94);
	color: #fff;
}

.ct-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.ct-btn-icon svg,
svg.ct-btn-icon,
.button.tresor-loop-add > svg {
	width: 1em;
	height: 1em;
	max-width: 100%;
	fill: currentColor;
}

.button.tresor-loop-add:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.tresor-loop-form.is-loading .button.tresor-loop-add {
	opacity: 0.7;
	pointer-events: none;
}

/* Lien « Voir le panier » injecté par WooCommerce (wc-add-to-cart.js) après
   l'ajout : masqué, c'est le toast qui confirme l'ajout. */
.tresor-loop-form .added_to_cart {
	display: none;
}

p.tresor-loop-msg {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
}

p.tresor-loop-msg.is-error {
	color: #b3261e;
}

p.tresor-loop-msg.is-success {
	color: #2e7d32;
}

/* Confirmation d'ajout : lien « Voir mon Panier » (discret). */
p.tresor-loop-msg a {
	color: inherit;
	font-weight: 400;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

p.tresor-loop-msg a:hover {
	color: #4eac52;
}

/* Toast : styles dans assets/css/tresor-toast.css (partagés). */


p.tresor-loop-oos {
	margin: auto 0 0;
	padding: 14px 20px 20px;
}

@media screen and (max-width: 768px) {
	.ct-product-cards {
		grid-template-columns: repeat(var(--ct-cols-mobile, 1), minmax(0, 1fr));
	}
}

@media screen and (max-width: 480px) {
	.tresor-qty-btn,
	.tresor-qty-input {
		width: 46px;
		height: 44px;
	}

	.tresor-live-price {
		font-size: 19px;
	}
}
